|
@@ -1091,7 +1091,7 @@ public class LabRiskPlanServiceImpl implements ILabRiskPlanService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//插入风险日志
|
|
//插入风险日志
|
|
|
- Long groupId = insertPlanAbnormalLog(newRiskPlan,riskPlanJson,groupList,1L,subFunction.getSubId());
|
|
|
|
|
|
|
+ Long groupId = insertPlanAbnormalLog(newRiskPlan,riskPlanJson,groupList,1L,subFunction);
|
|
|
log.info("####################groupId:"+groupId);
|
|
log.info("####################groupId:"+groupId);
|
|
|
if(groupId!=null){
|
|
if(groupId!=null){
|
|
|
log.error("这里记录预警消息记录开始=======================================================");
|
|
log.error("这里记录预警消息记录开始=======================================================");
|
|
@@ -1399,7 +1399,7 @@ public class LabRiskPlanServiceImpl implements ILabRiskPlanService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- public Long insertPlanAbnormalLog(LabRiskPlan newRiskPlan,JSONArray riskPlanJson,List <LabRiskPlanAbnormalGroupVO> groupList,Long riskStatus,Long subjectId){
|
|
|
|
|
|
|
+ public Long insertPlanAbnormalLog(LabRiskPlan newRiskPlan,JSONArray riskPlanJson,List <LabRiskPlanAbnormalGroupVO> groupList,Long riskStatus,SubFunction<SensorFunctionStatus> subFunction){
|
|
|
LabRiskPlanAbnormalGroup labRiskPlanAbnormalGroup;
|
|
LabRiskPlanAbnormalGroup labRiskPlanAbnormalGroup;
|
|
|
Long groupId;
|
|
Long groupId;
|
|
|
//将风险预案写入日志表
|
|
//将风险预案写入日志表
|
|
@@ -1409,12 +1409,26 @@ public class LabRiskPlanServiceImpl implements ILabRiskPlanService {
|
|
|
labRiskPlanAbnormalLog.setCreateTime(new Date());
|
|
labRiskPlanAbnormalLog.setCreateTime(new Date());
|
|
|
labRiskPlanAbnormalLog.setSensorJson(riskPlanJson.toString());
|
|
labRiskPlanAbnormalLog.setSensorJson(riskPlanJson.toString());
|
|
|
labRiskPlanAbnormalLog.setRiskStatus(riskStatus);
|
|
labRiskPlanAbnormalLog.setRiskStatus(riskStatus);
|
|
|
- labRiskPlanAbnormalLog.setSubjectId(subjectId);
|
|
|
|
|
|
|
+ labRiskPlanAbnormalLog.setSubjectId(subFunction.getSubId());
|
|
|
if(groupList==null || groupList.size()==0){
|
|
if(groupList==null || groupList.size()==0){
|
|
|
- labRiskPlanAbnormalGroup = insertPlanAbnormalGroup(newRiskPlan,subjectId);
|
|
|
|
|
|
|
+ labRiskPlanAbnormalGroup = insertPlanAbnormalGroup(newRiskPlan,subFunction.getSubId());
|
|
|
groupId = labRiskPlanAbnormalGroup.getId();
|
|
groupId = labRiskPlanAbnormalGroup.getId();
|
|
|
//给风险日志表关联组
|
|
//给风险日志表关联组
|
|
|
labRiskPlanAbnormalLog.setGroupId(labRiskPlanAbnormalGroup.getId());
|
|
labRiskPlanAbnormalLog.setGroupId(labRiskPlanAbnormalGroup.getId());
|
|
|
|
|
+
|
|
|
|
|
+ //处理预案下的传感器翻译
|
|
|
|
|
+ for(LabRiskPlanSensorRelation rps:newRiskPlan.getRiskPlanSensorList()){
|
|
|
|
|
+ //硬件社保统一传入的传感器设备列表
|
|
|
|
|
+ for(SensorFunctionStatus sensorFunc:subFunction.getFunctionStatuses()){
|
|
|
|
|
+ if(rps.getFunNum().equals(sensorFunc.getFunNum())){
|
|
|
|
|
+ if(StringUtils.isNotNull(labRiskPlanAbnormalLog.getRemark())){
|
|
|
|
|
+ labRiskPlanAbnormalLog.setRemark(labRiskPlanAbnormalLog.getRemark()+" "+sensorFunc.getDescribe()+":"+sensorFunc.getVal());
|
|
|
|
|
+ }else{
|
|
|
|
|
+ labRiskPlanAbnormalLog.setRemark(sensorFunc.getDescribe()+":"+sensorFunc.getVal());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
//插入风险日志
|
|
//插入风险日志
|
|
|
labRiskPlanAbnormalLogMapper.insertLabRiskPlanAbnormalLog(labRiskPlanAbnormalLog);
|
|
labRiskPlanAbnormalLogMapper.insertLabRiskPlanAbnormalLog(labRiskPlanAbnormalLog);
|
|
|
//todo 后面放入老柴的事件中 或者订阅老柴的事件处理
|
|
//todo 后面放入老柴的事件中 或者订阅老柴的事件处理
|
|
@@ -1422,7 +1436,7 @@ public class LabRiskPlanServiceImpl implements ILabRiskPlanService {
|
|
|
Optional.ofNullable(newRiskPlan.getRiskPlanSensorList())
|
|
Optional.ofNullable(newRiskPlan.getRiskPlanSensorList())
|
|
|
.ifPresent(f->{
|
|
.ifPresent(f->{
|
|
|
Set<String> funSet = newRiskPlan.getRiskPlanSensorList().stream().map(d -> d.getFunNum()).collect(Collectors.toSet());
|
|
Set<String> funSet = newRiskPlan.getRiskPlanSensorList().stream().map(d -> d.getFunNum()).collect(Collectors.toSet());
|
|
|
- redisService.setCacheSetV2(BaseConstants.WRAN_KEY+subjectId,funSet);
|
|
|
|
|
|
|
+ redisService.setCacheSetV2(BaseConstants.WRAN_KEY+subFunction.getSubId(),funSet);
|
|
|
});
|
|
});
|
|
|
try{
|
|
try{
|
|
|
//插入风险硬件日志
|
|
//插入风险硬件日志
|
|
@@ -1457,7 +1471,7 @@ public class LabRiskPlanServiceImpl implements ILabRiskPlanService {
|
|
|
Optional.ofNullable(newRiskPlan.getRiskPlanSensorList())
|
|
Optional.ofNullable(newRiskPlan.getRiskPlanSensorList())
|
|
|
.ifPresent(f->{
|
|
.ifPresent(f->{
|
|
|
Set<String> funSet = newRiskPlan.getRiskPlanSensorList().stream().map(d -> d.getFunNum()).collect(Collectors.toSet());
|
|
Set<String> funSet = newRiskPlan.getRiskPlanSensorList().stream().map(d -> d.getFunNum()).collect(Collectors.toSet());
|
|
|
- redisService.setCacheSetV2(BaseConstants.WRAN_KEY+subjectId,funSet);
|
|
|
|
|
|
|
+ redisService.setCacheSetV2(BaseConstants.WRAN_KEY+subFunction.getSubId(),funSet);
|
|
|
});
|
|
});
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
log.error("操作硬件设备异常::::"+e);
|
|
log.error("操作硬件设备异常::::"+e);
|