|
@@ -1,7 +1,7 @@
|
|
|
package thyyxxk.webserver.scheduled;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import thyyxxk.webserver.dao.his.scheduled.JieShouFeiYongDao;
|
|
@@ -25,6 +25,9 @@ public class FeiYongJieShouChongSuan {
|
|
|
private final JieShouFeiYongDao dao;
|
|
|
private final PatientService patientService;
|
|
|
|
|
|
+ @Value("${fei-yong-jie-shou}")
|
|
|
+ private Boolean feiYongJieShou;
|
|
|
+
|
|
|
public FeiYongJieShouChongSuan(JieShouFeiYongDao dao, PatientService patientService) {
|
|
|
this.dao = dao;
|
|
|
this.patientService = patientService;
|
|
@@ -32,14 +35,15 @@ public class FeiYongJieShouChongSuan {
|
|
|
|
|
|
@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();
|
|
|
+ if (feiYongJieShou) {
|
|
|
+ List<Patient> xuYaoJieShouDeFeiYong = dao.xuYaoJieShouFeiYong();
|
|
|
+ for (Patient item : xuYaoJieShouDeFeiYong) {
|
|
|
+ try {
|
|
|
+ patientService.receiveAndRecalculateCost(item);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("费用接受失败==>住院号:{},住院次数:{},账页号:{}", item.getInpatientNo(), item.getAdmissTimes(), item.getLedgerSn());
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|