委外
# 委外报价单
# 获取委外报价单列表
# 一、接口描述
用于获取委外报价单列表(同UI界面左侧的Search List数据)
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/search/search |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
stSearch | String(Query) | 是 | pdcoreSqu |
beId | long(Query) | 是 | aiM18企业法人[部门]的ID |
formatId | long(Query) | 否 | aiM18[查询格式]的ID,用于获取[查询格式]步骤二中设定的栏位格式;若不使用此参数,则使用默认设置。 |
startRow | int(Query) | 否 | 返回结果的开始行 |
endRow | int(Query) | 否 | 返回结果的结束行 |
quickSearchStr | String(Query) | 否 | 用于设定关键字查找数据 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
String param = "&stSearch=pdcoreSqu&beId=" + beId;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"stSearch": "pdcoreSqu",
"size": 8,
"stSearchDisplay": "委外报价单",
"values": [
{
"tDate": "2022-03-23",
"code": "SQUTEST",
"pdcoreMainSqu.lastModifyUid.simpleUser.desc__lang": "Milk",
"st_code": "SQUTEST",
"pdcoreMainSqu.venId.ven.desc__lang": "Accounts Payable Control Account (Raw Material) SC",
"st_desc": "SQUTEST",
"pdcoreMainSqu.flowTypeId.flowtype.code": "MX-SUBCON",
"iRev": 1,
"pdcoreMainSqu.curId.cur.sym": "HK$",
"pdcoreMainSqu.flowTypeId.flowtype.desc": "Subcontract",
"pdcoreMainSqu.venId.ven.code": "2000",
"st_id": 17,
"id": 17,
"lastModifyDate": "2022-03-24 14:39:36"
}
]
}
# 新增委外报价单(自动补全)
# 一、接口描述
1. 用于新增【委外报价单】
2. 此接口方法有如下特点:
a. 支持使用code 替代 id 栏位
b. 货币栏位未填时,自动使用本货币
c. 职员栏位未填时,自动使用个人选项中的默认职员
d. 单据日期未填时,根据贸易参数设定中的日期选项取值
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/erp/bsFlow/save/pdcoreSqu |
---|---|
http请求方式 | POST |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/pdcoreSqu";
String param = "";
HttpPost post = new HttpPost(url + "?" + param);
post.addHeader("authorization", access_token);
post.addHeader("client_id", ClientID);
StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
entity.setContentEncoding("UTF-8");
post.setEntity(entity);
res = client.execute(post);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
if (json != null) {
recordId = json.getLongValue("tranId");
}
System.out.println(json);
}
post.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
data数据示例:
{
"beId": 142,
"pdcoresqut": [
{
"sourceId": 0,
"lot": "A",
"sourceLot": "",
"sourceType": "pro",
"proId": 4634,
"qty": 100,
"disc": 5,
"up": 10
}
],
"code": "SQUTEST2",
"venId": 99,
"virDeptId": 7,
"flowTypeId": 15450
}
4、返回示例
{
"tranId": 19,
"tranCode": "SQUTEST2",
"message": "",
"status": true
}
# 读取委外报价单
# 一、接口描述
用于读取委外报价单数据
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/read/pdcoreSqu |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSqu |
id | long(Query) | 是 | 委外报价单的id |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/pdcoreSqu";
String param = "&menuCode=pdcoreSqu&id=" + id;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"data": {},
"messages": [
{
"msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限",
"msgCode": "core_141019"
}
],
"status": false
}
{
"data": {
"pdcoremainsqu": [
{
"lastModifyUid": 20,
"useAccess": false,
"virDeptId": 7,
"expiredDate": -2209017600000,
"position_zh-CN": "",
"sysJson": "",
"viewCode": "pdcoreSqu",
"expDate": 253402185600000,
"beId": 142,
"useAccessBl": false,
"id": 17,
"doctypeId": 0,
"locked": false,
"position_ctw": "",
"lastModifyDate": 1648103976000,
"createUid": 20,
"rev": "1",
"lastApproveUid": 20,
"ttlCharge": 0,
"expiredUid": 0,
"descOrigin": "VENREF",
"position_en": "",
"position_zh-TW": "",
"venId": 99,
"i18nField": "{\"position_zh-CN\": \"\"}",
"manId": 0,
"ttlAmt": 0,
"position": "",
"flowTypeId": 15450,
"status": "Y",
"weightUnit": "kg",
"tDate": 1647964800000,
"code": "SQUTEST",
"cnDeptId": 0,
"amt": 0,
"iRev": 1,
"upOrigin": "SUBPRO",
"ce01Module": "pdcoreSqu",
"curId": 2,
"expired": false,
"rate": 1,
"domAmt": 0,
"measUnit": "cbm",
"printCount": 0,
"statusModifyDate": 1648103976000,
"createDate": 1648103976000,
"useAccessWl": false,
"position_ccn": "",
"ttlDisc": 0,
"position_haha1": "",
"useAccessAutoCalc": false,
"staffId": 785,
"domAmtDiff": 0
}
],
"pdcoresqut": [
{
"sourceId": 0,
"dDesc_ctw": "",
"dualQty": 0,
"costAmt": 0,
"amt": 0,
"iRev": 1,
"leadTime": 0,
"itemNo": " 1",
"dDesc_zh-CN": "",
"type": "product",
"bDesc_ctw": "",
"ce01Module": "pdcoreSqu",
"beId": 142,
"lot": "A",
"bDesc_haha1": "",
"dDesc_zh-TW": "",
"domAmt": 0,
"processId": 0,
"bDesc": "",
"bDesc_ccn": "",
"bDesc_zh-TW": "",
"newLotno": 0,
"unitId": 39720,
"dDesc_ccn": "",
"id": 64,
"up": 10,
"locId": 0,
"dDesc_haha1": "",
"hId": 17,
"bDesc_en": "",
"processDesc": "",
"dDesc_en": "",
"dualUnitId": 4489,
"sourceLot": "",
"dDesc": "",
"footerKey": "",
"i18nField": "{\"bDesc_zh-CN\": \"\", \"dDesc_zh-CN\": \"\"}",
"sourceType": "pro",
"proId": 4634,
"qty": 100,
"disc": 5,
"refCode": "",
"lotNoId": 0,
"bDesc_zh-CN": ""
}
],
"pdcoreremsqu": [
{
"tradeTerm_ccn": "",
"country": "",
"heading_en": "",
"tradeTerm_zh-CN": "",
"shipAd4_haha1": "",
"remarks_en": "",
"packing_ccn": "",
"dest": "",
"tradeTerm": "",
"shipAd2_zh-TW": "",
"heading_ccn": "",
"shipAd1_en": "",
"payTerm_zh-TW": "",
"province": "",
"packing_haha1": "",
"tel": "",
"id": 17,
"fax": "",
"remarks_zh-TW": "",
"shipAd1_zh-CN": "",
"hId": 17,
"payTerm": "",
"payTerm_ccn": "",
"heading_zh-TW": "",
"remarks_ccn": "",
"heading_ctw": "",
"tradeTerm_zh-TW": "",
"shipAd4_ccn": "",
"zipcode": "",
"shipAd2_en": "",
"shipAd1_haha1": "",
"i18nField": "{\"heading_zh-CN\": \"\", \"packing_zh-CN\": \"\", \"payTerm_zh-CN\": \"\", \"remarks_zh-CN\": \"\", \"shipAd1_zh-CN\": \"\", \"shipAd2_zh-CN\": \"\", \"shipAd3_zh-CN\": \"\", \"shipAd4_zh-CN\": \"\", \"tradeTerm_zh-CN\": \"\"}",
"remarks_zh-CN": "",
"shipAd4_ctw": "",
"packing_en": "",
"shipAd3_zh-TW": "",
"payTerm_zh-CN": "",
"payTerm_ctw": "",
"remarks_ctw": "",
"lTime": "",
"shipAd1_ccn": "",
"tradeTerm_en": "",
"shipCodeId": 0,
"city": "",
"shipAd3_ctw": "",
"payTerm_en": "",
"iRev": 1,
"shipAd4_zh-TW": "",
"packing": "",
"shipAd2_ccn": "",
"heading_zh-CN": "",
"ce01Module": "pdcoreSqu",
"payTerm_haha1": "",
"shipAd3_en": "",
"packing_zh-TW": "",
"shipAd3_zh-CN": "",
"shipAd4_zh-CN": "",
"shipAd2_ctw": "",
"shipAd2_haha1": "",
"shipAd1_ctw": "",
"remarks_haha1": "",
"email": "",
"shipAd3_ccn": "",
"packing_ctw": "",
"heading_haha1": "",
"heading": "",
"tradeTerm_ctw": "",
"packing_zh-CN": "",
"telCountry": "",
"tradeTerm_haha1": "",
"shipAd1": "",
"shipAd2": "",
"shipAd3": "",
"shipAd4": "",
"telArea": "",
"shipAd1_zh-TW": "",
"shipAd4_en": "",
"shipAd2_zh-CN": "",
"shipAd3_haha1": "",
"remarks": ""
}
]
},
"messages": [],
"status": true
}
# 保存委外报价单
# 一、接口描述
用于新增或者更新【委外报价单】
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/save/pdcoreSqu |
---|---|
http请求方式 | PUT |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSqu |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/pdcoreSqu";
String param = "&menuCode=pdcoreSqu";
HttpPut put = new HttpPut(url + "?" + param);
put.addHeader("authorization", access_token);
put.addHeader("client_id", ClientID);
StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
entity.setContentEncoding("UTF-8");
put.setEntity(entity);
res = client.execute(put);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
if (json != null) {
recordId = json.getLongValue("recordId");
}
System.out.println(json);
}
put.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
Entity的JSON格式数据如下:
{
"pdcoremainsqu": {
"values": [
{
"beId": 142,
"tDate": "2022-03-23",
"curId": 2,
"code": "SQUTEST",
"venId": 99,
"rate": 1,
"virDeptId": 7,
"flowTypeId": 15450,
"staffId": 785
}
]
},
"pdcoresqut": {
"values": [
{
"sourceId": 0,
"lot": "A",
"sourceLot": "",
"sourceType": "pro",
"proId": 4634,
"qty": 100,
"unitId": 39720,
"disc": 5,
"up": 10
}
]
}
}
4、返回示例
{
"recordId": 20,
"messages": [],
"status": true
}
{
"recordId": 0,
"messages": [
{
"msgDetail": "必填项为空",
"msgCode": "core_101905"
}
],
"status": false
}
# 删除委外报价单
# 一、接口描述
用于删除委外报价单
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/delete/pdcoreSqu |
---|---|
http请求方式 | DELETE |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSqu |
id | long(Query) | 是 | 委外报价单的id |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/pdcoreSqu";
String param = "&menuCode=pdcoreSqu&id=" + id;
HttpDelete delete = new HttpDelete(url + "?" + param);
delete.addHeader("authorization", access_token);
delete.addHeader("client_id", ClientID);
res = client.execute(delete);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
delete.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"messages": [],
"status": true
}
{
"messages": [
{
"msgDetail": "单据已被删除",
"msgCode": "core_101017"
}
],
"status": false
}
# 读取EBI数据:委外报价单列表
# 一、接口描述
用于执行EBI[委外报价单列表],返回EBI数据
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/ebiWidget/loadReport |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
formatId | long(Query) | 是 | 通过EBI接口获取到formatId |
beId | long(Query) | 否 | 企业法人的ID。若不传,则查询所有有权限的BE数据 |
offset | int(Query) | 否 | 返回结果的开始行 |
rows | int(Query) | 否 | 返回结果的结束行 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
String param = "&formatId=" + formatId;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"size": 10,
"rows": [
{
"MAIN_reportRate": "1.00000000",
"MAIN_domFinalAmt": "1,130,481.00",
"MAIN_reportTtlCharge": "11,419.00",
"MAIN_domTtlDisc": "22,838.00",
"aiM18ReservedCol_dataIndex": 1,
"MAIN_domTtlCharge": "11,419.00",
"MAIN_reportFinalAmt": "1,130,481.00",
"MAIN_domTtlAmt": "1,141,900.00",
"MAIN_reportTtlAmt": "1,141,900.00",
"MAIN_reportTtlDisc": "22,838.00"
}
]
}
# 读取EBI数据:委外报价单报告
# 一、接口描述
用于执行EBI[委外报价单报告],返回EBI数据
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/ebiWidget/loadReport |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
formatId | long(Query) | 是 | 通过EBI接口获取到formatId |
beId | long(Query) | 否 | 企业法人的ID。若不传,则查询所有有权限的BE数据 |
offset | int(Query) | 否 | 返回结果的开始行 |
rows | int(Query) | 否 | 返回结果的结束行 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
String param = "&formatId=" + formatId;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"size": 44,
"rows": [
{
"SQUT_A_proId_code": "MX-YZ",
"SQUT_A_proId": "4174",
"aiM18ReservedCol_dataIndex": 1,
"SQUT_A_processId_code": "",
"SQU_A_code": "MX-TEST",
"SQUT_A_processId": "0",
"SQU_A_id": "1"
}
]
}
# 委外加工订单
# 获取委外加工订单列表
# 一、接口描述
用于获取委外加工订单列表(同UI界面左侧的Search List数据)
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/search/search |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
stSearch | String(Query) | 是 | pdcoreSjob |
beId | long(Query) | 是 | aiM18企业法人[部门]的ID |
formatId | long(Query) | 否 | aiM18[查询格式]的ID,用于获取[查询格式]步骤二中设定的栏位格式;若不使用此参数,则使用默认设置。 |
startRow | int(Query) | 否 | 返回结果的开始行 |
endRow | int(Query) | 否 | 返回结果的结束行 |
quickSearchStr | String(Query) | 否 | 用于设定关键字查找数据 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
String param = "&stSearch=pdcoreSjob&beId=" + beId;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"stSearch": "pdcoreSjob",
"size": 62,
"stSearchDisplay": "委外加工订单",
"values": [
{
"tDate": "2022-03-23",
"code": "SJOBTEST",
"st_id": 198,
"st_code": "SJOBTEST",
"pdcoreMainSjob.lastModifyUid.simpleUser.desc__lang": "Milk",
"st_desc": "SJOBTEST",
"iRev": 8,
"id": 198,
"lastModifyDate": "2022-03-25 11:23:58"
}
]
}
# 新增委外加工订单(自动补全)
# 一、接口描述
1. 用于新增【委外加工订单】
2. 此接口方法有如下特点:
a. 支持使用code 替代 id 栏位
b. 货币栏位未填时,自动使用本货币
c. 职员栏位未填时,自动使用个人选项中的默认职员
d. 单据日期未填时,根据贸易参数设定中的日期选项取值
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/erp/bsFlow/save/pdcoreSjob |
---|---|
http请求方式 | POST |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/pdcoreSjob";
String param = "";
HttpPost post = new HttpPost(url + "?" + param);
post.addHeader("authorization", access_token);
post.addHeader("client_id", ClientID);
StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
entity.setContentEncoding("UTF-8");
post.setEntity(entity);
res = client.execute(post);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
if (json != null) {
recordId = json.getLongValue("tranId");
}
System.out.println(json);
}
post.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
data数据示例:
{
"beId": 142,
"code": "SJOBTEST2",
"venId": 99,
"virDeptId": 7,
"pdcoresjobt": [
{
"sourceId": 0,
"lot": "A",
"oriQty": 100,
"sourceLot": "",
"cDate": "2022-04-23",
"sourceType": "pro",
"proId": 4634,
"qty": 100,
"oriUnitId": 39720,
"startDate": "2022-03-23"
}
],
"flowTypeId": 15450
}
4、返回示例
{
"tranId": 19,
"tranCode": "SJOBTEST2",
"message": "",
"status": true
}
# 读取委外加工订单
# 一、接口描述
用于读取委外加工订单数据
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/read/pdcoreSjob |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSjob |
id | long(Query) | 是 | 委外加工订单的id |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/pdcoreSjob";
String param = "&menuCode=pdcoreSjob&id=" + id;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"data": {},
"messages": [
{
"msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限",
"msgCode": "core_141019"
}
],
"status": false
}
{
"data": {
"pdcoremainsjob": [
{
"lastModifyUid": 20,
"useAccess": false,
"virDeptId": 7,
"expiredDate": -2209017600000,
"position_zh-CN": "",
"sysJson": "",
"viewCode": "pdcoreSjob",
"beId": 142,
"useAccessBl": false,
"id": 198,
"doctypeId": 0,
"locked": false,
"position_ctw": "",
"lastModifyDate": 1648178638000,
"createUid": 20,
"rev": "4",
"lastApproveUid": 20,
"ttlCharge": 0,
"completed": false,
"expiredUid": 0,
"position_en": "",
"position_zh-TW": "",
"venId": 99,
"i18nField": "{\"position_zh-CN\": \"\"}",
"manId": 0,
"deposit": 0,
"ttlAmt": 0,
"position": "",
"flowTypeId": 15450,
"status": "Y",
"tDate": 1647964800000,
"code": "SJOBTEST",
"cnDeptId": 0,
"amt": 0,
"iRev": 8,
"ce01Module": "pdcoreSjob",
"curId": 2,
"expired": false,
"rate": 1,
"domAmt": 0,
"printCount": 0,
"statusModifyDate": 1648106762000,
"createDate": 1648025584000,
"depoRate": 0,
"useAccessWl": false,
"position_ccn": "",
"ttlDisc": 0,
"position_haha1": "",
"useAccessAutoCalc": false,
"staffId": 785,
"domAmtDiff": 0
}
],
"pdcoresjobprot": [
{
"sourceId": 0,
"udfPJPwidth": 0,
"udfPJPtestNum": 0,
"dualQty": 0,
"itemNo": " 1",
"beId": 142,
"oriQty": 100,
"bDesc": "",
"bDesc_zh-TW": "",
"id": 250,
"up": 0,
"qcRequired": false,
"udfPJPtestBool": false,
"dDesc_haha1": "",
"hId": 198,
"cDate": 1650643200000,
"level": "",
"udfPJPtestLookup": 0,
"completed": false,
"footerKey": " 1",
"dDesc": "",
"udfPJPstring1": "",
"i18nField": "{}",
"sourceType": "pro",
"qty": 100,
"disc": 0,
"refCode": "",
"startDate": 1647964800000,
"dDesc_ctw": "",
"amt": 0,
"iRev": 8,
"dDesc_zh-CN": "",
"confirmed": true,
"bDesc_ctw": "",
"ce01Module": "pdcoreSjob",
"lot": "A",
"bDesc_haha1": "",
"treeLevel": "",
"dDesc_zh-TW": "",
"domAmt": 0,
"udfPJPtestStr": "",
"bDesc_ccn": "",
"unitId": 39720,
"udfPJPtestDate": -2209017600000,
"dDesc_ccn": "",
"bomId": 0,
"mjobId": 0,
"bDesc_en": "",
"udfPJPlength": 0,
"dDesc_en": "",
"oriUnitId": 39720,
"dualUnitId": 0,
"oriUp": 0,
"sourceLot": "",
"proId": 4634,
"cuspono": "",
"bDesc_zh-CN": ""
}
],
"pdcoresjobmatt": [
{
"tDate": 1647964800000,
"dDesc_ctw": "",
"dualQty": 0,
"oriMatLot": "A",
"pproId": 4634,
"iRev": 8,
"itemNo": " 1",
"dDesc_zh-CN": "",
"bDesc_ctw": "",
"ce01Module": "pdcoreSjob",
"beId": 142,
"lot": "A",
"oriQty": 100,
"bDesc_haha1": "",
"treeLevel": "",
"dDesc_zh-TW": "",
"bomReqQty": 0,
"processId": 0,
"oriMatId": 3972,
"bDesc": "",
"bDesc_ccn": "",
"bDesc_zh-TW": "",
"unitId": 38887,
"dDesc_ccn": "",
"id": 586,
"dDesc_haha1": "",
"hId": 198,
"bomId": 0,
"bDesc_en": "",
"dDesc_en": "",
"completed": false,
"oriUnitId": 38887,
"dualUnitId": 0,
"jobId": 0,
"footerKey": " 1",
"dDesc": "",
"i18nField": "{}",
"proId": 3972,
"qty": 100,
"bomLot": "",
"refCode": "",
"jobLot": "",
"bDesc_zh-CN": ""
}
],
"pdcoreremsjob": [
{
"tradeTerm_ccn": "",
"country": "",
"shipMark": "",
"heading_en": "",
"shipMark_zh-CN": "",
"tradeTerm_zh-CN": "",
"shipAd4_haha1": "",
"remarks_en": "",
"packing_ccn": "",
"dest": "",
"tradeTerm": "",
"shipAd2_zh-TW": "",
"heading_ccn": "",
"shipAd1_en": "",
"payTerm_zh-TW": "",
"province": "",
"packing_haha1": "",
"tel": "",
"shipMark_en": "",
"id": 191,
"fax": "",
"remarks_zh-TW": "",
"shipAd1_zh-CN": "",
"hId": 198,
"payTerm": "",
"heading_zh-TW": "",
"payTerm_ccn": "",
"remarks_ccn": "",
"heading_ctw": "",
"tradeTerm_zh-TW": "",
"shipMark_ccn": "",
"shipAd4_ccn": "",
"zipcode": "",
"shipAd2_en": "",
"shipAd1_haha1": "",
"i18nField": "{\"heading_zh-CN\": \"\", \"packing_zh-CN\": \"\", \"payTerm_zh-CN\": \"\", \"remarks_zh-CN\": \"\", \"shipAd1_zh-CN\": \"\", \"shipAd2_zh-CN\": \"\", \"shipAd3_zh-CN\": \"\", \"shipAd4_zh-CN\": \"\", \"shipMark_zh-CN\": \"\", \"tradeTerm_zh-CN\": \"\"}",
"remarks_zh-CN": "",
"shipAd4_ctw": "",
"packing_en": "",
"shipAd3_zh-TW": "",
"payTerm_zh-CN": "",
"payTerm_ctw": "",
"shipMark_zh-TW": "",
"remarks_ctw": "",
"shipAd1_ccn": "",
"tradeTerm_en": "",
"shipCodeId": 0,
"city": "",
"shipMark_ctw": "",
"shipAd3_ctw": "",
"payTerm_en": "",
"iRev": 8,
"shipAd4_zh-TW": "",
"packing": "",
"shipAd2_ccn": "",
"heading_zh-CN": "",
"ce01Module": "pdcoreSjob",
"payTerm_haha1": "",
"shipAd3_en": "",
"packing_zh-TW": "",
"shipAd3_zh-CN": "",
"shipAd4_zh-CN": "",
"shipAd2_ctw": "",
"shipAd2_haha1": "",
"shipAd1_ctw": "",
"remarks_haha1": "",
"email": "",
"shipAd3_ccn": "",
"packing_ctw": "",
"heading_haha1": "",
"heading": "",
"tradeTerm_ctw": "",
"packing_zh-CN": "",
"telCountry": "",
"tradeTerm_haha1": "",
"shipAd1": "",
"shipAd2": "",
"shipAd3": "",
"shipAd4": "",
"telArea": "",
"shipAd1_zh-TW": "",
"shipAd4_en": "",
"shipAd2_zh-CN": "",
"shipAd3_haha1": "",
"shipMark_haha1": "",
"smthId": 0,
"remarks": ""
}
],
"pdcoresjobt": [
{
"sourceId": 0,
"udfPJPwidth": 0,
"udfPJPtestNum": 0,
"dualQty": 0,
"prqFooterKey": "",
"itemNo": " 1",
"prqSourceId": 0,
"beId": 142,
"oriQty": 100,
"bDesc": "",
"bDesc_zh-TW": "",
"newLotno": 0,
"id": 267,
"udfPJPtestBool": false,
"dDesc_haha1": "",
"hId": 198,
"cDate": 1650643200000,
"level": "",
"udfPJPtestLookup": 0,
"prqResultId": 0,
"bomSource": "noBom",
"completed": false,
"mjobModule": "",
"dDesc": "",
"footerKey": "",
"udfPJPstring1": "",
"i18nField": "{}",
"sourceType": "pro",
"sourceDDate": -2209017600000,
"qty": 100,
"refCode": "",
"lotNoId": 0,
"dDesc_ctw": "",
"costAmt": 0,
"pproId": 4634,
"iRev": 8,
"dDesc_zh-CN": "",
"bDesc_ctw": "",
"ce01Module": "pdcoreSjob",
"lot": "A",
"sourceDate": -2209017600000,
"bDesc_haha1": "",
"treeLevel": "",
"dDesc_zh-TW": "",
"udfPJPtestStr": "",
"bDesc_ccn": "",
"unitId": 39720,
"udfPJPtestDate": -2209017600000,
"dDesc_ccn": "",
"locId": 0,
"bomId": 0,
"mjobId": 0,
"bDesc_en": "",
"udfPJPlength": 0,
"dDesc_en": "",
"dualUnitId": 4489,
"oriUnitId": 39720,
"prqSourceType": "pro",
"sourceLot": "",
"prqSourceLot": "",
"proId": 4634,
"cuspono": "",
"ndFooterKey": " 1",
"proLot": "A",
"bDesc_zh-CN": ""
}
]
},
"messages": [],
"status": true
}
# 保存委外加工订单
# 一、接口描述
用于新增或者更新【委外加工订单】
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/save/pdcoreSjob |
---|---|
http请求方式 | PUT |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSjob |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/pdcoreSjob";
String param = "&menuCode=pdcoreSjob";
HttpPut put = new HttpPut(url + "?" + param);
put.addHeader("authorization", access_token);
put.addHeader("client_id", ClientID);
StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
entity.setContentEncoding("UTF-8");
put.setEntity(entity);
res = client.execute(put);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
if (json != null) {
recordId = json.getLongValue("recordId");
}
System.out.println(json);
}
put.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
Entity的JSON格式数据如下:
{
"pdcoremainsjob": {
"values": [
{
"beId": 142,
"tDate": "2022-03-23",
"curId": 2,
"code": "SJOBTEST",
"venId": 99,
"rate": 1,
"virDeptId": 7,
"flowTypeId": 15450,
"staffId": 785
}
]
},
"pdcoresjobprot": {
"values": [
{
"sourceId": 0,
"lot": "A",
"oriQty": 100,
"sourceLot": "",
"cDate": "2022-04-23",
"footerKey": " 1",
"sourceType": "pro",
"proId": 4634,
"qty": 100,
"unitId": 39720,
"oriUnitId": 39720,
"startDate": "2022-03-23"
}
]
},
"pdcoresjobmatt": {
"values": [
{
"sourceId": 0,
"lot": "A",
"oriQty": 100,
"tDate": "2022-03-23",
"footerKey": " 1",
"proId": 3972,
"qty": 100,
"unitId": 38887,
"oriUnitId": 38887,
"treeLe": "pro"
}
]
},
"pdcoresjobt": {
"values": [
{
"sourceId": 0,
"cDate": "2022-04-23",
"oriUnitId": 39720,
"lot": "A",
"oriQty": 100,
"sourceLot": "",
"sourceType": "pro",
"proId": 4634,
"qty": 100,
"unitId": 39720,
"ndFooterKey": " 1",
"proLot": "A",
"startDate": "2022-03-23"
}
]
}
}
4、返回示例
{
"recordId": 20,
"messages": [],
"status": true
}
{
"recordId": 0,
"messages": [
{
"msgDetail": "必填项为空",
"msgCode": "core_101905"
}
],
"status": false
}
# 删除委外加工订单
# 一、接口描述
用于删除委外加工订单
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/delete/pdcoreSjob |
---|---|
http请求方式 | DELETE |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSjob |
id | long(Query) | 是 | 委外加工订单的id |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/pdcoreSjob";
String param = "&menuCode=pdcoreSjob&id=" + id;
HttpDelete delete = new HttpDelete(url + "?" + param);
delete.addHeader("authorization", access_token);
delete.addHeader("client_id", ClientID);
res = client.execute(delete);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
delete.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"messages": [],
"status": true
}
{
"messages": [
{
"msgDetail": "单据已被删除",
"msgCode": "core_101017"
}
],
"status": false
}
# 读取EBI数据:委外加工订单列表
# 一、接口描述
用于执行EBI[委外加工订单列表],返回EBI数据
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/ebiWidget/loadReport |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
formatId | long(Query) | 是 | 通过EBI接口获取到formatId |
beId | long(Query) | 否 | 企业法人的ID。若不传,则查询所有有权限的BE数据 |
offset | int(Query) | 否 | 返回结果的开始行 |
rows | int(Query) | 否 | 返回结果的结束行 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
String param = "&formatId=" + formatId;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"size": 69,
"rows": [
{
"MAIN_reportRate": "1.00000000",
"MAIN_domFinalAmt": "168,000.00",
"MAIN_reportTtlCharge": "16,000.00",
"MAIN_domTtlDisc": "8,000.00",
"aiM18ReservedCol_dataIndex": 1,
"MAIN_domTtlCharge": "16,000.00",
"MAIN_reportFinalAmt": "168,000.00",
"MAIN_domTtlAmt": "160,000.00",
"MAIN_reportTtlAmt": "160,000.00",
"MAIN_reportTtlDisc": "8,000.00"
}
]
}
# 读取EBI数据:委外加工订单报告
# 一、接口描述
用于执行EBI[委外加工订单报告],返回EBI数据
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/ebiWidget/loadReport |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
formatId | long(Query) | 是 | 通过EBI接口获取到formatId |
beId | long(Query) | 否 | 企业法人的ID。若不传,则查询所有有权限的BE数据 |
offset | int(Query) | 否 | 返回结果的开始行 |
rows | int(Query) | 否 | 返回结果的结束行 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
String param = "&formatId=" + formatId;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"size": 1,
"rows": [
{
"SJOB_A_id": "133",
"MAIN_completeDualQty": "0.00",
"MAIN_orderDualQty": "30.00",
"aiM18ReservedCol_dataIndex": 1,
"SJOBPROT_A_proId": "4634",
"SJOB_A_code": "BT_SCO2020122901",
"MAIN_outstandingQty": "30.0000",
"MAIN_returnDualQty": "0.00",
"SJOBPROT_A_proId_code": "MX-JZ-F5",
"MAIN_returnQty": "5.0000",
"MAIN_orderQty": "30.0000",
"MAIN_outstandingDualQty": "30.00",
"SJOBPROT_A_qty": "30.0000",
"MAIN_completeQty": "5.0000"
}
]
}
# 委外发料单
# 获取委外发料单列表
# 一、接口描述
用于获取委外发料单列表(同UI界面左侧的Search List数据)
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/search/search |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
stSearch | String(Query) | 是 | pdcoreSpick |
beId | long(Query) | 是 | aiM18企业法人[部门]的ID |
formatId | long(Query) | 否 | aiM18[查询格式]的ID,用于获取[查询格式]步骤二中设定的栏位格式;若不使用此参数,则使用默认设置。 |
startRow | int(Query) | 否 | 返回结果的开始行 |
endRow | int(Query) | 否 | 返回结果的结束行 |
quickSearchStr | String(Query) | 否 | 用于设定关键字查找数据 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
String param = "&stSearch=pdcoreSpick&beId=" + beId;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"stSearch": "pdcoreSpick",
"size": 25,
"stSearchDisplay": "委外发料单",
"values": [
{
"pdcoreMainSpick.lastModifyUid.simpleUser.desc__lang": "Milk",
"tDate": "2022-03-23",
"code": "SPICKTEST",
"st_id": 40,
"st_code": "SPICKTEST",
"st_desc": "SPICKTEST",
"iRev": 1,
"id": 40,
"lastModifyDate": "2022-03-24 16:31:35"
}
]
}
# 新增委外发料单(自动补全)
# 一、接口描述
1. 用于新增【委外发料单】
2. 此接口方法有如下特点:
a. 支持使用code 替代 id 栏位
b. 职员栏位未填时,自动使用个人选项中的默认职员
c. 单据日期未填时,根据贸易参数设定中的日期选项取值
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/erp/bsFlow/save/pdcoreSpick |
---|---|
http请求方式 | POST |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/pdcoreSpick";
String param = "";
HttpPost post = new HttpPost(url + "?" + param);
post.addHeader("authorization", access_token);
post.addHeader("client_id", ClientID);
StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
entity.setContentEncoding("UTF-8");
post.setEntity(entity);
res = client.execute(post);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
if (json != null) {
recordId = json.getLongValue("tranId");
}
System.out.println(json);
}
post.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
data数据示例:
{
"beId": 142,
"code": "SPICKTEST2",
"venId": 99,
"virDeptId": 7,
"pdcorespickt": [
{
"sourceId": 198,
"lot": "A",
"oriQty": 100,
"sourceLot": "A",
"sourceType": "pdcoreSjob",
"proId": 3972,
"oriUnitId": 38887,
"locId": 15
}
],
"locId": 15
}
4、返回示例
{
"tranId": 40,
"tranCode": "SPICKTEST2",
"message": "",
"status": true
}
# 读取委外发料单
# 一、接口描述
用于读取委外发料单数据
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/read/pdcoreSpick |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSpick |
id | long(Query) | 是 | 委外发料单的id |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/pdcoreSpick";
String param = "&menuCode=pdcoreSpick&id=" + id;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"data": {},
"messages": [
{
"msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限",
"msgCode": "core_141019"
}
],
"status": false
}
{
"data": {
"pdcorespicktlot": [
{
"lotnoNumAttr17": 0,
"lotnoNumAttr16": 0,
"lotnoNumAttr15": 0,
"lotnoNumAttr14": 0,
"lotnoNumAttr19": 0,
"lotnoNumAttr18": 0,
"lotnoLookupAttr20": 0,
"lotnoNumAttr13": 0,
"lotnoNumAttr12": 0,
"lotnoNumAttr11": 0,
"lotnoNumAttr10": 0,
"lotnoLookupAttr16": 0,
"lotnoLookupAttr17": 0,
"lotnoLookupAttr14": 0,
"lotnoLookupAttr15": 0,
"lotnoLookupAttr18": 0,
"lotnoLookupAttr19": 0,
"newLotno": 0,
"lotnoLot": "A",
"id": 205,
"lotnoNumAttr20": 0,
"lotnoLookupAttr12": 0,
"lotnoLookupAttr13": 0,
"lotnoLookupAttr10": 0,
"lotnoLookupAttr11": 0,
"iRev": 1,
"ce01Module": "pdcoreSpick",
"lotnoDateAttr3": -2209017600000,
"lotnoDateAttr4": -2209017600000,
"lotnoDateAttr1": -2209017600000,
"lotnoDateAttr2": -2209017600000,
"lotnoDateAttr7": -2209017600000,
"lotnoDateAttr8": -2209017600000,
"lotnoDateAttr5": -2209017600000,
"lotnoDateAttr6": -2209017600000,
"unitId": 38887,
"lotnoDateAttr9": -2209017600000,
"locId": 15,
"lotnoTextAttr1": "",
"lotnoTextAttr2": "",
"lotnoTextAttr3": "",
"lotnoTextAttr4": "",
"lotnoTextAttr5": "",
"lotnoTextAttr6": "",
"lotnoTextAttr7": "",
"lotnoTextAttr8": "",
"lotnoTextAttr9": "",
"dualQty": 0,
"itemNo": "",
"hId": 40,
"lotnoNumAttr1": 1001,
"lotnoNumAttr2": 0,
"lotnoNumAttr3": 0,
"lotnoNumAttr4": 0,
"lotnoExpDate": 253402271999000,
"footerKey": " 1",
"qty": 100,
"lotnoNumAttr5": 0,
"lotnoNumAttr6": 0,
"lotnoNumAttr7": 0,
"lotnoNumAttr8": 0,
"lotnoNumAttr9": 0,
"lotNoId": 5388,
"lotnoTextAttr16": "",
"lotnoTextAttr15": "",
"lotnoTextAttr18": "",
"lotnoTextAttr17": "",
"lotnoTextAttr12": "",
"lotnoTextAttr11": "",
"lotnoDateAttr20": -2209017600000,
"lotnoTextAttr14": "",
"lotnoTextAttr13": "",
"lotnoTextAttr19": "",
"lotnoTextAttr10": "",
"dualUnitId": 3937,
"lotnoLookupAttr5": 0,
"lotnoLookupAttr6": 0,
"lotnoLookupAttr7": 0,
"lotnoDateAttr18": -2209017600000,
"lotnoLookupAttr8": 0,
"lotnoDateAttr19": -2209017600000,
"lotno": "mx20220112a",
"lotnoLookupAttr9": 0,
"proId": 3972,
"lotnoDateAttr12": -2209017600000,
"lotnoDateAttr13": -2209017600000,
"lotnoDateAttr10": -2209017600000,
"lotnoDateAttr11": -2209017600000,
"lotnoTextAttr20": "",
"lotnoLookupAttr1": 0,
"lotnoDateAttr16": -2209017600000,
"lotnoLookupAttr2": 0,
"lotnoDateAttr17": -2209017600000,
"lotnoLookupAttr3": 0,
"lotnoDateAttr14": -2209017600000,
"lotnoLookupAttr4": 0,
"lotnoDateAttr15": -2209017600000
}
],
"pdcoreremspick": [
{
"hId": 40,
"i18nField": "{\"remarks_zh-CN\": \"\"}",
"remarks_zh-CN": "",
"remarks_ccn": "",
"remarks_en": "",
"remarks_haha1": "",
"iRev": 1,
"id": 40,
"remarks_zh-TW": "",
"remarks": "",
"remarks_ctw": "",
"ce01Module": "pdcoreSpick"
}
],
"pdcorespickt": [
{
"sourceId": 198,
"dualQty": 0,
"pbDesc": "",
"itemNo": " 1",
"beId": 142,
"oriQty": 100,
"pdDesc_zh-CN": "",
"bDesc": "",
"bDesc_zh-TW": "",
"newLotno": 0,
"id": 103,
"pbDesc_zh-TW": "",
"dDesc_haha1": "",
"hId": 40,
"pbDesc_ccn": "",
"pdDesc_zh-TW": "",
"pdDesc_ccn": "",
"dDesc": "",
"footerKey": " 1",
"i18nField": "{\"bDesc_zh-CN\": \"\", \"dDesc_zh-CN\": \"\", \"pbDesc_zh-CN\": \"\", \"pdDesc_zh-CN\": \"\"}",
"pbDesc_zh-CN": "",
"sourceType": "pdcoreSjob",
"qty": 100,
"refCode": "",
"lotNoId": 0,
"dDesc_ctw": "",
"costAmt": 0,
"pproId": 4634,
"iRev": 1,
"dDesc_zh-CN": "",
"bDesc_ctw": "",
"ce01Module": "pdcoreSpick",
"lot": "A",
"bDesc_haha1": "",
"dDesc_zh-TW": "",
"pdDesc_ctw": "",
"plot": "A",
"bDesc_ccn": "",
"unitId": 38887,
"dDesc_ccn": "",
"pbDesc_haha1": "",
"pbDesc_ctw": "",
"locId": 15,
"mjobId": 0,
"bDesc_en": "",
"pbDesc_en": "",
"pdDesc": "",
"pdDesc_haha1": "",
"pdDesc_en": "",
"dDesc_en": "",
"oriUnitId": 38887,
"dualUnitId": 3937,
"sourceLot": "A",
"proId": 3972,
"bDesc_zh-CN": ""
}
],
"pdcoremainspick": [
{
"tDate": 1647964800000,
"lastModifyUid": 20,
"code": "SPICKTEST",
"cnDeptId": 0,
"useAccess": false,
"virDeptId": 7,
"expiredDate": -2209017600000,
"iRev": 1,
"position_zh-CN": "",
"sysJson": "",
"viewCode": "pdcoreSpick",
"ce01Module": "pdcoreSpick",
"beId": 142,
"expired": false,
"printCount": 0,
"useAccessBl": false,
"id": 40,
"doctypeId": 0,
"statusModifyDate": 1648110695000,
"locked": false,
"position_ctw": "",
"lastModifyDate": 1648110695000,
"createUid": 20,
"locId": 15,
"createDate": 1648110695000,
"rev": "1",
"lastApproveUid": 20,
"expiredUid": 0,
"useAccessWl": false,
"position_en": "",
"position_zh-TW": "",
"venId": 99,
"i18nField": "{\"position_zh-CN\": \"\"}",
"position_ccn": "",
"position_haha1": "",
"manId": 0,
"position": "",
"useAccessAutoCalc": false,
"staffId": 785,
"status": "Y"
}
]
},
"messages": [],
"status": true
}
# 保存委外发料单
# 一、接口描述
用于新增或者更新【委外发料单】
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/save/pdcoreSpick |
---|---|
http请求方式 | PUT |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSpick |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/pdcoreSpick";
String param = "&menuCode=pdcoreSpick";
HttpPut put = new HttpPut(url + "?" + param);
put.addHeader("authorization", access_token);
put.addHeader("client_id", ClientID);
StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
entity.setContentEncoding("UTF-8");
put.setEntity(entity);
res = client.execute(put);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
if (json != null) {
recordId = json.getLongValue("recordId");
}
System.out.println(json);
}
put.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
Entity的JSON格式数据如下:
{
"pdcorespickt": {
"values": [
{
"sourceId": 198,
"lot": "A",
"oriQty": 100,
"sourceLot": "A",
"sourceType": "pdcoreSjob",
"plot": "A",
"pproId": 4634,
"proId": 3972,
"qty": 100,
"unitId": 38887,
"oriUnitId": 38887,
"locId": 15
}
]
},
"pdcoremainspick": {
"values": [
{
"beId": 142,
"tDate": "2022-03-23",
"code": "SPICKTEST",
"venId": 99,
"virDeptId": 7,
"staffId": 785,
"locId": 15
}
]
}
}
4、返回示例
{
"recordId": 40,
"messages": [],
"status": true
}
{
"recordId": 0,
"messages": [
{
"msgDetail": "必填项为空",
"msgCode": "core_101905"
}
],
"status": false
}
# 删除委外发料单
# 一、接口描述
用于删除委外发料单
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/delete/pdcoreSpick |
---|---|
http请求方式 | DELETE |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSpick |
id | long(Query) | 是 | 委外发料单的id |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/pdcoreSpick";
String param = "&menuCode=pdcoreSpick&id=" + id;
HttpDelete delete = new HttpDelete(url + "?" + param);
delete.addHeader("authorization", access_token);
delete.addHeader("client_id", ClientID);
res = client.execute(delete);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
delete.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"messages": [],
"status": true
}
{
"messages": [
{
"msgDetail": "单据已被删除",
"msgCode": "core_101017"
}
],
"status": false
}
# 委外退料单
# 获取委外退料单列表
# 一、接口描述
用于获取委外退料单列表(同UI界面左侧的Search List数据)
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/search/search |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
stSearch | String(Query) | 是 | pdcoreSmr |
beId | long(Query) | 是 | aiM18企业法人[部门]的ID |
formatId | long(Query) | 否 | aiM18[查询格式]的ID,用于获取[查询格式]步骤二中设定的栏位格式;若不使用此参数,则使用默认设置。 |
startRow | int(Query) | 否 | 返回结果的开始行 |
endRow | int(Query) | 否 | 返回结果的结束行 |
quickSearchStr | String(Query) | 否 | 用于设定关键字查找数据 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
String param = "&stSearch=pdcoreSmr&beId=" + beId;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"stSearch": "pdcoreSmr",
"size": 3,
"stSearchDisplay": "委外退料单",
"values": [
{
"tDate": "2021-01-27",
"code": "SMR20210001",
"st_id": 7,
"st_code": "SMR20210001",
"st_desc": "SMR20210001",
"iRev": 1,
"pdcoreMainSmr.lastModifyUid.simpleUser.desc__lang": "Milk",
"id": 7,
"lastModifyDate": "2021-01-27 11:24:30"
}
]
}
# 新增委外退料单(自动补全)
# 一、接口描述
1. 用于新增【委外退料单】
2. 此接口方法有如下特点:
a. 支持使用code 替代 id 栏位
b. 职员栏位未填时,自动使用个人选项中的默认职员
c. 单据日期未填时,根据贸易参数设定中的日期选项取值
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/erp/bsFlow/save/pdcoreSmr |
---|---|
http请求方式 | POST |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/pdcoreSmr";
String param = "";
HttpPost post = new HttpPost(url + "?" + param);
post.addHeader("authorization", access_token);
post.addHeader("client_id", ClientID);
StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
entity.setContentEncoding("UTF-8");
post.setEntity(entity);
res = client.execute(post);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
if (json != null) {
recordId = json.getLongValue("tranId");
}
System.out.println(json);
}
post.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
data数据示例:
{
"beId": 142,
"code": "SMRTEST2",
"venId": 99,
"virDeptId": 7,
"pdcoresmrt": [
{
"sourceId": 40,
"sjobId": 198,
"pproId": 4634,
"oriUnitId": 38887,
"lot": "A",
"oriQty": 100,
"sourceLot": "A",
"sourceType": "pdcoreSpick",
"plot": "A",
"sjobType": "pdcoreSjob",
"proId": 3972,
"locId": 15,
"sjobLot": "A",
"lotNoId": 5388
}
],
"locId": 15
}
4、返回示例
{
"tranId": 40,
"tranCode": "SMRTEST2",
"message": "",
"status": true
}
# 读取委外退料单
# 一、接口描述
用于读取委外退料单数据
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/read/pdcoreSmr |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSmr |
id | long(Query) | 是 | 委外退料单的id |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/pdcoreSmr";
String param = "&menuCode=pdcoreSmr&id=" + id;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"data": {},
"messages": [
{
"msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限",
"msgCode": "core_141019"
}
],
"status": false
}
{
"data": {
"pdcoremainsmr": [
{
"tDate": 1611676800000,
"lastModifyUid": 20,
"code": "SMR20210001",
"cnDeptId": 218,
"useAccess": false,
"virDeptId": 1,
"expiredDate": -2209017600000,
"iRev": 1,
"position_zh-CN": "",
"sysJson": "{\"autoGenCode\":{\"snId\":923,\"sn\":\"1\"}}",
"viewCode": "pdcoreSmr",
"ce01Module": "pdcoreSmr",
"beId": 142,
"expired": false,
"printCount": 0,
"useAccessBl": false,
"id": 7,
"doctypeId": 0,
"statusModifyDate": 1611717870000,
"locked": false,
"position_ctw": "",
"lastModifyDate": 1611717870000,
"createUid": 20,
"locId": 2,
"createDate": 1611717870000,
"rev": "1",
"lastApproveUid": 20,
"expiredUid": 0,
"useAccessWl": false,
"position_en": "PIE",
"position_zh-TW": "",
"venId": 99,
"i18nField": "{\"position_en\": \"PIE\"}",
"position_ccn": "",
"position_haha1": "",
"manId": 48,
"position": "PIE",
"useAccessAutoCalc": false,
"staffId": 21,
"status": "Y"
}
],
"pdcoreremsmr": [
{
"hId": 7,
"i18nField": "{\"remarks_en\": \"\"}",
"remarks_zh-CN": "",
"remarks_ccn": "",
"remarks_en": "",
"remarks_haha1": "",
"iRev": 1,
"id": 7,
"remarks_zh-TW": "",
"remarks": "",
"remarks_ctw": "",
"ce01Module": "pdcoreSmr"
}
],
"pdcoresmrt": [
{
"lotnoNumAttr17": 0,
"lotnoNumAttr16": 0,
"lotnoNumAttr15": 0,
"lotnoNumAttr14": 0,
"lotnoNumAttr19": 0,
"pbDesc": "半成品",
"lotnoNumAttr18": 0,
"lotnoLookupAttr20": 0,
"lotnoNumAttr13": 0,
"lotnoNumAttr12": 0,
"lotnoNumAttr11": 0,
"lotnoNumAttr10": 0,
"lotnoLookupAttr16": 0,
"oriQty": 20,
"lotnoLookupAttr17": 0,
"lotnoLookupAttr14": 0,
"lotnoLookupAttr15": 0,
"lotnoLookupAttr18": 0,
"bDesc_zh-TW": "",
"lotnoLookupAttr19": 0,
"newLotno": 0,
"lotnoLot": "A",
"id": 8,
"pbDesc_zh-TW": "半成品",
"dDesc_haha1": "",
"sjobLot": "A",
"lotnoNumAttr20": 0,
"pdDesc_ccn": "",
"lotnoLookupAttr12": 0,
"lotnoLookupAttr13": 0,
"lotnoLookupAttr10": 0,
"lotnoLookupAttr11": 0,
"i18nField": "{\"bDesc_en\": \"\", \"dDesc_en\": \"\", \"pbDesc_en\": \"半成品\", \"pdDesc_en\": \"\", \"pbDesc_haha1\": \"半成品\", \"pbDesc_zh-CN\": \"半成品\", \"pbDesc_zh-TW\": \"半成品\"}",
"pbDesc_zh-CN": "半成品",
"sourceType": "pdcoreSpick",
"costAmt": 600,
"pproId": 4536,
"iRev": 1,
"bDesc_ctw": "",
"ce01Module": "pdcoreSmr",
"lot": "A",
"lotnoDateAttr3": -2209017600000,
"lotnoDateAttr4": -2209017600000,
"lotnoDateAttr1": -2209017600000,
"lotnoDateAttr2": -2209017600000,
"lotnoDateAttr7": -2209017600000,
"lotnoDateAttr8": -2209017600000,
"bDesc_ccn": "",
"lotnoDateAttr5": -2209017600000,
"lotnoDateAttr6": -2209017600000,
"unitId": 39607,
"lotnoDateAttr9": -2209017600000,
"pbDesc_ctw": "",
"locId": 2,
"mjobId": 0,
"bDesc_en": "",
"sjobId": 130,
"pdDesc": "",
"pdDesc_haha1": "",
"pdDesc_en": "",
"lotnoTextAttr1": "",
"lotnoTextAttr2": "",
"lotnoTextAttr3": "",
"lotnoTextAttr4": "",
"lotnoTextAttr5": "",
"lotnoTextAttr6": "",
"lotnoTextAttr7": "",
"lotnoTextAttr8": "",
"lotnoTextAttr9": "",
"bDesc_zh-CN": "",
"sourceId": 29,
"dualQty": 40,
"itemNo": " 1",
"beId": 142,
"pdDesc_zh-CN": "",
"bDesc": "",
"hId": 7,
"pbDesc_ccn": "",
"lotnoNumAttr1": 0,
"lotnoNumAttr2": 0,
"lotnoNumAttr3": 0,
"lotnoNumAttr4": 0,
"pdDesc_zh-TW": "",
"lotnoExpDate": 253402185600000,
"footerKey": " 1",
"dDesc": "",
"sjobType": "pdcoreSjob",
"qty": 40,
"lotnoNumAttr5": 0,
"lotnoNumAttr6": 0,
"lotnoNumAttr7": 0,
"lotnoNumAttr8": 0,
"lotnoNumAttr9": 0,
"refCode": "",
"lotNoId": 753,
"lotnoTextAttr16": "",
"dDesc_ctw": "",
"lotnoTextAttr15": "",
"lotnoTextAttr18": "",
"lotnoTextAttr17": "",
"lotnoTextAttr12": "",
"lotnoTextAttr11": "",
"lotnoDateAttr20": -2209017600000,
"lotnoTextAttr14": "",
"lotnoTextAttr13": "",
"dDesc_zh-CN": "",
"lotnoTextAttr19": "",
"bDesc_haha1": "",
"dDesc_zh-TW": "",
"pdDesc_ctw": "",
"plot": "A",
"dDesc_ccn": "",
"pbDesc_haha1": "半成品",
"lotnoTextAttr10": "",
"pbDesc_en": "半成品",
"dDesc_en": "",
"oriUnitId": 41198,
"dualUnitId": 4396,
"lotnoLookupAttr5": 0,
"lotnoLookupAttr6": 0,
"sourceLot": "A",
"lotnoLookupAttr7": 0,
"lotnoDateAttr18": -2209017600000,
"lotnoLookupAttr8": 0,
"lotnoDateAttr19": -2209017600000,
"lotno": "************NE",
"lotnoLookupAttr9": 0,
"proId": 4538,
"lotnoDateAttr12": -2209017600000,
"lotnoDateAttr13": -2209017600000,
"lotnoDateAttr10": -2209017600000,
"lotnoDateAttr11": -2209017600000,
"lotnoTextAttr20": "",
"lotnoLookupAttr1": 0,
"lotnoDateAttr16": -2209017600000,
"lotnoLookupAttr2": 0,
"lotnoDateAttr17": -2209017600000,
"lotnoLookupAttr3": 0,
"lotnoDateAttr14": -2209017600000,
"lotnoLookupAttr4": 0,
"lotnoDateAttr15": -2209017600000
},
{
"lotnoNumAttr17": 0,
"lotnoNumAttr16": 0,
"lotnoNumAttr15": 0,
"lotnoNumAttr14": 0,
"lotnoNumAttr19": 0,
"pbDesc": "MRPPRO02",
"lotnoNumAttr18": 0,
"lotnoLookupAttr20": 0,
"lotnoNumAttr13": 0,
"lotnoNumAttr12": 0,
"lotnoNumAttr11": 0,
"lotnoNumAttr10": 0,
"lotnoLookupAttr16": 0,
"oriQty": 22,
"lotnoLookupAttr17": 0,
"lotnoLookupAttr14": 0,
"lotnoLookupAttr15": 0,
"lotnoLookupAttr18": 0,
"bDesc_zh-TW": "",
"lotnoLookupAttr19": 0,
"newLotno": 0,
"lotnoLot": "A",
"id": 9,
"pbDesc_zh-TW": "",
"dDesc_haha1": "",
"sjobLot": "A",
"lotnoNumAttr20": 0,
"pdDesc_ccn": "",
"lotnoLookupAttr12": 0,
"lotnoLookupAttr13": 0,
"lotnoLookupAttr10": 0,
"lotnoLookupAttr11": 0,
"i18nField": "{\"bDesc_en\": \"MRPMAT02\", \"dDesc_en\": \"\", \"pbDesc_en\": \"MRPPRO02\", \"pdDesc_en\": \"<p>MRPPRO02<br></p>\"}",
"pbDesc_zh-CN": "",
"sourceType": "pdcoreSpick",
"costAmt": 22,
"pproId": 4231,
"iRev": 1,
"bDesc_ctw": "",
"ce01Module": "pdcoreSmr",
"lot": "A",
"lotnoDateAttr3": -2209017600000,
"lotnoDateAttr4": -2209017600000,
"lotnoDateAttr1": -2209017600000,
"lotnoDateAttr2": -2209017600000,
"lotnoDateAttr7": -2209017600000,
"lotnoDateAttr8": -2209017600000,
"bDesc_ccn": "",
"lotnoDateAttr5": -2209017600000,
"lotnoDateAttr6": -2209017600000,
"unitId": 39228,
"lotnoDateAttr9": -2209017600000,
"pbDesc_ctw": "",
"locId": 2,
"mjobId": 0,
"bDesc_en": "MRPMAT02",
"sjobId": 84,
"pdDesc": "<p>MRPPRO02<br></p>",
"pdDesc_haha1": "",
"pdDesc_en": "<p>MRPPRO02<br></p>",
"lotnoTextAttr1": "",
"lotnoTextAttr2": "",
"lotnoTextAttr3": "",
"lotnoTextAttr4": "",
"lotnoTextAttr5": "",
"lotnoTextAttr6": "",
"lotnoTextAttr7": "",
"lotnoTextAttr8": "",
"lotnoTextAttr9": "",
"bDesc_zh-CN": "",
"sourceId": 29,
"dualQty": 22,
"itemNo": " 2",
"beId": 142,
"pdDesc_zh-CN": "",
"bDesc": "MRPMAT02",
"hId": 7,
"pbDesc_ccn": "",
"lotnoNumAttr1": 0,
"lotnoNumAttr2": 0,
"lotnoNumAttr3": 0,
"lotnoNumAttr4": 0,
"pdDesc_zh-TW": "",
"lotnoExpDate": 253402185600000,
"footerKey": " 2",
"dDesc": "",
"sjobType": "prodSpjob",
"qty": 22,
"lotnoNumAttr5": 0,
"lotnoNumAttr6": 0,
"lotnoNumAttr7": 0,
"lotnoNumAttr8": 0,
"lotnoNumAttr9": 0,
"refCode": "",
"lotNoId": 753,
"lotnoTextAttr16": "",
"dDesc_ctw": "",
"lotnoTextAttr15": "",
"lotnoTextAttr18": "",
"lotnoTextAttr17": "",
"lotnoTextAttr12": "",
"lotnoTextAttr11": "",
"lotnoDateAttr20": -2209017600000,
"lotnoTextAttr14": "",
"lotnoTextAttr13": "",
"dDesc_zh-CN": "",
"lotnoTextAttr19": "",
"bDesc_haha1": "",
"dDesc_zh-TW": "",
"pdDesc_ctw": "",
"plot": "A",
"dDesc_ccn": "",
"pbDesc_haha1": "",
"lotnoTextAttr10": "",
"pbDesc_en": "MRPPRO02",
"dDesc_en": "",
"oriUnitId": 39228,
"dualUnitId": 4171,
"lotnoLookupAttr5": 0,
"lotnoLookupAttr6": 0,
"sourceLot": "A",
"lotnoLookupAttr7": 0,
"lotnoDateAttr18": -2209017600000,
"lotnoLookupAttr8": 0,
"lotnoDateAttr19": -2209017600000,
"lotno": "************NE",
"lotnoLookupAttr9": 0,
"proId": 4233,
"lotnoDateAttr12": -2209017600000,
"lotnoDateAttr13": -2209017600000,
"lotnoDateAttr10": -2209017600000,
"lotnoDateAttr11": -2209017600000,
"lotnoTextAttr20": "",
"lotnoLookupAttr1": 0,
"lotnoDateAttr16": -2209017600000,
"lotnoLookupAttr2": 0,
"lotnoDateAttr17": -2209017600000,
"lotnoLookupAttr3": 0,
"lotnoDateAttr14": -2209017600000,
"lotnoLookupAttr4": 0,
"lotnoDateAttr15": -2209017600000
},
{
"lotnoNumAttr17": 0,
"lotnoNumAttr16": 0,
"lotnoNumAttr15": 0,
"lotnoNumAttr14": 0,
"lotnoNumAttr19": 0,
"pbDesc": "MRPPRO02",
"lotnoNumAttr18": 0,
"lotnoLookupAttr20": 0,
"lotnoNumAttr13": 0,
"lotnoNumAttr12": 0,
"lotnoNumAttr11": 0,
"lotnoNumAttr10": 0,
"lotnoLookupAttr16": 0,
"oriQty": 33,
"lotnoLookupAttr17": 0,
"lotnoLookupAttr14": 0,
"lotnoLookupAttr15": 0,
"lotnoLookupAttr18": 0,
"bDesc_zh-TW": "",
"lotnoLookupAttr19": 0,
"newLotno": 0,
"lotnoLot": "A",
"id": 10,
"pbDesc_zh-TW": "",
"dDesc_haha1": "",
"sjobLot": "A",
"lotnoNumAttr20": 0,
"pdDesc_ccn": "",
"lotnoLookupAttr12": 0,
"lotnoLookupAttr13": 0,
"lotnoLookupAttr10": 0,
"lotnoLookupAttr11": 0,
"i18nField": "{\"bDesc_en\": \"MRPMAT01\", \"dDesc_en\": \"\", \"pbDesc_en\": \"MRPPRO02\", \"pdDesc_en\": \"<p>MRPPRO02<br></p>\"}",
"pbDesc_zh-CN": "",
"sourceType": "pdcoreSpick",
"costAmt": 33,
"pproId": 4231,
"iRev": 1,
"bDesc_ctw": "",
"ce01Module": "pdcoreSmr",
"lot": "A",
"lotnoDateAttr3": -2209017600000,
"lotnoDateAttr4": -2209017600000,
"lotnoDateAttr1": -2209017600000,
"lotnoDateAttr2": -2209017600000,
"lotnoDateAttr7": -2209017600000,
"lotnoDateAttr8": -2209017600000,
"bDesc_ccn": "",
"lotnoDateAttr5": -2209017600000,
"lotnoDateAttr6": -2209017600000,
"unitId": 39227,
"lotnoDateAttr9": -2209017600000,
"pbDesc_ctw": "",
"locId": 2,
"mjobId": 0,
"bDesc_en": "MRPMAT01",
"sjobId": 84,
"pdDesc": "<p>MRPPRO02<br></p>",
"pdDesc_haha1": "",
"pdDesc_en": "<p>MRPPRO02<br></p>",
"lotnoTextAttr1": "",
"lotnoTextAttr2": "",
"lotnoTextAttr3": "",
"lotnoTextAttr4": "",
"lotnoTextAttr5": "",
"lotnoTextAttr6": "",
"lotnoTextAttr7": "",
"lotnoTextAttr8": "",
"lotnoTextAttr9": "",
"bDesc_zh-CN": "",
"sourceId": 29,
"dualQty": 33,
"itemNo": " 3",
"beId": 142,
"pdDesc_zh-CN": "",
"bDesc": "MRPMAT01",
"hId": 7,
"pbDesc_ccn": "",
"lotnoNumAttr1": 0,
"lotnoNumAttr2": 0,
"lotnoNumAttr3": 0,
"lotnoNumAttr4": 0,
"pdDesc_zh-TW": "",
"lotnoExpDate": 253402185600000,
"footerKey": " 3",
"dDesc": "",
"sjobType": "prodSpjob",
"qty": 33,
"lotnoNumAttr5": 0,
"lotnoNumAttr6": 0,
"lotnoNumAttr7": 0,
"lotnoNumAttr8": 0,
"lotnoNumAttr9": 0,
"refCode": "",
"lotNoId": 753,
"lotnoTextAttr16": "",
"dDesc_ctw": "",
"lotnoTextAttr15": "",
"lotnoTextAttr18": "",
"lotnoTextAttr17": "",
"lotnoTextAttr12": "",
"lotnoTextAttr11": "",
"lotnoDateAttr20": -2209017600000,
"lotnoTextAttr14": "",
"lotnoTextAttr13": "",
"dDesc_zh-CN": "",
"lotnoTextAttr19": "",
"bDesc_haha1": "",
"dDesc_zh-TW": "",
"pdDesc_ctw": "",
"plot": "A",
"dDesc_ccn": "",
"pbDesc_haha1": "",
"lotnoTextAttr10": "",
"pbDesc_en": "MRPPRO02",
"dDesc_en": "",
"oriUnitId": 39227,
"dualUnitId": 4170,
"lotnoLookupAttr5": 0,
"lotnoLookupAttr6": 0,
"sourceLot": "A",
"lotnoLookupAttr7": 0,
"lotnoDateAttr18": -2209017600000,
"lotnoLookupAttr8": 0,
"lotnoDateAttr19": -2209017600000,
"lotno": "************NE",
"lotnoLookupAttr9": 0,
"proId": 4232,
"lotnoDateAttr12": -2209017600000,
"lotnoDateAttr13": -2209017600000,
"lotnoDateAttr10": -2209017600000,
"lotnoDateAttr11": -2209017600000,
"lotnoTextAttr20": "",
"lotnoLookupAttr1": 0,
"lotnoDateAttr16": -2209017600000,
"lotnoLookupAttr2": 0,
"lotnoDateAttr17": -2209017600000,
"lotnoLookupAttr3": 0,
"lotnoDateAttr14": -2209017600000,
"lotnoLookupAttr4": 0,
"lotnoDateAttr15": -2209017600000
}
]
},
"messages": [],
"status": true
}
# 保存委外退料单
# 一、接口描述
用于新增或者更新【委外退料单】
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/save/pdcoreSmr |
---|---|
http请求方式 | PUT |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSmr |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/pdcoreSmr";
String param = "&menuCode=pdcoreSmr";
HttpPut put = new HttpPut(url + "?" + param);
put.addHeader("authorization", access_token);
put.addHeader("client_id", ClientID);
StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
entity.setContentEncoding("UTF-8");
put.setEntity(entity);
res = client.execute(put);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
if (json != null) {
recordId = json.getLongValue("recordId");
}
System.out.println(json);
}
put.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
Entity的JSON格式数据如下:
{
"pdcoremainsmr": {
"values": [
{
"beId": 142,
"tDate": "2022-03-23",
"code": "SMRTEST",
"venId": 99,
"virDeptId": 7,
"staffId": 785,
"locId": 15
}
]
},
"pdcoresmrt": {
"values": [
{
"sourceId": 40,
"sjobId": 198,
"pproId": 4634,
"oriUnitId": 38887,
"lot": "A",
"oriQty": 100,
"sourceLot": "A",
"sourceType": "pdcoreSpick",
"plot": "A",
"sjobType": "pdcoreSjob",
"proId": 3972,
"qty": 100,
"unitId": 38887,
"locId": 15,
"sjobLot": "A",
"lotNoId": 5388
}
]
}
}
4、返回示例
{
"recordId": 40,
"messages": [],
"status": true
}
{
"recordId": 0,
"messages": [
{
"msgDetail": "必填项为空",
"msgCode": "core_101905"
}
],
"status": false
}
# 删除委外退料单
# 一、接口描述
用于删除委外退料单
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/delete/pdcoreSmr |
---|---|
http请求方式 | DELETE |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSmr |
id | long(Query) | 是 | 委外退料单的id |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/pdcoreSmr";
String param = "&menuCode=pdcoreSmr&id=" + id;
HttpDelete delete = new HttpDelete(url + "?" + param);
delete.addHeader("authorization", access_token);
delete.addHeader("client_id", ClientID);
res = client.execute(delete);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
delete.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"messages": [],
"status": true
}
{
"messages": [
{
"msgDetail": "单据已被删除",
"msgCode": "core_101017"
}
],
"status": false
}
# 委外发货单
# 获取委外发货单列表
# 一、接口描述
用于获取委外发货单列表(同UI界面左侧的Search List数据)
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/search/search |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
stSearch | String(Query) | 是 | pdcoreSsn |
beId | long(Query) | 是 | aiM18企业法人[部门]的ID |
formatId | long(Query) | 否 | aiM18[查询格式]的ID,用于获取[查询格式]步骤二中设定的栏位格式;若不使用此参数,则使用默认设置。 |
startRow | int(Query) | 否 | 返回结果的开始行 |
endRow | int(Query) | 否 | 返回结果的结束行 |
quickSearchStr | String(Query) | 否 | 用于设定关键字查找数据 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
String param = "&stSearch=pdcoreSsn&beId=" + beId;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"stSearch": "pdcoreSsn",
"size": 9,
"stSearchDisplay": "委外发货单",
"values": [
{
"tDate": "2021-03-22",
"code": "SSN210009",
"st_id": 10,
"st_code": "SSN210009",
"pdcoreMainSsn.flowTypeId.flowtype.code": "MX-SUBCON",
"st_desc": "SSN210009",
"pdcoreMainSsn.flowTypeId.flowtype.desc": "Subcontract",
"iRev": 2,
"id": 10,
"lastModifyDate": "2021-03-22 16:48:30",
"pdcoreMainSsn.lastModifyUid.simpleUser.desc__lang": "Milk"
}
]
}
# 新增委外发货单(自动补全)
# 一、接口描述
1. 用于新增【委外发货单】
2. 此接口方法有如下特点:
a. 支持使用code 替代 id 栏位
b. 货币栏位未填时,自动使用本货币
c. 职员栏位未填时,自动使用个人选项中的默认职员
d. 单据日期未填时,根据贸易参数设定中的日期选项取值
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/erp/bsFlow/save/pdcoreSsn |
---|---|
http请求方式 | POST |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/pdcoreSsn";
String param = "";
HttpPost post = new HttpPost(url + "?" + param);
post.addHeader("authorization", access_token);
post.addHeader("client_id", ClientID);
StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
entity.setContentEncoding("UTF-8");
post.setEntity(entity);
res = client.execute(post);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
if (json != null) {
recordId = json.getLongValue("tranId");
}
System.out.println(json);
}
post.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
data数据示例:
{
"beId": 142,
"asnRefType": "ven",
"curId": 2,
"code": "SSNTEST2",
"asnRefId": 99,
"rate": 1,
"virDeptId": 7,
"pdcoressnt": [
{
"sourceId": 198,
"lot": "A",
"oriQty": 100,
"sourceLot": "A",
"sourceType": "pdcoreSjob",
"proId": 4634,
"qty": 100,
"unitId": 39720,
"oriUnitId": 39720
}
],
"flowTypeId": 15450
}
4、返回示例
{
"tranId": 10,
"tranCode": "SSNTEST2",
"message": "",
"status": true
}
# 读取委外发货单
# 一、接口描述
用于读取委外发货单数据
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/read/pdcoreSsn |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSsn |
id | long(Query) | 是 | 委外发货单的id |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/pdcoreSsn";
String param = "&menuCode=pdcoreSsn&id=" + id;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"data": {},
"messages": [
{
"msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限",
"msgCode": "core_141019"
}
],
"status": false
}
{
"data": {
"pdcoreremssn": [
{
"tradeTerm_ccn": "",
"tradeTerm_en": "",
"shipMark": "",
"heading_en": "",
"shipMark_zh-CN": "",
"tradeTerm_zh-CN": "",
"shipMark_ctw": "",
"remarks_en": "",
"payTerm_en": "",
"iRev": 2,
"packing_ccn": "",
"packing": "",
"heading_zh-CN": "",
"ce01Module": "pdcoreSsn",
"tradeTerm": "",
"heading_ccn": "",
"payTerm_haha1": "",
"packing_zh-TW": "",
"payTerm_zh-TW": "",
"packing_haha1": "",
"remarks_haha1": "",
"shipMark_en": "",
"id": 10,
"remarks_zh-TW": "",
"hId": 10,
"packing_ctw": "",
"heading_haha1": "",
"payTerm": "",
"heading_zh-TW": "",
"payTerm_ccn": "",
"heading": "",
"remarks_ccn": "",
"heading_ctw": "",
"tradeTerm_ctw": "",
"packing_zh-CN": "",
"tradeTerm_zh-TW": "",
"shipMark_ccn": "",
"tradeTerm_haha1": "",
"i18nField": "{\"heading_en\": \"\", \"packing_en\": \"\", \"payTerm_en\": \"\", \"remarks_en\": \"\", \"shipMark_en\": \"\", \"tradeTerm_en\": \"\"}",
"remarks_zh-CN": "",
"packing_en": "",
"shipMark_haha1": "",
"payTerm_zh-CN": "",
"payTerm_ctw": "",
"shipMark_zh-TW": "",
"remarks": "",
"remarks_ctw": ""
}
],
"pdcoremainssn": [
{
"lastModifyUid": 20,
"useAccess": false,
"virDeptId": 7,
"expiredDate": -2209017600000,
"position_zh-CN": "",
"sysJson": "{\"autoGenCode\":{\"snId\":567,\"sn\":\"9\"}}",
"viewCode": "pdcoreSsn",
"beId": 142,
"useAccessBl": false,
"id": 10,
"doctypeId": 0,
"locked": false,
"position_ctw": "",
"lastModifyDate": 1616402910000,
"createUid": 20,
"rev": "2",
"lastApproveUid": 20,
"ttlCharge": 0,
"completed": false,
"expiredUid": 0,
"freeQtyPer": 0,
"descOrigin": "SUBCONLAST",
"position_en": "PIE",
"position_zh-TW": "",
"i18nField": "{\"position_en\": \"PIE\"}",
"manId": 48,
"ttlAmt": 0,
"position": "PIE",
"flowTypeId": 15450,
"status": "Y",
"tDate": 1616342400000,
"code": "SSN210009",
"cnDeptId": 218,
"amt": 0,
"iRev": 2,
"upOrigin": "SUBCONLAST",
"ce01Module": "pdcoreSsn",
"curId": 2,
"expired": false,
"asnRefId": 99,
"rate": 1,
"domAmt": 0,
"printCount": 0,
"statusModifyDate": 1616402427000,
"createDate": 1616402427000,
"asnRefType": "ven",
"useAccessWl": false,
"position_ccn": "",
"ttlDisc": 0,
"position_haha1": "",
"useAccessAutoCalc": false,
"staffId": 21,
"domAmtDiff": 0
}
],
"pdcoressnt": [
{
"sourceId": 148,
"dualQty": 22.5,
"itemNo": " 1",
"beId": 142,
"oriQty": 45,
"bDesc": "多工艺产品",
"bDesc_zh-TW": "",
"id": 14,
"up": 0,
"qcRequired": false,
"dDesc_haha1": "",
"hId": 10,
"lotnoNumAttr1": 0,
"lotnoNumAttr2": 0,
"lotnoNumAttr3": 0,
"lotnoNumAttr4": 0,
"completed": false,
"lotnoExpDate": 253402271999000,
"dDesc": "<p>钻石套装 -- 18K鑽戒 (女)<br></p>",
"i18nField": "{\"bDesc_en\": \"多工艺产品\", \"dDesc_en\": \"<p>钻石套装 -- 18K鑽戒 (女)<br></p>\"}",
"sourceType": "pdcoreSjob",
"qty": 45,
"disc": 0,
"dDesc_ctw": "",
"amt": 0,
"iRev": 2,
"dDesc_zh-CN": "",
"bDesc_ctw": "",
"ce01Module": "pdcoreSsn",
"lot": "A",
"lotnoDateAttr3": -2209017600000,
"lotnoDateAttr4": -2209017600000,
"lotnoDateAttr1": -2209017600000,
"bDesc_haha1": "",
"lotnoDateAttr2": -2209017600000,
"dDesc_zh-TW": "",
"domAmt": 0,
"bDesc_ccn": "",
"unitId": 41203,
"dDesc_ccn": "",
"bDesc_en": "多工艺产品",
"dDesc_en": "<p>钻石套装 -- 18K鑽戒 (女)<br></p>",
"oriUnitId": 41203,
"dualUnitId": 8308,
"oriUp": 0,
"lotnoTextAttr1": "",
"sourceLot": "A",
"lotnoTextAttr2": "",
"lotnoTextAttr3": "",
"lotno": "",
"lotnoTextAttr4": "",
"proId": 6063,
"lotnoLookupAttr1": 0,
"lotnoLookupAttr2": 0,
"lotnoLookupAttr3": 0,
"lotnoLookupAttr4": 0,
"bDesc_zh-CN": ""
}
]
},
"messages": [],
"status": true
}
# 保存委外发货单
# 一、接口描述
用于新增或者更新【委外发货单】
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/save/pdcoreSsn |
---|---|
http请求方式 | PUT |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSsn |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/pdcoreSsn";
String param = "&menuCode=pdcoreSsn";
HttpPut put = new HttpPut(url + "?" + param);
put.addHeader("authorization", access_token);
put.addHeader("client_id", ClientID);
StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
entity.setContentEncoding("UTF-8");
put.setEntity(entity);
res = client.execute(put);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
if (json != null) {
recordId = json.getLongValue("recordId");
}
System.out.println(json);
}
put.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
Entity的JSON格式数据如下:
{
"pdcoremainssn": {
"values": [
{
"beId": 142,
"tDate": "2022-03-23",
"asnRefType": "ven",
"curId": 2,
"code": "SSNTEST",
"asnRefId": 99,
"rate": 1,
"virDeptId": 7,
"flowTypeId": 15450,
"staffId": 785
}
]
},
"pdcoressnt": {
"values": [
{
"sourceId": 198,
"lot": "A",
"oriQty": 100,
"sourceLot": "A",
"sourceType": "pdcoreSjob",
"proId": 4634,
"qty": 100,
"unitId": 39720,
"oriUnitId": 39720
}
]
}
}
4、返回示例
{
"recordId": 10,
"messages": [],
"status": true
}
{
"recordId": 0,
"messages": [
{
"msgDetail": "必填项为空",
"msgCode": "core_101905"
}
],
"status": false
}
# 删除委外发货单
# 一、接口描述
用于删除委外发货单
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/delete/pdcoreSsn |
---|---|
http请求方式 | DELETE |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSsn |
id | long(Query) | 是 | 委外发货单的id |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/pdcoreSqu";
String param = "&menuCode=pdcoreSqu&id=" + id;
HttpDelete delete = new HttpDelete(url + "?" + param);
delete.addHeader("authorization", access_token);
delete.addHeader("client_id", ClientID);
res = client.execute(delete);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
delete.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"messages": [],
"status": true
}
{
"messages": [
{
"msgDetail": "单据已被删除",
"msgCode": "core_101017"
}
],
"status": false
}
# 读取EBI数据:委外发货单报告
# 一、接口描述
用于执行EBI[委外发货单报告],返回EBI数据
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/ebiWidget/loadReport |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
formatId | long(Query) | 是 | 通过EBI接口获取到formatId |
beId | long(Query) | 否 | 企业法人的ID。若不传,则查询所有有权限的BE数据 |
offset | int(Query) | 否 | 返回结果的开始行 |
rows | int(Query) | 否 | 返回结果的结束行 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
String param = "&formatId=" + formatId;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"size": 14,
"rows": [
{
"aiM18ReservedCol_dataIndex": 1,
"MAIN_reportFinalAmt": "0.00",
"MAIN_sourceId": "72",
"MAIN_sourceCode": "SJOB180814",
"MAIN_reportTtlDisc": "0.00",
"MAIN_sourceType": "pdcoreSjob",
"MAIN_reportRate": "1.00000000",
"MAIN_lot": "A",
"MAIN_domFinalAmt": "0.00",
"MAIN_reportTtlCharge": "0.00",
"MAIN_domTtlDisc": "0.00",
"MAIN_domTtlCharge": "0.00",
"MAIN_domTtlAmt": "0.00",
"MAIN_basicDualQty": "0.00",
"MAIN_reportTtlAmt": "0.00"
}
]
}
# 委外入库单
# 获取委外入库单列表
# 一、接口描述
用于获取委外入库单列表(同UI界面左侧的Search List数据)
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/search/search |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
stSearch | String(Query) | 是 | pdcoreSpw |
beId | long(Query) | 是 | aiM18企业法人[部门]的ID |
formatId | long(Query) | 否 | aiM18[查询格式]的ID,用于获取[查询格式]步骤二中设定的栏位格式;若不使用此参数,则使用默认设置。 |
startRow | int(Query) | 否 | 返回结果的开始行 |
endRow | int(Query) | 否 | 返回结果的结束行 |
quickSearchStr | String(Query) | 否 | 用于设定关键字查找数据 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
String param = "&stSearch=pdcoreSpw&beId=" + beId;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"stSearch": "pdcoreSpw",
"size": 29,
"stSearchDisplay": "委外入库单",
"values": [
{
"tDate": "2022-03-25",
"code": "SPWTEST2",
"st_id": 58,
"st_code": "SPWTEST2",
"st_desc": "SPWTEST2",
"iRev": 1,
"pdcoreMainSpw.lastModifyUid.simpleUser.desc__lang": "Milk",
"id": 58,
"lastModifyDate": "2022-03-25 15:20:09"
}
]
}
# 新增委外入库单(自动补全)
# 一、接口描述
1. 用于新增【委外入库单】
2. 此接口方法有如下特点:
a. 支持使用code 替代 id 栏位
b. 货币栏位未填时,自动使用本货币
c. 职员栏位未填时,自动使用个人选项中的默认职员
d. 单据日期未填时,根据贸易参数设定中的日期选项取值
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/erp/bsFlow/save/pdcoreSpw |
---|---|
http请求方式 | POST |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/pdcoreSpw";
String param = "";
HttpPost post = new HttpPost(url + "?" + param);
post.addHeader("authorization", access_token);
post.addHeader("client_id", ClientID);
StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
entity.setContentEncoding("UTF-8");
post.setEntity(entity);
res = client.execute(post);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
if (json != null) {
recordId = json.getLongValue("tranId");
}
System.out.println(json);
}
post.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
data数据示例:
{
"beId": 142,
"curId": 2,
"code": "SPWTEST2",
"venId": 99,
"rate": 1,
"virDeptId": 7,
"flowTypeId": 15450,
"locId": 15,
"pdcorespwt": [
{
"sourceId": 198,
"lot": "A",
"oriQty": 100,
"sourceLot": "A",
"sjobId": 198,
"sourceType": "pdcoreSjob",
"sjobType": "pdcoreSjob",
"proId": 4634,
"oriUnitId": 39720,
"locId": 15,
"sjobLot": "A"
}
]
}
4、返回示例
{
"tranId": 19,
"tranCode": "SPWTEST2",
"message": "",
"status": true
}
# 读取委外入库单
# 一、接口描述
用于读取委外入库单数据
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/read/pdcoreSpw |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSpw |
id | long(Query) | 是 | 委外入库单的id |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/pdcoreSpw";
String param = "&menuCode=pdcoreSpw&id=" + id;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"data": {},
"messages": [
{
"msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限",
"msgCode": "core_141019"
}
],
"status": false
}
{
"data": {
"pdcoreremspw": [
{
"hId": 58,
"i18nField": "{\"remarks_zh-CN\": \"\"}",
"remarks_zh-CN": "",
"remarks_ccn": "",
"remarks_en": "",
"remarks_haha1": "",
"iRev": 1,
"id": 58,
"remarks_zh-TW": "",
"remarks": "",
"remarks_ctw": "",
"ce01Module": "pdcoreSpw"
}
],
"pdcoremainspw": [
{
"lastModifyUid": 20,
"useAccess": false,
"virDeptId": 7,
"expiredDate": -2209017600000,
"position_zh-CN": "PIE",
"sysJson": "",
"viewCode": "pdcoreSpw",
"beId": 142,
"useAccessBl": false,
"id": 58,
"doctypeId": 0,
"locked": false,
"position_ctw": "",
"lastModifyDate": 1648192809000,
"createUid": 20,
"rev": "1",
"lastApproveUid": 20,
"ttlCharge": 0,
"completed": false,
"expiredUid": 0,
"position_en": "",
"position_zh-TW": "",
"venId": 99,
"i18nField": "{\"position_zh-CN\": \"PIE\"}",
"manId": 48,
"ttlAmt": 0,
"position": "PIE",
"flowTypeId": 15450,
"status": "Y",
"tDate": 1648137600000,
"code": "SPWTEST2",
"cnDeptId": 0,
"amt": 0,
"iRev": 1,
"ce01Module": "pdcoreSpw",
"curId": 2,
"expired": false,
"rate": 1,
"domAmt": 0,
"printCount": 0,
"statusModifyDate": 1648192809000,
"locId": 15,
"createDate": 1648192809000,
"useAccessWl": false,
"position_ccn": "",
"ttlDisc": 0,
"position_haha1": "",
"useAccessAutoCalc": false,
"staffId": 785,
"domAmtDiff": 0
}
],
"pdcorespwmatt": [
{
"dDesc_ctw": "",
"dualQty": 0,
"costAmt": 0,
"iRev": 1,
"itemNo": " 1",
"dDesc_zh-CN": "",
"spickId": 40,
"bDesc_ctw": "",
"ce01Module": "pdcoreSpw",
"beId": 142,
"lot": "A",
"oriQty": 100,
"bDesc_haha1": "",
"dDesc_zh-TW": "",
"bDesc": "",
"bDesc_ccn": "",
"bDesc_zh-TW": "",
"newLotno": 0,
"unitId": 38887,
"dDesc_ccn": "",
"id": 173,
"dDesc_haha1": "",
"sjobLot": "A",
"hId": 58,
"bDesc_en": "",
"dDesc_en": "",
"oriUnitId": 38887,
"dualUnitId": 3937,
"spickLot": "A",
"footerKey": " 1",
"dDesc": "",
"i18nField": "{\"bDesc_zh-CN\": \"\", \"dDesc_zh-CN\": \"\"}",
"lastSpw": false,
"proId": 3972,
"qty": 100,
"ndFooterKey": " 1",
"refCode": "",
"lotNoId": 5388,
"bDesc_zh-CN": ""
}
],
"pdcorespwstt": [
{
"dDesc_ctw": "",
"dualQty": 0,
"iRev": 1,
"itemNo": " 1",
"dDesc_zh-CN": "",
"bDesc_ctw": "",
"ce01Module": "pdcoreSpw",
"beId": 142,
"lot": "A",
"oriQty": 100,
"bDesc_haha1": "",
"dDesc_zh-TW": "",
"bDesc": "",
"bDesc_ccn": "",
"bDesc_zh-TW": "",
"unitId": 39720,
"dDesc_ccn": "",
"id": 88,
"dDesc_haha1": "",
"sjobLot": "A",
"hId": 58,
"bDesc_en": "",
"sjobId": 198,
"stId": 198,
"dDesc_en": "",
"oriUnitId": 39720,
"dualUnitId": 0,
"footerKey": " 1",
"dDesc": "",
"i18nField": "{\"bDesc_zh-CN\": \"\", \"dDesc_zh-CN\": \"\"}",
"sjobType": "pdcoreSjob",
"proId": 4634,
"qty": 100,
"ndFooterKey": " 1",
"stLot": "A",
"stType": "pdcoreSjob",
"stProId": 4634,
"refCode": "",
"bDesc_zh-CN": ""
}
],
"pdcorespwt": [
{
"lotnoNumAttr17": 0,
"lotnoNumAttr16": 0,
"lotnoNumAttr15": 0,
"lotnoNumAttr14": 0,
"lotnoNumAttr19": 0,
"lotnoNumAttr18": 0,
"lotnoLookupAttr20": 0,
"lotnoNumAttr13": 0,
"lotnoNumAttr12": 0,
"lotnoNumAttr11": 0,
"lotnoNumAttr10": 0,
"lotnoLookupAttr16": 0,
"oriQty": 100,
"lotnoLookupAttr17": 0,
"lotnoLookupAttr14": 0,
"lotnoLookupAttr15": 0,
"lotnoLookupAttr18": 0,
"bDesc_zh-TW": "",
"lotnoLookupAttr19": 0,
"newLotno": 1,
"lotnoLot": "A",
"id": 67,
"dDesc_haha1": "",
"sjobLot": "A",
"matUc": 0,
"lotnoNumAttr20": 0,
"lotnoLookupAttr12": 0,
"lotnoLookupAttr13": 0,
"lotnoLookupAttr10": 0,
"passQty": 0,
"lotnoLookupAttr11": 0,
"i18nField": "{\"bDesc_zh-CN\": \"\", \"dDesc_zh-CN\": \"\"}",
"sourceType": "pdcoreSjob",
"costAmt": 0,
"iRev": 1,
"bDesc_ctw": "",
"ce01Module": "pdcoreSpw",
"lot": "A",
"lotnoDateAttr3": -2209017600000,
"lotnoDateAttr4": -2209017600000,
"lotnoDateAttr1": -2209017600000,
"lotnoDateAttr2": -2209017600000,
"lotnoDateAttr7": -2209017600000,
"lotnoDateAttr8": -2209017600000,
"bDesc_ccn": "",
"lotnoDateAttr5": -2209017600000,
"lotnoDateAttr6": -2209017600000,
"unitId": 39720,
"lotnoDateAttr9": -2209017600000,
"locId": 15,
"mjobId": 0,
"bDesc_en": "",
"sjobId": 198,
"scrapQty": 0,
"oriUp": 0,
"lotnoTextAttr1": "",
"lotnoTextAttr2": "",
"lotnoTextAttr3": "",
"lotnoTextAttr4": "",
"lotnoTextAttr5": "",
"lotnoTextAttr6": "",
"lotnoTextAttr7": "",
"lotnoTextAttr8": "",
"lotnoTextAttr9": "",
"bDesc_zh-CN": "",
"sourceId": 198,
"dualQty": 0,
"supMatUc": 0,
"itemNo": " 1",
"venDnNo": "",
"uc": 0,
"beId": 142,
"bDesc": "",
"up": 0,
"hId": 58,
"lotnoNumAttr1": 0,
"lotnoNumAttr2": 0,
"lotnoNumAttr3": 0,
"lotnoNumAttr4": 0,
"lotnoExpDate": 253402271999000,
"footerKey": " 1",
"dDesc": "",
"sjobType": "pdcoreSjob",
"qty": 100,
"lotnoNumAttr5": 0,
"lotnoNumAttr6": 0,
"disc": 0,
"lotnoNumAttr7": 0,
"lotnoNumAttr8": 0,
"lotnoNumAttr9": 0,
"refCode": "",
"lotNoId": 5488,
"lotnoTextAttr16": "",
"dDesc_ctw": "",
"lotnoTextAttr15": "",
"lotnoTextAttr18": "",
"lotnoTextAttr17": "",
"lotnoTextAttr12": "",
"lotnoTextAttr11": "",
"lotnoDateAttr20": -2209017600000,
"lotnoTextAttr14": "",
"lotnoTextAttr13": "",
"amt": 0,
"dDesc_zh-CN": "",
"lotnoTextAttr19": "",
"bDesc_haha1": "",
"dDesc_zh-TW": "",
"domAmt": 0,
"dDesc_ccn": "",
"lotnoTextAttr10": "",
"dDesc_en": "",
"oriUnitId": 39720,
"dualUnitId": 4489,
"lotnoLookupAttr5": 0,
"lotnoLookupAttr6": 0,
"sourceLot": "A",
"lotnoLookupAttr7": 0,
"lotnoDateAttr18": -2209017600000,
"lotnoLookupAttr8": 0,
"lotnoDateAttr19": -2209017600000,
"lotno": "SPWTEST2000000000000",
"lotnoLookupAttr9": 0,
"proId": 4634,
"lotnoDateAttr12": -2209017600000,
"lotnoDateAttr13": -2209017600000,
"lotnoDateAttr10": -2209017600000,
"lotnoDateAttr11": -2209017600000,
"lotnoTextAttr20": "",
"lotnoLookupAttr1": 0,
"lotnoDateAttr16": -2209017600000,
"lotnoLookupAttr2": 0,
"lotnoDateAttr17": -2209017600000,
"lotnoLookupAttr3": 0,
"lotnoDateAttr14": -2209017600000,
"lotnoLookupAttr4": 0,
"lotnoDateAttr15": -2209017600000
}
]
},
"messages": [],
"status": true
}
# 保存委外入库单
# 一、接口描述
用于新增或者更新【委外入库单】
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/save/pdcoreSpw |
---|---|
http请求方式 | PUT |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSpw |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/pdcoreSpw";
String param = "&menuCode=pdcoreSpw";
HttpPut put = new HttpPut(url + "?" + param);
put.addHeader("authorization", access_token);
put.addHeader("client_id", ClientID);
StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
entity.setContentEncoding("UTF-8");
put.setEntity(entity);
res = client.execute(put);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
if (json != null) {
recordId = json.getLongValue("recordId");
}
System.out.println(json);
}
put.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
Entity的JSON格式数据如下:
{
"pdcoremainspw": {
"values": [
{
"beId": 142,
"tDate": "2022-03-23",
"curId": 2,
"code": "SPWTEST2",
"venId": 99,
"rate": 1,
"virDeptId": 7,
"flowTypeId": 15450,
"staffId": 785,
"locId": 15
}
]
},
"pdcorespwstt": {
"values": [
{
"sjobId": 198,
"stId": 198,
"oriUnitId": 39720,
"lot": "A",
"oriQty": 100,
"sjobType": "pdcoreSjob",
"proId": 4634,
"qty": 100,
"unitId": 39720,
"ndFooterKey": " 1",
"stLot": "A",
"stType": "pdcoreSjob",
"stProId": 4634,
"sjobLot": "A"
}
]
},
"pdcorespwmatt": {
"values": [
{
"lot": "A",
"oriQty": 100,
"footerKey": " 1",
"proId": 3972,
"qty": 100,
"unitId": 38887,
"ndFooterKey": " 1",
"spickId": 40,
"oriUnitId": 38887,
"spickLot": "A",
"sjobLot": "A",
"lotNoId": 5388
}
]
},
"pdcorespwt": {
"values": [
{
"sourceId": 198,
"sjobId": 198,
"oriUnitId": 39720,
"lot": "A",
"oriQty": 100,
"sourceLot": "A",
"footerKey": " 1",
"sourceType": "pdcoreSjob",
"sjobType": "pdcoreSjob",
"proId": 4634,
"qty": 100,
"unitId": 39720,
"locId": 15,
"sjobLot": "A"
}
]
}
}
4、返回示例
{
"recordId": 20,
"messages": [],
"status": true
}
{
"recordId": 0,
"messages": [
{
"msgDetail": "必填项为空",
"msgCode": "core_101905"
}
],
"status": false
}
# 删除委外入库单
# 一、接口描述
用于删除委外入库单
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/delete/pdcoreSpw |
---|---|
http请求方式 | DELETE |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSpw |
id | long(Query) | 是 | 委外入库单的id |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/pdcoreSpw";
String param = "&menuCode=pdcoreSpw&id=" + id;
HttpDelete delete = new HttpDelete(url + "?" + param);
delete.addHeader("authorization", access_token);
delete.addHeader("client_id", ClientID);
res = client.execute(delete);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
delete.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"messages": [],
"status": true
}
{
"messages": [
{
"msgDetail": "单据已被删除",
"msgCode": "core_101017"
}
],
"status": false
}
# 读取EBI数据:委外入库单列表
# 一、接口描述
用于执行EBI[委外入库单列表],返回EBI数据
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/ebiWidget/loadReport |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
formatId | long(Query) | 是 | 通过EBI接口获取到formatId |
beId | long(Query) | 否 | 企业法人的ID。若不传,则查询所有有权限的BE数据 |
offset | int(Query) | 否 | 返回结果的开始行 |
rows | int(Query) | 否 | 返回结果的结束行 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
String param = "&formatId=" + formatId;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"size": 36,
"rows": [
{
"MAIN_id": "1",
"aiM18ReservedCol_dataIndex": 1,
"MAIN_ttlAmt": "55,000.00",
"MAIN_finalAmt": "57,750.00",
"MAIN_tDate": "2017.12.14",
"MAIN_code": "SPW20170002"
}
]
}
# 读取EBI数据:委外入库单报告
# 一、接口描述
用于执行EBI[委外入库单报告],返回EBI数据
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/ebiWidget/loadReport |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
formatId | long(Query) | 是 | 通过EBI接口获取到formatId |
beId | long(Query) | 否 | 企业法人的ID。若不传,则查询所有有权限的BE数据 |
offset | int(Query) | 否 | 返回结果的开始行 |
rows | int(Query) | 否 | 返回结果的结束行 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
String param = "&formatId=" + formatId;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"size": 1,
"rows": [
{
"aiM18ReservedCol_dataIndex": 1,
"MAIN_oriQty": "1,000.0000",
"MAIN_tranTypeMess": "委外入库单",
"MAIN_code": "SPW20200003"
}
]
}
# 委外退货单
# 获取委外退货单列表
# 一、接口描述
用于获取委外退货单列表(同UI界面左侧的Search List数据)
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/search/search |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
stSearch | String(Query) | 是 | pdcoreSpr |
beId | long(Query) | 是 | aiM18企业法人[部门]的ID |
formatId | long(Query) | 否 | aiM18[查询格式]的ID,用于获取[查询格式]步骤二中设定的栏位格式;若不使用此参数,则使用默认设置。 |
startRow | int(Query) | 否 | 返回结果的开始行 |
endRow | int(Query) | 否 | 返回结果的结束行 |
quickSearchStr | String(Query) | 否 | 用于设定关键字查找数据 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
String param = "&stSearch=pdcoreSpr&beId=" + beId;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"stSearch": "pdcoreSpr",
"size": 3,
"stSearchDisplay": "委外退货单",
"values": [
{
"tDate": "2021-01-13",
"code": "SPR20210001",
"st_id": 9,
"st_code": "SPR20210001",
"st_desc": "SPR20210001",
"iRev": 1,
"id": 9,
"lastModifyDate": "2021-01-13 18:07:15",
"pdcoreMainSpr.lastModifyUid.simpleUser.desc__lang": ""
}
]
}
# 新增委外退货单(自动补全)
# 一、接口描述
1. 用于新增【委外退货单】
2. 此接口方法有如下特点:
a. 支持使用code 替代 id 栏位
b. 货币栏位未填时,自动使用本货币
c. 职员栏位未填时,自动使用个人选项中的默认职员
d. 单据日期未填时,根据贸易参数设定中的日期选项取值
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/erp/bsFlow/save/pdcoreSpr |
---|---|
http请求方式 | POST |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/pdcoreSpr";
String param = "";
HttpPost post = new HttpPost(url + "?" + param);
post.addHeader("authorization", access_token);
post.addHeader("client_id", ClientID);
StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
entity.setContentEncoding("UTF-8");
post.setEntity(entity);
res = client.execute(post);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
if (json != null) {
recordId = json.getLongValue("tranId");
}
System.out.println(json);
}
post.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
data数据示例:
{
"beId": 142,
"pdcoresprt": [
{
"sourceId": 58,
"lot": "A",
"oriQty": 100,
"sourceLot": "A",
"sjobId": 198,
"sourceType": "pdcoreSpw",
"sjobType": "pdcoreSjob",
"proId": 4634,
"oriUnitId": 39720,
"locId": 15,
"sjobLot": "A"
}
],
"curId": 2,
"code": "SPRTEST2",
"venId": 99,
"rate": 1,
"virDeptId": 7,
"flowTypeId": 15450,
"locId": 15
}
4、返回示例
{
"tranId": 19,
"tranCode": "SPRTEST2",
"message": "",
"status": true
}
# 读取委外退货单
# 一、接口描述
用于读取委外退货单数据
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/read/pdcoreSpr |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSpr |
id | long(Query) | 是 | 委外退货单的id |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/pdcoreSpr";
String param = "&menuCode=pdcoreSpr&id=" + id;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"data": {},
"messages": [
{
"msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限",
"msgCode": "core_141019"
}
],
"status": false
}
{
"data": {
"pdcoremainspr": [
{
"lastModifyUid": 11,
"useAccess": false,
"virDeptId": 7,
"expiredDate": -2209017600000,
"position_zh-CN": "",
"sysJson": "{\"autoGenCode\":{\"snId\":918,\"sn\":\"1\"}}",
"viewCode": "pdcoreSpr",
"beId": 142,
"useAccessBl": false,
"id": 9,
"doctypeId": 0,
"locked": false,
"position_ctw": "",
"lastModifyDate": 1610532435000,
"createUid": 11,
"rev": "1",
"lastApproveUid": 11,
"ttlCharge": 0,
"completed": false,
"expiredUid": 0,
"position_en": "PIE",
"position_zh-TW": "",
"venId": 99,
"i18nField": "{\"position_en\": \"PIE\"}",
"manId": 48,
"ttlAmt": 1325.25,
"position": "PIE",
"flowTypeId": 15450,
"status": "Y",
"tDate": 1610467200000,
"code": "SPR20210001",
"cnDeptId": 29,
"amt": 1325.25,
"iRev": 1,
"ce01Module": "pdcoreSpr",
"curId": 2,
"expired": false,
"rate": 1,
"domAmt": 1325.25,
"printCount": 0,
"statusModifyDate": 1610532435000,
"locId": 15,
"createDate": 1610532435000,
"useAccessWl": false,
"position_ccn": "",
"ttlDisc": 0,
"position_haha1": "",
"useAccessAutoCalc": false,
"staffId": 723,
"domAmtDiff": 0
}
],
"pdcoresprt": [
{
"lotnoNumAttr17": 0,
"lotnoNumAttr16": 0,
"lotnoNumAttr15": 0,
"lotnoNumAttr14": 0,
"lotnoNumAttr19": 0,
"lotnoNumAttr18": 0,
"lotnoLookupAttr20": 0,
"lotnoNumAttr13": 0,
"lotnoNumAttr12": 0,
"lotnoNumAttr11": 0,
"lotnoNumAttr10": 0,
"lotnoLookupAttr16": 0,
"oriQty": 5,
"lotnoLookupAttr17": 0,
"lotnoLookupAttr14": 0,
"lotnoLookupAttr15": 0,
"lotnoLookupAttr18": 0,
"bDesc_zh-TW": "多工艺产品 tc",
"lotnoLookupAttr19": 0,
"newLotno": 0,
"lotnoLot": "A",
"id": 10,
"dDesc_haha1": "",
"sjobLot": "A",
"lotnoNumAttr20": 0,
"lotnoLookupAttr12": 0,
"lotnoLookupAttr13": 0,
"lotnoLookupAttr10": 0,
"lotnoLookupAttr11": 0,
"i18nField": "{\"bDesc_en\": \"多工艺产品\", \"dDesc_en\": \"<p>钻石套装 -- 18K鑽戒 (女)<br></p>\", \"bDesc_zh-CN\": \"多工艺产品 sc\", \"bDesc_zh-TW\": \"多工艺产品 tc\", \"dDesc_zh-CN\": \"<p>钻石套装 -- 18K鑽戒 (女)<br></p>\"}",
"sourceType": "pdcoreSpw",
"costAmt": 0,
"iRev": 1,
"bDesc_ctw": "",
"ce01Module": "pdcoreSpr",
"lot": "A",
"lotnoDateAttr3": -2209017600000,
"lotnoDateAttr4": -2209017600000,
"lotnoDateAttr1": -2209017600000,
"lotnoDateAttr2": -2209017600000,
"lotnoDateAttr7": -2209017600000,
"lotnoDateAttr8": -2209017600000,
"bDesc_ccn": "",
"lotnoDateAttr5": -2209017600000,
"lotnoDateAttr6": -2209017600000,
"unitId": 39720,
"lotnoDateAttr9": -2209017600000,
"locId": 15,
"mjobId": 0,
"bDesc_en": "多工艺产品",
"sjobId": 133,
"oriUp": 265.05,
"lotnoTextAttr1": "",
"lotnoTextAttr2": "",
"lotnoTextAttr3": "",
"lotnoTextAttr4": "",
"lotnoTextAttr5": "",
"lotnoTextAttr6": "",
"lotnoTextAttr7": "",
"lotnoTextAttr8": "",
"lotnoTextAttr9": "",
"bDesc_zh-CN": "多工艺产品 sc",
"sourceId": 33,
"dualQty": 0,
"itemNo": " 1",
"venDnNo": "DN20210113",
"beId": 142,
"bDesc": "多工艺产品",
"up": 265.05,
"hId": 9,
"lotnoNumAttr1": 0,
"lotnoNumAttr2": 0,
"lotnoNumAttr3": 0,
"lotnoNumAttr4": 0,
"lotnoExpDate": 253402271999000,
"footerKey": " 1",
"dDesc": "<p>钻石套装 -- 18K鑽戒 (女)<br></p>",
"sjobType": "pdcoreSjob",
"qty": 5,
"lotnoNumAttr5": 0,
"lotnoNumAttr6": 0,
"disc": 0,
"lotnoNumAttr7": 0,
"lotnoNumAttr8": 0,
"lotnoNumAttr9": 0,
"refCode": "",
"lotNoId": 4437,
"lotnoTextAttr16": "",
"dDesc_ctw": "",
"lotnoTextAttr15": "",
"lotnoTextAttr18": "",
"lotnoTextAttr17": "",
"lotnoTextAttr12": "",
"lotnoTextAttr11": "",
"lotnoDateAttr20": -2209017600000,
"lotnoTextAttr14": "",
"lotnoTextAttr13": "",
"amt": 1325.25,
"dDesc_zh-CN": "<p>钻石套装 -- 18K鑽戒 (女)<br></p>",
"lotnoTextAttr19": "",
"bDesc_haha1": "",
"dDesc_zh-TW": "",
"domAmt": 1325.25,
"dDesc_ccn": "",
"lotnoTextAttr10": "",
"dDesc_en": "<p>钻石套装 -- 18K鑽戒 (女)<br></p>",
"oriUnitId": 39720,
"dualUnitId": 4489,
"lotnoLookupAttr5": 0,
"lotnoLookupAttr6": 0,
"sourceLot": "A",
"lotnoLookupAttr7": 0,
"lotnoDateAttr18": -2209017600000,
"lotnoLookupAttr8": 0,
"lotnoDateAttr19": -2209017600000,
"lotno": "SPW20200008000000000",
"lotnoLookupAttr9": 0,
"proId": 4634,
"lotnoDateAttr12": -2209017600000,
"lotnoDateAttr13": -2209017600000,
"lotnoDateAttr10": -2209017600000,
"lotnoDateAttr11": -2209017600000,
"lotnoTextAttr20": "",
"lotnoLookupAttr1": 0,
"lotnoDateAttr16": -2209017600000,
"lotnoLookupAttr2": 0,
"lotnoDateAttr17": -2209017600000,
"lotnoLookupAttr3": 0,
"lotnoDateAttr14": -2209017600000,
"lotnoLookupAttr4": 0,
"lotnoDateAttr15": -2209017600000
}
],
"pdcoresprstt": [
{
"dDesc_ctw": "",
"dualQty": 0,
"iRev": 1,
"itemNo": " 1",
"dDesc_zh-CN": "<p>钻石套装 -- 18K鑽戒 (女)<br></p>",
"bDesc_ctw": "",
"ce01Module": "pdcoreSpr",
"beId": 142,
"lot": "A",
"oriQty": 5,
"bDesc_haha1": "",
"dDesc_zh-TW": "",
"bDesc": "多工艺产品",
"bDesc_ccn": "",
"bDesc_zh-TW": "多工艺产品 tc",
"unitId": 39720,
"dDesc_ccn": "",
"id": 12,
"dDesc_haha1": "",
"sjobLot": "B",
"hId": 9,
"bDesc_en": "多工艺产品",
"sjobId": 133,
"spwLot": "A",
"stId": 133,
"dDesc_en": "<p>钻石套装 -- 18K鑽戒 (女)<br></p>",
"oriUnitId": 39720,
"dualUnitId": 0,
"footerKey": " 1",
"dDesc": "<p>钻石套装 -- 18K鑽戒 (女)<br></p>",
"i18nField": "{\"bDesc_en\": \"多工艺产品\", \"dDesc_en\": \"<p>钻石套装 -- 18K鑽戒 (女)<br></p>\", \"bDesc_zh-CN\": \"多工艺产品 sc\", \"bDesc_zh-TW\": \"多工艺产品 tc\", \"dDesc_zh-CN\": \"<p>钻石套装 -- 18K鑽戒 (女)<br></p>\"}",
"sjobType": "pdcoreSjob",
"proId": 4634,
"qty": 5,
"ndFooterKey": " 1",
"stLot": "B",
"stType": "pdcoreSjob",
"stProId": 4634,
"spwId": 33,
"refCode": "",
"bDesc_zh-CN": "多工艺产品 sc"
}
],
"pdcoreremspr": [
{
"hId": 9,
"i18nField": "{\"remarks_en\": \"test\"}",
"remarks_zh-CN": "",
"remarks_ccn": "",
"remarks_en": "test",
"remarks_haha1": "",
"iRev": 1,
"id": 9,
"remarks_zh-TW": "",
"remarks": "test",
"remarks_ctw": "",
"ce01Module": "pdcoreSpr"
}
]
},
"messages": [],
"status": true
}
# 保存委外退货单
# 一、接口描述
用于新增或者更新【委外退货单】
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/save/pdcoreSpr |
---|---|
http请求方式 | PUT |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSpr |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/pdcoreSpr";
String param = "&menuCode=pdcoreSpr";
HttpPut put = new HttpPut(url + "?" + param);
put.addHeader("authorization", access_token);
put.addHeader("client_id", ClientID);
StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
entity.setContentEncoding("UTF-8");
put.setEntity(entity);
res = client.execute(put);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
if (json != null) {
recordId = json.getLongValue("recordId");
}
System.out.println(json);
}
put.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
Entity的JSON格式数据如下:
{
"pdcoremainspr": {
"values": [
{
"beId": 142,
"tDate": "2022-03-23",
"curId": 2,
"code": "SPRTEST2",
"venId": 99,
"rate": 1,
"virDeptId": 7,
"flowTypeId": 15450,
"staffId": 785,
"locId": 15
}
]
},
"pdcoresprt": {
"values": [
{
"sourceId": 59,
"sjobId": 198,
"oriUnitId": 39720,
"lot": "A",
"oriQty": 100,
"sourceLot": "A",
"footerKey": " 1",
"sourceType": "pdcoreSpw",
"sjobType": "pdcoreSjob",
"proId": 4634,
"qty": 100,
"unitId": 39720,
"locId": 15,
"sjobLot": "A",
"lotNoId": 5501
}
]
},
"pdcoresprmatt": {
"values": [
{
"spwLot": "A",
"spickId": 40,
"oriUnitId": 38887,
"spickLot": "A",
"lot": "A",
"oriQty": 100,
"footerKey": " 1",
"proId": 3972,
"qty": 100,
"unitId": 38887,
"ndFooterKey": " 1",
"spwId": 59,
"sjobLot": "A",
"lotNoId": 5388
}
]
},
"pdcoresprstt": {
"values": [
{
"sjobId": 198,
"spwLot": "A",
"stId": 198,
"oriUnitId": 39720,
"lot": "A",
"oriQty": 100,
"sjobType": "pdcoreSjob",
"proId": 4634,
"qty": 100,
"unitId": 39720,
"ndFooterKey": " 1",
"stLot": "A",
"stType": "pdcoreSjob",
"stProId": 4634,
"spwId": 59,
"sjobLot": "A"
}
]
}
}
4、返回示例
{
"recordId": 20,
"messages": [],
"status": true
}
{
"recordId": 0,
"messages": [
{
"msgDetail": "必填项为空",
"msgCode": "core_101905"
}
],
"status": false
}
# 删除委外退货单
# 一、接口描述
用于删除委外退货单
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/delete/pdcoreSpr |
---|---|
http请求方式 | DELETE |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSpr |
id | long(Query) | 是 | 委外退货单的id |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/pdcoreSpr";
String param = "&menuCode=pdcoreSpr&id=" + id;
HttpDelete delete = new HttpDelete(url + "?" + param);
delete.addHeader("authorization", access_token);
delete.addHeader("client_id", ClientID);
res = client.execute(delete);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
delete.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"messages": [],
"status": true
}
{
"messages": [
{
"msgDetail": "单据已被删除",
"msgCode": "core_101017"
}
],
"status": false
}
# 读取EBI数据:委外退货单列表
# 一、接口描述
用于执行EBI[委外退货单列表],返回EBI数据
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/ebiWidget/loadReport |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
formatId | long(Query) | 是 | 通过EBI接口获取到formatId |
beId | long(Query) | 否 | 企业法人的ID。若不传,则查询所有有权限的BE数据 |
offset | int(Query) | 否 | 返回结果的开始行 |
rows | int(Query) | 否 | 返回结果的结束行 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
String param = "&formatId=" + formatId;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"size": 3,
"rows": [
{
"MAIN_reportRate": "1.00000000",
"MAIN_domFinalAmt": "47,500.00",
"MAIN_reportTtlCharge": "5,000.00",
"MAIN_domTtlDisc": "2,500.00",
"aiM18ReservedCol_dataIndex": 1,
"MAIN_domTtlCharge": "5,000.00",
"MAIN_reportFinalAmt": "47,500.00",
"MAIN_domTtlAmt": "50,000.00",
"MAIN_reportTtlAmt": "50,000.00",
"MAIN_reportTtlDisc": "2,500.00"
}
]
}
# 读取EBI数据:委外退货单报告
# 一、接口描述
用于执行EBI[委外退货单报告],返回EBI数据
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/ebiWidget/loadReport |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
formatId | long(Query) | 是 | 通过EBI接口获取到formatId |
beId | long(Query) | 否 | 企业法人的ID。若不传,则查询所有有权限的BE数据 |
offset | int(Query) | 否 | 返回结果的开始行 |
rows | int(Query) | 否 | 返回结果的结束行 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport";
String param = "&formatId=" + formatId;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"size": 1,
"rows": [
{
"MAIN_domFinalAmt": "47,500.00",
"aiM18ReservedCol_dataIndex": 1,
"MAIN_oriQty": "1.0000",
"MAIN_domTtlAmt": "50,000.00"
}
]
}
# 委外加工发票
# 获取委外加工发票列表
# 一、接口描述
用于获取委外加工发票列表(同UI界面左侧的Search List数据)
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/search/search |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
stSearch | String(Query) | 是 | pdcoreSpi |
beId | long(Query) | 是 | aiM18企业法人[部门]的ID |
formatId | long(Query) | 否 | aiM18[查询格式]的ID,用于获取[查询格式]步骤二中设定的栏位格式;若不使用此参数,则使用默认设置。 |
startRow | int(Query) | 否 | 返回结果的开始行 |
endRow | int(Query) | 否 | 返回结果的结束行 |
quickSearchStr | String(Query) | 否 | 用于设定关键字查找数据 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
String param = "&stSearch=pdcoreSpi&beId=" + beId;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"stSearch": "pdcoreSpi",
"size": 1,
"stSearchDisplay": "委外加工发票",
"values": [
{
"tDate": "2021-05-24",
"code": "SPI20210003",
"st_code": "SPI20210003",
"st_desc": "SPI20210003",
"iRev": 1,
"pdcoreMainSpi.curId.cur.sym": "HK$",
"st_id": 7,
"pdcoreMainSpi.flowTypeId.flowtype.code": "MX-SUBCON",
"pdcoreMainSpi.lastModifyUid.simpleUser.desc__lang": "Milk",
"pdcoreMainSpi.flowTypeId.flowtype.desc": "Subcontract",
"id": 7,
"pdcoreMainSpi.venId.ven.desc__lang": "Accounts Payable Control Account (Raw Material) SC",
"lastModifyDate": "2021-05-24 10:57:53",
"pdcoreMainSpi.venId.ven.code": "2000"
}
]
}
# 新增委外加工发票(自动补全)
# 一、接口描述
1. 用于新增【委外加工发票】
2. 此接口方法有如下特点:
a. 支持使用code 替代 id 栏位
b. 货币栏位未填时,自动使用本货币
c. 职员栏位未填时,自动使用个人选项中的默认职员
d. 单据日期未填时,根据贸易参数设定中的日期选项取值
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/erp/bsFlow/save/pdcoreSpi |
---|---|
http请求方式 | POST |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/pdcoreSpi";
String param = "";
HttpPost post = new HttpPost(url + "?" + param);
post.addHeader("authorization", access_token);
post.addHeader("client_id", ClientID);
StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON);
entity.setContentEncoding("UTF-8");
post.setEntity(entity);
res = client.execute(post);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
if (json != null) {
recordId = json.getLongValue("tranId");
}
System.out.println(json);
}
post.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
data数据示例:
{
"beId": 142,
"tDate": "2022-03-23",
"curId": 2,
"code": "SPITEST",
"venId": 99,
"virDeptId": 7,
"rate": 1,
"pdcorespit": [
{
"sourceId": 58,
"lot": "A",
"oriQty": 100,
"sourceLot": "A",
"sourceType": "pdcoreSpw",
"proId": 4634,
"oriUnitId": 39720
}
],
"flowTypeId": 15450
}
4、返回示例
{
"tranId": 10,
"tranCode": "SPITEST",
"message": "",
"status": true
}
# 读取委外加工发票
# 一、接口描述
用于读取委外加工发票数据
# 二、接口调用说明
1、请求说明
URL | http://[server]/jsf/rfws/root/api/read/pdcoreSpi |
---|---|
http请求方式 | GET |
编码类型 | UTF-8 |
2、URL参数
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
authorization | String(Header) | 是 | OAuth获取的Access Token |
client_id | String(Header) | 是 | aiM18[授权应用列表]中的Client ID |
menuCode | String(Query) | 是 | pdcoreSpi |
id | long(Query) | 是 | 委外加工发票的id |
param | String(Query) | 否 | 额外的系统参数;JSON字符串 |
3、请求示例
CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse res = null;
try {
String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/pdcoreSpi";
String param = "&menuCode=pdcoreSpi&id=" + id;
HttpGet get = new HttpGet(url + "?" + param);
get.addHeader("authorization", access_token);
get.addHeader("client_id", ClientID);
res = client.execute(get);
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity()));
System.out.println(json);
}
get.releaseConnection();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (res != null) {
res.close();
}
if (client != null) {
client.close();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
4、返回示例
{
"data": {},
"messages": [
{
"msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限",
"msgCode": "core_141019"
}
],
"status": false
}
{
"data": {
"pdcoreremspi": [
{
"tradeTerm_ccn": "",
"tradeTerm_en": "",
"shipMark": "",
"heading_en": "",
"shipMark_zh-CN": "",
"tradeTerm_zh-CN": "",
"shipMark_ctw": "",
"remarks_en": "",
"payTerm_en": "",
"iRev": 1,
"heading_zh-CN": "",
"ce01Module": "pdcoreSpi",
"tradeTerm": "",
"heading_ccn": "",
"payTerm_haha1": "",
"payTerm_zh-TW": "",
"remarks_haha1": "",
"shipMark_en": "",
"id": 10,
"remarks_zh-TW": "",
"particular_ccn": "",
"hId": 10,
"heading_haha1": "",
"payTerm": "",
"particular_en": "",
"heading_zh-TW": "",
"payTerm_ccn": "",
"heading": "",
"particular_haha1": "",
"remarks_ccn": "",