Browse Source

结算成功后查询累计信息并入库

lighter 2 years ago
parent
commit
d6e9567db7

+ 3 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/external/WebHisSrvc.java

@@ -6,6 +6,7 @@ import com.dtflys.forest.annotation.Var;
 import thyyxxk.simzfeeoprnsystm.pojo.MzPatientInfo;
 import thyyxxk.simzfeeoprnsystm.pojo.MzReceipt;
 import thyyxxk.simzfeeoprnsystm.pojo.ResultVo;
+import thyyxxk.simzfeeoprnsystm.pojo.SiSetlinfo;
 
 import java.util.List;
 import java.util.Map;
@@ -18,4 +19,6 @@ public interface WebHisSrvc {
     @Post("{url}/siMz/insertSiMzFeesForThmz")
     ResultVo<String> insertSiMzFeesForThmz(@Var ("url") String url, @JSONBody List<MzReceipt> receipts);
 
+    @Post("{url}/siQuery/saveCumInfo")
+    void saveCumInfo(@Var ("url") String url, @JSONBody SiSetlinfo setlinfo);
 }

+ 13 - 20
src/main/java/thyyxxk/simzfeeoprnsystm/service/SiMzFeeService.java

@@ -329,16 +329,10 @@ public class SiMzFeeService {
             mzPreSetlmt.setMdtrtCertType(mdtrtCertType.getCode());
             if (mdtrtCertType == MdtrtCertType.SOCIAL_SECURITY_CARD) {
                 String[] out = p.getReadCardResult().split("\\|");
-//                if (!p.getName().trim().equals(out[4].trim())) {
-//                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "社保卡姓名与HIS姓名不一致,请确认是否人证相符。");
-//                }
                 mzPreSetlmt.setMdtrtCertNo(out[2]);
                 mzPreSetlmt.setCardSn(out[3]);
             } else if (mdtrtCertType == MdtrtCertType.MEDICAL_INSURANCE_ELECTRONIC_VOUCHER) {
                 JSONObject qrinfo = JSONObject.parseObject(p.getReadCardResult());
-//                if (!p.getName().trim().equals(qrinfo.getString("userName").trim())) {
-//                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "电子医保凭证姓名与HIS姓名不一致,请确认是否人证相符。");
-//                }
                 if (!p.getSocialNo().trim().equals(qrinfo.getString("idNo").trim())) {
                     return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "电子医保凭证身份证与HIS身份证不一致,请确认是否人证相符。");
                 }
@@ -371,6 +365,7 @@ public class SiMzFeeService {
             fundDetail.setCashPay(setlinfo.getString("psn_cash_pay"));
             fundDetail.setAcctPay(setlinfo.getString("acct_pay"));
             fundDetail.setSelfPay(setlinfo.getString("psn_part_amt"));
+            fundDetail.setCardType(getCardType(mzPreSetlmt.getInsuplcAdmdvs()));
             return ResultVoUtil.success(fundDetail);
         }
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
@@ -386,14 +381,7 @@ public class SiMzFeeService {
 
     private ResultVo<FundDetail> getFundDetailResultVo(SiSetlinfo sisetl) {
         FundDetail fundDetail = new FundDetail();
-        String insplc = sisetl.getInsuplcAdmdvs();
-        if (insplc.startsWith("4301")) {
-            fundDetail.setCardType(1);
-        } else if (insplc.equals("439900")) {
-            fundDetail.setCardType(2);
-        } else {
-            fundDetail.setCardType(3);
-        }
+        fundDetail.setCardType(getCardType(sisetl.getInsuplcAdmdvs()));
         fundDetail.setTotalCost(String.valueOf(sisetl.getMedfeeSumamt()));
         fundDetail.setFundPay(String.valueOf(sisetl.getFundPaySumamt()));
         fundDetail.setCashPay(String.valueOf(sisetl.getPsnCashPay()));
@@ -405,6 +393,15 @@ public class SiMzFeeService {
         return ResultVoUtil.success(fundDetail);
     }
 
+    private Integer getCardType(String insplc) {
+        if (insplc.startsWith("4301")) {
+            return 1;
+        } else if (insplc.equals("439900")) {
+            return 2;
+        }
+        return 3;
+    }
+
     public ResultVo<FundDetail> outpatientSettlement(MzPatientInfo p) {
         ResultVo<FundDetail> setlfund = getFundDetailResultVo(p);
         if (setlfund != null) {
@@ -419,16 +416,10 @@ public class SiMzFeeService {
             setlmt.setMdtrtCertType(mdtrtCertType.getCode());
             if (mdtrtCertType == MdtrtCertType.SOCIAL_SECURITY_CARD) {
                 String[] out = p.getReadCardResult().split("\\|");
-//                if (!p.getName().trim().equals(out[4].trim())) {
-//                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "社保卡姓名与HIS姓名不一致,请确认是否人证相符。");
-//                }
                 setlmt.setMdtrtCertNo(out[2]);
                 setlmt.setCardSn(out[3]);
             } else if (mdtrtCertType == MdtrtCertType.MEDICAL_INSURANCE_ELECTRONIC_VOUCHER) {
                 JSONObject qrinfo = JSONObject.parseObject(p.getReadCardResult());
-//                if (!p.getName().trim().equals(qrinfo.getString("userName").trim())) {
-//                    return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "电子医保凭证姓名与HIS姓名不一致,请确认是否人证相符。");
-//                }
                 if (!p.getSocialNo().trim().equals(qrinfo.getString("idNo").trim())) {
                     return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "电子医保凭证身份证与HIS身份证不一致,请确认是否人证相符。");
                 }
@@ -477,6 +468,7 @@ public class SiMzFeeService {
                 setldetailEntity.setLedgerSn(0);
                 setldetailDao.insert(setldetailEntity);
             }
+            webHisSrvc.saveCumInfo(webHisUrl, setlEntity);
             return getFundDetailResultVo(setlEntity);
         }
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
@@ -526,6 +518,7 @@ public class SiMzFeeService {
         data.put("psn_no", setlinfo.getPsnNo());
         input.getJSONObject("input").put("data", data);
         JSONObject result = exec.executeTrade(input, SiFunction.REVOKE_OUTPATIENT_SETTLEMENT);
+        log.info("【操作员:99999】门诊结算撤销:\n参数:{},\n结果:{}", input, result);
         Integer infcode = result.getInteger(RESULT_CODE);
         logDao.insert(new SiLog(input, result, setlinfo.getPatNo(), setlinfo.getTimes(), infcode, setlinfo.getPsnNo()));
         if (null != infcode && infcode == 0) {