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