|
@@ -1,7 +1,9 @@
|
|
|
package cn.hnthyy.thmz.common;
|
|
|
|
|
|
import cn.hnthyy.thmz.entity.his.MzyRequest;
|
|
|
+import cn.hnthyy.thmz.service.his.ChargeFeeVoService;
|
|
|
import cn.hnthyy.thmz.service.his.MzyRequestService;
|
|
|
+import cn.hnthyy.thmz.service.his.ZyDayclosingRecordService;
|
|
|
import cn.hnthyy.thmz.service.thmz.TokenService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
@@ -26,6 +28,10 @@ public class ScheduledService {
|
|
|
private TokenService tokenService;
|
|
|
@Autowired
|
|
|
private MzyRequestService mzyRequestService;
|
|
|
+ @Autowired
|
|
|
+ private ChargeFeeVoService chargeFeeVoService;
|
|
|
+ @Autowired
|
|
|
+ private ZyDayclosingRecordService zyDayclosingRecordService;
|
|
|
/**
|
|
|
* 每20分钟执行一次
|
|
|
*/
|
|
@@ -44,11 +50,13 @@ public class ScheduledService {
|
|
|
process();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-// @Scheduled(cron = "15 27 11 * * *")
|
|
|
-// public void scheduledFull() {
|
|
|
-// process();
|
|
|
-// }
|
|
|
+ /**
|
|
|
+ * 每天23时58分将自助收费做日结
|
|
|
+ */
|
|
|
+ @Scheduled(cron = "0 58 23 * * *")
|
|
|
+ public void scheduledFull() {
|
|
|
+ processZzRj();
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
@@ -66,4 +74,39 @@ public class ScheduledService {
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 定时处理自助缴费日结
|
|
|
+ *
|
|
|
+ */
|
|
|
+ private void processZzRj() {
|
|
|
+ try {
|
|
|
+ Integer count = chargeFeeVoService.queryCountCanDaily(Constants.BRZZJF_CODE);
|
|
|
+ if (count == null || count == 0) {
|
|
|
+ log.warn("99999 费用结算失败,无可结算费用");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ count = chargeFeeVoService.queryTFWDFPCount(Constants.BRZZJF_CODE);
|
|
|
+ if (count > 0) {
|
|
|
+ log.warn("99999 存在退费后发票未重打的发票信息,请 处理后再结账!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ chargeFeeVoService.dcountCharge(Constants.BRZZJF_CODE);
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("门诊自助日结出错。");
|
|
|
+ }
|
|
|
+
|
|
|
+ try{
|
|
|
+ zyDayclosingRecordService.dayclosing();
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("住院自助日结出错。");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|