|
@@ -1,5 +1,6 @@
|
|
|
package thyyxxk.webserver.service.medicalinsurance;
|
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.codec.binary.Base64;
|
|
@@ -72,7 +73,6 @@ public class ExecService {
|
|
|
signIn.put("ip", cfg.getIpAddress());
|
|
|
input.getJSONObject("input").put("signIn", signIn);
|
|
|
JSONObject result = executeTrade(input, SiFunction.SIGN_IN);
|
|
|
- log.info("医保签到:\n参数:{},\n结果:{}", input, result);
|
|
|
if (null != result && result.getInteger(RESULT_CODE) == 0) {
|
|
|
try {
|
|
|
JSONObject output = result.getJSONObject(OUTPUT);
|
|
@@ -92,8 +92,8 @@ public class ExecService {
|
|
|
signOut.put("opter_no", "99999");
|
|
|
input.getJSONObject("input").put("signOut", signOut);
|
|
|
JSONObject result = executeTrade(input, SiFunction.SIGN_OUT);
|
|
|
- log.info("医保签退:\n参数:{},\n结果:{}", input, result);
|
|
|
if (null != result && result.getIntValue(RESULT_CODE) == 0) {
|
|
|
+ log.info("医保签退成功。");
|
|
|
signNo = null;
|
|
|
}
|
|
|
}
|
|
@@ -155,6 +155,9 @@ public class ExecService {
|
|
|
header.put("fixmedins_code", cfg.getHospId());
|
|
|
header.put("fixmedins_name", cfg.getHospName());
|
|
|
header.put("sign_no", "");
|
|
|
+ if (StrUtil.isNotBlank(cfg.getSoftDeveloper())) {
|
|
|
+ header.put("fixmedins_soft_fcty", cfg.getSoftDeveloper());
|
|
|
+ }
|
|
|
header.put("input", input);
|
|
|
return header;
|
|
|
}
|
|
@@ -173,7 +176,7 @@ public class ExecService {
|
|
|
// webhis.thyy.cn代理地址添加header
|
|
|
headers.put("apiAccessKey", cfg.getAccessKey());
|
|
|
headers.put("apiSecreKey", cfg.getSecretKey());
|
|
|
- headers.put("apiName", function.getCode());
|
|
|
+ headers.put("apiName", StrUtil.isBlank(cfg.getApiName()) ? function.getCode() : cfg.getApiName());
|
|
|
headers.put("apiVersion", cfg.getApiVersion());
|
|
|
headers.put("apiTimestamp", timestamp);
|
|
|
headers.put("apiSignature", signature);
|
|
@@ -187,7 +190,7 @@ public class ExecService {
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
headers.add("apiAccessKey", cfg.getAccessKey());
|
|
|
headers.add("apiSecreKey", cfg.getSecretKey());
|
|
|
- headers.add("apiName", function.getCode());
|
|
|
+ headers.add("apiName", StrUtil.isBlank(cfg.getApiName()) ? function.getCode() : cfg.getApiName());
|
|
|
headers.add("apiVersion", cfg.getApiVersion());
|
|
|
headers.add("apiTimestamp", timestamp);
|
|
|
headers.add("apiSignature", signature);
|
|
@@ -221,6 +224,7 @@ public class ExecService {
|
|
|
try {
|
|
|
String result = template.postForObject(cfg.getApiUrl(),
|
|
|
new HttpEntity<>(input, getHttpHeaders(function)), String.class);
|
|
|
+ log.info("【接口号:" + function.getCode() + "】医保接口调用:\r\n参数:" + input + "\r\n返回:" + result);
|
|
|
return JSONObject.parseObject(result);
|
|
|
} catch (Exception e) {
|
|
|
log.error("医保网络出错", e);
|