Casual Labour
Version: 1.2 | Release Date: 30/01/2024
# 318 Employee Application
# Fetch 318 Employee Application List
# Description
Usage: Fetch 318 Employee Application List
# API Detail
Request URL
URL http://[server]/jsf/rfws/search/search HTTP Method GET Encode UTF-8 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 aiM18 stSearch String
(Query)Yes Lookup Type. You can find it in Lookup.
(Eg:casualextrahour
......)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 Request Sample
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/search/search"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&stSearch=").append("casualextrahour"); paramStrBuilder.append("&startRow=").append(0); paramStrBuilder.append("&endRow=").append(10); HttpGet get = new HttpGet(url + "?" + paramStrBuilder.toString()); 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(); } }
Response Sample
{ "stSearch": "casualextrahour", "size": 1, "stSearchDisplay": "318 Employee Application", "values": [ { "code": "1", "desc": "2", "startDate": "2020-06-07", "endDate": "2020-06-13", "iRev": 4, "lastModifyDate": "2020-10-30 10:44:08", "casualextrahour.lastModifyUid.simpleUser.desc__lang": "admin-SC", "id": 1, "st_desc": "2", "st_id": 1, "st_code": "1" } ] }
# Create 318 Employee Application
# Description
Usage: Create 318 Employee Application
# API Detail
Request URL
URL http://[server]/jsf/rfws/root/api/save/casualextrahour HTTP Method PUT Encode UTF-8 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 aiM18 menuCode String
(Query)Yes In Data Dictionary
Eg:casualextrahour
entitYes String
(Body)Yes JSON (Refer to Request Sample) Request Sample
long recordId = 0; CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/casualextrahour"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("casualextrahour"); HttpPut put = new HttpPut(url + "?" + paramStrBuilder.toString()); put.addHeader("authorization", access_token); put.addHeader("client_id", ClientID); StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON); entity.setContentEncoding("UTF-8"); put.setEntity(entity); res = client.execute(put); if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity())); if (json != null) { recordId = json.getLongValue("recordId"); } System.out.println(json); } put.releaseConnection(); } catch (Exception e) { e.printStackTrace(); } finally { try { if (res != null) { res.close(); } if (client != null) { client.close(); } } catch (Exception ex) { ex.printStackTrace(); } }
Entity JSON Format:
{ "casualextrahour": { "values": [ { "code": "test001", "desc": "测试001", "refDate": "2022-04-20" } ] }, "casualextrahourt": { "values": [ { "empId": 1 } ] } }
Response Sample
{ "recordId": 2, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "Invalid Data Found(casualextrahourt.empId.1)", "msgCode": "core_143009" } ], "status": false }
# Load 318 Employee Application
# Description
Usage: Load 318 Employee Application
# API Detail
Request URL
URL http://[server]/jsf/rfws/root/api/read/casualextrahour HTTP Method GET Encode UTF-8 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 aiM18 menuCode String
(Query)Yes In Data Dictionary
Eg:casualextrahour
id long
(Query)Yes 318 Employee Application ID iRev long
(Query)No Inner Version Request Sample
JSONObject json = null; CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/read/casualextrahour"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("casualextrahour"); paramStrBuilder.append("&id=").append(id); HttpGet get = new HttpGet(url + "?" + paramStrBuilder.toString()); get.addHeader("authorization", access_token); get.addHeader("client_id", ClientID); res = client.execute(get); if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { 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(); } }
Response Sample
{ "data": { "casualextrahourt": [ { "empId": 49, "week1": 0, "hId": 2, "week2": 0, "week3": 0, "fulfilled": false, "iRev": 1, "itemNo": "", "allowWorkHrs": 0, "prevAllowWorkHrs": 0, "week8": 0, "week9": 0, "id": 1, "week4": 0, "week5": 0, "week6": 0, "week7": 0 } ], "casualextrahour": [ { "cancel": false, "canceledOn": -2209017600000, "attachmentNo": 0, "lastModifyUid": 4, "code": "test001", "useAccess": false, "endDate": 1650643200000, "expiredDate": -2209017600000, "canceledBy": 0, "iRev": 1, "sysJson": "", "viewCode": "casualextrahour", "beId": 0, "expired": false, "printCount": 0, "useAccessBl": false, "id": 2, "statusModifyDate": 1656647646000, "locked": false, "cancelReason": "", "lastModifyDate": 1656647646000, "createUid": 4, "createDate": 1656647646000, "lastApproveUid": 4, "expiredUid": 0, "useAccessWl": false, "refDate": 1650384000000, "useAccessAutoCalc": false, "startDate": 1650124800000, "status": "Y", "desc": "测试001" } ] }, "messages": [], "status": true }
{ "data": {}, "messages": [ { "msgDetail": "No data is found, it may be deleted or not authorized for you to access", "msgCode": "core_141019" } ], "status": false }
# Update 318 Employee Application
# Description
Usage: Update 318 Employee Application
# API Detail
Request URL
URL http://[server]/jsf/rfws/root/api/save/casualextrahour HTTP Method PUT Encode UTF-8 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 aiM18 menuCode String
(Query)Yes In Data Dictionary
Eg:casualextrahour
entitYes String
(Body)Yes JSON (Refer to Request Sample) Request Sample
long recordId = 0; CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/save/casualextrahour"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("casualextrahour"); HttpPut put = new HttpPut(url + "?" + paramStrBuilder.toString()); put.addHeader("authorization", access_token); put.addHeader("client_id", ClientID); StringEntity entity = new StringEntity(data.toJSONString(), ContentType.APPLICATION_JSON); entity.setContentEncoding("UTF-8"); put.setEntity(entity); res = client.execute(put); if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity())); if (json != null) { recordId = json.getLongValue("recordId"); } System.out.println(json); } put.releaseConnection(); } catch (Exception e) { e.printStackTrace(); } finally { try { if (res != null) { res.close(); } if (client != null) { client.close(); } } catch (Exception ex) { ex.printStackTrace(); } }
Entity JSON Format:
{ "casualextrahour": { "values": [ { "id": 2, "code": "test001", "refDate": "2022-07-01" } ] } }
Response Sample
{ "recordId": 2, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "No data is found, it may be deleted or not authorized for you to access", "msgCode": "core_141019" } ], "status": false }
# Delete 318 Employee Application
# Description
Usage: Delete 318 Employee Application
# API Detail
Request URL
URL http://[server]/jsf/rfws/root/api/delete/casualextrahour HTTP Method DELETE Encode UTF-8 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 aiM18 menuCode String
(Query)Yes In Data Dictionary
Eg:casualextrahour
id long
(Query)Yes 318 Employee Application ID Request Sample
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/casualextrahour"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("casualextrahour"); paramStrBuilder.append("&id=").append(id); HttpDelete delete = new HttpDelete(url + "?" + paramStrBuilder.toString()); 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(); } }
Response Sample
{ "messages": [], "status": true }
{ "messages": [ { "msgDetail": "The record was deleted", "msgCode": "core_101017" } ], "status": false }
# Load EBI data
# Casual Labour Requisition Summary Report
# Description
Usage: Run EBI [Casual Labour Requisition Summary Report], return EBI data
# API Detail
Request URL
URL http://[server]/jsf/rfws/ebiWidget/loadReport HTTP Method GET Encode UTF-8 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 aiM18 formatId long
(Query)Yes Format ID fetched from another API offset int
(Query)No Resultset offset : start index rows int
(Query)No Resultset offset : end index Request Sample
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&formatId=").append(formatId); paramStrBuilder.append("&offset=").append(0); paramStrBuilder.append("&rows=").append(10); HttpGet get = new HttpGet(url + "?" + paramStrBuilder.toString()); 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(); } }
Response Sample
{ "size": 10, "rows": [ { "T1_A_eventDFrom": "2020/04/06", "T3_A_check418": "否", "aiM18ReservedCol_dataIndex": 1, "MAIN_pax": "2", "MAIN_eventNo": "Event NO1", "T1_A_eventDTo": "2020/04/06" }, ...... ] }
# Casual Leader Fee Report
# Description
Usage: Run EBI [Casual Leader Fee Report], return EBI data
# API Detail
Request URL
URL http://[server]/jsf/rfws/ebiWidget/loadReport HTTP Method GET Encode UTF-8 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 aiM18 formatId long
(Query)Yes Format ID fetched from another API offset int
(Query)No Resultset offset : start index rows int
(Query)No Resultset offset : end index Request Sample
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&formatId=").append(formatId); paramStrBuilder.append("&offset=").append(0); paramStrBuilder.append("&rows=").append(10); HttpGet get = new HttpGet(url + "?" + paramStrBuilder.toString()); 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(); } }
Response Sample
{ "size": 10, "rows": [ { "MAIN_leaderCo": "MLTEST", "MAIN_chiName": "封易-繁体姓名", "MAIN_positionDesc": "D122", "aiM18ReservedCol_dataIndex": 1, "MAIN_leaderType": "时计", "MAIN_desc": "ML001-SZO中介人", "T2_A_id": "14657", "MAIN_ratePercent": "80.0", "T2_A_code": "SZ0001", "MAIN_code": "ML001ZJ" }, ...... ] }
# 318 Employee Application Report
# Description
Usage: Run EBI [318 Employee Application Report], return EBI data
# API Detail
Request URL
URL http://[server]/jsf/rfws/ebiWidget/loadReport HTTP Method GET Encode UTF-8 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 aiM18 formatId long
(Query)Yes Format ID fetched from another API offset int
(Query)No Resultset offset : start index rows int
(Query)No Resultset offset : end index Request Sample
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&formatId=").append(formatId); paramStrBuilder.append("&offset=").append(0); paramStrBuilder.append("&rows=").append(10); HttpGet get = new HttpGet(url + "?" + paramStrBuilder.toString()); 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(); } }
Response Sample
{ "size": 1, "rows": [ { "CEHT_ceh_code": "test001", "CEHT_ceh_endDate": "2022/07/02", "CEHT_ceh_id": "2", "CEHT_ceh_desc": "测试001", "MAIN_hId": "2", "CEHT_ceh_startDate": "2022/06/26", "aiM18ReservedCol_dataIndex": 1 } ] }