Browse Source

优化医保登记日期和账页日期的大小判断

lighter 2 years ago
parent
commit
cf533170e3

+ 4 - 0
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiQueryDao.java

@@ -518,6 +518,10 @@ public interface SiQueryDao {
     @Select("select name,code='' from t_si_admdvs where code=#{code}")
     CodeName selectAdmdvsName(@Param("code") String code);
 
+    @Select("select count(1) from zy_ledger_file where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn>0 ")
+    Integer selectLedgerCount(@Param("patNo") String patNo,
+                              @Param("times") int times);
+
     @Select("select max(account_date) from zy_ledger_file where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn>0")
     Date selectMaxLedgerAccountDate(@Param("patNo") String patNo,
                                     @Param("times") int times);

+ 3 - 0
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiQueryService.java

@@ -1794,6 +1794,9 @@ public class SiQueryService {
     }
 
     public ResultVo<String> checkRegisterDate(String patNo, Integer times) {
+        if (dao.selectLedgerCount(patNo, times) == 1) {
+            return ResultVoUtil.success();
+        }
         Date ledgerAccountDate = dao.selectMaxLedgerAccountDate(patNo, times);
         if (null == ledgerAccountDate) {
             return ResultVoUtil.success();