Browse Source

再次优化定时撤销未缴费的门诊医保结算

lighter 2 years ago
parent
commit
57d18a8408

+ 4 - 6
src/main/java/thyyxxk/simzfeeoprnsystm/dao/ScheduledDao.java

@@ -8,11 +8,9 @@ import java.util.List;
 
 @Mapper
 public interface ScheduledDao {
-    @Select("select pat_no,times,ledger_sn,setl_id,mdtrt_id,psn_no from t_si_setlinfo where setl_type=11 " +
-            "and mz_saved=0 and revoked=0 and datediff(hour, endtime, getdate()) between 12 and 72 ")
+    @Select("select a.pat_no,a.times,a.ledger_sn,a.setl_id,a.mdtrt_id,a.psn_no from " +
+            "t_si_setlinfo a,mz_deposit_file b where a.setl_type=11 and a.mz_saved=0 " +
+            "and a.revoked=0 and b.pay_mark!=0 and a.pat_no=b.patient_id and a.times=b.times " +
+            "and datediff(hour, a.setl_time, getdate()) between 13 and 72")
     List<SiSetlinfo> selectSetlinfos();
-
-    @Select("select count(1) from mz_deposit_file WITH(NOLOCK) where " +
-            "patient_id=#{patNo} and times=#{times} and pay_mark=0")
-    int alreadyPayed(String patNo, int times);
 }

+ 2 - 4
src/main/java/thyyxxk/simzfeeoprnsystm/scheduled/ScheduledTask.java

@@ -25,10 +25,8 @@ public class ScheduledTask {
     public void cancelSettlement() throws Exception {
         List<SiSetlinfo> list = dao.selectSetlinfos();
         for (SiSetlinfo setlinfo : list) {
-            if (dao.alreadyPayed(setlinfo.getPatNo(), setlinfo.getTimes()) == 0) {
-                service.revokeOutpatientSettlementForTask(setlinfo);
-                TimeUnit.SECONDS.sleep(2);
-            }
+            service.revokeOutpatientSettlementForTask(setlinfo);
+            TimeUnit.SECONDS.sleep(2);
         }
     }
 }