Bladeren bron

医保费用固化

lighter 5 dagen geleden
bovenliggende
commit
4b3854f8fa

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

@@ -548,4 +548,8 @@ public interface SiQueryDao {
             "#{yearPreSelfPayMz},#{yearBigAmtpaysZy},#{yearBigAmtpaysMz},#{yearBigdssFundPayAmtZy},#{yearBigdssFundPayAmtMz}," +
             "#{yearMafPayAmtZy},#{yearMafPayAmtMz},#{yearAcctPayZy},#{yearAcctPayMz})")
     void insertCumInfo(CuminfoInYear cuminfo);
+
+    @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);
 }

+ 5 - 1
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiZyDao.java

@@ -86,7 +86,7 @@ public interface SiZyDao {
      * @param admissTimes 住院次数
      * @param ledgerSn    账页号
      */
-    @Update("update zy_detail_charge set trans_flag_yb=0 where inpatient_no=#{inpatientNo} and " +
+    @Update("update zy_detail_charge set trans_flag_yb=0,solid=null where inpatient_no=#{inpatientNo} and " +
             "admiss_times=#{admissTimes} and ledger_sn=#{ledgerSn} and isnull(trans_flag_yb,0)!=2")
     void revokeAllUploadFee(String inpatientNo, int admissTimes, int ledgerSn);
 
@@ -255,4 +255,8 @@ public interface SiZyDao {
     @Update("update t_si_sign_in set sign_no=#{signNo}, " +
             "sign_date=getdate() where id='medInsurSignIn'")
     void updateSignNo(String signNo);
+
+    @Update("update zy_detail_charge set solid=1 where inpatient_no=#{zyh} " +
+            "and admiss_times=#{times} and ledger_sn=#{ledger} and trans_flag_yb=1")
+    void solidifyPatFees(String zyh, int times, int ledger);
 }

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

@@ -279,6 +279,7 @@ public class SiZyService {
                 balance = "0";
             }
             patientDao.updateZyActPatientBalance(p.getInpatientNo(), balance);
+            dao.solidifyPatFees(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
             return "患者【" + p.getName() + "】院内总费用与医保中心总费用一致,医保报销金额为:¥ " + fundPay + "。";
         }
         throw new BizException(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
@@ -291,7 +292,10 @@ public class SiZyService {
         }
         JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.REVOKE_HOSPITALIZATION_FEE_DETAILS, siPatInfo.getInsuplcAdmdvs());
         JSONArray data = new JSONArray();
-        if (null == p.getDetailSns() || p.getDetailSns().isEmpty()) {
+        if (ListUtil.isBlank(p.getDetailSns())) {
+            p.setDetailSns(queryDao.getUnsolidSn(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn()));
+        }
+        if (ListUtil.isBlank(p.getDetailSns())) {
             JSONObject item = new JSONObject();
             item.put("feedetl_sn", "0000");
             item.put("mdtrt_id", siPatInfo.getMdtrtId());

+ 3 - 0
update/2025-08-11.md

@@ -0,0 +1,3 @@
+```sql
+alter table zy_detail_charge add solid smallint
+```