소스 검색

手动关闭预案,3Min不触发新的预案2

hanzhiwei 2 년 전
부모
커밋
7f592b3789
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 6 2
      zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabRiskPlanServiceImpl.java

+ 6 - 2
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabRiskPlanServiceImpl.java

@@ -629,7 +629,11 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
     @Override
     public synchronized int triggerRiskPlan(SubFunction<SensorFunctionStatus> subFunction, Integer riskAttribute) {
         int flag = 200;
-        //这里判断火焰预案,就不继续往下执行了,锁死火焰预案
+        if (redisService.getCacheObject("manualLockRiskPlan" + subFunction.getSubId()) != null) {
+            log.info("当前手动关闭预案,不能触发预案!");
+            return flag;
+        }
+        //判断火焰预案
         if (redisService.getCacheObject("subjectByHuoyan" + subFunction.getSubId()) != null) {
             log.info("当前已触发火焰预案,不能触发其他预案!");
             return flag;
@@ -1101,7 +1105,7 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
                 redisService.deleteObject("subjectByYa" + subFunction.getSubId());
             }
             //设置手动关闭预案 延时触发时间
-            redisService.setCacheObject("subjectByYa" + subFunction.getSubId(), subFunction.getSubId(), 180L, TimeUnit.SECONDS);
+            redisService.setCacheObject("manualLockRiskPlan" + subFunction.getSubId(), subFunction.getSubId(), 180L, TimeUnit.SECONDS);
             //向前端发送预案关闭
             messageSendService.riskPlanTriggerNotice();
         }