|
|
|
@ -1,7 +1,9 @@
|
|
|
|
|
package com.xydl.cac.task;
|
|
|
|
|
|
|
|
|
|
import com.xydl.cac.entity.Iec104Point;
|
|
|
|
|
import com.xydl.cac.entity.WarnRule;
|
|
|
|
|
import com.xydl.cac.model.StaticVariable;
|
|
|
|
|
import com.xydl.cac.service.Iec104PointService;
|
|
|
|
|
import com.xydl.cac.service.WarnRuleService;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
@ -16,9 +18,11 @@ public class CacheTask {
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
WarnRuleService ruleService;
|
|
|
|
|
@Resource
|
|
|
|
|
Iec104PointService iec104PointService;
|
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 0 1 * * ?")
|
|
|
|
|
private void clearCache1() {
|
|
|
|
|
public void clearCache1() {
|
|
|
|
|
StaticVariable.unit_Cache.clear();
|
|
|
|
|
StaticVariable.modevType_Cache = null;
|
|
|
|
|
StaticVariable.jg_Cache = null;
|
|
|
|
@ -29,12 +33,12 @@ public class CacheTask {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 30 9 * * ?")
|
|
|
|
|
private void clearCache9() {
|
|
|
|
|
public void clearCache9() {
|
|
|
|
|
StaticVariable.doneWarnMap.clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Scheduled(initialDelay = 30 * 1000, fixedDelay = 60 * 1000)
|
|
|
|
|
private void refreshRule() {
|
|
|
|
|
public void refreshRule() {
|
|
|
|
|
try {
|
|
|
|
|
List<WarnRule> list = ruleService.listAll(null);
|
|
|
|
|
for (WarnRule item : list) {
|
|
|
|
@ -52,4 +56,9 @@ public class CacheTask {
|
|
|
|
|
log.error("CacheTask.refreshRule error.", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Scheduled(initialDelay = 5 * 60 * 1000, fixedDelay = 5 * 60 * 1000)
|
|
|
|
|
public void refresh104() {
|
|
|
|
|
iec104PointService.findAll();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|