lighter 2 місяців тому
батько
коміт
a0689e1dd4

+ 2 - 0
src/main/java/thyyxxk/webserver/config/envionment/MedinsurConfig.java

@@ -12,6 +12,7 @@ import org.springframework.stereotype.Component;
 public class MedinsurConfig {
     private String apiUrl;
     private String apiVersion;
+    private String apiName;
     private String accessKey;
     private String secretKey;
     private String ipAddress;
@@ -19,4 +20,5 @@ public class MedinsurConfig {
     private String hospId;
     private String hospName;
     private String hospArea;
+    private String softDeveloper;
 }

+ 8 - 4
src/main/java/thyyxxk/webserver/service/medicalinsurance/ExecService.java

@@ -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);

+ 3 - 1
src/main/resources/application-dev.yml

@@ -203,4 +203,6 @@ thyy:
     mac-address: FE-FC-FE-35-35-DE
     hosp-id: H43010500370
     hosp-name: 长沙泰和医院
-    hosp-area: 430105
+    hosp-area: 430105
+    soft-developer:
+    api-name:

+ 3 - 1
src/main/resources/application-prod.yml

@@ -183,4 +183,6 @@ thyy:
     mac-address: FE-FC-FE-35-35-DE
     hosp-id: H43010500370
     hosp-name: 长沙泰和医院
-    hosp-area: 430105
+    hosp-area: 430105
+    soft-developer:
+    api-name: