提交 e1c8963b authored 作者: 邓砥奕's avatar 邓砥奕

[自查模块]修改没有系统变量表时的bug

上级 ca1d10d3
...@@ -2,6 +2,7 @@ package com.tykj.dev.device.selfcheck.base; ...@@ -2,6 +2,7 @@ package com.tykj.dev.device.selfcheck.base;
import com.tykj.dev.config.GlobalMap; import com.tykj.dev.config.GlobalMap;
import com.tykj.dev.config.TaskBeanConfig; import com.tykj.dev.config.TaskBeanConfig;
import com.tykj.dev.config.repository.SystemVariableDao;
import com.tykj.dev.config.service.SystemVariableService; import com.tykj.dev.config.service.SystemVariableService;
import com.tykj.dev.device.selfcheck.service.SelfCheckBillService; import com.tykj.dev.device.selfcheck.service.SelfCheckBillService;
import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill; import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill;
...@@ -59,22 +60,30 @@ public class SelfCheckSchedulerTask { ...@@ -59,22 +60,30 @@ public class SelfCheckSchedulerTask {
private SystemVariableService systemVariableService = SpringUtils.getBean("systemVariableServiceImpl"); private SystemVariableService systemVariableService = SpringUtils.getBean("systemVariableServiceImpl");
private SystemVariableDao systemVariableDao = SpringUtils.getBean("systemVariableDao");
private SelfCheckBillService selfCheckBillService = SpringUtils.getBean("selfCheckBillServiceImpl"); private SelfCheckBillService selfCheckBillService = SpringUtils.getBean("selfCheckBillServiceImpl");
private ScheduledFuture scheduledFuture; private ScheduledFuture scheduledFuture;
public SelfCheckSchedulerTask() { public SelfCheckSchedulerTask() {
String vaule = Objects.requireNonNull(systemVariableService).getVaule("selfCheckCycle"); String value;
if ("month".equals(vaule)){ if (systemVariableDao.findAll().size()==0){
value = "quarter";
}
else {
value = Objects.requireNonNull(systemVariableService).getVaule("selfCheckCycle");
}
if ("month".equals(value)){
setCron(cron1); setCron(cron1);
} }
if ("quarter".equals(vaule)){ if ("quarter".equals(value)){
setCron(cron2); setCron(cron2);
} }
if ("year".equals(vaule)){ if ("year".equals(value)){
setCron(cron3); setCron(cron3);
} }
if ("minute".equals(vaule)){ if ("minute".equals(value)){
setCron(cron4); setCron(cron4);
} }
scheduledFuture = TaskBeanConfig.getThreadPoolTaskScheduler().schedule(new SelfCheckTask(), triggerContext -> new CronTrigger(cron).nextExecutionTime(triggerContext)); scheduledFuture = TaskBeanConfig.getThreadPoolTaskScheduler().schedule(new SelfCheckTask(), triggerContext -> new CronTrigger(cron).nextExecutionTime(triggerContext));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论