|
|
|
@ -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;
|
|
|
|
|