Преглед на файлове

医保接口header参数

lighter_217 преди 2 месеца
родител
ревизия
49255bf057
променени са 1 файла, в които са добавени 8 реда и са изтрити 1 реда
  1. 8 1
      src/main/java/thyyxxk/webserver/service/medicalinsurance/ExecService.java

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

@@ -13,6 +13,8 @@ import thyyxxk.webserver.config.envionment.MedinsurConfig;
 import thyyxxk.webserver.config.exception.BizException;
 import thyyxxk.webserver.constants.sidicts.SiFunction;
 import thyyxxk.webserver.dao.his.medicalinsurance.SiZyDao;
+import thyyxxk.webserver.entity.login.UserInfo;
+import thyyxxk.webserver.service.hutoolcache.UserCache;
 import thyyxxk.webserver.utils.DateUtil;
 import thyyxxk.webserver.utils.StringUtil;
 import thyyxxk.webserver.utils.TokenUtil;
@@ -42,12 +44,14 @@ public class ExecService {
     private final SiZyDao dao;
     private final RestTemplate template;
     private final MedinsurConfig cfg;
+    private final UserCache userCache;
 
     @Autowired
-    public ExecService(SiZyDao dao, RestTemplate template, MedinsurConfig cfg) {
+    public ExecService(SiZyDao dao, RestTemplate template, MedinsurConfig cfg, UserCache userCache) {
         this.dao = dao;
         this.template = template;
         this.cfg = cfg;
+        this.userCache = userCache;
     }
 
     public synchronized String makeMsgId() {
@@ -147,6 +151,7 @@ public class ExecService {
         if (null == insureArea) {
             insureArea = "";
         }
+        UserInfo user = userCache.getUserInfoByToken();
         JSONObject header = new JSONObject();
         JSONObject input = new JSONObject();
         header.put("msgid", makeMsgId());
@@ -159,6 +164,8 @@ public class ExecService {
         header.put("signtype", "");
         header.put("infver", cfg.getApiVersion());
         header.put("opter_type", "1");
+        header.put("opter", user.getCode());
+        header.put("opter_name", user.getName());
         header.put("inf_time", DateUtil.now());
         header.put("fixmedins_code", cfg.getHospId());
         header.put("fixmedins_name", cfg.getHospName());