Переглянути джерело

费用接收重算时,更新在院病人表的余额

lighter 2 роки тому
батько
коміт
910e8c499e

+ 9 - 0
src/main/java/thyyxxk/webserver/dao/his/inpatient/PatientDao.java

@@ -323,4 +323,13 @@ public interface PatientDao {
     void updateBalance(@Param("zyh") String zyh,
                        @Param("times") int times,
                        @Param("ledger") int ledger);
+
+    @Select("select balance from zy_ledger_file where inpatient_no=#{zyh} and admiss_times=#{times} and ledger_sn=#{ledger}")
+    String selectLedgerBalance(@Param("zyh") String zyh,
+                               @Param("times") int times,
+                               @Param("ledger") int ledger);
+
+    @Update("update zy_actpatient set balance=#{balance} where inpatient_no=#{zyh}")
+    void updateZyActPatientBalance(@Param("zyh") String zyh, @Param("balance") String balance);
+
 }

+ 5 - 0
src/main/java/thyyxxk/webserver/service/inpatient/PatientService.java

@@ -505,6 +505,11 @@ public class PatientService {
         dao.updateZyDetailCharge(zyh, times, ledger);
         dao.zyCalcDetailAgainNew(zyh, times, ledger);
         dao.updateBalance(zyh, times, ledger);
+        String balance = dao.selectLedgerBalance(zyh, times, ledger);
+        if (StringUtil.isBlank(balance)) {
+            balance = "0";
+        }
+        dao.updateZyActPatientBalance(zyh, balance);
         return getPatientInfo(zyh);
     }
 }