lighter 2 éve
szülő
commit
a98046600a

+ 8 - 2
src/main/java/thyyxxk/simzfeeoprnsystm/dao/SiMzDao.java

@@ -10,6 +10,10 @@ import java.util.List;
 
 @Mapper
 public interface SiMzDao {
+    @Update("update t_si_pat_info set times=#{times} where pat_no=#{patNo} and times=-1")
+    int updateMzTimes(@Param("patNo") String patNo,
+                      @Param("times") int times);
+
     @Select("select * from t_si_pat_info where pat_no=#{patNo} and times=#{times}")
     SiPatInfo selectSiPatInfoForMz(@Param("patNo") String patNo,
                                    @Param("times") int times);
@@ -44,7 +48,7 @@ public interface SiMzDao {
                         @Param("ledgerSn") int ledgerSn);
 
     @Update("update t_si_pat_info set insuplc_admdvs=#{insuplcAdmdvs},psn_type=#{psnType},emp_name=#{empName}," +
-            "mdtrt_id=#{mdtrtId},insutype=#{insutype},visit_datetime=#{visitDate} " +
+            "mdtrt_id=#{mdtrtId},insutype=#{insutype},visit_datetime=#{visitDate},balc=#{balc} " +
             "where pat_no=#{patNo} and times=#{times} ")
     void afterRegistrtn(MzPatientInfo p);
 
@@ -124,7 +128,9 @@ public interface SiMzDao {
     @Update("update t_si_pat_info set rvk_setl_msgid=#{rvkSetlMsgid} where pat_no=#{patNo} and times=#{times}")
     void updateRvkSetlMsgid(@Param("patNo") String patNo, @Param("times") int times, @Param("rvkSetlMsgid") String rvkSetlMsgid);
 
-    @Select("select * from t_si_mz_diag where pat_no=#{patNo} and times=#{times}")
+    @Select("select a.diag_srt_no,a.diag_type,a.diag_code,a.diag_name,a.diag_dept, " +
+            "a.dise_dor_name,a.diag_time,a.vali_flag,dise_dor_no=rtrim(b.yb_code) " +
+            "from t_si_mz_diag a, a_employee_mi b where pat_no=#{patNo} and times=#{times} and a.dise_dor_no=b.code")
     List<Diseinfo> selectMzDiags(@Param("patNo") String patNo, @Param("times") int times);
 
     @Select("select icd_code_new from mz_visit_table where patient_id=#{patNo} and times=#{times}")

+ 7 - 9
src/main/java/thyyxxk/simzfeeoprnsystm/external/WebHisSrvc.java

@@ -1,8 +1,8 @@
 package thyyxxk.simzfeeoprnsystm.external;
 
-import com.dtflys.forest.annotation.BaseRequest;
 import com.dtflys.forest.annotation.JSONBody;
 import com.dtflys.forest.annotation.Post;
+import com.dtflys.forest.annotation.Var;
 import thyyxxk.simzfeeoprnsystm.pojo.MzPatientInfo;
 import thyyxxk.simzfeeoprnsystm.pojo.MzReceipt;
 import thyyxxk.simzfeeoprnsystm.pojo.ResultVo;
@@ -11,17 +11,15 @@ import thyyxxk.simzfeeoprnsystm.pojo.onlinepayment.EcTokenParams;
 import java.util.List;
 import java.util.Map;
 
-@BaseRequest(baseURL = "http://172.16.30.26:8706")
-//@BaseRequest(baseURL = "http://172.16.32.160:8706")
 public interface WebHisSrvc {
 
-    @Post("/siMz/getMzReceipts")
-    ResultVo<List<Map<String, Object>>> getMzReceipts(@JSONBody MzPatientInfo p);
+    @Post("{url}/siMz/getMzReceipts")
+    ResultVo<List<Map<String, Object>>> getMzReceipts(@Var ("url") String url, @JSONBody MzPatientInfo p);
 
-    @Post("/siMz/insertSiMzFees")
-    ResultVo<String> insertSiMzFees(@JSONBody List<MzReceipt> receipts);
+    @Post("{url}/siMz/insertSiMzFees")
+    ResultVo<String> insertSiMzFees(@Var ("url") String url, @JSONBody List<MzReceipt> receipts);
 
-    @Post("/markMtFees/queryInsuinfo")
-    Map<String, Object> queryInsuinfo(@JSONBody EcTokenParams param);
+    @Post("{url}/markMtFees/queryInsuinfo")
+    Map<String, Object> queryInsuinfo(@Var ("url") String url, @JSONBody EcTokenParams param);
 
 }

+ 1 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/MzPatientInfo.java

@@ -19,6 +19,7 @@ public class MzPatientInfo {
     private String name;
     private String socialNo;
     private String psnNo;
+    private String balc;
     private String insuplcAdmdvs;
     private String insutype;
     private String empName;

+ 10 - 7
src/main/java/thyyxxk/simzfeeoprnsystm/service/SiMzFeeService.java

@@ -2,6 +2,7 @@ package thyyxxk.simzfeeoprnsystm.service;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import org.springframework.beans.factory.annotation.Value;
 import thyyxxk.simzfeeoprnsystm.dao.SiLogDao;
 import thyyxxk.simzfeeoprnsystm.dao.SiMzDao;
 import thyyxxk.simzfeeoprnsystm.dao.SiSetldetailDao;
@@ -36,7 +37,8 @@ public class SiMzFeeService {
     private static final String ERROR_MESSAGE = "err_msg";
     private static final String OUTPUT = "output";
     private final SiLogDao logDao;
-
+    @Value("${web-his-url}")
+    private String webHisUrl;
 
     @Autowired
     public SiMzFeeService(SiMzDao mzDao, SiSetlinfoDao setlinfoDao,
@@ -542,18 +544,18 @@ public class SiMzFeeService {
         mzptnt.setPatNo(ecpms.getPatientId());
         mzptnt.setTimes(ecpms.getTimes());
         mzptnt.setAcctUsedFlag(String.valueOf(ecpms.getAcctUsedFlag()));
-        SiPatInfo siPatInfo = mzDao.selectSiPatInfoForMz(mzptnt.getPatNo(), mzptnt.getTimes());
-        if (null == siPatInfo) {
-            Map<String, Object> map = webHisSrvc.queryInsuinfo(ecpms);
+        int hasSiPatInfo = mzDao.updateMzTimes(mzptnt.getPatNo(), mzptnt.getTimes());
+        if (hasSiPatInfo == 0) {
+            Map<String, Object> map = webHisSrvc.queryInsuinfo(webHisUrl, ecpms);
             if (null == map) {
                 return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
             }
             if ((int) map.get("code") == -1) {
                 return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, map.get("msg").toString());
             }
-            siPatInfo = mzDao.selectSiPatInfoForMz(mzptnt.getPatNo(), mzptnt.getTimes());
         }
         // 查询到职工参保信息后挂号登记(执行到这一步,siPatInfo必不为空,所以无需作非空判断)
+        SiPatInfo siPatInfo = mzDao.selectSiPatInfoForMz(mzptnt.getPatNo(), mzptnt.getTimes());
         mzptnt.setInsuplcAdmdvs(siPatInfo.getInsuplcAdmdvs());
         mzptnt.setInsutype(siPatInfo.getInsutype());
         mzptnt.setPsnType(siPatInfo.getPsnType());
@@ -573,6 +575,7 @@ public class SiMzFeeService {
         if (regres.getCode() != ExceptionEnum.SUCCESS.getCode()) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, regres.getMessage());
         }
+
         // 挂号登记成功后上传就诊信息
         siPatInfo = mzDao.selectSiPatInfoForMz(mzptnt.getPatNo(), mzptnt.getTimes());
         siPatInfo.setFromDirectReg(true);
@@ -588,7 +591,7 @@ public class SiMzFeeService {
         }
 
         // 上传就诊信息成功后生成门诊医保费用
-        ResultVo<List<Map<String, Object>>> getMzRcptRes = webHisSrvc.getMzReceipts(mzptnt);
+        ResultVo<List<Map<String, Object>>> getMzRcptRes = webHisSrvc.getMzReceipts(webHisUrl, mzptnt);
         if (null == getMzRcptRes) {
             revokeOutpatientRegistration(mzptnt);
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
@@ -604,7 +607,7 @@ public class SiMzFeeService {
                 mzReceipts.addAll(entry.getValue());
             }
         }
-        ResultVo<String> insertSiMzFeeRes = webHisSrvc.insertSiMzFees(mzReceipts);
+        ResultVo<String> insertSiMzFeeRes = webHisSrvc.insertSiMzFees(webHisUrl, mzReceipts);
         if (null == insertSiMzFeeRes) {
             revokeOutpatientRegistration(mzptnt);
             return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);

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

@@ -29,8 +29,15 @@ spring:
 mybatis:
   configuration:
     map-underscore-to-camel-case: true
+forest:
+  timeout: 0
+  read-timeout: 0
+  log-enabled: false
+  log-request: false
+  log-response-status: false
 
 #正式环境
 si-api-url: http://dms.hun.hsip.gov.cn/isp-api/powercsb/1101
 si-access-key: 04eMGRg7beAO6vqwrZiLacV8Uy3jNn7QGDUcBO
-si-secret-key: SK3Oip3a2R3NLz2xm58Mpmi69oFu96KrdKNRKglN
+si-secret-key: SK3Oip3a2R3NLz2xm58Mpmi69oFu96KrdKNRKglN
+web-his-url: http://172.16.32.160:8706

+ 11 - 2
src/main/resources/application.yml

@@ -12,7 +12,8 @@ spring:
   thymeleaf:
     cache: false
   datasource:
-    url: jdbc:jtds:sqlserver://172.16.32.168:1433/thxyhisdb
+#    url: jdbc:jtds:sqlserver://172.16.32.168:1433/thxyhisdb
+    url: jdbc:jtds:sqlserver://172.16.32.179:1433/thxyhisdb
     hikari:
       username: sa
       password:
@@ -29,13 +30,21 @@ spring:
 mybatis:
   configuration:
     map-underscore-to-camel-case: true
+forest:
+  timeout: 0
+  read-timeout: 0
+  log-enabled: false
+  log-request: false
+  log-response-status: false
 
 #正式环境
 #si-api-url: http://dms.hun.hsip.gov.cn/isp-api/powercsb/1101
 #si-access-key: 04eMGRg7beAO6vqwrZiLacV8Uy3jNn7QGDUcBO
 #si-secret-key: SK3Oip3a2R3NLz2xm58Mpmi69oFu96KrdKNRKglN
+#web-his-url: http://172.16.32.160:8706
 
 #测试环境
 si-api-url: http://10.93.30.130:20001/isp-api/powercsb/1101
 si-access-key: Zgs5jfxaKb86XbCuUzLK9EhFjiQfHR1vydaPzp
-si-secret-key: SKT2ETMT3XkAYApqh79DCnN9ZjfbQEBMPU0GyLz9
+si-secret-key: SKT2ETMT3XkAYApqh79DCnN9ZjfbQEBMPU0GyLz9
+web-his-url: http://172.16.30.26:8706