Przeglądaj źródła

如果费用发生时间小于入院时间那么就加一秒

DESKTOP-0GD05B0\Administrator 2 lat temu
rodzic
commit
57cd578d24

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

@@ -308,11 +308,12 @@ public interface PatientDao {
             "and status_flag > '1' and isnull(group_no, '00')='00' and order_code in ('06026','06053','05973')")
     Date selectActOrderDisDate(@Param("patNo") String patNo, @Param("times") Integer times);
 
-    @Update("update zy_detail_charge set charge_date=#{disdate} where inpatient_no=#{zyh} " +
+    @Update("update zy_detail_charge set charge_date=#{newDate} where inpatient_no=#{zyh} " +
             "and admiss_times=#{times} and charge_date>#{disdate}")
     void correctFeeChargeTimeAfterDismiss(@Param("zyh") String zyh,
                                           @Param("times") int times,
-                                          @Param("disdate") Date disdate);
+                                          @Param("disdate") Date disdate,
+                                          @Param("newDate") Date newDate);
 
     @Update("update zy_ledger_file set deposit=(select isnull(sum(depo_amount),0) from zy_deposit_file f with(nolock) " +
             "where f.inpatient_no=#{zyh} and f.admiss_times=#{times} and f.ledger_sn=#{ledger} and f.status in ('1','2') ) " +

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

@@ -352,7 +352,8 @@ public class PatientService {
         dao.correctFeeChargeTimeBeforeAdmiss(zyh, times, p.getAdmissDate());
         Date disdate = dao.selectActOrderDisDate(zyh, times);
         if (null != disdate) {
-            dao.correctFeeChargeTimeAfterDismiss(zyh, times, disdate);
+            // 如果费用发生时间小于入院时间那么就加一秒。
+            dao.correctFeeChargeTimeAfterDismiss(zyh, times, disdate, DateUtil.timePlusSecond(disdate, 60));
         }
         dao.recountDeposit(zyh, times, ledger);
         dao.zyReceiveDrug(zyh, times, infant);