lighter 1 개월 전
부모
커밋
85ba618a8e

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

@@ -552,4 +552,12 @@ public interface SiQueryDao {
     @Select("select detail_sn from zy_detail_charge where inpatient_no=#{zyh} and admiss_times=#{times} " +
             "and ledger_sn=#{ledger} and trans_flag_yb=1 and solid is null")
     List<Integer> getUnsolidSn(String zyh, int times, int ledger);
+
+    @Select("select count(1) from zy_detail_charge where inpatient_no=#{zyh} and admiss_times=#{times} " +
+            "and ledger_sn=#{ledger} and solid=1")
+    Integer getDbSolidSize(String zyh, int times, int ledger);
+
+    @Select("select count(1) from zy_detail_charge where inpatient_no=#{zyh} and admiss_times=#{times} " +
+            "and ledger_sn=#{ledger} and trans_flag_yb=1")
+    Integer getDbUploadedSize(String zyh, int times, int ledger);
 }

+ 3 - 1
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiZyService.java

@@ -295,7 +295,9 @@ public class SiZyService {
         if (ListUtil.isBlank(p.getDetailSns())) {
             p.setDetailSns(queryDao.getUnsolidSn(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn()));
         }
-        if (ListUtil.isBlank(p.getDetailSns())) {
+        Integer dbSolidSize = queryDao.getDbSolidSize(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
+        Integer dbUploadedSize = queryDao.getDbUploadedSize(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
+        if (ListUtil.isBlank(p.getDetailSns()) || Objects.equals(dbSolidSize, dbUploadedSize)) {
             JSONObject item = new JSONObject();
             item.put("feedetl_sn", "0000");
             item.put("mdtrt_id", siPatInfo.getMdtrtId());