# 培训&资助管理
# 培训记录
# 获取培训记录列表
# 接口描述
用于获取培训记录列表
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/search/search HTTP 请求方式 GET 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y M18 授权应用列表中的 Client ID stSearch String
(Query)Y Lookup Type. 可在 UDF Lookup 中找到。
(Eg:training
......)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("training"); 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": "training", "size": 1, "stSearchDisplay": "培训记录", "values": [ { "training.empId.employee.code": "MAC08", "training.empId.employee.desc": "杨兰", "training.trainCourse.trainCourse.desc": "入职培训", "refDate": "2018-06-04", "training.trainResult.trainResult.desc": "", "trainHrs": 0, "code": "TRA2022021700002", "status": "N", "lastModifyDate": "2022-02-17 16:05:26", "training.lastModifyUid.simpleUser.desc": "杨兰", "id": 88, "st_desc": "TRA2022021700002 - 杨兰", "st_id": 88, "st_code": "TRA2022021700002" } ] }
# 新增培训记录
# 接口描述
用于新增培训记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/training HTTP 请求方式 PUT 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y M18 授权应用列表中的 Client ID menuCode String
(Query)Y 可在 Data Dictionary 中找到
Eg:training
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/training"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("training"); 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 格式如下:
{ "training": { "values": [ { "empId": 3461, "refDate": "2018-06-04", "trainCourse":33 } ] } }
返回示例
{ "recordId": 89, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "必填项为空(training.empId)", "msgCode": "core_101905" } ], "status": false }
# 读取培训记录
# 接口描述
根据 ID 读取培训记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/read/training HTTP 请求方式 GET 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y M18 授权应用列表中的 Client ID menuCode String
(Query)Y 可在 Data Dictionary 中找到
Eg:training
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/training"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("training"); 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": { "training": [ { "attachmentNo": 0, "empId": 4730, "lastModifyUid": 4, "code": "TRA2022021700002", "intorext": "int", "skillType": 0, "useAccess": false, "trainType": 0, "udfjerry15": false, "trainInstitute": 0, "udfjeery05": "", "iRev": 2, "exemption": false, "sysJson": "{\"autoGenCode\":{\"snId\":617,\"sn\":\"2\"}}", "viewCode": "training", "trainHrs": 0, "beId": 0, "trainer": 0, "printCount": 0, "useAccessBl": false, "id": 88, "statusModifyDate": 1645085126000, "lastModifyDate": 1653377263000, "createUid": 3991, "createDate": 1645085126000, "lastApproveUid": 0, "useAccessWl": false, "exemptionBy": 0, "udfsub": 0, "udfclaimsession": 0, "udfclaimamount": 0, "trainCourse": 27, "trainResult": 0, "refDate": 1662739200000, "useAccessAutoCalc": false, "remarks": "", "status": "N" } ] }, "messages": [], "status": true }
{ "data": {}, "messages": [ { "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 保存培训记录
# 接口描述
用于保存培训记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/training HTTP 请求方式 PUT 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y M18 授权应用列表中的 Client ID menuCode String
(Query)Y 可在 Data Dictionary 中找到
Eg:training
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/training"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("training"); 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 格式如下:
{ "training": { "values": [ { "id": 88, "empId":36, "refDate":"2022-09-10" } ] } }
返回示例
{ "recordId": 88, "messages": [], "status": true }
# 删除培训记录
# 接口描述
用于删除指定 ID 的培训记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/delete/training HTTP 请求方式 DELETE 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y M18 授权应用列表中的 Client ID menuCode String
(Query)Y 可在 Data Dictionary 中找到
Eg:training
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/training"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("training"); 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 M18 授权应用列表中的 Client ID stSearch String
(Query)Y Lookup Type. 可在 UDF Lookup 中找到。
(Eg:sponsorship
......)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("sponsorship"); 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": "sponsorship", "size": 1, "stSearchDisplay": "资助", "values": [ { "sponsorship.empId.employee.code": "ANDY1", "sponsorship.empId.employee.desc": "ANDY1繁", "refDate": "2021-02-22", "sponsorship.sponsorType.sponsorType.desc": "公司培训费用", "paymentDate": "2021-02-22", "amount": 1000, "undertaking": true, "undertakeExpDate": "2022-03-03", "code": "ANDY1", "status": "Y", "lastModifyDate": "2021-09-18 09:33:51", "sponsorship.lastModifyUid.simpleUser.desc": "林文语(人事经理)", "id": 70, "st_desc": "ANDY1", "st_id": 70, "st_code": "ANDY1" } ] }
# 新增资助
# 接口描述
用于新增资助记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/sponsorship HTTP 请求方式 PUT 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y M18 授权应用列表中的 Client ID menuCode String
(Query)Y 可在 Data Dictionary 中找到
Eg:sponsorship
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/sponsorship"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("sponsorship"); 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 格式如下:
{ "sponsorship": { "values": [ { "empId":36, "sponsorType":32, "refDate":"2022-09-10", "cur":10 } ] } }
返回示例
{ "recordId": 73, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "必填项为空(sponsorship.cur.1)", "msgCode": "core_101905" } ], "status": false }
# 读取资助
# 接口描述
根据 ID 读取资助记录详情
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/read/sponsorshiip HTTP 请求方式 GET 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y M18 授权应用列表中的 Client ID menuCode String
(Query)Y 可在 Data Dictionary 中找到
Eg:sponsorship
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/sponsorship"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("sponsorship"); 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": { "sponsorship_white": [ { "hId": 68, "roleId": 0, "iRev": 3, "id": 43, "userId": 4 } ], "sponsorship": [ { "attachmentNo": 0, "empId": 16323, "cur": 10, "lastModifyUid": 4, "code": "SS20110014", "useAccess": true, "udfjeery05": false, "iRev": 3, "sysJson": "{\"autoGenCode\":{\"snId\":132,\"sn\":\"14\"}}", "viewCode": "sponsorship", "beId": 0, "printCount": 0, "useAccessBl": false, "id": 68, "statusModifyDate": 1606465659000, "lastModifyDate": 1606465659000, "createUid": 4, "createDate": 1606465658000, "amount": 544, "lastApproveUid": 4, "sponsorType": 34, "undertakeExpDate": -2209017600000, "udfjeery11": "", "useAccessWl": true, "udfjeery12": 0, "undertaking": false, "refDate": 1606406400000, "paymentDate": -2209017600000, "useAccessAutoCalc": true, "remarks": "", "status": "Y" } ], "sponsorshipcoa": [ { "iRev": 3, "itemNo": " 1", "percent": 100, "udfcost38": 0, "udfcost37": 0, "udfcost39": 0, "withCeiling": false, "udfcost30": 0, "udfcost32": 0, "id": 20, "udfcost12": 0, "udfcost11": 0, "udfcost14": 0, "udfcost36": 0, "udfcost13": 0, "udfcost35": 0, "hId": 68, "dept": 0, "residue": true, "udfcost27": 0, "udfcost26": 0, "udfcost29": 0, "udfcost28": 0, "udfcost41": 0, "udfcost40": 0, "udfcost21": 0, "udfcost43": 0, "position": 0, "absCeil": 0, "udfcost23": 0, "udfcost22": 0, "udfcost44": 0, "fixAmt": 0, "udfcost25": 34, "udfcost24": 0 } ] }, "messages": [], "status": true }
{ "data": {}, "messages": [ { "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 保存资助
# 接口描述
用于保存资助
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/sponsorship HTTP 请求方式 PUT 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y M18 授权应用列表中的 Client ID menuCode String
(Query)Y 可在 Data Dictionary 中找到
Eg:sponsorship
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/sponsorship"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("sponsorship"); 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 格式如下:
{ "sponsorship": { "values": [ { "id":73, "empId":36, "sponsorType":32, "refDate":"2022-09-10", "cur":10 } ] } }
返回示例
{ "recordId": 73, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 删除资助
# 接口描述
用于删除指定 ID 的资助记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/delete/sponsorship HTTP 请求方式 DELETE 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y M18 授权应用列表中的 Client ID menuCode String
(Query)Y 可在 Data Dictionary 中找到
Eg:sponsorship
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/sponsorship"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("sponsorship"); 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 M18 授权应用列表中的 Client ID stSearch String
(Query)Y Lookup Type. 可在 UDF Lookup 中找到。
(Eg:trainadvcourseapp
......)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("trainadvcourseapp"); 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": "trainadvcourseapp", "size": 1, "stSearchDisplay": "课程申请", "values": [ { "code": "TRA0001", "trainadvcourseapp.empId.employee.code": "809", "trainadvcourseapp.empId.employee.desc__lang": "test001", "trainadvcourseapp.empId.employee.dept.dept.desc__lang": "admin", "trainadvcourseapp.empId.employee.position.position.desc__lang": "测试001", "status": "Y", "iRev": 5, "lastModifyDate": "2021-05-17 11:00:34", "trainadvcourseapp.lastModifyUid.simpleUser.desc__lang": "admin", "id": 1, "st_desc": "TRA0001", "st_id": 1, "st_code": "TRA0001" } ] }
# 新增课程申请记录
# 接口描述
用于新增课程申请记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/trainadvcourseapp HTTP 请求方式 PUT 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y M18 授权应用列表中的 Client ID menuCode String
(Query)Y 可在 Data Dictionary 中找到
Eg:trainadvcourseapp
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/trainadvcourseapp"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("trainadvcourseapp"); 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 格式如下:
{ "trainadvcourseapp": { "values": [ { "empId":36, "course":35, "courseDesc":"fqCS02", "trainDateFrom":"2021-05-01", "trainDateTo":"2021-05-10", "courseType":3 } ] } }
返回示例
{ "recordId": 59, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "必填项为空(trainadvcourseapp.course.1)", "msgCode": "ch01_trainadv_trainadvcourseapp_100001" }, { "msgDetail": "必填项为空(trainadvcourseapp.courseDesc,trainadvcourseapp.trainDateFrom,trainadvcourseapp.trainDateTo)", "msgCode": "core_101905" } ], "status": false }
# 读取课程申请记录
# 接口描述
根据 ID 读取课程申请记录详情
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/read/trainadvcourseapp HTTP 请求方式 GET 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y M18 授权应用列表中的 Client ID menuCode String
(Query)Y 可在 Data Dictionary 中找到
Eg:trainadvcourseapp
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/trainadvcourseapp"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("trainadvcourseapp"); 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": { "trainadvcourseapp": [ { "cancel": false, "skipSponsorPlanMaxCheck": 0, "courseType": 0, "lastModifyUid": 12262, "udfLocale": "", "useAccess": false, "trainOrganizer_zh-CN": "", "udfLocale_zh-TW": "", "cert": false, "trainObjective_zh-CN": "", "sysJson": "{\"autoGenCode\":{\"snId\":236,\"sn\":\"62\"}}", "viewCode": "trainAdvCourseApp", "trainVenue_pl": "", "beId": 0, "extSponsor": 0, "netAmt": 0, "trainVenue_zh-CN": "", "useAccessBl": false, "courseDesc_udfcn": "", "passAtt": "nill", "attRate": 0, "id": 58, "reimbursement": false, "lastModifyDate": 1651047708000, "createUid": 12262, "sponsorName_zh-CN": "", "courseDesc": "etertery", "lateApp": true, "passExam": "nill", "lastApproveUid": 4, "nomByManag": false, "trainOrganizer_pl": "", "otherAmt": 0, "totalSponsorAmt": 1, "udfLocale_zh-CN": "", "courseDesc_zh-TW": "", "totalAmt": 0, "i18nField": "{\"courseDesc_en\": \"etertery\"}", "trainObjective_pl": "", "receipt": false, "trainObjective": "", "sponsorName_pl": "", "courseSponsorType": 0, "status": "Y", "origCourseFee": 0, "attachmentNo": 0, "empId": 13688, "discountAmt": 0, "code": "TRA0062", "covering": 0, "trainOrganizer_udfcn": "", "trainOrganizer": "", "sponsorName": "", "courseDesc_zh-CN": "", "trainObjective_en": "", "iRev": 5, "appDate": 1646755200000, "courseDesc_pl": "", "trainFee": 0, "trainDateTo": 1646150400000, "printCount": 0, "trainVenue_en": "", "course": 0, "sponsorName_zh-TW": "", "trainObjective_udfcn": "", "udfLocale_en": "", "statusModifyDate": 1651047708000, "cancelReason": "", "overApp": false, "createDate": 1646825884000, "sponsorName_udfcn": "", "trainintorext": "ext", "trainObjective_zh-TW": "", "trainVenue": "", "passAttRate": 0, "udfLocale_pl": "", "sponsorName_en": "", "undertakeExpDate": -2209017600000, "airTicket": 0, "transport": 0, "daysOfLeave": 0, "trainVenue_zh-TW": "", "sponsorPlan": 2, "useAccessWl": false, "fundSource": 0, "trainVenue_udfcn": "", "undertaking": false, "trainDateFrom": 1646236800000, "accommodation": 0, "courseDesc_en": "etertery", "useAccessAutoCalc": false, "trainOrganizer_zh-TW": "", "trainOrganizer_en": "", "udfLocale_udfcn": "" } ] }, "messages": [], "status": true }
{ "data": {}, "messages": [ { "msgDetail": "找不到相关记录,记录可能已被删除或你没有访问权限", "msgCode": "core_141019" } ], "status": false }
# 保存课程申请记录
# 接口描述
用于保存课程申请记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/save/trainadvcourseapp HTTP 请求方式 PUT 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y M18 授权应用列表中的 Client ID menuCode String
(Query)Y 可在 Data Dictionary 中找到
Eg:trainadvcourseapp
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/trainadvcourseapp"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("trainadvcourseapp"); 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 格式如下:
{ "trainadvcourseapp": { "values": [ { "id":59, "empId":36, "course":35, "courseDesc":"fqCS02", "trainDateFrom":"2021-05-01", "trainDateTo":"2021-05-10", "courseType":3, "passAtt":"nil", "passExam":"nil" } ] } }
返回示例
{ "recordId": 59, "messages": [], "status": true }
{ "recordId": 0, "messages": [ { "msgDetail": "下拉框的值设置不正确,不在可选项中(trainadvcourseapp.passAtt,trainadvcourseapp.passExam)", "msgCode": "core_143008" }, { "msgDetail": "同一课程每名员工只能有一张课程申请记录,不能保存", "msgCode": "ch01_trainadv_trainadvcourseapp_100002" } ], "status": false }
# 删除课程申请记录
# 接口描述
用于删除指定 ID 的课程申请记录
# 接口调用说明
请求说明
URL http://[server]/jsf/rfws/root/api/delete/trainadvcourseapp HTTP 请求方式 DELETE 编码类型 UTF-8 URL 参数
参数 类型 必填 说明 authorization String
(Header)Y 通过 OAuth 获取的 Access Token client_id String
(Header)Y M18 授权应用列表中的 Client ID menuCode String
(Query)Y 可在 Data Dictionary 中找到
Eg:trainadvcourseapp
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/trainadvcourseapp"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&menuCode=").append("trainadvcourseapp"); 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 M18 授权应用列表中的 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(3); HttpGet get = new HttpGet(url + "?" + paramStrBuilder.toString()); get.addHeader("authorization", access_token); get.addHeader("client_id", ClientID); res = client.execute(get); if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity())); System.out.println(json); } get.releaseConnection(); } catch (Exception e) { e.printStackTrace(); } finally { try { if (res != null) { res.close(); } if (client != null) { client.close(); } } catch (Exception ex) { ex.printStackTrace(); } }
返回示例
{ "size": 1, "rows": [ { "T_A_refDate": "2022-01-19", "T_A_empId": "4730", "T_A_remarks": "<p>a</p>", "T_A_skillType_desc__lang": "通用技能", "M18ReservedCol_dataIndex": 1, "T_A_empId_code": "MAC08", "T_A_trainInstitute_desc__lang": "", "T_A_trainer_desc__lang": "", "T_A_code": "TR21020026", "T_A_trainResult_desc__lang": "良好", "T_A_id": "46", "T_A_empId_desc__lang": "杨兰", "T_A_trainCourse_desc__lang": "入职培训", "T_A_intorext": "内部培训", "T_A_exemptionBy_desc__lang": "", "T_A_trainType_desc__lang": "集团总部培训", "T_A_exemption": "否" } ] }
# 培训需求报告
# 接口描述
用于按照指定 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 M18 授权应用列表中的 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(1); HttpGet get = new HttpGet(url + "?" + paramStrBuilder.toString()); get.addHeader("authorization", access_token); get.addHeader("client_id", ClientID); res = client.execute(get); if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity())); System.out.println(json); } get.releaseConnection(); } catch (Exception e) { e.printStackTrace(); } finally { try { if (res != null) { res.close(); } if (client != null) { client.close(); } } catch (Exception ex) { ex.printStackTrace(); } }
返回示例
{ "size": 1, "rows": [ { "PT_A_course_code": "a", "PT_A_trainUnit": "年", "PT_A_course": "2", "M18ReservedCol_dataIndex": 1, "PT_A_dateTo": "2023/05/31", "PT_A_trainExp": "1", "PT_A_dateFrom": "2019/01/01", "PT_A_itemNo": "", "MAIN_trainNeed": "未完成", "PT_A_course_desc__lang": "2" } ] }
# 员工资助报告
# 接口描述
用于按照指定 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 M18 授权应用列表中的 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(1); HttpGet get = new HttpGet(url + "?" + paramStrBuilder.toString()); get.addHeader("authorization", access_token); get.addHeader("client_id", ClientID); res = client.execute(get); if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity())); System.out.println(json); } get.releaseConnection(); } catch (Exception e) { e.printStackTrace(); } finally { try { if (res != null) { res.close(); } if (client != null) { client.close(); } } catch (Exception ex) { ex.printStackTrace(); } }
返回示例
{ "size": 1, "rows": [ { "T_A_cur_desc__lang": "RMB", "T_A_sponsorType_desc__lang": "不产生变动科目", "T_A_refDate": "2022/05/06", "T_A_empId": "70925", "M18ReservedCol_dataIndex": 1, "T_A_sponsorType": "2", "T_A_empId_code": "JIM002", "T_A_paymentDate": "", "T_A_sponsorType_code": "NOVAR", "T_A_code": "181018-TEST", "T_A_id": "9", "T_A_undertaking": "是", "T_A_empId_desc__lang": "JIM TEST-SC", "T_A_undertakeExpDate": "2020/12/31" } ] }
# 员工资助摊分报告
# 接口描述
用于按照指定 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 M18 授权应用列表中的 Client ID formatId long
(Query)Y 通过 EBI 接口获得 offset int
(Query)N 返回结果的开始行 rows int
(Query)N 返回结果行数 请求示例
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&formatId=").append(formatId); paramStrBuilder.append("&offset=").append(0); paramStrBuilder.append("&rows=").append(10); HttpGet get = new HttpGet(url + "?" + paramStrBuilder.toString()); get.addHeader("authorization", access_token); get.addHeader("client_id", ClientID); res = client.execute(get); if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity())); System.out.println(json); } get.releaseConnection(); } catch (Exception e) { e.printStackTrace(); } finally { try { if (res != null) { res.close(); } if (client != null) { client.close(); } } catch (Exception ex) { ex.printStackTrace(); } }
返回示例
{ "size": 1, "rows": [ { "S_A_paymentDate": "2022/06/18", "MAIN_residue": "是", "M18ReservedCol_dataIndex": 1, "MAIN_amount": "250.0", "MAIN_posCode": "AP", "S_A_code": "a", "MAIN_deptCode": "ACCT", "MAIN_udfcost9": "", "S_A_undertaking": "是", "MAIN_udfcost2": "", "MAIN_udfcost1": "", "MAIN_udfcost1Desc": "", "S_A_id": "1" } ] }
# 课程申请报告
# 接口描述
用于按照指定 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 M18 授权应用列表中的 Client ID formatId long
(Query)Y 通过 EBI 接口获得 offset int
(Query)N 返回结果的开始行 rows int
(Query)N 返回结果行数 请求示例
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&formatId=").append(formatId); paramStrBuilder.append("&offset=").append(0); paramStrBuilder.append("&rows=").append(10); HttpGet get = new HttpGet(url + "?" + paramStrBuilder.toString()); get.addHeader("authorization", access_token); get.addHeader("client_id", ClientID); res = client.execute(get); if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity())); System.out.println(json); } get.releaseConnection(); } catch (Exception e) { e.printStackTrace(); } finally { try { if (res != null) { res.close(); } if (client != null) { client.close(); } } catch (Exception ex) { ex.printStackTrace(); } }
返回示例
{ "size": 1, "rows": [ { "C_TC_id": "4", "C_TC_code": "C1", "C_TC_trainAttRate": "80.00", "C_TC_trainDateTo": "2021/05/10", "M18ReservedCol_dataIndex": 1, "C_TC_trainintorext": "内部培训", "C_TC_trainObjective": "C1", "CT_TCT_code": "A", "CT_TCT_id": "1", "C_TC_trainVacancy": "1", "C_TC_trainDateFrom": "2021/05/01", "C_TC_trainVenue": "GZ" } ] }
# 员工资助与进修假期结余
# 接口描述
用于按照指定 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 M18 授权应用列表中的 Client ID formatId long
(Query)Y 通过 EBI 接口获得 offset int
(Query)N 返回结果的开始行 rows int
(Query)N 返回结果行数 请求示例
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&formatId=").append(formatId); paramStrBuilder.append("&offset=").append(0); paramStrBuilder.append("&rows=").append(10); HttpGet get = new HttpGet(url + "?" + paramStrBuilder.toString()); get.addHeader("authorization", access_token); get.addHeader("client_id", ClientID); res = client.execute(get); if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity())); System.out.println(json); } get.releaseConnection(); } catch (Exception e) { e.printStackTrace(); } finally { try { if (res != null) { res.close(); } if (client != null) { client.close(); } } catch (Exception ex) { ex.printStackTrace(); } }
返回示例
{ "size": 1, "rows": [ { "MAIN_maxSponsorPerCycle": "5000.0", "MAIN_effDate": "2022/01/31", "MAIN_approvedDaysBal": "10.00", "MAIN_applieddSponsorBal": "5,000.00", "MAIN_maxDaysPerCycle": "10.0", "MAIN_appliedSponsor": "0.00", "MAIN_expDate": "2023/01/30", "M18ReservedCol_dataIndex": 1, "MAIN_appliedDaysBal": "10.00", "MAIN_approvedDays": "0.00", "MAIN_approvedSponsor": "0.00", "MAIN_approvedSponsorBal": "5,000.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 M18 授权应用列表中的 Client ID formatId long
(Query)Y 通过 EBI 接口获得 offset int
(Query)N 返回结果的开始行 rows int
(Query)N 返回结果行数 请求示例
CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse res = null; try { String url = "http://" + HostIP + ":" + HostPort + "/jsf/rfws/ebiWidget/loadReport"; StringBuilder paramStrBuilder = new StringBuilder(); paramStrBuilder.append("&formatId=").append(formatId); paramStrBuilder.append("&offset=").append(0); paramStrBuilder.append("&rows=").append(10); HttpGet get = new HttpGet(url + "?" + paramStrBuilder.toString()); get.addHeader("authorization", access_token); get.addHeader("client_id", ClientID); res = client.execute(get); if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { JSONObject json = JSON.parseObject(EntityUtils.toString(res.getEntity())); System.out.println(json); } get.releaseConnection(); } catch (Exception e) { e.printStackTrace(); } finally { try { if (res != null) { res.close(); } if (client != null) { client.close(); } } catch (Exception ex) { ex.printStackTrace(); } }
返回示例
{ "size": 1, "rows": [ { "C_TC_code": "MLCC001", "C_TC_trainAttRate": "80.00", "M18ReservedCol_dataIndex": 1, "C_TC_trainintorext": "内部培训", "CT_TCT_code": "M1", "CT_TCT_id": "2", "C_TC_trainVenue": "", "C_TC_id": "15", "MAIN_mandatory": "是", "CA_A_code": "SZ0001MLCC001", "C_TC_trainObjective": "", "C_TC_trainVacancy": "10", "CA_A_id": "24" } ] }