|
|
@@ -653,10 +653,14 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
Long groupId = insertPlanAbnormalLog(labRiskPlanLevel, riskPlanJson, groupList, 1L, subFunction, riskAttribute);
|
|
|
if (groupId != null) {
|
|
|
log.info("日志组id不为空时,预警消息记录,groupId = {}", groupId);
|
|
|
- //记录通知
|
|
|
- recordNotice(subFunction, labRiskPlanLevel, groupId);
|
|
|
- //向前端发送mqtt预案触发提示
|
|
|
- messageSendService.riskPlanTriggerNotice();
|
|
|
+ try {
|
|
|
+ //记录通知
|
|
|
+ recordNotice(subFunction, labRiskPlanLevel, groupId);
|
|
|
+ //向前端发送mqtt预案触发提示
|
|
|
+ messageSendService.riskPlanTriggerNotice();
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("test日志={}",e);
|
|
|
+ }
|
|
|
//打开喇叭
|
|
|
openLoudSpeaker(subFunction.getSubId(), labRiskPlanLevel.getFloorId(), labRiskPlanLevel.getRiskPlanId());
|
|
|
//远程调用开始录制视频接口
|
|
|
@@ -800,27 +804,28 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
LabAudioSynthesis labAudioSynthesis = new LabAudioSynthesis();
|
|
|
labAudioSynthesis.setRiskPlanId(riskPlanId);
|
|
|
List<LabAudioSynthesis> audioSyntheses = labAudioSynthesisMapper.selectLabAudioSynthesisList(labAudioSynthesis);
|
|
|
+ log.info("关闭喇叭-查询的音乐列表信息 audioSyntheses= {}", JSON.toJSONString(audioSyntheses));
|
|
|
if (audioSyntheses != null && audioSyntheses.size() > 0) {
|
|
|
- log.info("远程调用查询喇叭列表,楼层id={},实验室id={}", floorId, subjectid);
|
|
|
+ log.info("关闭喇叭-远程调用查询喇叭列表,楼层id={},实验室id={}", floorId, subjectid);
|
|
|
R deviceList = remoteSpeakService.getDeviceList(1, 100, floorId, subjectid);
|
|
|
- log.info("远程调用喇叭列表返回内容: deviceList={}", JSON.toJSONString(deviceList));
|
|
|
+ log.info("关闭喇叭-远程调用喇叭列表返回内容: deviceList={}", JSON.toJSONString(deviceList));
|
|
|
if (deviceList.getCode() == 200) {
|
|
|
List<Map<String, Object>> mapList = (List<Map<String, Object>>) deviceList.getData();
|
|
|
for (Map<String, Object> map : mapList) {
|
|
|
if (StringUtils.isNotNull(map.get("deviceSn")) && StringUtils.isNotNull(map.get("port"))) {
|
|
|
- log.info("远程调用关闭喇叭播放音乐!url={},deviceSn={}", audioSyntheses.get(0).getNewMusicUrl(), map.get("deviceSn"));
|
|
|
+ log.info("关闭喇叭-远程调用喇叭播放音乐!url={},deviceSn={}", audioSyntheses.get(0).getNewMusicUrl(), map.get("deviceSn"));
|
|
|
R r = remoteSpeakService.stopPlayMusic(map.get("deviceSn") + "", audioSyntheses.get(0).getNewMusicUrl());
|
|
|
- log.info("远程调用关闭喇叭播放音乐返回信息:{}", JSON.toJSONString(r));
|
|
|
+ log.info("关闭喇叭-远程调用喇叭播放音乐返回信息:{}", JSON.toJSONString(r));
|
|
|
} else {
|
|
|
- log.info("喇叭deviceSn/port为空!");
|
|
|
+ log.info("关闭喇叭deviceSn/port为空!");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- log.info("合成音乐列表为空,此预案不关闭喇叭!riskPlanId={}", riskPlanId);
|
|
|
+ log.info("关闭喇叭-合成音乐列表为空,此预案不关闭喇叭!riskPlanId={}", riskPlanId);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- log.error("关闭喇叭失败!!!!!:" + e);
|
|
|
+ log.info("关闭喇叭失败!!={}", e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -920,48 +925,52 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
* @Return void
|
|
|
**/
|
|
|
private void recordNotice(SubFunction<SensorFunctionStatus> subFunction, LabRiskPlanLevel labRiskPlanLevel, Long groupId) {
|
|
|
- //记录预警消息记录开始
|
|
|
- insertWarnPushMessageByOnePc(labRiskPlanLevel, subFunction.getSubId(), groupId);
|
|
|
+ try {
|
|
|
+ //记录预警消息记录开始
|
|
|
+ insertWarnPushMessageByOnePc(labRiskPlanLevel, subFunction.getSubId(), groupId);
|
|
|
|
|
|
- //记录语音播报开始
|
|
|
- insertPlanAbnormalLogByVoice(labRiskPlanLevel, subFunction.getSubId(), groupId);
|
|
|
+ //记录语音播报开始
|
|
|
+ insertPlanAbnormalLogByVoice(labRiskPlanLevel, subFunction.getSubId(), groupId);
|
|
|
|
|
|
- //记录语音电话开始
|
|
|
- insertPlanAbnormalLogByPhone(labRiskPlanLevel, subFunction.getSubId(), groupId);
|
|
|
+ //记录语音电话开始
|
|
|
+ insertPlanAbnormalLogByPhone(labRiskPlanLevel, subFunction.getSubId(), groupId);
|
|
|
|
|
|
- //一键灭火日志记录
|
|
|
- insertPlanAbnormalLogByOneClickFire(labRiskPlanLevel, subFunction, groupId);
|
|
|
+ //一键灭火日志记录
|
|
|
+ insertPlanAbnormalLogByOneClickFire(labRiskPlanLevel, subFunction, groupId);
|
|
|
|
|
|
- //向一体机推送语音播报
|
|
|
- String str = StringUtils.isBlank(labRiskPlanLevel.getVoicebroadcast()) ? "" : labRiskPlanLevel.getVoicebroadcast();
|
|
|
- try {
|
|
|
- messageSendService.sendOnepcSubNews(subFunction.getSubId(), 2, RiskPlanConstants.LAB_SAFETY_MANAGEMENT_SYSTEM + labRiskPlanLevel.getTopName() + str);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("向一体机推送语音播报异常:" + e);
|
|
|
- }
|
|
|
+ //向一体机推送语音播报
|
|
|
+ String str = StringUtils.isBlank(labRiskPlanLevel.getVoicebroadcast()) ? "" : labRiskPlanLevel.getVoicebroadcast();
|
|
|
+ try {
|
|
|
+ messageSendService.sendOnepcSubNews(subFunction.getSubId(), 2, RiskPlanConstants.LAB_SAFETY_MANAGEMENT_SYSTEM + labRiskPlanLevel.getTopName() + str);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("向一体机推送语音播报异常:" + e);
|
|
|
+ }
|
|
|
|
|
|
- //向一体机传感器预警
|
|
|
- messageSendService.sendWranFunctionToSub(subFunction.getSubId());
|
|
|
+ //向一体机传感器预警
|
|
|
+ messageSendService.sendWranFunctionToSub(subFunction.getSubId());
|
|
|
|
|
|
- //向一体机发送预警消息展示
|
|
|
- insertMachineContent(subFunction.getSubId(), RiskPlanConstants.LAB_SAFETY_MANAGEMENT_SYSTEM + labRiskPlanLevel.getTopName() + str);
|
|
|
+ //向一体机发送预警消息展示
|
|
|
+ insertMachineContent(subFunction.getSubId(), RiskPlanConstants.LAB_SAFETY_MANAGEMENT_SYSTEM + labRiskPlanLevel.getTopName() + str);
|
|
|
|
|
|
- //首页消息通知
|
|
|
- messageSendService.SendBigViewUpdate(BigViewDataType.SUB_WRAN_MESSAGE);
|
|
|
+ //首页消息通知
|
|
|
+ messageSendService.SendBigViewUpdate(BigViewDataType.SUB_WRAN_MESSAGE);
|
|
|
|
|
|
- //发送大屏左下角预警消息
|
|
|
- labMessageContentService.sendWranMessage(subFunction.getSubId(), labRiskPlanLevel, groupId);
|
|
|
+ //发送大屏左下角预警消息
|
|
|
+ labMessageContentService.sendWranMessage(subFunction.getSubId(), labRiskPlanLevel, groupId);
|
|
|
|
|
|
- //首页预案流程通知
|
|
|
- messageSendService.SendBigViewUpdate(BigViewDataType.SUB_RISKPLAN_LOG);
|
|
|
+ //首页预案流程通知
|
|
|
+ messageSendService.SendBigViewUpdate(BigViewDataType.SUB_RISKPLAN_LOG);
|
|
|
|
|
|
- //首页预案组通知
|
|
|
- messageSendService.SendBigViewUpdate(BigViewDataType.SUB_RISKPLAN_GROUP);
|
|
|
+ //首页预案组通知
|
|
|
+ messageSendService.SendBigViewUpdate(BigViewDataType.SUB_RISKPLAN_GROUP);
|
|
|
|
|
|
- //首页预案是否同步疏散线路
|
|
|
- if (labRiskPlanLevel.getIfExit() != null && labRiskPlanLevel.getIfExit() == 1) {
|
|
|
- redisService.setCacheObject("subjectByExit" + subFunction.getSubId(), subFunction.getSubId(), 30L, TimeUnit.SECONDS);
|
|
|
- messageSendService.SendBigViewUpdate(BigViewDataType.SUB_RISKPLAN_EXIT);
|
|
|
+ //首页预案是否同步疏散线路
|
|
|
+ if (labRiskPlanLevel.getIfExit() != null && labRiskPlanLevel.getIfExit() == 1) {
|
|
|
+ redisService.setCacheObject("subjectByExit" + subFunction.getSubId(), subFunction.getSubId(), 30L, TimeUnit.SECONDS);
|
|
|
+ messageSendService.SendBigViewUpdate(BigViewDataType.SUB_RISKPLAN_EXIT);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("预案处理消息异常!{}",e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -978,49 +987,40 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
LabAudioSynthesis labAudioSynthesis = new LabAudioSynthesis();
|
|
|
labAudioSynthesis.setRiskPlanId(riskPlanId);
|
|
|
List<LabAudioSynthesis> audioSyntheses = labAudioSynthesisMapper.selectLabAudioSynthesisList(labAudioSynthesis);
|
|
|
- log.info("查询的音乐列表信息 audioSyntheses= {}", JSON.toJSONString(audioSyntheses));
|
|
|
+ log.info("打开喇叭-查询的音乐列表信息 audioSyntheses= {}", JSON.toJSONString(audioSyntheses));
|
|
|
if (audioSyntheses != null && audioSyntheses.size() > 0) {
|
|
|
//预案调用喇叭
|
|
|
- log.info("远程调用查询喇叭列表,楼层id={},实验室id={}", floorId, subjectId);
|
|
|
+ log.info("打开喇叭-远程调用查询喇叭列表,楼层id={},实验室id={}", floorId, subjectId);
|
|
|
R deviceList = remoteSpeakService.getDeviceList(1, 100, floorId, subjectId);
|
|
|
- log.info("远程调用喇叭列表返回内容: deviceList={}", JSON.toJSONString(deviceList));
|
|
|
+ log.info("打开喇叭-远程调用喇叭列表返回内容: deviceList={}", JSON.toJSONString(deviceList));
|
|
|
if (deviceList.getCode() == 200) {
|
|
|
- log.info("调用喇叭1");
|
|
|
List<Map<String, Object>> mapList = (List<Map<String, Object>>) deviceList.getData();
|
|
|
- log.info("调用喇叭2={}",JSON.toJSONString(mapList));
|
|
|
for (Map<String, Object> map : mapList) {
|
|
|
if (StringUtils.isNotNull(map.get("deviceSn")) && StringUtils.isNotNull(map.get("port"))) {
|
|
|
- log.info("调用喇叭3");
|
|
|
List<PlayVo> playVoList = new ArrayList<>();
|
|
|
PlayVo playVo = new PlayVo();
|
|
|
- log.info("调用喇叭4");
|
|
|
playVo.setSn(map.get("deviceSn") + "");
|
|
|
- log.info("调用喇叭5");
|
|
|
playVo.setDeviceIp(map.get("deviceIp") + "");
|
|
|
- log.info("调用喇叭6");
|
|
|
playVo.setPort(Integer.parseInt(map.get("port") + ""));
|
|
|
- log.info("调用喇叭7");
|
|
|
ParamVo paramVo = new ParamVo();
|
|
|
paramVo.setVol(Integer.parseInt(map.get("deviceVol").toString()));
|
|
|
- log.info("调用喇叭8");
|
|
|
playVo.setParams(paramVo);
|
|
|
- log.info("调用喇叭9");
|
|
|
playVoList.add(playVo);
|
|
|
- log.info("远程调用喇叭播放音乐!url={},playVoList={}", audioSyntheses.get(0).getNewMusicUrl(), JSON.toJSONString(playVoList));
|
|
|
+ log.info("打开喇叭-远程调用喇叭播放音乐!url={},playVoList={}", audioSyntheses.get(0).getNewMusicUrl(), JSON.toJSONString(playVoList));
|
|
|
R r = remoteSpeakService.textParseUrlAppIps(audioSyntheses.get(0).getNewMusicUrl(), playVoList);
|
|
|
- log.info("远程调用喇叭播放音乐返回信息:{}", JSON.toJSONString(r));
|
|
|
+ log.info("打开喇叭-远程调用喇叭播放音乐返回信息:{}", JSON.toJSONString(r));
|
|
|
} else {
|
|
|
- log.info("喇叭deviceSn/port为空!");
|
|
|
+ log.info("打开喇叭-喇叭deviceSn/port为空!");
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- log.info("远程查询喇叭信息错误!");
|
|
|
+ log.info("打开喇叭-远程查询喇叭信息错误!");
|
|
|
}
|
|
|
} else {
|
|
|
- log.info("合成音乐列表为空,此预案不触发音乐!riskPlanId={}", riskPlanId);
|
|
|
+ log.info("打开喇叭-合成音乐列表为空,此预案不触发音乐!riskPlanId={}", riskPlanId);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- log.info("开启喇叭失败!={}",e);
|
|
|
+ log.error("开启喇叭异常!={}",e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1281,25 +1281,29 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
}
|
|
|
|
|
|
public void insertPlanAbnormalLogByOneClickFire(LabRiskPlanLevel labRiskPlanLevel, SubFunction<SensorFunctionStatus> subFunction, Long groupId) {
|
|
|
- //将一件灭火插入日志
|
|
|
- subFunction.getFunctionStatuses().stream().filter(a -> "huoyan".equals(a.getFunNum())).forEach(a -> {
|
|
|
- if (a.getAutomanual() == 0 || a.getAutomanual() == 1) {
|
|
|
- LabRiskPlanAbnormalLog labRiskPlanAbnormalLog = new LabRiskPlanAbnormalLog();
|
|
|
- labRiskPlanAbnormalLog.setRiskPlanId(labRiskPlanLevel.getRiskPlanId());
|
|
|
- labRiskPlanAbnormalLog.setRiskPlanName("一键灭火");
|
|
|
- labRiskPlanAbnormalLog.setSubjectId(subFunction.getSubId());
|
|
|
- labRiskPlanAbnormalLog.setCreateTime(new Date());
|
|
|
- labRiskPlanAbnormalLog.setGroupId(groupId);
|
|
|
- labRiskPlanAbnormalLog.setRiskAttribute(labRiskPlanLevel.getRiskAttribute());
|
|
|
- labRiskPlanAbnormalLog.setRiskPlanLevelId(labRiskPlanLevel.getId());
|
|
|
- labRiskPlanAbnormalLog.setRiskPlanLevelName(RiskPlanLevelEnum.getValue(labRiskPlanLevel.getRiskPlanLevel()));
|
|
|
- labRiskPlanAbnormalLog.setRiskPlanLevel(labRiskPlanLevel.getRiskPlanLevel());
|
|
|
- labRiskPlanAbnormalLog.setRiskStatus(6L);
|
|
|
- labRiskPlanAbnormalLog.setRemark(a.getAutomanual() == 1 ? "自动灭火" : "手动灭火");
|
|
|
- //插入风险日志
|
|
|
- labRiskPlanAbnormalLogMapper.insertLabRiskPlanAbnormalLog(labRiskPlanAbnormalLog);
|
|
|
- }
|
|
|
- });
|
|
|
+ try {
|
|
|
+ //将一件灭火插入日志
|
|
|
+ subFunction.getFunctionStatuses().stream().filter(a -> "huoyan".equals(a.getFunNum()) && a.getAutomanual() != null).forEach(a -> {
|
|
|
+ if (a.getAutomanual() == 0 || a.getAutomanual() == 1) {
|
|
|
+ LabRiskPlanAbnormalLog labRiskPlanAbnormalLog = new LabRiskPlanAbnormalLog();
|
|
|
+ labRiskPlanAbnormalLog.setRiskPlanId(labRiskPlanLevel.getRiskPlanId());
|
|
|
+ labRiskPlanAbnormalLog.setRiskPlanName("一键灭火");
|
|
|
+ labRiskPlanAbnormalLog.setSubjectId(subFunction.getSubId());
|
|
|
+ labRiskPlanAbnormalLog.setCreateTime(new Date());
|
|
|
+ labRiskPlanAbnormalLog.setGroupId(groupId);
|
|
|
+ labRiskPlanAbnormalLog.setRiskAttribute(labRiskPlanLevel.getRiskAttribute());
|
|
|
+ labRiskPlanAbnormalLog.setRiskPlanLevelId(labRiskPlanLevel.getId());
|
|
|
+ labRiskPlanAbnormalLog.setRiskPlanLevelName(RiskPlanLevelEnum.getValue(labRiskPlanLevel.getRiskPlanLevel()));
|
|
|
+ labRiskPlanAbnormalLog.setRiskPlanLevel(labRiskPlanLevel.getRiskPlanLevel());
|
|
|
+ labRiskPlanAbnormalLog.setRiskStatus(6L);
|
|
|
+ labRiskPlanAbnormalLog.setRemark(a.getAutomanual() == 1 ? "自动灭火" : "手动灭火");
|
|
|
+ //插入风险日志
|
|
|
+ labRiskPlanAbnormalLogMapper.insertLabRiskPlanAbnormalLog(labRiskPlanAbnormalLog);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("一键灭火插入日志异常!{}",e);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|