fix: 调整定时统计任务

dev
huangfeng 10 months ago
parent 2306b92671
commit 55e176096e

@ -5,6 +5,7 @@ import com.shxy.xymanager_common.util.DateUtil;
import com.shxy.xymanager_service.service.MntnDayStatService;
import com.shxy.xymanager_service.service.NewCacheService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
@ -22,8 +23,12 @@ public class MntnDayStatTask {
@Resource
NewCacheService newCacheService;
@Scheduled(cron = "0 0 10 * * ?")
@Value("${maintain.check}")
private boolean needCheck;
@Scheduled(cron = "0 0 12 * * ?")
private void storeAll() {
if (needCheck) {
try {
long total = dayStatService.countTotal();
int days = 3;
@ -42,6 +47,7 @@ public class MntnDayStatTask {
log.error("MntnDayStatTask.storeAll error.", e);
}
}
}
private void storeOne(Integer termId, Date today, int days) {
Date date = today;

Loading…
Cancel
Save