ソースを参照

定时任务以及版本号。

xiaochan 3 年 前
コミット
e0a92645a6

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>10.9.0</version>
+    <version>10.9.1</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
     <properties>

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

@@ -0,0 +1,23 @@
+package thyyxxk.webserver.dao.his.scheduled;
+
+import org.apache.ibatis.annotations.Select;
+import thyyxxk.webserver.entity.yibao.patient.Patient;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 描述: 接受费用
+ * </p>
+ *
+ * @author xc
+ * @date 2021-12-21 16:39
+ */
+public interface JieShouFeiYongDao {
+
+    @Select("select rtrim(inpatient_no) inpatient_no,admiss_times, " +
+            "       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 where a.inpatient_no = '020118' ")
+    List<Patient> xuYaoJieShouFeiYong();
+}

+ 46 - 0
src/main/java/thyyxxk/webserver/scheduled/FeiYongJieShouChongSuan.java

@@ -0,0 +1,46 @@
+package thyyxxk.webserver.scheduled;
+
+import com.alibaba.fastjson.JSON;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+import thyyxxk.webserver.dao.his.scheduled.JieShouFeiYongDao;
+import thyyxxk.webserver.entity.yibao.patient.Patient;
+import thyyxxk.webserver.service.yibao.PatientService;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 描述: 费用接受重算
+ * </p>
+ *
+ * @author xc
+ * @date 2021-12-21 16:37
+ */
+@Slf4j
+@Component
+public class FeiYongJieShouChongSuan {
+
+    private final JieShouFeiYongDao dao;
+    private final PatientService patientService;
+
+    public FeiYongJieShouChongSuan(JieShouFeiYongDao dao, PatientService patientService) {
+        this.dao = dao;
+        this.patientService = patientService;
+    }
+
+    @Scheduled(cron = "0 0 0 * * ?")
+    public void jieShouFeiYong() {
+        List<Patient> xuYaoJieShouDeFeiYong = dao.xuYaoJieShouFeiYong();
+        log.info("开启费用接受定时任务:{}", JSON.toJSONString(xuYaoJieShouDeFeiYong));
+        for (Patient item : xuYaoJieShouDeFeiYong) {
+            try {
+                patientService.receiveAndRecalculateCost(item);
+            } catch (Exception e) {
+                log.info("费用接受失败==>住院号:{},住院次数:{},账页号:{}", item.getInpatientNo(), item.getAdmissTimes(), item.getLedgerSn());
+                e.printStackTrace();
+            }
+        }
+    }
+}