瀏覽代碼

优化mzlock

lighter 5 月之前
父節點
當前提交
0586b43a59

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

@@ -179,6 +179,6 @@ public interface SiMzDao {
             "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);
+    @Select("select count(1) from mz_order_lock where his_order_num=#{id} and lock_flag=1 and ybzf=1")
+    int getLockedCount(String id);
 }

+ 2 - 2
src/main/java/thyyxxk/simzfeeoprnsystm/service/SiMzFeeService.java

@@ -61,8 +61,8 @@ public class SiMzFeeService {
     }
 
     private boolean inMipSettleProcess(String hisOrdNum) {
-        Integer lockFlag = mzDao.getLockFlag(hisOrdNum);
-        return null != lockFlag && lockFlag == 1;
+        int count = mzDao.getLockedCount(hisOrdNum);
+        return count > 0;
     }
 
     public ResultVo<String> outpatientRegistration(MzPatientInfo p) {