|
@@ -220,27 +220,11 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
labRiskPlan.setDeptName(user.getDeptName());
|
|
labRiskPlan.setDeptName(user.getDeptName());
|
|
|
labRiskPlan.setCreateTime(DateUtils.getNowDate());
|
|
labRiskPlan.setCreateTime(DateUtils.getNowDate());
|
|
|
labRiskPlan.setUpdateTime(DateUtils.getNowDate());
|
|
labRiskPlan.setUpdateTime(DateUtils.getNowDate());
|
|
|
- //有个启动条件,需要查询出所有传感器拼接
|
|
|
|
|
- labRiskPlan.setStartCondition("~~~~~~~~~~~~~~~~~~~");
|
|
|
|
|
int i = labRiskPlanMapper.insertLabRiskPlan(labRiskPlan);
|
|
int i = labRiskPlanMapper.insertLabRiskPlan(labRiskPlan);
|
|
|
if (i > 0) {
|
|
if (i > 0) {
|
|
|
return labRiskPlan.getId();
|
|
return labRiskPlan.getId();
|
|
|
}
|
|
}
|
|
|
return -1L;
|
|
return -1L;
|
|
|
-
|
|
|
|
|
-// log.info("预案id={}", labRiskPlan.getId());
|
|
|
|
|
-// //分级存储
|
|
|
|
|
-// List<LabRiskPlanLevel> labRiskPlanLevels = labRiskPlan.getLabRiskPlanLevels();
|
|
|
|
|
-// //查询
|
|
|
|
|
-// for (LabRiskPlanLevel labRiskPlanLevel : labRiskPlanLevels) {
|
|
|
|
|
-// labRiskPlanLevel.setRiskPlanId(labRiskPlan.getId());
|
|
|
|
|
-// }
|
|
|
|
|
-// labRiskPlanLevelService.insertLabRiskPlanLevel(labRiskPlanLevels);
|
|
|
|
|
-// //关联实验室
|
|
|
|
|
-// List<RiskPlanSubjectRelationVo> riskPlanSubjectRelationVoList = labRiskPlan.getRiskPlanSubjectRelationVoList();
|
|
|
|
|
-// if (!riskPlanSubjectRelationVoList.isEmpty()) {
|
|
|
|
|
-// riskPlanJoinSub(labRiskPlan.getId(), riskPlanSubjectRelationVoList);
|
|
|
|
|
-// }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -255,29 +239,6 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
LabRiskPlan newLabRiskPlan = labRiskPlanMapper.selectLabRiskPlanById(labRiskPlan.getId());
|
|
LabRiskPlan newLabRiskPlan = labRiskPlanMapper.selectLabRiskPlanById(labRiskPlan.getId());
|
|
|
newLabRiskPlan.setLabRiskPlanjoinsubList(labRiskPlanjoinsubList);
|
|
newLabRiskPlan.setLabRiskPlanjoinsubList(labRiskPlanjoinsubList);
|
|
|
Map<String, Object> resultStr = getLabRiskPlanRepeat(newLabRiskPlan);
|
|
Map<String, Object> resultStr = getLabRiskPlanRepeat(newLabRiskPlan);
|
|
|
-// LabRiskPlanjoinsubVO labRiskPlanjoinsubVO = new LabRiskPlanjoinsubVO();
|
|
|
|
|
-// labRiskPlanjoinsubVO.setRiskPlanId(labRiskPlan.getId());
|
|
|
|
|
-// Optional.ofNullable(labRiskPlan.getLabRiskPlanjoinsubList()).orElseGet(Collections::emptyList)
|
|
|
|
|
-// .stream().forEach(a->{
|
|
|
|
|
-// labRiskPlanjoinsubVO.getSubIds().add(a.getSubjectId());
|
|
|
|
|
-// });
|
|
|
|
|
-// List<LabRiskPlanjoinsubVO> riskPlanjoinsubVOList = labRiskPlanjoinsubMapper.getPlanjoinsubNoRiskList(labRiskPlanjoinsubVO);
|
|
|
|
|
-//
|
|
|
|
|
-// Map<String,Object> resultStr = new HashMap<>();
|
|
|
|
|
-// StringBuffer tipsStr = new StringBuffer();
|
|
|
|
|
-// if(riskPlanjoinsubVOList.size()>0){
|
|
|
|
|
-// Optional.ofNullable(riskPlanjoinsubVOList).orElseGet(Collections::emptyList)
|
|
|
|
|
-// .stream().forEach(a->{
|
|
|
|
|
-// tipsStr.append(","+a.getSubName());
|
|
|
|
|
-// });
|
|
|
|
|
-// resultStr.put("tipsStr",tipsStr.substring(1)+"实验室已经关联了预案,是否绑定到当前预案");
|
|
|
|
|
-// resultStr.put("riskPlanjoinsubList",riskPlanjoinsubVOList);
|
|
|
|
|
-// resultStr.put("repeat",true);
|
|
|
|
|
-// }else{
|
|
|
|
|
-// resultStr.put("tipsStr","");
|
|
|
|
|
-// resultStr.put("riskPlanjoinsubList","");
|
|
|
|
|
-// resultStr.put("repeat",false);
|
|
|
|
|
-// }
|
|
|
|
|
return resultStr;
|
|
return resultStr;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -322,25 +283,6 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
labRiskPlanDistribution.setCreateBy(tokenService.getLoginUser().getSysUser().getNickName());
|
|
labRiskPlanDistribution.setCreateBy(tokenService.getLoginUser().getSysUser().getNickName());
|
|
|
labRiskPlanDistributionMapper.insertLabRiskPlanDistribution(labRiskPlanDistribution);
|
|
labRiskPlanDistributionMapper.insertLabRiskPlanDistribution(labRiskPlanDistribution);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- //删除预案和实验室的关联数据
|
|
|
|
|
-// labRiskPlanjoinsubMapper.deleteByPlanjoinsubId(riskPlanId);
|
|
|
|
|
-// for (RiskPlanSubjectRelationVo laRiskPlanSubjectRelationVo : riskPlanSubjectRelationVoList) {
|
|
|
|
|
-// List<LabSensorHazardRelation> labSensorHazardRelations = laRiskPlanSubjectRelationVo.getLabSensorHazardRelations();
|
|
|
|
|
-// labSensorHazardRelation.setRiskPlanId(riskPlanId);
|
|
|
|
|
-// //建立预案和实验室的关联数据
|
|
|
|
|
-// LabRiskPlanjoinsub labRiskPlanjoinsub = new LabRiskPlanjoinsub();
|
|
|
|
|
-// labRiskPlanjoinsub.setSubjectId(labSensorHazardRelations.get(0).getSubjectId());
|
|
|
|
|
-// labRiskPlanjoinsub.setRiskPlanId(riskPlanId);
|
|
|
|
|
-// labRiskPlanjoinsub.setUserId(tokenService.getLoginUser().getSysUser().getUserId());
|
|
|
|
|
-// labRiskPlanjoinsub.setCreateBy(tokenService.getLoginUser().getSysUser().getNickName());
|
|
|
|
|
-// labRiskPlanjoinsub.setCreateTime(DateUtils.getNowDate());
|
|
|
|
|
-// labRiskPlanjoinsubMapper.insertLabRiskPlanjoinsub(labRiskPlanjoinsub);
|
|
|
|
|
-// }
|
|
|
|
|
-// labSensorHazardRelationService.remove(new LambdaQueryWrapper<LabSensorHazardRelation>().eq(LabSensorHazardRelation::getRiskPlanId,riskPlanId));
|
|
|
|
|
-// labSensorHazardRelationService.saveBatch(labSensorHazardRelations);
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -902,7 +844,7 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
redisService.setCacheObject("subjectByYa" + subFunction.getSubId(), subFunction.getSubId(), 2L, TimeUnit.MINUTES);
|
|
redisService.setCacheObject("subjectByYa" + subFunction.getSubId(), subFunction.getSubId(), 2L, TimeUnit.MINUTES);
|
|
|
//这里处理,如果是火焰预案,需要redis额外缓存
|
|
//这里处理,如果是火焰预案,需要redis额外缓存
|
|
|
Optional.ofNullable(subFunction.getFunctionStatuses()).orElseGet(Collections::emptyList).stream().filter(a -> "huoyan".equals(a.getFunNum())).forEach(a -> {
|
|
Optional.ofNullable(subFunction.getFunctionStatuses()).orElseGet(Collections::emptyList).stream().filter(a -> "huoyan".equals(a.getFunNum())).forEach(a -> {
|
|
|
- if (redisService.getCacheObject("subjectByHuoyan" + subFunction.getSubId()) == null) {
|
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(a.getVal()) && a.getVal().equals("1") && redisService.getCacheObject("subjectByHuoyan" + subFunction.getSubId()) == null) {
|
|
|
redisService.setCacheObject("subjectByHuoyan" + subFunction.getSubId(), subFunction, 1L, TimeUnit.HOURS);
|
|
redisService.setCacheObject("subjectByHuoyan" + subFunction.getSubId(), subFunction, 1L, TimeUnit.HOURS);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -1368,7 +1310,7 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
for (LabHardware hard : hardwareList) {
|
|
for (LabHardware hard : hardwareList) {
|
|
|
ResultData result = labSubjectManagerService.excutingComm(hard, status);
|
|
ResultData result = labSubjectManagerService.excutingComm(hard, status);
|
|
|
try {
|
|
try {
|
|
|
- Thread.sleep(200);
|
|
|
|
|
|
|
+ Thread.sleep(300);
|
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
@@ -1404,7 +1346,7 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
for (LabHardware hard : hardwareList) {
|
|
for (LabHardware hard : hardwareList) {
|
|
|
labSubjectManagerService.excutingComm(hard, status);
|
|
labSubjectManagerService.excutingComm(hard, status);
|
|
|
try {
|
|
try {
|
|
|
- Thread.sleep(200);
|
|
|
|
|
|
|
+ Thread.sleep(300);
|
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|