|
|
|
@ -8,6 +8,7 @@ import com.shxy.xymanager_service.service.CacheService;
|
|
|
|
|
import com.shxy.xymanager_service.service.NewCacheService;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
@ -23,6 +24,9 @@ public class MntnCheckTask {
|
|
|
|
|
private int max = 20;
|
|
|
|
|
private HashMap<Integer, Long> alertMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
@Value("${maintain.check}")
|
|
|
|
|
private boolean needCheck;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
MntnRawReportsMapper rawReportsMapper;
|
|
|
|
|
@Resource
|
|
|
|
@ -54,6 +58,7 @@ public class MntnCheckTask {
|
|
|
|
|
|
|
|
|
|
@Scheduled(initialDelay = 60000, fixedDelay = 60000)
|
|
|
|
|
private void checkAll() {
|
|
|
|
|
if (needCheck) {
|
|
|
|
|
try {
|
|
|
|
|
log.info("MntnCheckTask.checkAll 开始.");
|
|
|
|
|
Map<Integer, Terminals> terminalMap = cacheService.getTerminalMap();
|
|
|
|
@ -67,6 +72,7 @@ public class MntnCheckTask {
|
|
|
|
|
log.error("MntnCheckTask.checkAll error.", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void checkOne(Integer termId) {
|
|
|
|
|
Terminals term = newCacheService.getTerminal(termId);
|
|
|
|
|