Browse Source

优化费用接收重算

lighter 2 years ago
parent
commit
2f7d23788c

+ 6 - 2
src/main/java/thyyxxk/webserver/dao/his/inpatient/PatientDao.java

@@ -82,8 +82,6 @@ public interface PatientDao {
             "and admiss_times=a.admiss_times and ledger_sn=a.times_billed), " +
             "totalCharge=(select rtrim(isnull(total_charge, '0.00')) from zy_ledger_file where inpatient_no=a.inpatient_no " +
             "and admiss_times=a.admiss_times and ledger_sn=a.times_billed), " +
-            "balance=(select balance+charge_yb from zy_ledger_file where inpatient_no=a.inpatient_no and " +
-            "admiss_times=a.admiss_times and ledger_sn=a.times_billed), " +
             "injuryArea=(select injury_area from t_injury_si_pat_info where pat_no=a.inpatient_no " +
             "and times=a.admiss_times and ledger_sn=a.times_billed) FROM ${table} a with(nolock), " +
             "a_patient_mi b with(nolock) WHERE a.inpatient_no=#{inpatientNo} " +
@@ -306,4 +304,10 @@ public interface PatientDao {
     void zyCalcDetailAgainNew(@Param("zyh") String zyh,
                               @Param("times") int times,
                               @Param("ledger") int ledger);
+
+    @Update("update zy_ledger_file set balance=(deposit+charge_yb-total_charge) where " +
+            "inpatient_no=#{zyh} and admiss_times=#{times} and ledger_sn=#{ledger}")
+    void updateBalance(@Param("zyh") String zyh,
+                       @Param("times") int times,
+                       @Param("ledger") int ledger);
 }

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

@@ -493,6 +493,7 @@ public class PatientService {
         dao.zyCnglFyjsListYz(zyh, times);
         dao.updateZyDetailCharge(zyh, times, ledger);
         dao.zyCalcDetailAgainNew(zyh, times, ledger);
+        dao.updateBalance(zyh, times, ledger);
         return getPatientInfo(zyh);
     }
 }