|
@@ -628,7 +628,6 @@ 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) {
|
|
|
- log.info("======进入触发预案======");
|
|
|
|
|
int flag = 200;
|
|
int flag = 200;
|
|
|
//这里判断火焰预案,就不继续往下执行了,锁死火焰预案
|
|
//这里判断火焰预案,就不继续往下执行了,锁死火焰预案
|
|
|
if (redisService.getCacheObject("subjectByHuoyan" + subFunction.getSubId()) != null) {
|
|
if (redisService.getCacheObject("subjectByHuoyan" + subFunction.getSubId()) != null) {
|
|
@@ -637,12 +636,11 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
}
|
|
}
|
|
|
//实验室传感器是否触发预案
|
|
//实验室传感器是否触发预案
|
|
|
LabRiskPlanLevel labRiskPlanLevel = matchingRiskPlan(subFunction);
|
|
LabRiskPlanLevel labRiskPlanLevel = matchingRiskPlan(subFunction);
|
|
|
- log.info("触发预案具体信息={}", JSON.toJSONString(labRiskPlanLevel));
|
|
|
|
|
//获取当前实验室触发预案的风险异常组列表
|
|
//获取当前实验室触发预案的风险异常组列表
|
|
|
List<LabRiskPlanAbnormalGroupVO> groupList = getLabRiskPlanAbnormalGroupVOS(subFunction.getSubId());
|
|
List<LabRiskPlanAbnormalGroupVO> groupList = getLabRiskPlanAbnormalGroupVOS(subFunction.getSubId());
|
|
|
//如果预案里面配置传感器都达标,需要执行预案对应的硬件操作
|
|
//如果预案里面配置传感器都达标,需要执行预案对应的硬件操作
|
|
|
if (labRiskPlanLevel.getRiskPlanId() != null) {
|
|
if (labRiskPlanLevel.getRiskPlanId() != null) {
|
|
|
- log.info("触发预案id:{}", labRiskPlanLevel.getRiskPlanId());
|
|
|
|
|
|
|
+ log.info("触发预案具体信息={}", JSON.toJSONString(labRiskPlanLevel));
|
|
|
//预案缓存信息处理
|
|
//预案缓存信息处理
|
|
|
riskPlanRedisCache(subFunction);
|
|
riskPlanRedisCache(subFunction);
|
|
|
//获取系统配置通知模板
|
|
//获取系统配置通知模板
|
|
@@ -957,7 +955,7 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
try {
|
|
try {
|
|
|
messageSendService.sendOnepcSubNews(subFunction.getSubId(), 2, RiskPlanConstants.LAB_SAFETY_MANAGEMENT_SYSTEM + labRiskPlanLevel.getContent() + str);
|
|
messageSendService.sendOnepcSubNews(subFunction.getSubId(), 2, RiskPlanConstants.LAB_SAFETY_MANAGEMENT_SYSTEM + labRiskPlanLevel.getContent() + str);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- log.error("向一体机推送语音播报异常:" + e);
|
|
|
|
|
|
|
+ log.error("向一体机推送语音播报异常:{}",e);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//向一体机传感器预警
|
|
//向一体机传感器预警
|
|
@@ -1006,7 +1004,6 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
//预案调用喇叭
|
|
//预案调用喇叭
|
|
|
log.info("打开喇叭-远程调用查询喇叭列表,楼层id={},实验室id={}", floorId, subjectId);
|
|
log.info("打开喇叭-远程调用查询喇叭列表,楼层id={},实验室id={}", floorId, subjectId);
|
|
|
Integer count = labSparseHardwareService.selectSpeakerCount();
|
|
Integer count = labSparseHardwareService.selectSpeakerCount();
|
|
|
- log.info("查询喇叭总数:{}",count);
|
|
|
|
|
R deviceList = remoteSpeakService.getDeviceList(1, count + 10, -99L, subjectId);
|
|
R deviceList = remoteSpeakService.getDeviceList(1, count + 10, -99L, subjectId);
|
|
|
log.info("打开喇叭-远程调用喇叭列表返回内容: deviceList={}", JSON.toJSONString(deviceList));
|
|
log.info("打开喇叭-远程调用喇叭列表返回内容: deviceList={}", JSON.toJSONString(deviceList));
|
|
|
if (deviceList.getCode() == 200) {
|
|
if (deviceList.getCode() == 200) {
|
|
@@ -1181,7 +1178,7 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
//插入风险硬件日志
|
|
//插入风险硬件日志
|
|
|
operateHardWareInfo(labRiskPlanLevel, labRiskPlanAbnormalGroup.getSubjectId(), labRiskPlanAbnormalLog.getGroupId(), riskPlanJson.toString());
|
|
operateHardWareInfo(labRiskPlanLevel, labRiskPlanAbnormalGroup.getSubjectId(), labRiskPlanAbnormalLog.getGroupId(), riskPlanJson.toString());
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- log.error("操作硬件设备异常::::" + e);
|
|
|
|
|
|
|
+ log.error("操作硬件设备异!{}",e);
|
|
|
} finally {
|
|
} finally {
|
|
|
return groupId;
|
|
return groupId;
|
|
|
}
|
|
}
|
|
@@ -1224,7 +1221,7 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
redisService.setCacheSetV2(BaseConstants.WRAN_KEY + subFunction.getSubId(), funSet);
|
|
redisService.setCacheSetV2(BaseConstants.WRAN_KEY + subFunction.getSubId(), funSet);
|
|
|
});
|
|
});
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- log.error("操作硬件设备异常::::" + e);
|
|
|
|
|
|
|
+ log.error("操作硬件设备异常{}",e);
|
|
|
} finally {
|
|
} finally {
|
|
|
return groupId;
|
|
return groupId;
|
|
|
}
|
|
}
|
|
@@ -1240,7 +1237,7 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void insertPlanAbnormalLogByHard(LabRiskPlanLevel labRiskPlanLevel, LabRiskPlanHardwareRelation hardRelation, Long subjectId, Long groupId, String riskPlanJson) {
|
|
public void insertPlanAbnormalLogByHard(LabRiskPlanLevel labRiskPlanLevel, LabRiskPlanHardwareRelation hardRelation, Long subjectId, Long groupId, String riskPlanJson) {
|
|
|
- log.error("打开硬件记录风险日志");
|
|
|
|
|
|
|
+ log.error("硬件记录风险日志");
|
|
|
LabRiskPlanAbnormalLog labRiskPlanAbnormalLog = new LabRiskPlanAbnormalLog();
|
|
LabRiskPlanAbnormalLog labRiskPlanAbnormalLog = new LabRiskPlanAbnormalLog();
|
|
|
String operate = hardwareFunctionStatusConfig.getCache().get(hardRelation.getHardwareType() + "-" + hardRelation.getOperate()).getDescribe();
|
|
String operate = hardwareFunctionStatusConfig.getCache().get(hardRelation.getHardwareType() + "-" + hardRelation.getOperate()).getDescribe();
|
|
|
labRiskPlanAbnormalLog.setRiskPlanId(labRiskPlanLevel.getRiskPlanId());
|
|
labRiskPlanAbnormalLog.setRiskPlanId(labRiskPlanLevel.getRiskPlanId());
|
|
@@ -1359,7 +1356,7 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
* @return 结果
|
|
* @return 结果
|
|
|
*/
|
|
*/
|
|
|
public void operateHardWareInfo(LabRiskPlanLevel labRiskPlanLevel, Long subjectId, Long groupId, String riskPlanJson) {
|
|
public void operateHardWareInfo(LabRiskPlanLevel labRiskPlanLevel, Long subjectId, Long groupId, String riskPlanJson) {
|
|
|
- log.error("这里需要开始调用相关硬件设备=======================================================");
|
|
|
|
|
|
|
+ log.info("开始调用相关硬件设备");
|
|
|
//这里获取预案下的硬件关联列表
|
|
//这里获取预案下的硬件关联列表
|
|
|
List<LabRiskPlanHardwareRelation> riskPlanHardwareList = labRiskPlanLevel.getRiskPlanHardwareList();
|
|
List<LabRiskPlanHardwareRelation> riskPlanHardwareList = labRiskPlanLevel.getRiskPlanHardwareList();
|
|
|
Map<HardwareTypeEnum, List<FunctionStatus>> hardwareFunList = hardwareFunctionStatusConfig.getHardwareFunctionStatusListMap();
|
|
Map<HardwareTypeEnum, List<FunctionStatus>> hardwareFunList = hardwareFunctionStatusConfig.getHardwareFunctionStatusListMap();
|
|
@@ -1376,7 +1373,6 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
labSubjectManagerService.operationHardware(status, hardwareList);
|
|
labSubjectManagerService.operationHardware(status, hardwareList);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- log.error("打开硬件记录风险日志");
|
|
|
|
|
insertPlanAbnormalLogByHard(labRiskPlanLevel, riskPlanHardwareList.get(i), subjectId, groupId, riskPlanJson);
|
|
insertPlanAbnormalLogByHard(labRiskPlanLevel, riskPlanHardwareList.get(i), subjectId, groupId, riskPlanJson);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|