# Subcontract Quotation

# Fetch Subcontract Quotation List

# 一、Description

​ Usage: Fetch Subcontract Quotation List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes pdcoreSqu
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	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、Response Sample

{
    "stSearch": "pdcoreSqu",
    "size": 8,
    "stSearchDisplay": "Subcontract Quotation",
    "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"
        }
    ]
}

# Create Subcontract Quotation (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Subcontract Quotation】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field

​ b. If field currency has no value specified, the Entity Currency will be used automatically

​ ​ c. If field staff has no value specified, the default staff in the User Options will be used automatically

​ ​ d. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/pdcoreSqu
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	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();
		}
	}

Sample 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、Response Sample

{
    "tranId": 19,
    "tranCode": "SQUTEST2",
    "message": "",
    "status": true
}

# Load Subcontract Quotation

# 一、Description

​ Usage: Load Subcontract Quotation Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/pdcoreSqu
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSqu
id long(Query) Yes Subcontract Quotation ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		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、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "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
}

# Create Subcontract Quotation

# 一、Description

​ Usage: Create or Update 【Subcontract Quotation】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/pdcoreSqu
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSqu
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	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 data as JSON format:

{
    "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、Response Sample

{
    "recordId": 20,
    "messages": [],
    "status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Subcontract Quotation

# 一、Description

​ Usage: Delete Subcontract Quotation

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/pdcoreSqu
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSqu
id long(Query) Yes Subcontract Quotation ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	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、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Load EBI data:Subcontract Quotation List

# 一、Description

​ Usage: Run EBI[Subcontract Quotation List],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	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、Response Sample

{
    "size": 10,
    "rows": [
        {
            "MAIN_reportRate": "1.00000000",
            "MAIN_domFinalAmt": "1,130,481.00",
            "MAIN_reportTtlCharge": "11,419.00",
            "MAIN_domTtlDisc": "22,838.00",
            "M18ReservedCol_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"
        }
    ]
}

ebi1

# Load EBI data:Subcontract Quotation Report

# 一、Description

​ Usage: Run EBI[Subcontract Quotation Report],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	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、Response Sample

{
    "size": 44,
    "rows": [
        {
            "SQUT_A_proId_code": "MX-YZ",
            "SQUT_A_proId": "4174",
            "M18ReservedCol_dataIndex": 1,
            "SQUT_A_processId_code": "",
            "SQU_A_code": "MX-TEST",
            "SQUT_A_processId": "0",
            "SQU_A_id": "1"
        }
    ]
}

ebi2

# Subcontract Order

# Fetch Subcontract Order List

# 一、Description

​ Usage: Fetch Subcontract Order List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes pdcoreSjob
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	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、Response Sample

{
    "stSearch": "pdcoreSjob",
    "size": 62,
    "stSearchDisplay": "Subcontract Order",
    "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"
        }
    ]
}

# Create Subcontract Order (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Subcontract Order】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field

​ b. If field currency has no value specified, the Entity Currency will be used automatically

​ ​ c. If field staff has no value specified, the default staff in the User Options will be used automatically

​ ​ d. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/pdcoreSjob
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	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();
		}
	}

Sample 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、Response Sample

{
    "tranId": 19,
    "tranCode": "SJOBTEST2",
    "message": "",
    "status": true
}

# Load Subcontract Order

# 一、Description

​ Usage: Load Subcontract Order Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/pdcoreSjob
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSjob
id long(Query) Yes Subcontract Order ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		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、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "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
}

# Create Subcontract Order

# 一、Description

​ Usage: Create or Update 【Subcontract Order】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/pdcoreSjob
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSjob
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	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 data as JSON format:

{
    "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、Response Sample

{
    "recordId": 20,
    "messages": [],
    "status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Subcontract Order

# 一、Description

​ Usage: Delete Subcontract Order

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/pdcoreSjob
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSjob
id long(Query) Yes Subcontract Order ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	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、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Load EBI data:Subcontract Order List

# 一、Description

​ Usage: Run EBI[Subcontract Order List],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	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、Response Sample

{
    "size": 69,
    "rows": [
        {
            "MAIN_reportRate": "1.00000000",
            "MAIN_domFinalAmt": "168,000.00",
            "MAIN_reportTtlCharge": "16,000.00",
            "MAIN_domTtlDisc": "8,000.00",
            "M18ReservedCol_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"
        }
    ]
}

ebi1

# Load EBI data:Subcontract Order Report

# 一、Description

​ Usage: Run EBI[Subcontract Order Report],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	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、Response Sample

{
    "size": 1,
    "rows": [
        {
            "SJOB_A_id": "133",
            "MAIN_completeDualQty": "0.00",
            "MAIN_orderDualQty": "30.00",
            "M18ReservedCol_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"
        }
    ]
}

ebi2

# Subcontract Material Delivery

# Fetch Subcontract Material Delivery List

# 一、Description

​ Usage: Fetch Subcontract Material Delivery List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes pdcoreSpick
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	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、Response Sample

{
    "stSearch": "pdcoreSpick",
    "size": 25,
    "stSearchDisplay": "Subcontract Material Delivery",
    "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"
        }
    ]
}

# Create Subcontract Material Delivery (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Subcontract Material Delivery】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field​

​ b. If field staff has no value specified, the default staff in the User Options will be used automatically

​ c. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/pdcoreSpick
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	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();
		}
	}

Sample 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、Response Sample

{
    "tranId": 40,
    "tranCode": "SPICKTEST2",
    "message": "",
    "status": true
}

# Load Subcontract Material Delivery

# 一、Description

​ Usage: Load Subcontract Material Delivery Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/pdcoreSpick
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSpick
id long(Query) Yes Subcontract Material Delivery ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		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、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "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
}

# Create Subcontract Material Delivery

# 一、Description

​ Usage: Create or Update 【Subcontract Material Delivery】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/pdcoreSpick
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSpick
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	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 data as JSON format:

{
    "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、Response Sample

{
    "recordId": 40,
    "messages": [],
    "status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Subcontract Material Delivery

# 一、Description

​ Usage: Delete Subcontract Material Delivery

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/pdcoreSpick
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSpick
id long(Query) Yes Subcontract Material Delivery ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	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、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Subcontract Material Return

# Fetch Subcontract Material Return List

# 一、Description

​ Usage: Fetch Subcontract Material Return List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes pdcoreSmr
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	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、Response Sample

{
    "stSearch": "pdcoreSmr",
    "size": 3,
    "stSearchDisplay": "Subcontract Material Return",
    "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"
        }
    ]
}

# Create Subcontract Material Return (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Subcontract Material Return】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field​

​ b. If field staff has no value specified, the default staff in the User Options will be used automatically

​ c. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/pdcoreSmr
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	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();
		}
	}

Sample 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、Response Sample

{
    "tranId": 40,
    "tranCode": "SMRTEST2",
    "message": "",
    "status": true
}

# Load Subcontract Material Return

# 一、Description

​ Usage: Load Subcontract Material Return Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/pdcoreSmr
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSmr
id long(Query) Yes Subcontract Material Return ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		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、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "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
}

# Create Subcontract Material Return

# 一、Description

​ Usage: Create or Update 【Subcontract Material Return】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/pdcoreSmr
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSmr
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	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 data as JSON format:

{
    "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、Response Sample

{
    "recordId": 40,
    "messages": [],
    "status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Subcontract Material Return

# 一、Description

​ Usage: Delete Subcontract Material Return

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/pdcoreSmr
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSmr
id long(Query) Yes Subcontract Material Return ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	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、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Subcontract Shipment Note

# Fetch Subcontract Shipment Note List

# 一、Description

​ Usage: Fetch Subcontract Shipment Note List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes pdcoreSsn
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	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、Response Sample

{
    "stSearch": "pdcoreSsn",
    "size": 9,
    "stSearchDisplay": "Subcontract Shipment Note",
    "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"
        }
    ]
}

# Create Subcontract Shipment Note (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Subcontract Shipment Note】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field

​ b. If field currency has no value specified, the Entity Currency will be used automatically

​ ​ c. If field staff has no value specified, the default staff in the User Options will be used automatically

​ ​ d. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/pdcoreSsn
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	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();
		}
	}

Sample 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、Response Sample

{
    "tranId": 10,
    "tranCode": "SSNTEST2",
    "message": "",
    "status": true
}

# Load Subcontract Shipment Note

# 一、Description

​ Usage: Load Subcontract Shipment Note Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/pdcoreSsn
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSsn
id long(Query) Yes Subcontract Shipment Note ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		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、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "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
}

# Create Subcontract Shipment Note

# 一、Description

​ Usage: Create or Update 【Subcontract Shipment Note】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/pdcoreSsn
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSsn
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	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 data as JSON format:

{
    "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、Response Sample

{
    "recordId": 10,
    "messages": [],
    "status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Subcontract Shipment Note

# 一、Description

​ Usage: Delete Subcontract Shipment Note

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/pdcoreSsn
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSsn
id long(Query) Yes Subcontract Shipment Note ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	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、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Load EBI data:Subcontract Shipment Note Report

# 一、Description

​ Usage: Run EBI[Subcontract Shipment Note Report],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	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、Response Sample

{
    "size": 14,
    "rows": [
        {
            "M18ReservedCol_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"
        }
    ]
}

ebi2

# Subcontract Product Receipt

# Fetch Subcontract Product Receipt List

# 一、Description

​ Usage: Fetch Subcontract Product Receipt List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes pdcoreSpw
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	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、Response Sample

{
    "stSearch": "pdcoreSpw",
    "size": 29,
    "stSearchDisplay": "Subcontract Product Receipt",
    "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"
        }
    ]
}

# Create Subcontract Product Receipt (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Subcontract Product Receipt】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field

​ b. If field currency has no value specified, the Entity Currency will be used automatically

​ ​ c. If field staff has no value specified, the default staff in the User Options will be used automatically

​ ​ d. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/pdcoreSpw
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	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();
		}
	}

Sample 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、Response Sample

{
    "tranId": 19,
    "tranCode": "SPWTEST2",
    "message": "",
    "status": true
}

# Load Subcontract Product Receipt

# 一、Description

​ Usage: Load Subcontract Product Receipt Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/pdcoreSpw
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSpw
id long(Query) Yes Subcontract Product Receipt ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		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、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "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
}

# Create Subcontract Product Receipt

# 一、Description

​ Usage: Create or Update 【Subcontract Product Receipt】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/pdcoreSpw
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSpw
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	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 data as JSON format:

{
    "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、Response Sample

{
    "recordId": 20,
    "messages": [],
    "status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Subcontract Product Receipt

# 一、Description

​ Usage: Delete Subcontract Product Receipt

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/pdcoreSpw
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSpw
id long(Query) Yes Subcontract Product Receipt ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	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、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Load EBI data:Subcontract Product Receipt List

# 一、Description

​ Usage: Run EBI[Subcontract Product Receipt List],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	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、Response Sample

{
    "size": 36,
    "rows": [
        {
            "MAIN_id": "1",
            "M18ReservedCol_dataIndex": 1,
            "MAIN_ttlAmt": "55,000.00",
            "MAIN_finalAmt": "57,750.00",
            "MAIN_tDate": "2017.12.14",
            "MAIN_code": "SPW20170002"
        }
    ]
}

ebi1

# Load EBI data:Subcontract Product Receipt Report

# 一、Description

​ Usage: Run EBI[Subcontract Product Receipt Report],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	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、Response Sample

{
    "size": 1,
    "rows": [
        {
            "M18ReservedCol_dataIndex": 1,
            "MAIN_oriQty": "1,000.0000",
            "MAIN_tranTypeMess": "Subcontract Product Receipt",
            "MAIN_code": "SPW20200003"
        }
    ]
}

ebi2

# Subcontract Product Return

# Fetch Subcontract Product Return List

# 一、Description

​ Usage: Fetch Subcontract Product Return List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes pdcoreSpr
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	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、Response Sample

{
    "stSearch": "pdcoreSpr",
    "size": 3,
    "stSearchDisplay": "Subcontract Product Return",
    "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": ""
        }
    ]
}

# Create Subcontract Product Return (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Subcontract Product Return】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field

​ b. If field currency has no value specified, the Entity Currency will be used automatically

​ ​ c. If field staff has no value specified, the default staff in the User Options will be used automatically

​ ​ d. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/pdcoreSpr
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	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();
		}
	}

Sample 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、Response Sample

{
    "tranId": 19,
    "tranCode": "SPRTEST2",
    "message": "",
    "status": true
}

# Load Subcontract Product Return

# 一、Description

​ Usage: Load Subcontract Product Return Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/pdcoreSpr
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSpr
id long(Query) Yes Subcontract Product Return ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		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、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "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
}

# Create Subcontract Product Return

# 一、Description

​ Usage: Create or Update 【Subcontract Product Return】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/pdcoreSpr
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSpr
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	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 data as JSON format:

{
    "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、Response Sample

{
    "recordId": 20,
    "messages": [],
    "status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Subcontract Product Return

# 一、Description

​ Usage: Delete Subcontract Product Return

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/pdcoreSpr
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSpr
id long(Query) Yes Subcontract Product Return ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	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、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Load EBI data:Subcontract Product Return List

# 一、Description

​ Usage: Run EBI[Subcontract Product Return List],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	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、Response Sample

{
    "size": 3,
    "rows": [
        {
            "MAIN_reportRate": "1.00000000",
            "MAIN_domFinalAmt": "47,500.00",
            "MAIN_reportTtlCharge": "5,000.00",
            "MAIN_domTtlDisc": "2,500.00",
            "M18ReservedCol_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"
        }
    ]
}

ebi1

# Load EBI data:Subcontract Product Return Report

# 一、Description

​ Usage: Run EBI[Subcontract Product Return Report],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	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、Response Sample

{
    "size": 1,
    "rows": [
        {
            "MAIN_domFinalAmt": "47,500.00",
            "M18ReservedCol_dataIndex": 1,
            "MAIN_oriQty": "1.0000",
            "MAIN_domTtlAmt": "50,000.00"
        }
    ]
}

ebi2

# Subcontract Invoice

# Fetch Subcontract Invoice List

# 一、Description

​ Usage: Fetch Subcontract Invoice List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes pdcoreSpi
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	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、Response Sample

{
    "stSearch": "pdcoreSpi",
    "size": 1,
    "stSearchDisplay": "Subcontract Invoice",
    "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"
        }
    ]
}

# Create Subcontract Invoice (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Subcontract Invoice】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field

​ b. If field currency has no value specified, the Entity Currency will be used automatically

​ ​ c. If field staff has no value specified, the default staff in the User Options will be used automatically

​ ​ d. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/pdcoreSpi
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	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();
		}
	}

Sample 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、Response Sample

{
    "tranId": 10,
    "tranCode": "SPITEST",
    "message": "",
    "status": true
}

# Load Subcontract Invoice

# 一、Description

​ Usage: Load Subcontract Invoice Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/pdcoreSpi
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSpi
id long(Query) Yes Subcontract Invoice ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		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、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "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": "",
                "particular_zh-TW": "",
                "heading_ctw": "",
                "tradeTerm_ctw": "",
                "particular": "",
                "tradeTerm_zh-TW": "",
                "shipMark_ccn": "",
                "tradeTerm_haha1": "",
                "particular_zh-CN": "",
                "i18nField": "{\"heading_zh-CN\": \"\", \"payTerm_zh-CN\": \"\", \"remarks_zh-CN\": \"\", \"shipMark_zh-CN\": \"\", \"tradeTerm_zh-CN\": \"\", \"particular_zh-CN\": \"\"}",
                "remarks_zh-CN": "",
                "particular_ctw": "",
                "shipMark_haha1": "",
                "payTerm_zh-CN": "",
                "payTerm_ctw": "",
                "shipMark_zh-TW": "",
                "remarks": "",
                "remarks_ctw": ""
            }
        ],
        "pdcoremainspi": [
            {
                "cpDate": 1648828800000,
                "lastModifyUid": 20,
                "useAccess": false,
                "virDeptId": 7,
                "accDesc_ccn": "",
                "expiredDate": -2209017600000,
                "installNo": 0,
                "position_zh-CN": "PIE",
                "sysJson": "",
                "viewCode": "pdcoreSpi",
                "accDesc": "",
                "accDesc_haha1": "",
                "eDiscRate": 0,
                "beId": 142,
                "comRate": 0,
                "useAccessBl": false,
                "id": 10,
                "locked": false,
                "position_ctw": "",
                "lastModifyDate": 1648880367000,
                "createUid": 20,
                "showEarlyPayDisc": false,
                "accDesc_ctw": "",
                "fromModule": "",
                "rev": "1",
                "lastApproveUid": 20,
                "method": "cod",
                "ttlCharge": 0,
                "expiredUid": 0,
                "descOrigin": "VENREF",
                "position_en": "",
                "position_zh-TW": "",
                "venId": 99,
                "i18nField": "{\"accDesc_zh-CN\": \"\", \"position_zh-CN\": \"PIE\"}",
                "dayOfMonth": 0,
                "monthEndDate": 0,
                "accDesc_en": "",
                "manId": 48,
                "ttlAmt": 0,
                "position": "PIE",
                "flowTypeId": 15450,
                "venInvNo": "",
                "status": "Y",
                "hpSetting": "dayAfterInv",
                "tDate": 1647964800000,
                "code": "SPITEST",
                "cnDeptId": 0,
                "jlTypeId": 0,
                "amt": 0,
                "iRev": 1,
                "accDesc_zh-TW": "",
                "upOrigin": "SQU",
                "aInvMonth": 0,
                "depoAmt": 0,
                "ce01Module": "pdcoreSpi",
                "curId": 2,
                "expired": false,
                "rate": 1,
                "domAmt": 0,
                "printCount": 0,
                "statusModifyDate": 1648880367000,
                "domDepoAmt": 0,
                "locId": 15,
                "createDate": 1648880367000,
                "loadNeed": true,
                "accDesc_zh-CN": "",
                "cp": 0,
                "useAccessWl": false,
                "position_ccn": "",
                "ttlDisc": 0,
                "position_haha1": "",
                "useAccessAutoCalc": false,
                "staffId": 785,
                "domAmtDiff": 0
            }
        ],
        "pdcorespit": [
            {
                "sourceId": 58,
                "dDesc_ctw": "",
                "dualQty": 0,
                "costAmt": 0,
                "amt": 0,
                "iRev": 1,
                "itemNo": "     1",
                "dDesc_zh-CN": "",
                "venDnNo": "",
                "bDesc_ctw": "",
                "ce01Module": "pdcoreSpi",
                "beId": 142,
                "lot": "A",
                "oriQty": 100,
                "bDesc_haha1": "",
                "dDesc_zh-TW": "",
                "domAmt": 0,
                "bDesc": "",
                "bDesc_ccn": "",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "unitId": 39720,
                "dDesc_ccn": "",
                "id": 16,
                "up": 0,
                "locId": 0,
                "dDesc_haha1": "",
                "sjobLot": "",
                "hId": 10,
                "mjobId": 0,
                "bDesc_en": "",
                "sjobId": 0,
                "dDesc_en": "",
                "dualUnitId": 4489,
                "oriUnitId": 39720,
                "oriUp": 0,
                "sourceLot": "A",
                "dDesc": "",
                "footerKey": "     1",
                "i18nField": "{\"bDesc_zh-CN\": \"\", \"dDesc_zh-CN\": \"\"}",
                "sourceType": "pdcoreSpw",
                "proId": 4634,
                "qty": 100,
                "disc": 0,
                "refCode": "",
                "lotNoId": 0,
                "bDesc_zh-CN": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Subcontract Invoice

# 一、Description

​ Usage: Create or Update 【Subcontract Invoice】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/pdcoreSpi
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSpi
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/pdcoreSpi";
		String param = "&menuCode=pdcoreSpi";

		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 data as JSON format:

{
    "pdcoremainspi": {
        "values": [
            {
                "beId": 142,
                "tDate": "2022-03-23",
                "curId": 2,
                "code": "SPITEST2",
                "venId": 99,
                "virDeptId": 7,
                "rate": 1,
                "flowTypeId": 15450,
                "staffId": 785
            }
        ]
    },
    "pdcorespit": {
        "values": [
            {
                "sourceId": 58,
                "lot": "A",
                "oriQty": 100,
                "sourceLot": "A",
                "sjobId": 198,
                "sourceType": "pdcoreSpw",
                "proId": 4634,
                "qty": 100,
                "unitId": 39720,
                "oriUnitId": 39720,
                "sjobLot": "A"
            }
        ]
    }
}

​ 4、Response Sample

{
    "recordId": 19,
    "messages": [],
    "status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Subcontract Invoice

# 一、Description

​ Usage: Delete Subcontract Invoice

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/pdcoreSpi
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSpi
id long(Query) Yes Subcontract Invoice ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/pdcoreSpi";
		String param = "&menuCode=pdcoreSpi&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、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Load EBI data:Subcontract Invoice List

# 一、Description

​ Usage: Run EBI[Subcontract Invoice List],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	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、Response Sample

{
    "size": 1,
    "rows": [
        {
            "SPI_A_code": "SPI20170002",
            "MAIN_reportRate": "1.00000000",
            "MAIN_domFinalAmt": "168,000.00",
            "MAIN_reportTtlCharge": "16,000.00",
            "MAIN_domTtlDisc": "8,000.00",
            "SPI_A_id": "1",
            "M18ReservedCol_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"
        }
    ]
}

ebi1

# Load EBI data:Subcontract Invoice Report

# 一、Description

​ Usage: Run EBI[Subcontract Invoice Report],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	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、Response Sample

{
    "size": 1,
    "rows": [
        {
            "SPI_A_code": "SPI20170002",
            "SPI_A_id": "1",
            "M18ReservedCol_dataIndex": 1,
            "MAIN_oriQty": "1.0000",
            "MAIN_domTtlAmt": "160,000.00"
        }
    ]
}

ebi2

# Subcontract Rejection Note

# Fetch Subcontract Rejection Note List

# 一、Description

​ Usage: Fetch Subcontract Rejection Note List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes pdcoreSrj
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=pdcoreSrj&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、Response Sample

{
    "stSearch": "pdcoreSrj",
    "size": 1,
    "stSearchDisplay": "Subcontract Rejection Note",
    "values": [
        {
            "tDate": "2022-03-25",
            "code": "SRJTEST2",
            "st_id": 4,
            "st_code": "SRJTEST2",
            "pdcoreMainSrj.venId.ven.desc__lang": "Accounts Payable Control Account (Raw Material) SC",
            "pdcoreMainSrj.staffId.staff.code": "A000-0019",
            "st_desc": "SRJTEST2",
            "pdcoreMainSrj.venId.ven.code": "2000",
            "iRev": 1,
            "pdcoreMainSrj.lastModifyUid.simpleUser.desc__lang": "Milk",
            "id": 4,
            "lastModifyDate": "2022-03-25 17:02:51"
        }
    ]
}

# Create Subcontract Rejection Note (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Subcontract Rejection Note】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field​

​ b. If field staff has no value specified, the default staff in the User Options will be used automatically

​ c. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/pdcoreSrj
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/pdcoreSrj";
		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();
		}
	}

Sample data:

{
    "beId": 142,
    "code": "SRJTEST2",
    "venId": 99,
    "virDeptId": 1,
    "pdcoresrjt": [
        {
            "sourceId": 28,
            "lot": "A",
            "sourceLot": "B",
            "ssnId": 1,
            "sourceType": "qc",
            "ssnLot": "B",
            "proId": 4170,
            "qty": 3,
            "unitId": 39094
        }
    ]
}

​ 4、Response Sample

{
    "tranId": 4,
    "tranCode": "SRJTEST2",
    "message": "",
    "status": true
}

# Load Subcontract Rejection Note

# 一、Description

​ Usage: Load Subcontract Rejection Note Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/pdcoreSrj
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSrj
id long(Query) Yes Subcontract Rejection Note ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/pdcoreSrj";
			String param = "&menuCode=pdcoreSrj&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、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "msgCode": "core_141019"
        }
    ],
    "status": false
}
{
    "data": {
        "pdcoremainsrj": [
            {
                "tDate": 1648137600000,
                "lastModifyUid": 20,
                "code": "SRJTEST2",
                "cnDeptId": 0,
                "useAccess": false,
                "virDeptId": 1,
                "expiredDate": -2209017600000,
                "iRev": 1,
                "position_zh-CN": "PIE",
                "sysJson": "",
                "viewCode": "pdcoreSrj",
                "ce01Module": "pdcoreSrj",
                "beId": 142,
                "expired": false,
                "printCount": 0,
                "useAccessBl": false,
                "id": 4,
                "doctypeId": 0,
                "statusModifyDate": 1648198971000,
                "locked": false,
                "position_ctw": "",
                "lastModifyDate": 1648198971000,
                "createUid": 20,
                "createDate": 1648198971000,
                "rev": "1",
                "lastApproveUid": 20,
                "loadGpCoData": false,
                "expiredUid": 0,
                "useAccessWl": false,
                "position_en": "",
                "position_zh-TW": "",
                "venId": 99,
                "i18nField": "{\"position_zh-CN\": \"PIE\"}",
                "position_ccn": "",
                "position_haha1": "",
                "manId": 48,
                "position": "PIE",
                "useAccessAutoCalc": false,
                "staffId": 21,
                "status": "Y"
            }
        ],
        "pdcoresrjt": [
            {
                "sourceId": 28,
                "dDesc_ctw": "",
                "ssnId": 1,
                "dualQty": 0,
                "iRev": 1,
                "itemNo": "     1",
                "dDesc_zh-CN": "",
                "bDesc_ctw": "",
                "ce01Module": "pdcoreSrj",
                "beId": 142,
                "lot": "A",
                "bDesc_haha1": "",
                "dDesc_zh-TW": "",
                "bDesc": "",
                "bDesc_ccn": "",
                "bDesc_zh-TW": "",
                "unitId": 39094,
                "dDesc_ccn": "",
                "id": 4,
                "dDesc_haha1": "",
                "sjobLot": "",
                "hId": 4,
                "bDesc_en": "",
                "sjobId": 0,
                "sourceCliId": 0,
                "ssnLot": "B",
                "dDesc_en": "",
                "dualUnitId": 4123,
                "sourceLot": "B",
                "footerKey": "     1",
                "dDesc": "",
                "i18nField": "{\"bDesc_zh-CN\": \"\", \"dDesc_zh-CN\": \"\"}",
                "sourceType": "qc",
                "proId": 4170,
                "qty": 3,
                "bDesc_zh-CN": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Subcontract Rejection Note

# 一、Description

​ Usage: Create or Update 【Subcontract Rejection Note】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/pdcoreSrj
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSrj
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/pdcoreSrj";
		String param = "&menuCode=pdcoreSrj";

		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 data as JSON format:

{
    "pdcoremainsrj": {
        "values": [
            {
                "beId": 142,
                "tDate": "2022-03-23",
                "code": "SRJTEST",
                "venId": 99,
                "virDeptId": 1,
                "staffId": 785
            }
        ]
    },
    "pdcoresrjt": {
        "values": [
            {
                "sourceId": 28,
                "lot": "A",
                "sourceLot": "B",
                "ssnId": 1,
                "sourceType": "qc",
                "ssnLot": "B",
                "proId": 4170,
                "qty": 3,
                "unitId": 39094
            }
        ]
    }
}

​ 4、Response Sample

{
    "recordId": 4,
    "messages": [],
    "status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Subcontract Rejection Note

# 一、Description

​ Usage: Delete Subcontract Rejection Note

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/pdcoreSrj
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes pdcoreSrj
id long(Query) Yes Subcontract Rejection Note ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/pdcoreSrj";
		String param = "&menuCode=pdcoreSrj&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、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Load EBI data:Subcontract Rejection Note Report

# 一、Description

​ Usage: Run EBI[Subcontract Rejection Note Report],return EBI data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/ebiWidget/loadReport
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
formatId long(Query) Yes Format ID fetched from another API
beId long(Query) No Business Entity ID,If not specified, query all authorized Business Entity data.
offset int(Query) No Resultset offset : start index
rows int(Query) No Resultset offset : end index

​ 3、Request Sample

	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、Response Sample

{
    "size": 1,
    "rows": [
        {
            "MAIN_sourceType": "qc",
            "M18ReservedCol_dataIndex": 1,
            "MAIN_sourceId": "28",
            "MAIN_sourceCode": "QC0180007"
        }
    ]
}

ebi2

# Work Process Subcontract

# Fetch Work Process Subcontract List

# 一、Description

​ Usage: Fetch Work Process Subcontract List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes prodSpjob
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=prodSpjob&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、Response Sample

{
    "stSearch": "prodSpjob",
    "size": 1,
    "stSearchDisplay": "Work Process Subcontract",
    "values": [
        {
            "tDate": "2021-06-17",
            "code": "WPSC210617-A",
            "st_id": 90,
            "st_code": "WPSC210617-A",
            "st_desc": "WPSC210617-A",
            "iRev": 1,
            "id": 90,
            "lastModifyDate": "2021-06-17 09:44:15",
            "prodMainSpjob.lastModifyUid.simpleUser.desc__lang": "Milk"
        }
    ]
}

# Create Work Process Subcontract (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Work Process Subcontract】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field

​ b. If field currency has no value specified, the Entity Currency will be used automatically

​ ​ c. If field staff has no value specified, the default staff in the User Options will be used automatically

​ ​ d. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/prodSpjob
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/prodSpjob";
		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();
		}
	}

Sample data:

{
    "beId": 142,
    "tDate": "2022-03-23",
    "prodspjobprot": [
        {
            "sourceId": 1651,
            "lot": "A",
            "jobId": 1651,
            "oriQty": 100,
            "sourceLot": "A",
            "sourceType": "prodJob",
            "proId": 4634,
            "oriUnitId": 39720
        }
    ],
    "curId": 2,
    "code": "SPJOBTEST",
    "venId": 99,
    "virDeptId": 7,
    "rate": 1
}

​ 4、Response Sample

{
    "tranId": 93,
    "tranCode": "SPJOBTEST",
    "message": "",
    "status": true
}

# Load Work Process Subcontract

# 一、Description

​ Usage: Load Work Process Subcontract Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/prodSpjob
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes prodSpjob
id long(Query) Yes Work Process Subcontract ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/prodSpjob";
			String param = "&menuCode=prodSpjob&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、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "msgCode": "core_141019"
        }
    ],
    "status": false
}
{
    "data": {
        "prodspjobprot": [
            {
                "sourceId": 1651,
                "dualQty": 0,
                "itemNo": "     1",
                "beId": 142,
                "oriQty": 100,
                "bDesc": "多工艺产品 sc 1",
                "bDesc_zh-TW": "多工艺产品 tc 1",
                "id": 175,
                "up": 0,
                "dDesc_haha1": "",
                "processRemarks_zh-TW": "",
                "hId": 93,
                "cDate": 1647964800000,
                "level": "  1",
                "completed": false,
                "jobId": 1651,
                "footerKey": "     1",
                "dDesc": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "i18nField": "{\"bDesc_en\": \"多工艺产品 1\", \"dDesc_en\": \"<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>\", \"bDesc_zh-CN\": \"多工艺产品 sc 1\", \"bDesc_zh-TW\": \"多工艺产品 tc 1\", \"dDesc_zh-CN\": \"<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>\", \"dDesc_zh-TW\": \"<p>&nbsp;</p>\", \"processRemarks_zh-CN\": \"<p>bbbbb</p>\"}",
                "sourceType": "prodJob",
                "qty": 100,
                "disc": 0,
                "refCode": "",
                "startDate": 1647964800000,
                "dDesc_ctw": "",
                "endAccord": "latest",
                "processRemarks_zh-CN": "<p>bbbbb</p>",
                "amt": 0,
                "iRev": 1,
                "dDesc_zh-CN": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "confirmed": true,
                "bDesc_ctw": "",
                "ce01Module": "prodSpjob",
                "lot": "A",
                "bDesc_haha1": "",
                "treeLevel": "   1-   2",
                "dDesc_zh-TW": "<p>&nbsp;</p>",
                "domAmt": 0,
                "processId": 12,
                "startAccord": "latest",
                "bDesc_ccn": "",
                "unitId": 39720,
                "dDesc_ccn": "",
                "processRemarks_ccn": "",
                "bomId": 75,
                "mjobId": 425,
                "bDesc_en": "多工艺产品 1",
                "processRemarks_ctw": "",
                "processRemarks_haha1": "",
                "processRemarks_en": "",
                "dDesc_en": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "oriUnitId": 39720,
                "dualUnitId": 0,
                "oriUp": 0,
                "sourceLot": "A",
                "mjobFooterKey": "     1",
                "proId": 4634,
                "processRemarks": "<p>bbbbb</p>",
                "bDesc_zh-CN": "多工艺产品 sc 1"
            }
        ],
        "prodremspjob": [
            {
                "tradeTerm_ccn": "",
                "shipMark": "",
                "heading_en": "",
                "shipMark_zh-CN": "",
                "tradeTerm_zh-CN": "",
                "remarks_en": "",
                "packing_ccn": "",
                "dest": "",
                "tradeTerm": "",
                "heading_ccn": "",
                "payTerm_zh-TW": "",
                "packing_haha1": "",
                "shipMark_en": "",
                "id": 93,
                "remarks_zh-TW": "",
                "hId": 93,
                "payTerm": "",
                "heading_zh-TW": "",
                "payTerm_ccn": "",
                "remarks_ccn": "",
                "heading_ctw": "",
                "tradeTerm_zh-TW": "",
                "shipMark_ccn": "",
                "i18nField": "{\"heading_zh-CN\": \"\", \"packing_zh-CN\": \"\", \"payTerm_zh-CN\": \"\", \"remarks_zh-CN\": \"\", \"shipMark_zh-CN\": \"\", \"tradeTerm_zh-CN\": \"\"}",
                "remarks_zh-CN": "",
                "packing_en": "",
                "payTerm_zh-CN": "",
                "payTerm_ctw": "",
                "shipMark_zh-TW": "",
                "remarks_ctw": "",
                "tradeTerm_en": "",
                "shipMark_ctw": "",
                "payTerm_en": "",
                "iRev": 1,
                "packing": "",
                "heading_zh-CN": "",
                "ce01Module": "prodSpjob",
                "payTerm_haha1": "",
                "packing_zh-TW": "",
                "remarks_haha1": "",
                "packing_ctw": "",
                "heading_haha1": "",
                "heading": "",
                "tradeTerm_ctw": "",
                "packing_zh-CN": "",
                "tradeTerm_haha1": "",
                "shipMark_haha1": "",
                "smthId": 0,
                "remarks": ""
            }
        ],
        "prodmainspjob": [
            {
                "lastModifyUid": 20,
                "useAccess": false,
                "virDeptId": 7,
                "expiredDate": -2209017600000,
                "position_zh-CN": "PIE",
                "sysJson": "",
                "viewCode": "prodSpjob",
                "beId": 142,
                "useAccessBl": false,
                "id": 93,
                "doctypeId": 0,
                "locked": false,
                "position_ctw": "",
                "lastModifyDate": 1648883972000,
                "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,
                "deposit": 0,
                "ttlAmt": 0,
                "position": "PIE",
                "status": "Y",
                "tDate": 1647964800000,
                "code": "SPJOBTEST",
                "cnDeptId": 0,
                "amt": 0,
                "iRev": 1,
                "ce01Module": "prodSpjob",
                "curId": 2,
                "expired": false,
                "rate": 1,
                "domAmt": 0,
                "printCount": 0,
                "statusModifyDate": 1648883972000,
                "createDate": 1648883972000,
                "depoRate": 0,
                "useAccessWl": false,
                "position_ccn": "",
                "ttlDisc": 0,
                "position_haha1": "",
                "useAccessAutoCalc": false,
                "staffId": 21,
                "domAmtDiff": 0
            }
        ],
        "prodspjobmatt": [
            {
                "tDate": 1647964800000,
                "dDesc_ctw": "",
                "jobModule": "prodJob",
                "dualQty": 101,
                "pproId": 4634,
                "iRev": 1,
                "itemNo": "     1",
                "dDesc_zh-CN": "<p>1</p>",
                "bDesc_ctw": "",
                "ce01Module": "prodSpjob",
                "beId": 142,
                "lot": "A",
                "oriQty": 101,
                "bDesc_haha1": "",
                "treeLevel": "   1-   2-   1",
                "dDesc_zh-TW": "",
                "bomReqQty": 101,
                "bDesc": "木材 sc 1",
                "bDesc_ccn": "",
                "bDesc_zh-TW": "",
                "unitId": 39233,
                "dDesc_ccn": "",
                "id": 353,
                "dDesc_haha1": "",
                "hId": 93,
                "bomId": 75,
                "bDesc_en": "",
                "dDesc_en": "",
                "completed": false,
                "oriUnitId": 39233,
                "dualUnitId": 4174,
                "jobId": 1651,
                "footerKey": "     1",
                "dDesc": "<p>1</p>",
                "i18nField": "{\"bDesc_zh-CN\": \"木材 sc 1\", \"dDesc_zh-CN\": \"<p>1</p>\"}",
                "proId": 4236,
                "qty": 101,
                "refCode": "",
                "jobLot": "A",
                "bDesc_zh-CN": "木材 sc 1"
            }
        ],
        "prodspjobt": [
            {
                "sourceId": 425,
                "dDesc_ctw": "",
                "dualQty": 0,
                "costAmt": 0,
                "iRev": 1,
                "itemNo": "     1",
                "dDesc_zh-CN": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "bDesc_ctw": "",
                "ce01Module": "prodSpjob",
                "beId": 142,
                "lot": "A",
                "sourceDate": 1647964800000,
                "oriQty": 100,
                "bDesc_haha1": "",
                "dDesc_zh-TW": "<p>&nbsp;</p>",
                "bDesc": "多工艺产品 sc 1",
                "bDesc_ccn": "",
                "bDesc_zh-TW": "多工艺产品 tc 1",
                "newLotno": 0,
                "unitId": 39720,
                "dDesc_ccn": "",
                "id": 217,
                "locId": 0,
                "dDesc_haha1": "",
                "hId": 93,
                "bomId": 75,
                "cDate": 1648656000000,
                "bDesc_en": "多工艺产品 1",
                "bomSource": "aiBom",
                "dDesc_en": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "completed": false,
                "sourceProId": 4634,
                "oriUnitId": 39720,
                "dualUnitId": 4489,
                "sourceLot": "A",
                "sourceMjobLot": "A",
                "dDesc": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "footerKey": "     1",
                "i18nField": "{\"bDesc_en\": \"多工艺产品 1\", \"dDesc_en\": \"<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>\", \"bDesc_zh-CN\": \"多工艺产品 sc 1\", \"bDesc_zh-TW\": \"多工艺产品 tc 1\", \"dDesc_zh-CN\": \"<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>\", \"dDesc_zh-TW\": \"<p>&nbsp;</p>\"}",
                "sourceType": "prodMjob",
                "sourceDDate": -2209017600000,
                "proId": 4634,
                "qty": 100,
                "refCode": "",
                "lotNoId": 0,
                "bDesc_zh-CN": "多工艺产品 sc 1"
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Work Process Subcontract

# 一、Description

​ Usage: Create or Update 【Work Process Subcontract】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/prodSpjob
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes prodSpjob
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/prodSpjob";
		String param = "&menuCode=prodSpjob";

		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 data as JSON format:

{
    "prodspjobprot": {
        "values": [
            {
                "sourceId": 1651,
                "mjobId": 425,
                "bomId": 75,
                "cDate": "2022-03-31",
                "level": "  1",
                "confirmed": true,
                "oriUnitId": 39720,
                "lot": "A",
                "oriQty": 100,
                "jobId": 1651,
                "sourceLot": "A",
                "treeLevel": "   1-   2",
                "footerKey": "     1",
                "sourceType": "prodJob",
                "mjobFooterKey": "     1",
                "processId": 12,
                "proId": 4634,
                "qty": 100,
                "unitId": 39720,
                "startDate": "2022-03-23"
            }
        ]
    },
    "prodmainspjob": {
        "values": [
            {
                "beId": 142,
                "tDate": "2022-03-23",
                "curId": 2,
                "code": "SPJOBTEST2",
                "venId": 99,
                "virDeptId": 7,
                "rate": 1,
                "staffId": 785
            }
        ]
    },
    "prodspjobmatt": {
        "values": [
            {
                "bomId": 75,
                "pproId": 4634,
                "oriUnitId": 39233,
                "lot": "A",
                "oriQty": 100,
                "jobId": 1651,
                "treeLevel": "   1-   2-   1",
                "footerKey": "     1",
                "bomReqQty": 101,
                "proId": 4236,
                "qty": 100,
                "unitId": 39233,
                "jobLot": "A"
            }
        ]
    },
    "prodspjobt": {
        "values": [
            {
                "sourceId": 425,
                "bomId": 75,
                "cDate": "2022-03-31",
                "sourceProId": 4634,
                "oriUnitId": 39720,
                "sourceDate": "2022-03-23",
                "lot": "A",
                "oriQty": 100,
                "sourceLot": "A",
                "sourceMjobLot": "A",
                "footerKey": "     1",
                "sourceType": "prodMjob",
                "sourceDDate": "1900-01-01",
                "proId": 4634,
                "qty": 100,
                "unitId": 39720,
                "startDate": "2022-03-23"
            }
        ]
    }
}

​ 4、Response Sample

{
    "recordId": 94,
    "messages": [],
    "status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Work Process Subcontract

# 一、Description

​ Usage: Delete Work Process Subcontract

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/prodSpjob
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes prodSpjob
id long(Query) Yes Work Process Subcontract ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/prodSpjob";
		String param = "&menuCode=prodSpjob&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、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Work Process Subcontract Dispatch

# Fetch Work Process Subcontract Dispatch List

# 一、Description

​ Usage: Fetch Work Process Subcontract Dispatch List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes prodSdisp
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=prodSdisp&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、Response Sample

{
    "stSearch": "prodSdisp",
    "size": 1,
    "stSearchDisplay": "Work Process Subcontract Dispatch",
    "values": [
        {
            "tDate": "2020-12-03",
            "code": "SDISP20200002",
            "prodMainSdisp.lastModifyUid.simpleUser.desc__lang": "Milk",
            "st_id": 15,
            "st_code": "SDISP20200002",
            "st_desc": "SDISP20200002",
            "iRev": 1,
            "id": 15,
            "lastModifyDate": "2020-12-03 10:58:14"
        }
    ]
}

# Create Work Process Subcontract Dispatch (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Work Process Subcontract Dispatch】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field

​ b. If field currency has no value specified, the Entity Currency will be used automatically

​ ​ c. If field staff has no value specified, the default staff in the User Options will be used automatically

​ ​ d. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/prodSdisp
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/prodSdisp";
		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();
		}
	}

Sample data:

{
    "beId": 142,
    "tDate": "2022-03-23",
    "curId": 2,
    "code": "SDISPTEST",
    "venId": 99,
    "virDeptId": 7,
    "rate": 1,
    "prodsdispt": [
        {
            "sourceId": 95,
            "lot": "A",
            "oriQty": 100,
            "sourceLot": "A",
            "sourceType": "prodSpjob",
            "proId": 4634,
            "oriUnitId": 39720
        }
    ]
}

​ 4、Response Sample

{
    "tranId": 18,
    "tranCode": "SDISPTEST",
    "message": "",
    "status": true
}

# Load Work Process Subcontract Dispatch

# 一、Description

​ Usage: Load Work Process Subcontract Dispatch Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/prodSdisp
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes prodSdisp
id long(Query) Yes Work Process Subcontract Dispatch ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/prodSdisp";
			String param = "&menuCode=prodSdisp&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、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "msgCode": "core_141019"
        }
    ],
    "status": false
}
{
    "data": {
        "prodremsdisp": [
            {
                "hId": 18,
                "i18nField": "{\"remarks_zh-CN\": \"\"}",
                "remarks_zh-CN": "",
                "remarks_ccn": "",
                "remarks_en": "",
                "remarks_haha1": "",
                "iRev": 1,
                "id": 18,
                "remarks_zh-TW": "",
                "remarks": "",
                "remarks_ctw": "",
                "ce01Module": "prodSdisp"
            }
        ],
        "prodmainsdisp": [
            {
                "tDate": 1647964800000,
                "lastModifyUid": 20,
                "code": "SDISPTEST",
                "cnDeptId": 0,
                "useAccess": false,
                "virDeptId": 7,
                "expiredDate": -2209017600000,
                "amt": 0,
                "iRev": 1,
                "position_zh-CN": "PIE",
                "sysJson": "",
                "viewCode": "prodSdisp",
                "ce01Module": "prodSdisp",
                "beId": 142,
                "curId": 2,
                "expired": false,
                "rate": 1,
                "domAmt": 0,
                "printCount": 0,
                "useAccessBl": false,
                "id": 18,
                "doctypeId": 0,
                "statusModifyDate": 1648885560000,
                "locked": false,
                "position_ctw": "",
                "lastModifyDate": 1648885560000,
                "createUid": 20,
                "createDate": 1648885560000,
                "rev": "1",
                "lastApproveUid": 20,
                "ttlCharge": 0,
                "expiredUid": 0,
                "useAccessWl": false,
                "position_en": "",
                "position_zh-TW": "",
                "venId": 99,
                "i18nField": "{\"position_zh-CN\": \"PIE\"}",
                "position_ccn": "",
                "ttlDisc": 0,
                "position_haha1": "",
                "manId": 48,
                "ttlAmt": 0,
                "position": "PIE",
                "useAccessAutoCalc": false,
                "staffId": 21,
                "status": "Y",
                "domAmtDiff": 0
            }
        ],
        "prodsdispt": [
            {
                "sourceId": 95,
                "dDesc_ctw": "",
                "dualQty": 0,
                "amt": 0,
                "iRev": 1,
                "itemNo": "     1",
                "dDesc_zh-CN": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "bDesc_ctw": "",
                "ce01Module": "prodSdisp",
                "beId": 142,
                "lot": "A",
                "oriQty": 100,
                "bDesc_haha1": "",
                "dDesc_zh-TW": "<p>&nbsp;</p>",
                "domAmt": 0,
                "processId": 12,
                "bDesc": "多工艺产品 sc 1",
                "bDesc_ccn": "",
                "bDesc_zh-TW": "多工艺产品 tc 1",
                "unitId": 39720,
                "dDesc_ccn": "",
                "id": 25,
                "up": 0,
                "dDesc_haha1": "",
                "hId": 18,
                "mjobId": 425,
                "bDesc_en": "多工艺产品 1",
                "dDesc_en": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "oriUnitId": 39720,
                "dualUnitId": 4489,
                "oriUp": 0,
                "sourceLot": "A",
                "footerKey": "     1",
                "dDesc": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "i18nField": "{\"bDesc_en\": \"多工艺产品 1\", \"dDesc_en\": \"<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>\", \"bDesc_zh-CN\": \"多工艺产品 sc 1\", \"bDesc_zh-TW\": \"多工艺产品 tc 1\", \"dDesc_zh-CN\": \"<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>\", \"dDesc_zh-TW\": \"<p>&nbsp;</p>\"}",
                "sourceType": "prodSpjob",
                "proId": 4634,
                "qty": 100,
                "disc": 0,
                "refCode": "",
                "bDesc_zh-CN": "多工艺产品 sc 1"
            }
        ],
        "prodsdispstt": [
            {
                "sourceId": 425,
                "dDesc_ctw": "",
                "dualQty": 0,
                "iRev": 1,
                "itemNo": "     1",
                "dDesc_zh-CN": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "bDesc_ctw": "",
                "ce01Module": "prodSdisp",
                "beId": 142,
                "sourceDate": 1647964800000,
                "lot": "A",
                "oriQty": 100,
                "bDesc_haha1": "",
                "dDesc_zh-TW": "<p>&nbsp;</p>",
                "spjobType": "prodSpjob",
                "bDesc": "多工艺产品 sc 1",
                "bDesc_ccn": "",
                "bDesc_zh-TW": "多工艺产品 tc 1",
                "unitId": 39720,
                "dDesc_ccn": "",
                "id": 33,
                "dDesc_haha1": "",
                "hId": 18,
                "cDate": 1648656000000,
                "bDesc_en": "多工艺产品 1",
                "dDesc_en": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "sourceProId": 4634,
                "spjobId": 95,
                "oriUnitId": 39720,
                "dualUnitId": 0,
                "sourceLot": "A",
                "sourceMjobLot": "A",
                "footerKey": "     1",
                "dDesc": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "i18nField": "{\"bDesc_en\": \"多工艺产品 1\", \"dDesc_en\": \"<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>\", \"bDesc_zh-CN\": \"多工艺产品 sc 1\", \"bDesc_zh-TW\": \"多工艺产品 tc 1\", \"dDesc_zh-CN\": \"<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>\", \"dDesc_zh-TW\": \"<p>&nbsp;</p>\"}",
                "sourceType": "prodMjob",
                "sourceDDate": -2209017600000,
                "proId": 4634,
                "qty": 100,
                "spjobLot": "A",
                "bDesc_zh-CN": "多工艺产品 sc 1"
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Work Process Subcontract Dispatch

# 一、Description

​ Usage: Create or Update 【Work Process Subcontract Dispatch】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/prodSdisp
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes prodSdisp
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/prodSdisp";
		String param = "&menuCode=prodSdisp";

		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 data as JSON format:

{
    "prodmainsdisp": {
        "values": [
            {
                "beId": 142,
                "tDate": "2022-03-23",
                "curId": 2,
                "code": "SDISPTEST2",
                "venId": 99,
                "virDeptId": 7,
                "rate": 1,
                "staffId": 785
            }
        ]
    },
    "prodsdispt": {
        "values": [
            {
                "sourceId": 95,
                "lot": "A",
                "oriQty": 100,
                "sourceLot": "A",
                "mjobId": 425,
                "footerKey": "     1",
                "sourceType": "prodSpjob",
                "processId": 12,
                "proId": 4634,
                "qty": 100,
                "unitId": 39720,
                "oriUnitId": 39720
            }
        ]
    },
    "prodsdispstt": {
        "values": [
            {
                "sourceId": 425,
                "cDate": "2022-03-31",
                "sourceProId": 4634,
                "spjobId": 95,
                "oriUnitId": 39720,
                "sourceDate": "2022-03-23",
                "lot": "A",
                "oriQty": 100,
                "sourceLot": "A",
                "sourceMjobLot": "A",
                "footerKey": "     1",
                "sourceType": "prodMjob",
                "sourceDDate": "1900-01-01",
                "spjobType": "prodSpjob",
                "proId": 4634,
                "qty": 100,
                "unitId": 39720,
                "spjobLot": "A"
            }
        ]
    }
}

​ 4、Response Sample

{
    "recordId": 19,
    "messages": [],
    "status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Work Process Subcontract Dispatch

# 一、Description

​ Usage: Delete Work Process Subcontract Dispatch

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/prodSdisp
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes prodSdisp
id long(Query) Yes Work Process Subcontract Dispatch ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/prodSdisp";
		String param = "&menuCode=prodSdisp&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、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Work Process Subcontract Complete

# Fetch Work Process Subcontract Complete List

# 一、Description

​ Usage: Fetch Work Process Subcontract Complete List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes prodSc
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=prodSc&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、Response Sample

{
    "stSearch": "prodSc",
    "size": 1,
    "stSearchDisplay": "Work Process Subcontract Complete",
    "values": [
        {
            "tDate": "2021-03-17",
            "code": "SC20210001",
            "st_id": 19,
            "st_code": "SC20210001",
            "st_desc": "SC20210001",
            "iRev": 5,
            "id": 19,
            "lastModifyDate": "2021-09-26 14:40:18",
            "prodMainSc.lastModifyUid.simpleUser.desc__lang": "Milk"
        }
    ]
}

# Create Work Process Subcontract Complete (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Work Process Subcontract Complete】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field

​ b. If field currency has no value specified, the Entity Currency will be used automatically

​ ​ c. If field staff has no value specified, the default staff in the User Options will be used automatically

​ ​ d. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/prodSc
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/prodSc";
		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();
		}
	}

Sample data:

{
    "beId": 142,
    "prodsct": [
        {
            "sourceId": 20,
            "lot": "A",
            "oriQty": 100,
            "sourceLot": "A",
            "sourceType": "prodSdisp",
            "proId": 4634,
            "oriUnitId": 39720,
            "passQty": 100
        }
    ],
    "tDate": "2022-03-23",
    "curId": 2,
    "code": "SCTEST",
    "venId": 99,
    "virDeptId": 7,
    "rate": 1
}

​ 4、Response Sample

{
    "tranId": 21,
    "tranCode": "SCTEST",
    "message": "",
    "status": true
}

# Load Work Process Subcontract Complete

# 一、Description

​ Usage: Load Work Process Subcontract Complete Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/prodSc
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes prodSc
id long(Query) Yes Work Process Subcontract Complete ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/prodSc";
			String param = "&menuCode=prodSc&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、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "msgCode": "core_141019"
        }
    ],
    "status": false
}
{
    "data": {
        "prodsct": [
            {
                "sourceId": 20,
                "dDesc_ctw": "",
                "failQty": 0,
                "dualQty": 0,
                "amt": 0,
                "iRev": 1,
                "itemNo": "     1",
                "dDesc_zh-CN": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "bDesc_ctw": "",
                "ce01Module": "prodSc",
                "beId": 142,
                "lot": "A",
                "oriQty": 100,
                "bDesc_haha1": "",
                "dDesc_zh-TW": "<p>&nbsp;</p>",
                "domAmt": 0,
                "processId": 12,
                "bDesc": "多工艺产品 sc 1",
                "bDesc_ccn": "",
                "scrapMQty": 0,
                "bDesc_zh-TW": "多工艺产品 tc 1",
                "unitId": 39720,
                "dDesc_ccn": "",
                "id": 25,
                "up": 0,
                "dDesc_haha1": "",
                "hId": 21,
                "mjobId": 425,
                "bDesc_en": "多工艺产品 1",
                "scrapQty": 0,
                "dDesc_en": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "spjobId": 95,
                "oriUnitId": 39720,
                "dualUnitId": 4489,
                "passQty": 100,
                "oriUp": 0,
                "sourceLot": "A",
                "footerKey": "     1",
                "dDesc": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "i18nField": "{\"bDesc_en\": \"多工艺产品 1\", \"dDesc_en\": \"<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>\", \"bDesc_zh-CN\": \"多工艺产品 sc 1\", \"bDesc_zh-TW\": \"多工艺产品 tc 1\", \"dDesc_zh-CN\": \"<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>\", \"dDesc_zh-TW\": \"<p>&nbsp;</p>\"}",
                "sourceType": "prodSdisp",
                "proId": 4634,
                "qty": 100,
                "scrapMachineQty": 0,
                "disc": 0,
                "spjobLot": "A",
                "refCode": "",
                "bDesc_zh-CN": "多工艺产品 sc 1"
            }
        ],
        "prodmainsc": [
            {
                "tDate": 1647964800000,
                "lastModifyUid": 20,
                "code": "SCTEST",
                "cnDeptId": 0,
                "useAccess": false,
                "virDeptId": 7,
                "expiredDate": -2209017600000,
                "amt": 0,
                "iRev": 1,
                "position_zh-CN": "PIE",
                "sysJson": "",
                "viewCode": "prodSc",
                "ce01Module": "prodSc",
                "beId": 142,
                "curId": 2,
                "expired": false,
                "rate": 1,
                "domAmt": 0,
                "printCount": 0,
                "useAccessBl": false,
                "id": 21,
                "doctypeId": 0,
                "statusModifyDate": 1648886818000,
                "locked": false,
                "position_ctw": "",
                "lastModifyDate": 1648886818000,
                "createUid": 20,
                "createDate": 1648886818000,
                "rev": "1",
                "lastApproveUid": 20,
                "ttlCharge": 0,
                "expiredUid": 0,
                "useAccessWl": false,
                "position_en": "",
                "position_zh-TW": "",
                "venId": 99,
                "i18nField": "{\"position_zh-CN\": \"PIE\"}",
                "position_ccn": "",
                "ttlDisc": 0,
                "position_haha1": "",
                "manId": 48,
                "ttlAmt": 0,
                "position": "PIE",
                "useAccessAutoCalc": false,
                "staffId": 21,
                "status": "Y",
                "domAmtDiff": 0
            }
        ],
        "prodremsc": [
            {
                "hId": 21,
                "i18nField": "{\"remarks_zh-CN\": \"\"}",
                "remarks_zh-CN": "",
                "remarks_ccn": "",
                "remarks_en": "",
                "remarks_haha1": "",
                "iRev": 1,
                "id": 21,
                "remarks_zh-TW": "",
                "remarks": "",
                "remarks_ctw": "",
                "ce01Module": "prodSc"
            }
        ],
        "prodscstt": [
            {
                "sourceId": 425,
                "dDesc_ctw": "",
                "dualQty": 0,
                "iRev": 1,
                "itemNo": "     1",
                "dDesc_zh-CN": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "bDesc_ctw": "",
                "ce01Module": "prodSc",
                "beId": 142,
                "sourceDate": 1647964800000,
                "lot": "A",
                "oriQty": 100,
                "bDesc_haha1": "",
                "dDesc_zh-TW": "<p>&nbsp;</p>",
                "bDesc": "多工艺产品 sc 1",
                "bDesc_ccn": "",
                "bDesc_zh-TW": "多工艺产品 tc 1",
                "unitId": 39720,
                "dDesc_ccn": "",
                "id": 36,
                "sdispType": "prodSdisp",
                "sdispId": 20,
                "dDesc_haha1": "",
                "hId": 21,
                "cDate": 1648656000000,
                "bDesc_en": "多工艺产品 1",
                "dDesc_en": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "sourceProId": 4634,
                "spjobId": 95,
                "oriUnitId": 39720,
                "dualUnitId": 0,
                "sourceLot": "A",
                "sourceMjobLot": "A",
                "footerKey": "     1",
                "dDesc": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "i18nField": "{\"bDesc_en\": \"多工艺产品 1\", \"dDesc_en\": \"<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>\", \"bDesc_zh-CN\": \"多工艺产品 sc 1\", \"bDesc_zh-TW\": \"多工艺产品 tc 1\", \"dDesc_zh-CN\": \"<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>\", \"dDesc_zh-TW\": \"<p>&nbsp;</p>\"}",
                "sourceType": "prodMjob",
                "sourceDDate": -2209017600000,
                "sdispLot": "A",
                "proId": 4634,
                "qty": 100,
                "spjobLot": "A",
                "bDesc_zh-CN": "多工艺产品 sc 1"
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Work Process Subcontract Complete

# 一、Description

​ Usage: Create or Update 【Work Process Subcontract Complete】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/prodSc
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes prodSc
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/prodSc";
		String param = "&menuCode=prodSc";

		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 data as JSON format:

{
    "prodsct": {
        "values": [
            {
                "sourceId": 20,
                "mjobId": 425,
                "spjobId": 95,
                "oriUnitId": 39720,
                "passQty": 100,
                "lot": "A",
                "oriQty": 100,
                "sourceLot": "A",
                "footerKey": "     1",
                "sourceType": "prodSdisp",
                "processId": 12,
                "proId": 4634,
                "qty": 100,
                "unitId": 39720,
                "spjobLot": "A"
            }
        ]
    },
    "prodmainsc": {
        "values": [
            {
                "beId": 142,
                "tDate": "2022-03-23",
                "curId": 2,
                "code": "SCTEST2",
                "venId": 99,
                "virDeptId": 7,
                "rate": 1,
                "staffId": 785
            }
        ]
    },
    "prodscstt": {
        "values": [
            {
                "sourceId": 425,
                "cDate": "2022-03-31",
                "sourceProId": 4634,
                "spjobId": 95,
                "oriUnitId": 39720,
                "sourceDate": "2022-03-23",
                "lot": "A",
                "oriQty": 100,
                "sourceLot": "A",
                "sourceMjobLot": "A",
                "footerKey": "     1",
                "sourceType": "prodMjob",
                "sourceDDate": "1900-01-01",
                "sdispLot": "A",
                "proId": 4634,
                "qty": 100,
                "unitId": 39720,
                "spjobLot": "A",
                "sdispType": "prodSdisp",
                "sdispId": 20
            }
        ]
    }
}

​ 4、Response Sample

{
    "recordId": 22,
    "messages": [],
    "status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Work Process Subcontract Complete

# 一、Description

​ Usage: Delete Work Process Subcontract Complete

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/prodSc
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes prodSc
id long(Query) Yes Work Process Subcontract Complete ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/prodSc";
		String param = "&menuCode=prodSc&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、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}

# Work Process Subcontract Invoice

# Fetch Work Process Subcontract Invoice List

# 一、Description

​ Usage: Fetch Work Process Subcontract Invoice List.

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/search/search
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
stSearch String(Query) Yes prodSi
beId long(Query) Yes Business Entity ID
formatId long(Query) No Lookup Query ID, If not specified, the default format is used.
startRow int(Query) No Resultset offset : start index
endRow int(Query) No Resultset offset : end index
quickSearchStr String(Query) No Quick search keyword

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search";
		String param = "&stSearch=prodSi&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、Response Sample

{
    "stSearch": "prodSi",
    "size": 1,
    "stSearchDisplay": "Work Process Subcontract Invoice",
    "values": [
        {
            "tDate": "2019-09-24",
            "prodMainSi.lastModifyUid.simpleUser.desc__lang": "Milk",
            "code": "SC20190003",
            "prodMainSi.venId.ven.code": "V0002",
            "st_id": 4,
            "st_code": "SC20190003",
            "st_desc": "SC20190003",
            "prodMainSi.venId.ven.desc__lang": "Group Test 1",
            "prodMainSi.curId.cur.sym": "HK$",
            "iRev": 6,
            "id": 4,
            "lastModifyDate": "2020-05-13 16:02:01"
        }
    ]
}

# Create Work Process Subcontract Invoice (Auto Completion)

# 一、Description

​ 1. Usage: Create 【Work Process Subcontract Invoice】

​ 2. This API has the following characteristics:

​ ​ a. Support using code instead of id field

​ b. If field currency has no value specified, the Entity Currency will be used automatically

​ ​ c. If field staff has no value specified, the default staff in the User Options will be used automatically

​ ​ d. If field document date has no value specified, the value is obtained according to the date option in the [Preference Setup (Trade)]

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/erp/bsFlow/save/prodSi
HTTP Method POST
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/erp/bsFlow/save/prodSi";
		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();
		}
	}

Sample data:

{
    "beId": 142,
    "tDate": "2022-03-23",
    "curId": 2,
    "code": "SITEST",
    "venId": 99,
    "virDeptId": 7,
    "rate": 1,
    "prodsit": [
        {
            "sourceId": 23,
            "lot": "A",
            "oriQty": 100,
            "sourceLot": "A",
            "sourceType": "prodSc",
            "proId": 4634,
            "oriUnitId": 39720
        }
    ]
}

​ 4、Response Sample

{
    "tranId": 6,
    "tranCode": "SITEST",
    "message": "",
    "status": true
}

# Load Work Process Subcontract Invoice

# 一、Description

​ Usage: Load Work Process Subcontract Invoice Data

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/read/prodSi
HTTP Method GET
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes prodSi
id long(Query) Yes Work Process Subcontract Invoice ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

		CloseableHttpClient client = HttpClientBuilder.create().build();
		CloseableHttpResponse res = null;
		try {

			String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/prodSi";
			String param = "&menuCode=prodSi&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、Response Sample

{
    "data": {},
    "messages": [
        {
            "msgDetail": "找不到相关记录,记录可能已被Delete 或你没有访问权限",
            "msgCode": "core_141019"
        }
    ],
    "status": false
}
{
    "data": {
        "prodmainsi": [
            {
                "cpDate": 1648828800000,
                "lastModifyUid": 20,
                "useAccess": false,
                "virDeptId": 7,
                "accDesc_ccn": "",
                "expiredDate": -2209017600000,
                "installNo": 0,
                "position_zh-CN": "PIE",
                "sysJson": "",
                "viewCode": "prodSi",
                "accDesc": "",
                "accDesc_haha1": "",
                "eDiscRate": 0,
                "beId": 142,
                "comRate": 0,
                "useAccessBl": false,
                "id": 6,
                "locked": false,
                "position_ctw": "",
                "lastModifyDate": 1648887837000,
                "createUid": 20,
                "showEarlyPayDisc": false,
                "accDesc_ctw": "",
                "fromModule": "",
                "rev": "1",
                "lastApproveUid": 20,
                "method": "cod",
                "ttlCharge": 0,
                "expiredUid": 0,
                "position_en": "",
                "position_zh-TW": "",
                "venId": 99,
                "i18nField": "{\"accDesc_zh-CN\": \"\", \"position_zh-CN\": \"PIE\"}",
                "dayOfMonth": 0,
                "monthEndDate": 0,
                "accDesc_en": "",
                "manId": 48,
                "ttlAmt": 0,
                "position": "PIE",
                "venInvNo": "",
                "status": "Y",
                "hpSetting": "dayAfterInv",
                "tDate": 1647964800000,
                "code": "SITEST",
                "cnDeptId": 0,
                "jlTypeId": 0,
                "amt": 0,
                "iRev": 1,
                "accDesc_zh-TW": "",
                "aInvMonth": 0,
                "depoAmt": 0,
                "ce01Module": "prodSi",
                "curId": 2,
                "expired": false,
                "rate": 1,
                "domAmt": 0,
                "printCount": 0,
                "statusModifyDate": 1648887837000,
                "domDepoAmt": 0,
                "locId": 0,
                "createDate": 1648887837000,
                "loadNeed": true,
                "accDesc_zh-CN": "",
                "cp": 0,
                "useAccessWl": false,
                "position_ccn": "",
                "ttlDisc": 0,
                "position_haha1": "",
                "useAccessAutoCalc": false,
                "staffId": 21,
                "domAmtDiff": 0
            }
        ],
        "prodsit": [
            {
                "sourceId": 23,
                "dDesc_ctw": "",
                "dualQty": 0,
                "costAmt": 0,
                "amt": 0,
                "iRev": 1,
                "itemNo": "     1",
                "dDesc_zh-CN": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "bDesc_ctw": "",
                "ce01Module": "prodSi",
                "beId": 142,
                "lot": "A",
                "oriQty": 100,
                "bDesc_haha1": "",
                "dDesc_zh-TW": "",
                "domAmt": 0,
                "processId": 12,
                "bDesc": "多工艺产品 sc 1",
                "bDesc_ccn": "",
                "bDesc_zh-TW": "",
                "newLotno": 0,
                "unitId": 39720,
                "dDesc_ccn": "",
                "id": 6,
                "up": 0,
                "locId": 0,
                "dDesc_haha1": "",
                "hId": 6,
                "mjobId": 425,
                "bDesc_en": "",
                "dDesc_en": "",
                "dualUnitId": 4489,
                "spjobId": 95,
                "oriUnitId": 39720,
                "oriUp": 0,
                "sourceLot": "A",
                "dDesc": "<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>",
                "footerKey": "     1",
                "i18nField": "{\"bDesc_zh-CN\": \"多工艺产品 sc 1\", \"dDesc_zh-CN\": \"<p>钻石套装 -- 18K鑽戒 (女) 1<br></p>\"}",
                "sourceType": "prodSc",
                "proId": 4634,
                "qty": 100,
                "disc": 0,
                "spjobLot": "A",
                "refCode": "",
                "lotNoId": 0,
                "bDesc_zh-CN": "多工艺产品 sc 1"
            }
        ],
        "prodremsi": [
            {
                "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": "prodSi",
                "tradeTerm": "",
                "heading_ccn": "",
                "payTerm_haha1": "",
                "payTerm_zh-TW": "",
                "remarks_haha1": "",
                "shipMark_en": "",
                "id": 6,
                "remarks_zh-TW": "",
                "particular_ccn": "",
                "hId": 6,
                "heading_haha1": "",
                "payTerm": "",
                "particular_en": "",
                "heading_zh-TW": "",
                "payTerm_ccn": "",
                "heading": "",
                "particular_haha1": "",
                "remarks_ccn": "",
                "particular_zh-TW": "",
                "heading_ctw": "",
                "tradeTerm_ctw": "",
                "particular": "",
                "tradeTerm_zh-TW": "",
                "shipMark_ccn": "",
                "tradeTerm_haha1": "",
                "particular_zh-CN": "",
                "i18nField": "{\"heading_zh-CN\": \"\", \"payTerm_zh-CN\": \"\", \"remarks_zh-CN\": \"\", \"shipMark_zh-CN\": \"\", \"tradeTerm_zh-CN\": \"\", \"particular_zh-CN\": \"\"}",
                "remarks_zh-CN": "",
                "particular_ctw": "",
                "shipMark_haha1": "",
                "payTerm_zh-CN": "",
                "payTerm_ctw": "",
                "shipMark_zh-TW": "",
                "remarks": "",
                "remarks_ctw": ""
            }
        ]
    },
    "messages": [],
    "status": true
}

# Create Work Process Subcontract Invoice

# 一、Description

​ Usage: Create or Update 【Work Process Subcontract Invoice】

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/save/prodSi
HTTP Method PUT
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes prodSi
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/prodSi";
		String param = "&menuCode=prodSi";

		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 data as JSON format:

{
    "prodmainsi": {
        "values": [
            {
                "beId": 142,
                "tDate": "2022-03-23",
                "curId": 2,
                "code": "SITEST2",
                "venId": 99,
                "virDeptId": 7,
                "rate": 1,
                "staffId": 785
            }
        ]
    },
    "prodsit": {
        "values": [
            {
                "sourceId": 23,
                "mjobId": 425,
                "spjobId": 95,
                "oriUnitId": 39720,
                "lot": "A",
                "oriQty": 100,
                "sourceLot": "A",
                "footerKey": "     1",
                "sourceType": "prodSc",
                "processId": 12,
                "proId": 4634,
                "qty": 100,
                "unitId": 39720,
                "spjobLot": "A"
            }
        ]
    }
}

​ 4、Response Sample

{
    "recordId": 7,
    "messages": [],
    "status": true
}
{
    "recordId": 0,
    "messages": [
        {
            "msgDetail": "Required field is empty",
            "msgCode": "core_101905"
        }
    ],
    "status": false
}	

# Delete Work Process Subcontract Invoice

# 一、Description

​ Usage: Delete Work Process Subcontract Invoice

# 二、API Detail

​ 1、Request URL

URL http://[server]/jsf/rfws/root/api/delete/prodSi
HTTP Method DELETE
Encode UTF-8

​ 2、URL Parameters

Parameter Type Required Remarks
authorization String(Header) Yes Access Token obtained via Oauth2
client_id String(Header) Yes Client ID from [OAuth Applications], generated by the M18
menuCode String(Query) Yes prodSi
id long(Query) Yes Work Process Subcontract Invoice ID
param String(Query) No Extra Pamameters: in JSON format

​ 3、Request Sample

	CloseableHttpClient client = HttpClientBuilder.create().build();
	CloseableHttpResponse res = null;
	try {

		String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/prodSi";
		String param = "&menuCode=prodSi&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、Response Sample

{
	"messages": [],
	"status": true
}
{
    "messages": [
        {
            "msgDetail": "Record has been deleted",
            "msgCode": "core_101017"
        }
    ],
    "status": false
}