diff --git a/src/main/java/com/xydl/cac/controller/TestController.java b/src/main/java/com/xydl/cac/controller/TestController.java index 3cc51e8..d0c881d 100644 --- a/src/main/java/com/xydl/cac/controller/TestController.java +++ b/src/main/java/com/xydl/cac/controller/TestController.java @@ -1,6 +1,5 @@ package com.xydl.cac.controller; -import com.xydl.cac.iec.IecClient; import com.xydl.cac.model.Response; import com.xydl.cac.model.StaticVariable; import com.xydl.cac.service.IcdFileConfigService; @@ -40,9 +39,28 @@ public class TestController extends BasicController { webSocketServer.sendMessage(msg, warningId); } - @GetMapping("realTimeMap") - @ApiOperation("实时订阅Map") - public Response> realTimeMap() { + @GetMapping("realTimeClientMap") + @ApiOperation("realTimeClientMap") + public Response realTimeClientMap() { return Response.success(StaticVariable.realTimeClientMap); } + + @GetMapping("paramRelationMap") + @ApiOperation("paramRelationMap") + public Response paramRelationMap() { + return Response.success(StaticVariable.paramRelationMap); + } + + @GetMapping("sensorLastDataMap") + @ApiOperation("sensorLastDataMap") + public Response sensorLastDataMap() { + return Response.success(StaticVariable.sensorLastDataMap); + } + + @GetMapping("clearMap") + @ApiOperation("clearMap") + public void clearMap() { + StaticVariable.sensorLastDataMap.clear(); + StaticVariable.paramRelationMap.clear(); + } } diff --git a/src/main/java/com/xydl/cac/task/CacheTask.java b/src/main/java/com/xydl/cac/task/CacheTask.java index 68b1784..cbca1ca 100644 --- a/src/main/java/com/xydl/cac/task/CacheTask.java +++ b/src/main/java/com/xydl/cac/task/CacheTask.java @@ -17,17 +17,20 @@ public class CacheTask { @Resource WarnRuleService ruleService; - - @Scheduled(cron = "0 0 9 * * ?") - private void clearCache() { + @Scheduled(cron = "0 0 1 * * ?") + private void clearCache1() { StaticVariable.unit_Cache.clear(); StaticVariable.modevType_Cache = null; StaticVariable.jg_Cache = null; StaticVariable.zsb_Cache = null; StaticVariable.rule_Cache.clear(); - StaticVariable.doneWarnMap.clear(); + StaticVariable.paramRelationMap.clear(); } + @Scheduled(cron = "0 30 9 * * ?") + private void clearCache9() { + StaticVariable.doneWarnMap.clear(); + } @Scheduled(initialDelay = 30 * 1000, fixedDelay = 60 * 1000) private void refreshRule() {