当前工伤接口处于测试状态,使用模拟接口进行开发和测试。
文件: src/main/java/thyyxxk/sizyfeeoprnsystm/service/ExecService.java
当前配置(测试状态):
// 模拟接口地址(当前使用)
private static final String WORK_INJURY_API_URL = "http://130.150.161.72:9206/thyy/api/public/injury/workinjury";
// 真实接口地址(注释掉,需要时手动切换)
// private static final String WORK_INJURY_API_URL = "http://localhost:8321/api/entry/workinjury";
切换到真实状态:
// 模拟接口地址(注释掉,需要时手动切换)
// private static final String WORK_INJURY_API_URL = "http://130.150.161.72:9206/thyy/api/public/injury/workinjury";
// 真实接口地址(当前使用)
private static final String WORK_INJURY_API_URL = "http://localhost:8321/api/entry/workinjury";
文件: src/main/java/thyyxxk/sizyfeeoprnsystm/service/SiZyFeeService.java
当前配置(测试状态):
// 模拟接口处理(当前使用)
if (result.containsKey("data") && result.getJSONObject("data").containsKey("data")) {
JSONObject innerData = result.getJSONObject("data").getJSONObject("data");
return innerData != null ? innerData.getInteger(RESULT_CODE) : null;
}
// 真实接口处理(注释掉,需要时手动切换)
// else if (result.containsKey("data")) {
// JSONObject data = result.getJSONObject("data");
// return data != null ? data.getInteger(RESULT_CODE) : null;
// }
切换到真实状态:
// 模拟接口处理(注释掉,需要时手动切换)
// if (result.containsKey("data") && result.getJSONObject("data").containsKey("data")) {
// JSONObject innerData = result.getJSONObject("data").getJSONObject("data");
// return innerData != null ? innerData.getInteger(RESULT_CODE) : null;
// }
// 真实接口处理(当前使用)
else if (result.containsKey("data")) {
JSONObject data = result.getJSONObject("data");
return data != null ? data.getInteger(RESULT_CODE) : null;
}
ExecService.java
中注释掉模拟接口URL,取消注释真实接口URLSiZyFeeService.java
中注释掉模拟接口处理逻辑,取消注释真实接口处理逻辑ExecService.java
中注释掉真实接口URL,取消注释模拟接口URLSiZyFeeService.java
中注释掉真实接口处理逻辑,取消注释模拟接口处理逻辑{
"code": 1,
"data": {
"success": true,
"code": 200,
"message": "交易成功",
"device": "江苏工伤联网接口(模拟)",
"transactionCode": "2201",
"data": {
"infcode": "0",
"inf_refmsgid": "320101202007301235414321",
"refmsg_time": "20200730123541",
"respond_time": "20200730123539",
"err_msg": "",
"warn_msg": "",
"output": {}
}
},
"message": "success"
}
{
"success": true,
"code": 200,
"message": "交易成功",
"device": "江苏工伤联网接口",
"transactionCode": "2201",
"data": {
"infcode": "0",
"inf_refmsgid": "320101202007301235414321",
"refmsg_time": "20200730123541",
"respond_time": "20200730123539",
"err_msg": "",
"warn_msg": "",
"output": {}
}
}
transformed_parameters
中的信息进行日志记录工伤接口调用成功后,会在 t_si_log
表中记录详细的调用日志,包括:
transformed_parameters
中获取 infno
、msgid
、opter
等信息executeWorkInjuryUploadFees()
方法中revokeWorkInjuryUploadFees()
方法中workInjuryPreSettlement()
方法中字段 | 来源 | 说明 |
---|---|---|
infno |
transformed_parameters.infno |
接口功能号 |
msgid |
transformed_parameters.msgid |
消息ID |
opter |
transformed_parameters.opter |
操作员ID |
insuplc_admdvs |
固定值 "" |
工伤接口不需要医保区划 |
body |
logInput.toJSONString() |
请求体 |
result |
result.toJSONString() |
响应体 |
infcode |
extractWorkInjuryResultCode(result) |
返回代码 |