临时工
# 318员工申请
# 获取318员工申请单据列表
# 接口描述
用于获取318员工申请单据列表
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/search/search HTTP 请求方式 GET 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y aiM18 授权应用列表中的 Client ID stSearch String
(Query)Y Lookup Type. 可在 UDF Lookup 中找到。
(Eg:casualextrahour
......)formatId long
(Query)N Lookup Query 中的格式 ID
(若未指定该参数,则使用默认格式)startRow int
(Query)N 返回结果的开始行 endRow int
(Query)N 返回结果的结束行 quickSearchStr String
(Query)N 设定关键字查找数据 请求示例
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(); } }
返回示例
{ "stSearch": "casualextrahour", "size": 1, "stSearchDisplay": "318员工申请", "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" } ] }
# 新增318员工申请
# 接口描述
用于新增318员工申请记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/casualextrahour HTTP 请求方式 PUT 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y aiM18 授权应用列表中的 Client ID menuCode String
(Query)Y 可在 Data Dictionary 中找到
Eg:casualextrahour
entity String
(Body)Y JSON (可参考请求示例中的相关参数) 请求示例
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 格式如下:
{ "casualextrahour": { "values": [ { "code": "test001", "desc": "测试001", "refDate": "2022-04-20" } ] }, "casualextrahourt": { "values": [ { "empId": 1 } ] } }
返回示例
{ "recordId": 2, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "存在无效数据(casualextrahourt.empId.1)", "msgCode": "core_143009" } ], "status": false }
# 读取318员工申请
# 接口描述
根据 ID 读取318员工申请记录详情
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/read/casualextrahour HTTP 请求方式 GET 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y aiM18 授权应用列表中的 Client ID menuCode String
(Query)Y 可在 Data Dictionary 中找到
Eg:casualextrahour
id long
(Query)Y 318员工申请单 ID,可参考获取318员工申请单据列表返回的 ID iRev long
(Query)N 版本号,用于读取历史记录 / 已删除的记录 请求示例
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(); } }
返回示例
{ "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": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 保存318员工申请
# 接口描述
用于保存318员工申请单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/casualextrahour HTTP 请求方式 PUT 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y aiM18 授权应用列表中的 Client ID menuCode String
(Query)Y 可在 Data Dictionary 中找到
Eg:casualextrahour
entity String
(Body)Y JSON (可参考请求示例中的相关参数) 请求示例
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 格式如下:
{ "casualextrahour": { "values": [ { "id": 2, "code": "test001", "refDate": "2022-07-01" } ] } }
返回示例
{ "recordId": 2, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 删除318员工申请
# 接口描述
用于删除指定 ID 的318员工申请单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/delete/casualextrahour HTTP 请求方式 DELETE 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y aiM18 授权应用列表中的 Client ID menuCode String
(Query)Y 可在 Data Dictionary 中找到
Eg:casualextrahour
id long
(Query)Y 318员工申请单 ID,可参考获取318员工申请单据列表返回的 ID 请求示例
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(); } }
返回示例
{ "messages": [], "status": true }
{ "messages": [ { "msgDetail": "单据已被删除", "msgCode": "core_101017" } ], "status": false }
# 读取EBI数据
# 征用临时雇员汇总报告
# 接口描述
用于按照指定 EBI 格式读取 [征用临时雇员汇总报告] EBI,并返回数据
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/ebiWidget/loadReport HTTP 请求方式 GET 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y aiM18 授权应用列表中的 Client ID formatId long
(Query)Y 通过 EBI 接口获得 offset int
(Query)N 返回结果的开始行 rows int
(Query)N 返回结果行数 请求示例
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(); } }
返回示例
{ "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" }, ...... ] }
# 中介费报告
# 接口描述
用于按照指定 EBI 格式读取 [中介费报告] EBI,并返回数据
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/ebiWidget/loadReport HTTP 请求方式 GET 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y aiM18 授权应用列表中的 Client ID formatId long
(Query)Y 通过 EBI 接口获得 offset int
(Query)N 返回结果的开始行 rows int
(Query)N 返回结果行数 请求示例
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(); } }
返回示例
{ "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员工申请报告
# 接口描述
用于按照指定 EBI 格式读取 [318员工申请报告] EBI,并返回数据
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/ebiWidget/loadReport HTTP 请求方式 GET 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y aiM18 授权应用列表中的 Client ID formatId long
(Query)Y 通过 EBI 接口获得 offset int
(Query)N 返回结果的开始行 rows int
(Query)N 返回结果行数 请求示例
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(); } }
返回示例
{ "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 } ] }
Last Updated: 2024/09/13, 09:57:11