Prechádzať zdrojové kódy

费用结算重算日志

DESKTOP-0GD05B0\Administrator 2 rokov pred
rodič
commit
a936661ed2

+ 1 - 1
src/main/java/thyyxxk/webserver/dao/his/scheduled/JieShouFeiYongDao.java

@@ -16,7 +16,7 @@ import java.util.List;
  */
 public interface JieShouFeiYongDao {
 
-    @Select("select rtrim(inpatient_no) inpatient_no,admiss_times, " +
+    @Select("select rtrim(inpatient_no) inpatient_no,admiss_times,admiss_date, " +
             "       ledgerSn = (select max(ledger_sn) from zy_ledger_file b " +
             "       where a.inpatient_no = b.inpatient_no and a.admiss_times = b.admiss_times) " +
             "from zy_actpatient a ")

+ 18 - 1
src/main/java/thyyxxk/webserver/scheduled/FeiYongJieShouChongSuan.java

@@ -1,6 +1,7 @@
 package thyyxxk.webserver.scheduled;
 
 import lombok.extern.slf4j.Slf4j;
+import org.aspectj.lang.annotation.Pointcut;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
@@ -9,6 +10,8 @@ import thyyxxk.webserver.entity.inpatient.patient.Patient;
 import thyyxxk.webserver.service.PublicServer;
 import thyyxxk.webserver.service.inpatient.PatientService;
 
+import javax.annotation.PostConstruct;
+import javax.validation.constraints.Positive;
 import java.util.List;
 
 /**
@@ -36,6 +39,9 @@ public class FeiYongJieShouChongSuan {
         this.publicServer = publicServer;
     }
 
+    /**
+     * 费用接受重算
+     */
     @Scheduled(cron = "0 30 23 * * ?")
     public void jieShouFeiYong() {
         // 每天 23 点 执行
@@ -47,14 +53,25 @@ public class FeiYongJieShouChongSuan {
                         item.setLedgerSn(publicServer.getLedgerSn(item.getInpatientNo(), item.getAdmissTimes()));
                     }
                     patientService.receiveAndRecalculateCost(item);
+                    log.info("费用接受成功==>住院号:{},住院次数:{},账页号:{} ", item.getInpatientNo(), item.getAdmissTimes(), item.getLedgerSn());
                 } catch (Exception e) {
-                    log.info("费用接受失败==>住院号:{},住院次数:{},账页号:{}", item.getInpatientNo(), item.getAdmissTimes(), item.getLedgerSn());
+                    log.info("费用接受失败==>住院号:{},住院次数:{},账页号:{},错误信息:{}", item.getInpatientNo(), item.getAdmissTimes(), item.getLedgerSn(), getExceptionAllinformation(e));
                     e.printStackTrace();
                 }
             }
         }
     }
 
+    public static String getExceptionAllinformation(Exception ex) {
+        StringBuilder sOut = new StringBuilder();
+        StackTraceElement[] trace = ex.getStackTrace();
+        for (StackTraceElement s : trace) {
+            sOut.append("\tat ").append(s).append("\r\n");
+        }
+        return sOut.toString();
+    }
+
+
     @Scheduled(cron = "59 59 23 * * ?")
     public void chongZhiYaoDanHao() {
         if (executeScheduled) {