薪资管理
# 变动科目
# 获取变动科目单据列表
# 接口描述
用于获取变动科目单据列表
# 接口调用说明
请求说明
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:varpay
......)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("varpay"); 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": "varpay", "size": 10, "stSearchDisplay": "变动科目", "values": [ { "code": "18051401", "desc__lang": "", "status": "Y", "iRev": 1, "lastModifyDate": "2018-05-14 17:27:12", "varpay.lastModifyUid.simpleUser.desc__lang": "", "id": 7, "st_desc": "18051401", "st_id": 7, "st_code": "18051401" }, {......} ] }
# 新增变动科目
# 接口描述
用于新增变动科目记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/varpay 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:varpay
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/varpay"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("varpay"); 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 格式如下:
{ "mainvp": { "values": [ { "code": "test001", "desc": "测试变动科目", "vpcatId": 1 } ] } }
返回示例
{ "recordId": 41, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "编号重复(mainvp.code)", "msgCode": "core_101903" } ], "status": false }
# 读取变动科目
# 接口描述
根据 ID 读取变动科目记录详情
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/read/varpay 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:varpay
id long
(Query)Y 变动科目单 ID,可参考获取变动科目单据列表返回的 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/varpay"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("varpay"); 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": { "mainvp": [ { "ir56macc": "nil", "attachmentNo": 0, "lastModifyUid": 4, "code": "test001", "useAccess": false, "ddesc": "", "expiredDate": -2209017600000, "vpcatId": 3, "iRev": 3, "sysJson": "", "payrollrela": "nil", "viewCode": "varpay", "beId": 0, "ir56bacc": "nil", "ir56Rent": "nil", "expired": false, "leaveType": 0, "incomecate": "nil", "printCount": 0, "useAccessBl": false, "printSequence": 1, "id": 41, "statusModifyDate": 1651908968000, "locked": false, "desc_en": "测试变动科目", "lastModifyDate": 1651909228000, "createUid": 4, "forOneOffSpeAllow": false, "createDate": 1651908968000, "payScaleCat": "--", "desc_zh-CN": "", "lastApproveUid": 4, "mandaitem": false, "expiredUid": 0, "useAccessWl": false, "udfaac": 0, "i18nField": "{\"desc_en\": \"测试变动科目\"}", "desc_zh-TW": "", "showzero": false, "taxrela": "nil", "ir56eacc": "nil", "sysDefault": false, "useAccessAutoCalc": false, "status": "Y", "desc": "测试变动科目" } ] }, "messages": [], "status": true }
{ "data": {}, "messages": [ { "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 保存变动科目
# 接口描述
用于保存变动科目单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/varpay 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:varpay
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/varpay"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("varpay"); 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 格式如下:
{ "mainvp": { "values": [ { "id": 41, "code": "test001", "vpcatId": 3 } ] } }
返回示例
{ "recordId": 41, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "存在无效数据(mainvp.vpcatId)", "msgCode": "core_143009" } ], "status": false }
# 删除变动科目
# 接口描述
用于删除指定 ID 的变动科目单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/delete/varpay 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:varpay
id long
(Query)Y 变动科目单 ID,可参考获取变动科目单据列表返回的 ID 请求示例
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/varpay"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("varpay"); 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 }
# 固定科目
# 获取固定科目单据列表
# 接口描述
用于获取固定科目单据列表
# 接口调用说明
请求说明
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:fixpay
......)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("fixpay"); 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": "fixpay", "size": 10, "stSearchDisplay": "固定科目", "values": [ { "code": "ADMIN_ACC", "desc__lang": "", "status": "Y", "iRev": 7, "lastModifyDate": "2017-12-01 10:06:34", "fixpay.lastModifyUid.simpleUser.desc__lang": "admin-SC", "id": 11, "st_desc": "(ADMIN_ACC)", "st_id": 11, "st_code": "ADMIN_ACC" }, {......} ] }
# 新增固定科目
# 接口描述
用于新增固定科目记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/fixpay 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:fixpay
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/fixpay"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("fixpay"); 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 格式如下:
{ "mainfp": { "values": [ { "code": "test001", "desc": "测试固定科目", "fpcatId": 1 } ] } }
返回示例
{ "recordId": 28, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "编号重复(mainfp.code)", "msgCode": "core_101903" } ], "status": false }
# 读取固定科目
# 接口描述
根据 ID 读取固定科目记录详情
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/read/fixpay 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:fixpay
id long
(Query)Y 固定科目单 ID,可参考获取固定科目单据列表返回的 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/fixpay"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("fixpay"); 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": { "mainfp": [ { "ir56macc": "nil", "attachmentNo": 0, "lastModifyUid": 4, "code": "test001", "useAccess": false, "ddesc": "", "expiredDate": -2209017600000, "iRev": 1, "sysJson": "", "payrollrela": "nil", "viewCode": "fixpay", "calcdivide": false, "beId": 0, "ir56bacc": "nil", "ir56Rent": "nil", "expired": false, "leaveType": 0, "incomecate": "nil", "printCount": 0, "useAccessBl": false, "printSequence": 1, "id": 28, "statusModifyDate": 1651909592000, "locked": false, "desc_en": "测试固定科目", "lastModifyDate": 1651909592000, "createUid": 4, "forOneOffSpeAllow": false, "createDate": 1651909592000, "payScaleCat": "--", "desc_zh-CN": "", "period": "pay", "lastApproveUid": 4, "mandaitem": false, "expiredUid": 0, "useAccessWl": false, "i18nField": "{\"desc_en\": \"测试固定科目\"}", "desc_zh-TW": "", "showzero": false, "taxrela": "nil", "fpcatId": 1, "ir56eacc": "nil", "useAccessAutoCalc": false, "status": "Y", "desc": "测试固定科目" } ] }, "messages": [], "status": true }
{ "data": {}, "messages": [ { "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 保存固定科目
# 接口描述
用于保存固定科目单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/fixpay 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:fixpay
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/fixpay"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("fixpay"); 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 格式如下:
{ "mainfp": { "values": [ { "id": 28, "code": "test001", "fpcatId": 3 } ] } }
返回示例
{ "recordId": 28, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "存在无效数据(mainfp.fpcatId)", "msgCode": "core_143009" } ], "status": false }
# 删除固定科目
# 接口描述
用于删除指定 ID 的固定科目单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/delete/fixpay 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:fixpay
id long
(Query)Y 固定科目单 ID,可参考获取固定科目单据列表返回的 ID 请求示例
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/fixpay"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("fixpay"); 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 }
# 统计科目
# 获取统计科目单据列表
# 接口描述
用于获取统计科目单据列表
# 接口调用说明
请求说明
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:resultvalue
......)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("resultvalue"); 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": "resultvalue", "size": 10, "stSearchDisplay": "统计科目", "values": [ { "code": "AA", "desc__lang": "AA", "status": "Y", "iRev": 3, "lastModifyDate": "2019-03-25 14:14:49", "resultvalue.lastModifyUid.simpleUser.desc__lang": "admin-SC", "id": 33, "st_desc": "AA", "st_id": 33, "st_code": "AA" }, {......} ] }
# 新增统计科目
# 接口描述
用于新增统计科目记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/resultvalue 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:resultvalue
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/resultvalue"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("resultvalue"); 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 格式如下:
{ "mainrv": { "values": [ { "code": "test001", "desc": "测试统计科目", "rvcatId": 1 } ] } }
返回示例
{ "recordId": 74, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "编号重复(mainrv.code)", "msgCode": "core_101903" } ], "status": false }
# 读取统计科目
# 接口描述
根据 ID 读取统计科目记录详情
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/read/resultvalue 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:resultvalue
id long
(Query)Y 统计科目单 ID,可参考获取统计科目单据列表返回的 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/resultvalue"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("resultvalue"); 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": { "mainrv": [ { "ir56macc": "nil", "lastModifyUid": 4, "useAccess": false, "expiredDate": -2209017600000, "sysJson": "", "viewCode": "resultvalue", "beId": 0, "ir56bacc": "nil", "ir56Rent": "nil", "calcOrder": "bmpf", "leaveType": 0, "useAccessBl": false, "printSequence": 1, "id": 74, "locked": false, "lastModifyDate": 1651909763000, "createUid": 4, "forOneOffSpeAllow": false, "payScaleCat": "--", "lastApproveUid": 4, "expiredUid": 0, "transfer": false, "i18nField": "{\"desc_en\": \"测试统计科目\"}", "desc_zh-TW": "", "casualPayRela": "nil", "taxrela": "nil", "status": "Y", "desc": "测试统计科目", "attachmentNo": 0, "code": "test001", "ddesc": "", "iRev": 1, "payrollrela": "nil", "rvcatId": 1, "expired": false, "incomecate": "nil", "printCount": 0, "statusModifyDate": 1651909763000, "desc_en": "测试统计科目", "createDate": 1651909763000, "desc_zh-CN": "", "lspAcType": "nil", "mandaitem": false, "useAccessWl": false, "needCostAmor": false, "showzero": false, "ir56eacc": "nil", "sysDefault": false, "useAccessAutoCalc": false } ] }, "messages": [], "status": true }
{ "data": {}, "messages": [ { "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 保存统计科目
# 接口描述
用于保存统计科目单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/resultvalue 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:resultvalue
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/resultvalue"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("resultvalue"); 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 格式如下:
{ "mainrv": { "values": [ { "id": 74, "code": "test001", "rvcatId": 3 } ] } }
返回示例
{ "recordId": 74, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "存在无效数据(mainrv.rvcatId)", "msgCode": "core_143009" } ], "status": false }
# 删除统计科目
# 接口描述
用于删除指定 ID 的统计科目单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/delete/resultvalue 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:resultvalue
id long
(Query)Y 统计科目单 ID,可参考获取统计科目单据列表返回的 ID 请求示例
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/resultvalue"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("resultvalue"); 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 }
# 保险科目
# 获取保险科目单据列表
# 接口描述
用于获取保险科目单据列表
# 接口调用说明
请求说明
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:insurAcc
......)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("insurAcc"); 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": "insurAcc", "size": 10, "stSearchDisplay": "保险科目", "values": [ { "code": "IA001", "desc__lang": "Insurance Account", "status": "Y", "iRev": 7, "lastModifyDate": "2020-02-21 16:11:43", "insurAcc.lastModifyUid.simpleUser.desc__lang": "admin-SC", "id": 55, "st_desc": "Insurance Account", "st_id": 55, "st_code": "IA001" }, {......} ] }
# 新增保险科目
# 接口描述
用于新增保险科目记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/insurAcc 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:insurAcc
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/insurAcc"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("insurAcc"); 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 格式如下:
{ "insuracc": { "values": [ { "code": "test001", "desc": "测试保险科目", "insurAccCat": 3 } ] } }
返回示例
{ "recordId": 78, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "编号重复(insuracc.code)", "msgCode": "core_101903" } ], "status": false }
# 读取保险科目
# 接口描述
根据 ID 读取保险科目记录详情
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/read/insurAcc 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:insurAcc
id long
(Query)Y 保险科目单 ID,可参考获取保险科目单据列表返回的 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/insurAcc"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("insurAcc"); 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": { "insuracc": [ { "attachmentNo": 0, "lastModifyUid": 4, "code": "test002", "useAccess": false, "ddesc": "", "expiredDate": -2209017600000, "iRev": 1, "sysJson": "", "payrollrela": "nil", "viewCode": "insurAcc", "insurPayer": "emp", "beId": 0, "expired": false, "insurAccCat": 3, "incomecate": "nil", "printCount": 0, "useAccessBl": false, "printSequence": 1, "id": 78, "statusModifyDate": 1652250429000, "locked": false, "desc_en": "测试保险科目", "lastModifyDate": 1652250429000, "createUid": 4, "createDate": 1652250429000, "desc_zh-CN": "", "lastApproveUid": 4, "mandaitem": false, "expiredUid": 0, "useAccessWl": false, "i18nField": "{\"desc_en\": \"测试保险科目\"}", "desc_zh-TW": "", "showzero": false, "useAccessAutoCalc": false, "status": "Y", "desc": "测试保险科目" } ] }, "messages": [], "status": true }
{ "data": {}, "messages": [ { "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 保存保险科目
# 接口描述
用于保存保险科目单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/insurAcc 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:insurAcc
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/insurAcc"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("insurAcc"); 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 格式如下:
{ "insuracc": { "values": [ { "id": 78, "code": "test001", "insurAccCat": 3 } ] } }
返回示例
{ "recordId": 78, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "编号重复(insuracc.code)", "msgCode": "core_101903" } ], "status": false }
# 删除保险科目
# 接口描述
用于删除指定 ID 的保险科目单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/delete/insurAcc 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:insurAcc
id long
(Query)Y 保险科目单 ID,可参考获取保险科目单据列表返回的 ID 请求示例
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/insurAcc"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("insurAcc"); 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 }
# 报销记录
# 获取报销记录单据列表
# 接口描述
用于获取报销记录单据列表
# 接口调用说明
请求说明
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:myClaim
......)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("myClaim"); 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": "myClaim", "size": 10, "stSearchDisplay": "报销记录", "values": [ { "code": "18060501", "myClaim.empId.employee.code": "18040801", "myClaim.empId.employee.desc": "18040801_en", "iRev": 3, "lastModifyDate": "2018-06-05 15:25:07", "myClaim.lastModifyUid.simpleUser.desc__lang": "", "id": 75, "st_desc": "18060501", "st_id": 75, "st_code": "18060501" }, {......} ] }
# 新增报销记录
# 接口描述
用于新增报销记录记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/myClaim 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:myClaim
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/myClaim"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("myClaim"); 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 格式如下:
{ "myclaim": { "values": [ { "code": "test001", "empId": 49 } ] }, "myclaimt": { "values": [ { "claimTypeId": 1, "currency": 2, "paymentDate": "2022-05-11" } ] } }
返回示例
{ "recordId": 168, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "编号重复(myclaim.code)", "msgCode": "core_101903" } ], "status": false }
# 读取报销记录
# 接口描述
根据 ID 读取报销记录记录详情
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/read/myClaim 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:myClaim
id long
(Query)Y 报销记录单 ID,可参考获取报销记录单据列表返回的 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/myClaim"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("myClaim"); 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": { "myclaimt": [ { "date": -2209017600000, "hId": 168, "amount": 0, "claimTypeId": 1, "iRev": 1, "currency": 2, "id": 220, "itemNo": "", "paymentDate": 1652198400000, "desc": "" } ], "myclaim": [ { "empId": 49, "attachmentNo": 0, "lastModifyUid": 4, "code": "test001", "useAccess": false, "expiredDate": -2209017600000, "iRev": 1, "sysJson": "", "viewCode": "myClaim", "beId": 0, "expired": false, "printCount": 0, "useAccessBl": false, "id": 168, "statusModifyDate": 1652251160000, "locked": false, "lastModifyDate": 1652251160000, "createUid": 4, "createDate": 1652251160000, "lastApproveUid": 0, "expiredUid": 0, "useAccessWl": false, "udftextml": "", "udfvarpay": "", "useAccessAutoCalc": false, "remarks": "", "status": "N" } ] }, "messages": [], "status": true }
{ "data": {}, "messages": [ { "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 保存报销记录
# 接口描述
用于保存报销记录单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/myClaim 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:myClaim
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/myClaim"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("myClaim"); 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 格式如下:
{ "myclaim": { "values": [ { "id": 78, "code": "test001" } ] } }
返回示例
{ "recordId": 78, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "编号重复(myclaim.code)", "msgCode": "core_101903" } ], "status": false }
# 删除报销记录
# 接口描述
用于删除指定 ID 的报销记录单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/delete/myClaim 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:myClaim
id long
(Query)Y 报销记录单 ID,可参考获取报销记录单据列表返回的 ID 请求示例
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/myClaim"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("myClaim"); 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 }
# 员工薪资资料
# 获取员工薪资资料单据列表
# 接口描述
用于获取员工薪资资料单据列表
# 接口调用说明
请求说明
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:empPayrollInfo
......)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("empPayrollInfo"); 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": "empPayrollInfo", "size": 10, "stSearchDisplay": "员工薪资资料", "values": [ { "code": "00002", "empPayrollInfo.empId.employee.desc": "00002", "empPayrollInfo.empId.employee.dept.dept.desc__lang": "SZO", "empPayrollInfo.empId.employee.position.position.desc__lang": "人事部门-简体", "iRev": 10, "lastModifyDate": "2020-06-23 12:20:50", "empPayrollInfo.lastModifyUid.simpleUser.desc__lang": "admin-SC", "id": 33518, "st_desc": "00002", "st_id": 33518, "st_code": "00002" }, {......} ] }
# 新增员工薪资资料
# 新增员工
# 读取员工薪资资料
# 接口描述
根据 ID 读取员工薪资资料记录详情
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/read/empPayrollInfo 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:empPayrollInfo
id long
(Query)Y 员工薪资资料单 ID,可参考获取员工薪资资料单据列表返回的 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/empPayrollInfo"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("empPayrollInfo"); 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": { "emppacc": [ { "cur": 1, "udfmltime": "", "allowPtFrom": 0, "udfmlcombo": "", "obsolete": false, "udfmltest": "", "allowPct": 0, "iRev": 2, "itemNo": "", "notPublishToEssp": false, "isAllow": false, "fixPayId": 3, "payUpReasonId": 2, "effDate": 1546272000000, "salaryPt": 0, "udfmlboolean": false, "disabled": false, "id": 453, "udfmldate": -2209017600000, "subFooterRemark": "", "payScaleId": 0, "hId": 168, "amount": 1577, "allowPtTo": 0, "footerRemark": "", "allowPtDiff": 0, "payScaleFooterKey": 0, "amtByPayScale": false, "udfmlnum": 0, "udfmlquery": 0 } ], "emppayrollinfo": [ {......} ] }, "messages": [], "status": true }
{ "data": {}, "messages": [ { "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 保存员工薪资资料
# 接口描述
用于保存员工薪资资料单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/empPayrollInfo 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:empPayrollInfo
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/empPayrollInfo"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("empPayrollInfo"); 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 格式如下:
{ "emppayrollinfo": { "values": [ { "id": 7 } ] }, "empaacc": { "values": [ { "varPayId": 1, "cur": 2, "effDate": "2022-05-11" }] } }
返回示例
{ "recordId": 7, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "存在无效数据(empaacc.cur.1)", "msgCode": "core_143009" } ], "status": false }
# 删除员工薪资资料
# 删除员工
# 员工 IR56 相关资料
# 获取员工 IR56 相关资料单据列表
# 接口描述
用于获取员工 IR56 相关资料单据列表
# 接口调用说明
请求说明
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:empIR56Info
......)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("empIR56Info"); 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": "empIR56Info", "size": 9, "stSearchDisplay": "员工IR56相关资料", "values": [ { "code": "BT2017102501", "empIR56Info.empId.employee.code": "BTEST001", "empIR56Info.empId.employee.desc": "迈克尔.乔丹", "effDate": "2017-01-01", "iRev": 5, "lastModifyDate": "2019-01-28 09:48:24", "empIR56Info.lastModifyUid.simpleUser.desc__lang": "BT_SC", "id": 2, "st_desc": "BT2017102501", "st_id": 2, "st_code": "BT2017102501" }, {......} ] }
# 新增员工 IR56 相关资料
# 接口描述
用于新增员工 IR56 相关资料记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/empIR56Info 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:empIR56Info
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/empIR56Info"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("empIR56Info"); 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 格式如下:
{ "empir56info": { "values": [ { "code": "test001", "empId": 49, "effDate": "2022-05-11" } ] } }
返回示例
{ "recordId": 10, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "已存在该生效日期,不能保存!(empir56info.effDate)", "msgCode": "ch01_hklaw_empIR56Info_100001" }, { "msgDetail": "编号重复(empir56info.code)", "msgCode": "core_101903" } ], "status": false }
# 读取员工 IR56 相关资料
# 接口描述
根据 ID 读取员工 IR56 相关资料记录详情
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/read/empIR56Info 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:empIR56Info
id long
(Query)Y 员工 IR56 相关资料单 ID,可参考获取员工 IR56 相关资料单据列表返回的 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/empIR56Info"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("empIR56Info"); 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": { "empir56info": [ { "returnHK": false, "reason": "", "estAmt": 0, "lastModifyUid": 4, "useAccess": false, "sysJson": "", "viewCode": "empIR56Info", "rentPaidEr1": 0, "beId": 0, "naturePayAfterTerm": "NP", "effDate": 1462464000000, "rentPaidToEr1": 0, "rentPaidToEr2": 0, "departOtherReason": "", "useAccessBl": false, "id": 9, "anyMoneyHeld": false, "lastModifyDate": 1633336030000, "createUid": 4, "overseaCo": "", "overseaAdd": "", "withheldAmt": 0, "prinEr": "", "rentRefundEmp2": 0, "rentRefundEmp1": 0, "lastApproveUid": 4, "placeProByEr": false, "grantDate": -2209017600000, ...... } ] }, "messages": [], "status": true }
{ "data": {}, "messages": [ { "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 保存员工 IR56 相关资料
# 接口描述
用于保存员工 IR56 相关资料单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/empIR56Info 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:empIR56Info
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/empIR56Info"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("empIR56Info"); 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 格式如下:
{ "empir56info": { "values": [ { "id": 10, "code": "test001", "empId": 12, "effDate": "2022-05-12" } ] } }
返回示例
{ "recordId": 10, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "已批核记录的<员工>无法更改(empir56info.empId)", "msgCode": "ch01_hklaw_empIR56Info_100002" }, { "msgDetail": "存在无效数据(empir56info.empId)", "msgCode": "core_143009" } ], "status": false }
# 删除员工 IR56 相关资料
# 接口描述
用于删除指定 ID 的员工 IR56 相关资料单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/delete/empIR56Info 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:empIR56Info
id long
(Query)Y 员工 IR56 相关资料单 ID,可参考获取员工 IR56 相关资料单据列表返回的 ID 请求示例
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/empIR56Info"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("empIR56Info"); 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 }
# 薪资调整
# 获取薪资调整单据列表
# 接口描述
用于获取薪资调整单据列表
# 接口调用说明
请求说明
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:salAdj
......)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("salAdj"); 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": "salAdj", "size": 8, "stSearchDisplay": "薪资调整", "values": [ { "code": "AA", "desc": "AA", "adjType": "annualPayInc", "status": "Y", "iRev": 1, "lastModifyDate": "2020-12-03 12:46:34", "salAdj.lastModifyUid.simpleUser.desc__lang": "admin-SC", "id": 14, "st_desc": "AA", "st_id": 14, "st_code": "AA" }, {......} ] }
# 新增薪资调整
# 接口描述
用于新增薪资调整记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/salAdj 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:salAdj
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/salAdj"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("salAdj"); 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 格式如下:
{ "saladj": { "values": [ { "code": "test001", "desc": "description", "pic": 71010 } ] }, "saladjt": { "values": [ { "empId": 49 } ] } }
返回示例
{ "recordId": 16, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "薪酬调整说明不能重复使用,请更正。", "msgCode": "ch01_payscale_salAdj_100002" }, { "msgDetail": "编号重复(saladj.code)", "msgCode": "core_101903" } ], "status": false }
# 读取薪资调整
# 接口描述
根据 ID 读取薪资调整记录详情
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/read/salAdj 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:salAdj
id long
(Query)Y 薪资调整单 ID,可参考获取薪资调整单据列表返回的 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/salAdj"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("salAdj"); 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": { "saladjt": [ { "salPt": 6, "empId": 10197, "aiSusPeriodFrom": -2209017600000, "totalAllowAmt": 0, "minPt": 5, "amt": 0.01, "iRev": 1, "itemNo": " 1", "salAmt": 0, "oneOffSalary": 0, "rank": 1, "id": 11, "incPercent": 100, "hId": 15, "totalSalaryAmt": 0, "maxPt": 14, "barPt": -1, "newSalAmt": 0, "oneOffAllow": 0, "increDay": 0, "updateByIncDate": false, "aiSusPeriodTo": -2209017600000, "increYear": 0, "omitPt": "12.0,13.0", "payScale": 2, "newPt": 9, "incExtPt": 3, "remarks": "", "increMth": 0 } ], "saladj": [ {......} ] }, "messages": [], "status": true }
{ "data": {}, "messages": [ { "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 保存薪资调整
# 接口描述
用于保存薪资调整单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/salAdj 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:salAdj
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/salAdj"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("salAdj"); 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 格式如下:
{ "saladj": { "values": [ { "id": 16, "code": "test001", "desc": "description", "adjType": "sal", "effDate": "2022-05-11" } ] } }
返回示例
{ "recordId": 16, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "下拉框的值设置不正确,不在可选项中(saladj.adjType)", "msgCode": "core_143008" } ], "status": false }
# 删除薪资调整
# 接口描述
用于删除指定 ID 的薪资调整单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/delete/salAdj 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:salAdj
id long
(Query)Y 薪资调整单 ID,可参考获取薪资调整单据列表返回的 ID 请求示例
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/salAdj"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("salAdj"); 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 }
# 薪资计算
# 获取薪资计算单据列表
# 接口描述
用于获取薪资计算单据列表
# 接口调用说明
请求说明
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:payCalcSet
......)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("payCalcSet"); 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": "payCalcSet", "size": 10, "stSearchDisplay": "薪资计算", "values": [ { "code": "1000_201812-02", "desc": "1000_201812", "filingYear": 2019, "filingMth": 1, "payCalcStatus": "calcConfirm", "payCalcSet.pic.employee.code": "SZ0001", "status": "Y", "iRev": 28, "lastModifyDate": "2022-01-06 12:12:09", "payCalcSet.lastModifyUid.simpleUser.desc__lang": "admin-SC", "id": 290, "st_desc": "1000_201812", "st_id": 290, "st_code": "1000_201812-02" }, {......} ] }
# 新增薪资计算
# 接口描述
用于新增薪资计算记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/payCalcSet 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:payCalcSet
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/payCalcSet"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("payCalcSet"); 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 格式如下:
{ "paycalcset": { "values": [ { "code": "test001", "desc": "description", "payPeriodStart": "2022-05-01", "payPeriodEnd": "2022-05-31", "attPeriodStart": "2022-05-01", "attPeriodEnd": "2022-05-31", "filingYear": 2022, "pic": 49, "cur": 1 } ] } }
返回示例
{ "recordId": 525, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "编号重复(paycalcset.code)", "msgCode": "core_101903" } ], "status": false }
# 读取薪资计算
# 接口描述
根据 ID 读取薪资计算记录详情
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/read/payCalcSet 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:payCalcSet
id long
(Query)Y 薪资计算单 ID,可参考获取薪资计算单据列表返回的 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/payCalcSet"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("payCalcSet"); 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": { "paycalcsett": [ { "empId": 14979, "hId": 524, "payCalcRemark": "", "paySlipRemark": "", "iRev": 2, "itemNo": " 1", "dept": 2255, "payrollFormula": 0, "beId": 0, "insur": 0, "salaryTax": 0, "finalPay": false, "id": 94705, "position": 48, "isCalc": false }, {......} ], "paycalcset": [ {......} ], "paycalcsetemphistinfo": [ { "empId": 14979, "mpfAdjustedDate": -2209017600000, "hId": 524, "mpfTrusteeId": 0, "deptId": 2255, "iRev": 2, "itemNo": "", "mpfTypeId": 0, "mpfAdjustedBy": 0, "beId": 2028, "memberNo": "", "positionId": 48, "mpfFirstDate": -2209017600000, "mpfEffDate": -2209017600000, "mpfAdjusted": false, "id": 108583 }, {......} ] }, "messages": [], "status": true }
{ "data": {}, "messages": [ { "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 保存薪资计算
# 接口描述
用于保存薪资计算单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/payCalcSet 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:payCalcSet
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/payCalcSet"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("payCalcSet"); 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 格式如下:
{ "paycalcset": { "values": [ { "id": 525, "code": "test001", "desc": "description", "filingYear": "year", "calcDate": "2022-05-11" } ] }, "paycalcsett": { "values": [ { "empId": 49 } ] } }
返回示例
{ "recordId": 525, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "错误的数字格式(paycalcset.filingYear)", "msgCode": "core_143006" }, { "msgDetail": "必填项为空(paycalcset.filingYear)", "msgCode": "core_101905" } ], "status": false }
# 删除薪资计算
# 接口描述
用于删除指定 ID 的薪资计算单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/delete/payCalcSet 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:payCalcSet
id long
(Query)Y 薪资计算单 ID,可参考获取薪资计算单据列表返回的 ID 请求示例
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/payCalcSet"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("payCalcSet"); 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 }
# 工资积欠
# 获取工资积欠单据列表
# 接口描述
用于获取工资积欠单据列表
# 接口调用说明
请求说明
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:backPay
......)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("backPay"); 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": "backPay", "size": 10, "stSearchDisplay": "工资积欠", "values": [ { "code": "1000_201812", "desc": "1000_201812", "backPayStatus": "setConfirm", "backPay.pic.employee.code": "SZ0001", "status": "Y", "iRev": 2, "lastModifyDate": "2021-04-06 18:13:48", "backPay.lastModifyUid.simpleUser.desc__lang": "admin-SC", "id": 82, "st_desc": "1000_201812", "st_id": 82, "st_code": "1000_201812" }, {......} ] }
# 新增工资积欠
# 接口描述
用于新增工资积欠记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/backPay 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:backPay
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/backPay"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("backPay"); 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 格式如下:
{ "backpay": { "values": [ { "code": "test001", "desc": "description", "pic": 49 } ] } }
返回示例
{ "recordId": 90, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "编号重复(backpay.code)", "msgCode": "core_101903" } ], "status": false }
# 读取工资积欠
# 接口描述
根据 ID 读取工资积欠记录详情
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/read/backPay 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:backPay
id long
(Query)Y 工资积欠单 ID,可参考获取工资积欠单据列表返回的 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/backPay"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("backPay"); 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": { "backpay": [ { "attachmentNo": 0, "lastModifyUid": 4, "code": "test001", "useAccess": false, "backPayStatus": "open", "iRev": 1, "sysJson": "", "pic": 49, "viewCode": "backPay", "notPublishToEssp": false, "beId": 0, "isConfirm": false, "paymentId": 0, "printCount": 0, "useAccessBl": false, "id": 90, "statusModifyDate": 1652260630000, "lastModifyDate": 1652260630000, "createUid": 4, "createDate": 1652260630000, "lastApproveUid": 4, "useAccessWl": false, "paymentDate": -2209017600000, "useAccessAutoCalc": false, "remarks": "", "status": "Y", "desc": "description" } ] }, "messages": [], "status": true }
{ "data": {}, "messages": [ { "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 保存工资积欠
# 接口描述
用于保存工资积欠单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/backPay 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:backPay
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/backPay"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("backPay"); 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 格式如下:
{ "backpay": { "values": [ { "id": 90 } ] }, "backpayt": { "values": [ { "payCalcSetId": 478 } ] } }
返回示例
{ "recordId": 90, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "存在无效数据(backpayt.payCalcSetId.1)", "msgCode": "core_143009" } ], "status": false }
# 删除工资积欠
# 接口描述
用于删除指定 ID 的工资积欠单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/delete/backPay 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:backPay
id long
(Query)Y 工资积欠单 ID,可参考获取工资积欠单据列表返回的 ID 请求示例
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/backPay"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("backPay"); 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 }
# 付款单
# 获取付款单据列表
# 接口描述
用于获取付款单据列表
# 接口调用说明
请求说明
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:payment
......)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("payment"); 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": "payment", "size": 10, "stSearchDisplay": "付款单", "values": [ { "code": "1", "desc": "2", "paymentDate": "2018-06-01", "paymentStatus": "transfer", "payment.pic.employee.code": "CTEST01", "status": "Y", "iRev": 20, "lastModifyDate": "2019-06-06 17:12:26", "payment.lastModifyUid.simpleUser.desc__lang": "", "id": 14, "st_desc": "2", "st_id": 14, "st_code": "1" }, {......} ] }
# 新增付款单
# 接口描述
用于新增付款单记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/payment 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:payment
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/payment"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("payment"); 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 格式如下:
{ "payment": { "values": [ { "code": "test001", "desc": "description", "paymentDate": "2022-05-11", "pic": 49 } ] } }
返回示例
{ "recordId": 115, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "编号重复(payment.code)", "msgCode": "core_101903" } ], "status": false }
# 读取付款单
# 接口描述
根据 ID 读取付款单记录详情
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/read/payment 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:payment
id long
(Query)Y 付款单 ID,可参考获取付款单据列表返回的 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/payment"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("payment"); 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": { "paymentemp": [ { "empId": 14657, "cur": 6, "hId": 100, "payCalcSetId": 447, "backPayId": 0, "amt": 89000, "iRev": 5, "itemNo": "", "bankAcc": "SZ0001", "beId": 5164, "reference": "", "bank": 2, "payMethod": "autopay", "tranDate": -2209017600000, "id": 1524, "remarks": "" }, { "empId": 14649, "cur": 6, "hId": 100, "payCalcSetId": 447, "backPayId": 0, "amt": 89000, "iRev": 5, "itemNo": "", "bankAcc": "SZ0002", "beId": 2028, "reference": "", "bank": 2, "payMethod": "autopay", "tranDate": -2209017600000, "id": 1525, "remarks": "" } ], "paymentt": [ { "hId": 100, "payCalcSetId": 447, "backPayId": 0, "iRev": 5, "id": 137, "itemNo": " 1", "payCode": "MLSZ0002-2010", "remarks": "", "backpay": false } ], "payment": [ {......} ] }, "messages": [], "status": true }
{ "data": {}, "messages": [ { "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 保存付款单
# 接口描述
用于保存付款单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/payment 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:payment
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/payment"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("payment"); 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 格式如下:
{ "payment": { "values": [ { "id": 100 } ] }, "paymentt": { "values": [ { "payCode": 1 } ] } }
返回示例
{ "recordId": 100, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "空值异常", "msgCode": "core_130001" } ], "status": false }
# 删除付款单
# 接口描述
用于删除指定 ID 的付款单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/delete/payment 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:payment
id long
(Query)Y 付款单 ID,可参考获取付款单据列表返回的 ID 请求示例
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/payment"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("payment"); 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 }
# 保险资料
# 获取保险资料单据列表
# 接口描述
用于获取保险资料单据列表
# 接口调用说明
请求说明
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:insur
......)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("insur"); 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": "insur", "size": 10, "stSearchDisplay": "保险资料", "values": [ { "code": "INSUR00001", "desc__lang": "北京 - 本地城镇", "status": "Y", "iRev": 2, "lastModifyDate": "2017-06-15 15:55:12", "insur.lastModifyUid.simpleUser.desc__lang": "", "id": 3, "st_desc": "北京 - 本地城镇", "st_id": 3, "st_code": "INSUR00001" }, {......} ] }
# 新增保险资料
# 接口描述
用于新增保险资料记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/insur 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:insur
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/insur"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("insur"); 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 格式如下:
{ "insur": { "values": [ { "code": "test001", "desc": "保险资料" } ] } }
返回示例
{ "recordId": 135, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "<保险地区> + <保险身份> +<生效日期>不能重复使用, 请更正(insur.insurDistrict,insur.insurIdentity,insur.effDate)", "msgCode": "ch01_insur_insur_100002" }, { "msgDetail": "编号重复(insur.code)", "msgCode": "core_101903" } ], "status": false }
# 读取保险资料
# 接口描述
根据 ID 读取保险资料记录详情
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/read/insur 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:insur
id long
(Query)Y 保险资料单 ID,可参考获取保险资料单据列表返回的 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/insur"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("insur"); 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": { "insur": [ { "attachmentNo": 0, "lastModifyUid": 4, "code": "test001", "useAccess": false, "expiredDate": -2209017600000, "iRev": 1, "sysJson": "", "viewCode": "insur", "beId": 0, "effDate": -2209017600000, "expired": false, "insurDistrict": 0, "printCount": 0, "useAccessBl": false, "id": 135, "statusModifyDate": 1652263652000, "locked": false, "desc_en": "保险资料", "lastModifyDate": 1652263652000, "createUid": 4, "createDate": 1652263652000, "desc_zh-CN": "", "lastApproveUid": 4, "udflevel": "", "expiredUid": 0, "useAccessWl": false, "insurIdentity": 0, "i18nField": "{\"desc_en\": \"保险资料\"}", "desc_zh-TW": "", "useAccessAutoCalc": false, "status": "Y", "desc": "保险资料" } ] }, "messages": [], "status": true }
{ "data": {}, "messages": [ { "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 保存保险资料
# 接口描述
用于保存保险资料单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/insur 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:insur
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/insur"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("insur"); 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 格式如下:
{ "insur": { "values": [ { "id": 135, "effDate": "2022-05-11", "insurDistrict": 2 } ] }, "insurt": { "values": [ { "insurAcc": 41 } ] } }
返回示例
{ "recordId": 135, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "存在无效数据(insur.insurDistrict)", "msgCode": "core_143009" } ], "status": false }
# 删除保险资料
# 接口描述
用于删除指定 ID 的保险资料单
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/delete/insur 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:insur
id long
(Query)Y 保险资料单 ID,可参考获取保险资料单据列表返回的 ID 请求示例
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/root/api/delete/insur"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("insur"); 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": [ { "E_A_code": "SZ0003", "aiM18ReservedCol_dataIndex": 1, "VP_C_code": "F1", "VP_A_effDate": "2017/01/01", "VP_C_id": "3", "MAIN_latest": "否", "E_A_id": "14668", "MAIN_isCurEffect": "否" } ] }
# 员工变动科目列表
# 接口描述
用于按照指定 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": [ { "E_A_code": "BTEST001", "aiM18ReservedCol_dataIndex": 1, "VP_A_effDate": "1901/01/01", "VP_C_code": "VP001", "VP_B_sym": "A货币", "VP_A_amount": "677.0000", "VP_C_id": "1", "E_A_id": "10127" } ] }
# 薪资统计科目报告
# 接口描述
用于按照指定 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": [ { "E_A_code": "CTESTHK01", "PCR_C_id": "478", "PCR_C_code": "CTESTHK2022", "MAIN_cur": "HKD", "aiM18ReservedCol_dataIndex": 1, "E_A_id": "72474", "MAIN_amt": "29,400.00" } ] }
# 员工薪资参数列表
# 接口描述
用于按照指定 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": [ { "T3_B_code": "PAYPAR2", "T3_B_id": "1", "aiM18ReservedCol_dataIndex": 1, "T1_A_id": "70363", "T3_A_effDate": "2017/03/01", "MAIN_isCurEffect": "否", "T1_A_code": "17080801" } ] }
# 薪资分析报告
# 接口描述
用于按照指定 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": [ { "E_A_code": "SZ0001", "MAIN_PAYROLLX_cur": "HKD", "P_C_code": "MLT001", "aiM18ReservedCol_dataIndex": 1, "P_C_filingYear": "2017", "P_C_id": "2", "P_C_filingMth": "7月", "MAIN_PAYROLLX_desc": "", "E_A_id": "14657", "MAIN_PAYROLLX_amt": "35,000.00", "MAIN_PAYROLLX_repCurAmt": "0.00" } ] }
# 最后薪资报告
# 接口描述
用于按照指定 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_amt_cur": "0.00", "aiM18ReservedCol_dataIndex": 1, "MAIN_calcDate": "2018/03/22" } ] }
# 员工成本摊分设定报告
# 接口描述
用于按照指定 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_effDate": "2017/01/01", "MAIN_residue": "是", "aiM18ReservedCol_dataIndex": 1, "MAIN_absCeil": "0.00", "MAIN_udfresult29": "0.00", "T1_A_id": "10127", "T2_A_id": "0", "T1_A_code": "BTEST001", "T2_A_code": "" } ] }
# 薪资摊分报告
# 接口描述
用于按照指定 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