|
|
@@ -47,6 +47,7 @@ import org.jetbrains.annotations.NotNull;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -114,6 +115,7 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
private LabAudioSynthesisMapper labAudioSynthesisMapper;
|
|
|
|
|
|
@Autowired
|
|
|
+ @Lazy
|
|
|
private LabRiskPlanLevelService labRiskPlanLevelService;
|
|
|
|
|
|
@Autowired
|
|
|
@@ -143,6 +145,9 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
@Autowired
|
|
|
private ILabBuildFloorLayoutService labBuildFloorLayoutService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ILabSparseHardwareService labSparseHardwareService;
|
|
|
+
|
|
|
private static final Logger log = LoggerFactory.getLogger(LabRiskPlanServiceImpl.class);
|
|
|
|
|
|
|
|
|
@@ -804,7 +809,9 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
log.info("关闭喇叭-查询的音乐列表信息 audioSyntheses= {}", JSON.toJSONString(audioSyntheses));
|
|
|
if (audioSyntheses != null && audioSyntheses.size() > 0) {
|
|
|
log.info("关闭喇叭-远程调用查询喇叭列表,楼层id={},实验室id={}", floorId, subjectid);
|
|
|
- R deviceList = remoteSpeakService.getDeviceList(1, 100, floorId, subjectid);
|
|
|
+ Integer count = labSparseHardwareService.selectSpeakerCount();
|
|
|
+ log.info("查询喇叭总数:{}",count);
|
|
|
+ R deviceList = remoteSpeakService.getDeviceList(1, count + 10, floorId, subjectid);
|
|
|
log.info("关闭喇叭-远程调用喇叭列表返回内容: deviceList={}", JSON.toJSONString(deviceList));
|
|
|
if (deviceList.getCode() == 200) {
|
|
|
List<Map<String, Object>> mapList = (List<Map<String, Object>>) deviceList.getData();
|
|
|
@@ -1000,7 +1007,9 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
if (audioSyntheses != null && audioSyntheses.size() > 0) {
|
|
|
//预案调用喇叭
|
|
|
log.info("打开喇叭-远程调用查询喇叭列表,楼层id={},实验室id={}", floorId, subjectId);
|
|
|
- R deviceList = remoteSpeakService.getDeviceList(1, 100, floorId, subjectId);
|
|
|
+ Integer count = labSparseHardwareService.selectSpeakerCount();
|
|
|
+ log.info("查询喇叭总数:{}",count);
|
|
|
+ R deviceList = remoteSpeakService.getDeviceList(1, count + 10, floorId, subjectId);
|
|
|
log.info("打开喇叭-远程调用喇叭列表返回内容: deviceList={}", JSON.toJSONString(deviceList));
|
|
|
if (deviceList.getCode() == 200) {
|
|
|
List<Map<String, Object>> mapList = (List<Map<String, Object>>) deviceList.getData();
|
|
|
@@ -1016,7 +1025,7 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
playVo.setParams(paramVo);
|
|
|
playVoList.add(playVo);
|
|
|
log.info("打开喇叭-远程调用喇叭播放音乐!url={},playVoList={}", audioSyntheses.get(0).getNewMusicUrl(), JSON.toJSONString(playVoList));
|
|
|
- R r = remoteSpeakService.textParseUrlAppIps(audioSyntheses.get(0).getNewMusicUrl(), playVoList);
|
|
|
+ R r = remoteSpeakService.textMoreParseUrlAppIps(audioSyntheses.get(0).getNewMusicUrl(), playVoList,1000);
|
|
|
log.info("打开喇叭-远程调用喇叭播放音乐返回信息:{}", JSON.toJSONString(r));
|
|
|
} else {
|
|
|
log.info("打开喇叭-喇叭deviceSn/port为空!");
|
|
|
@@ -1042,7 +1051,7 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
private void startVideo(Long subjectId) {
|
|
|
try {
|
|
|
LabHardware labHardware = labHardwareService.selectLabHardwareCameraBySub(subjectId);
|
|
|
- if (labHardware != null || labHardware.getIpAddress() != null) {
|
|
|
+ if (labHardware != null && labHardware.getIpAddress() != null) {
|
|
|
//开始录制视频
|
|
|
log.info("远程调用开始录制视频ip地址={}", labHardware.getIpAddress());
|
|
|
remoteCameraService.stopRecord(labHardware.getIpAddress());
|
|
|
@@ -1057,7 +1066,7 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
log.info("未查询到实验室关联摄像头信息!请检查ip是否为空!");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- log.error("远程调用开始录制视频接口失败!{}", e);
|
|
|
+ log.error("远程调用开始录制视频接口异常!{}", e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1365,15 +1374,8 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
labHardware.setSubjectId(subjectId);
|
|
|
labHardware.setType(HardwareTypeEnum.getByCode(riskPlanHardwareList.get(i).getHardwareType()));
|
|
|
List<LabHardware> hardwareList = labHardwareMapper.selectLabHardwareListBySubject(labHardware);
|
|
|
- //循环执行实验室下的硬件功能
|
|
|
- for (LabHardware hard : hardwareList) {
|
|
|
- ResultData result = labSubjectManagerService.excutingComm(hard, status);
|
|
|
- try {
|
|
|
- Thread.sleep(300);
|
|
|
- } catch (InterruptedException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
+ //异步循环执行实验室下的硬件功能
|
|
|
+ labSubjectManagerService.operationHardware(status, hardwareList);
|
|
|
}
|
|
|
}
|
|
|
log.error("打开硬件记录风险日志");
|
|
|
@@ -1401,15 +1403,12 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
labHardware.setSubjectId(subjectId);
|
|
|
labHardware.setType(HardwareTypeEnum.getByCode(riskPlanHardwareList.get(i).getHardwareType()));
|
|
|
List<LabHardware> hardwareList = labHardwareMapper.selectLabHardwareListBySubject(labHardware);
|
|
|
- //循环执行实验室下的硬件功能
|
|
|
- for (LabHardware hard : hardwareList) {
|
|
|
- labSubjectManagerService.excutingComm(hard, status);
|
|
|
- try {
|
|
|
- Thread.sleep(300);
|
|
|
- } catch (InterruptedException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ if (hardwareList.isEmpty()) {
|
|
|
+ log.info("查询实验室硬件信息为空,跳过此实验室!subjectId={}",subjectId);
|
|
|
+ continue;
|
|
|
}
|
|
|
+ //异步循环执行实验室下的硬件功能
|
|
|
+ labSubjectManagerService.operationHardware(status,hardwareList);
|
|
|
}
|
|
|
}
|
|
|
}
|