Kaynağa Gözat

拦截已进行移动医保支付的门诊登记

lighter 5 ay önce
ebeveyn
işleme
013937fbd8

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>SiMzFeeOprnSystm</artifactId>
-    <version>3.1.5</version>
+    <version>3.1.6</version>
     <name>SiMzFeeOprnSystm</name>
     <description>SiMzFeeOprnSystm</description>
     <properties>

+ 7 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/dao/SiMzDao.java

@@ -174,4 +174,11 @@ public interface SiMzDao {
 
     @Select("select insuplc_admdvs_name from t_si_pat_info where mdtrt_id=#{mdtrtId}")
     String getInsuplcAdmdvsName(String mdtrtId);
+
+    @Select("select count(1) from powersi_mip_setlinfo where " +
+            "med_org_ord=#{id} and ord_state='SETTLED'")
+    int getMipSettleCount(String id);
+
+    @Select("select lock_flag from mz_order_lock where his_order_num=#{id}")
+    Integer getLockFlag(String id);
 }

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

@@ -55,6 +55,16 @@ public class SiMzFeeService {
         this.logDao = logDao;
     }
 
+    private boolean mipSettled(String hisOrdNum) {
+        int count = mzDao.getMipSettleCount(hisOrdNum);
+        return count > 0;
+    }
+
+    private boolean inMipSettleProcess(String hisOrdNum) {
+        Integer lockFlag = mzDao.getLockFlag(hisOrdNum);
+        return null != lockFlag && lockFlag == 1;
+    }
+
     public ResultVo<String> outpatientRegistration(MzPatientInfo p) {
         Regstrtn regstrtn;
         if (null != p.getVisitDate() && StringUtil.notBlank(p.getDeptCode())
@@ -76,6 +86,16 @@ public class SiMzFeeService {
             return ResultVoUtil.success("本次就诊已有医保登记[mdtrtId:" + regstrtn.getMdtrtId() + "],请勿重复办理。");
         }
 
+        String hisOrdNum = p.getPatNo() + "_" + p.getTimes() + "_1";
+        if (mipSettled(hisOrdNum)) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR,
+                    "患者已完成移动医保支付,请勿重复办理。");
+        }
+        if (inMipSettleProcess(hisOrdNum)) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR,
+                    "患者已进入移动医保支付流程,无法办理。");
+        }
+
         if (!p.abortBeforeUploadFees()) {
             List<String> chargeCodeList = mzDao.selectHisChargeCodes(p.getPatNo(), p.getTimes());
             if (chargeCodeList.isEmpty()) {