|
|
@ -295,8 +295,6 @@ public class MonitorServiceImpl implements MonitorService { |
|
|
|
List<StAlarmRecordEntity> alertList = alertService.list(new LambdaQueryWrapper<StAlarmRecordEntity>() {{ |
|
|
|
List<StAlarmRecordEntity> alertList = alertService.list(new LambdaQueryWrapper<StAlarmRecordEntity>() {{ |
|
|
|
orderByDesc(StAlarmRecordEntity::getCreateTime); |
|
|
|
orderByDesc(StAlarmRecordEntity::getCreateTime); |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
// 获取所有故障记录
|
|
|
|
|
|
|
|
List<FdpFaultStatusVo> faultList = this.getFdpFaultAll(); |
|
|
|
|
|
|
|
// 所有设备分类
|
|
|
|
// 所有设备分类
|
|
|
|
Map<String, List<String>> deviceClassifyMap = (Map<String, List<String>>) redisTemplate.opsForValue().get(device_classify_cache_final); |
|
|
|
Map<String, List<String>> deviceClassifyMap = (Map<String, List<String>>) redisTemplate.opsForValue().get(device_classify_cache_final); |
|
|
|
// 所有设备
|
|
|
|
// 所有设备
|
|
|
@ -309,7 +307,7 @@ public class MonitorServiceImpl implements MonitorService { |
|
|
|
// 铃铛
|
|
|
|
// 铃铛
|
|
|
|
List<String> bells = alarmQueryService.bells(stationEntityList.stream().map(StationEntity::getCode).collect(Collectors.toList())); |
|
|
|
List<String> bells = alarmQueryService.bells(stationEntityList.stream().map(StationEntity::getCode).collect(Collectors.toList())); |
|
|
|
// 数据中断
|
|
|
|
// 数据中断
|
|
|
|
List<String> aborts = interruptionAlarmService.aborts(stationEntityList.stream().map(StationEntity::getCode).collect(Collectors.toList())); |
|
|
|
List<String> aborts = interruptionAlarmService.aborts(stationEntityList.stream().filter(o->HomePageConstant.HYDROPOWER_SERVETYPE_STR.equals(o.getServeType())).map(StationEntity::getCode).collect(Collectors.toList())); |
|
|
|
// 隐藏设备列表
|
|
|
|
// 隐藏设备列表
|
|
|
|
List<String> hideList = attrConfigService.getHideList(); |
|
|
|
List<String> hideList = attrConfigService.getHideList(); |
|
|
|
// 分割,每个map限制10个长度
|
|
|
|
// 分割,每个map限制10个长度
|
|
|
@ -339,7 +337,7 @@ public class MonitorServiceImpl implements MonitorService { |
|
|
|
deviceVo.setDeviceName(device); |
|
|
|
deviceVo.setDeviceName(device); |
|
|
|
deviceVo.setDeviceCode(attbt.get(0).getEmCode()); |
|
|
|
deviceVo.setDeviceCode(attbt.get(0).getEmCode()); |
|
|
|
// 设备处理
|
|
|
|
// 设备处理
|
|
|
|
this.handleDevice(attbt, map, deviceVo, alertList, faultList); |
|
|
|
this.handleDevice(attbt, map, deviceVo, alertList); |
|
|
|
deviceList.add(deviceVo); |
|
|
|
deviceList.add(deviceVo); |
|
|
|
}); |
|
|
|
}); |
|
|
|
// 设备状态
|
|
|
|
// 设备状态
|
|
|
@ -389,8 +387,7 @@ public class MonitorServiceImpl implements MonitorService { |
|
|
|
* @param device |
|
|
|
* @param device |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void handleDevice(List<StationAttributeEntity> list, Map<String, Map<String, String>> map, |
|
|
|
private void handleDevice(List<StationAttributeEntity> list, Map<String, Map<String, String>> map, |
|
|
|
RealDeviceVo device, List<StAlarmRecordEntity> alertList, |
|
|
|
RealDeviceVo device, List<StAlarmRecordEntity> alertList) { |
|
|
|
List<FdpFaultStatusVo> faultList) { |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(list) || MapUtils.isEmpty(map)) { |
|
|
|
if (CollectionUtil.isEmpty(list) || MapUtils.isEmpty(map)) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -410,7 +407,7 @@ public class MonitorServiceImpl implements MonitorService { |
|
|
|
attbtList.add(realAttributeVo); |
|
|
|
attbtList.add(realAttributeVo); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
realAttributeVo = handleAttbt(item, real, alertList, faultList); |
|
|
|
realAttributeVo = handleAttbt(item, real, alertList); |
|
|
|
if (ObjectUtil.isEmpty(realAttributeVo)) { |
|
|
|
if (ObjectUtil.isEmpty(realAttributeVo)) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -536,7 +533,7 @@ public class MonitorServiceImpl implements MonitorService { |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private RealAttributeVo handleAttbt(StationAttributeEntity item, Map<String, String> real, |
|
|
|
private RealAttributeVo handleAttbt(StationAttributeEntity item, Map<String, String> real, |
|
|
|
List<StAlarmRecordEntity> alertList, List<FdpFaultStatusVo> faultList) { |
|
|
|
List<StAlarmRecordEntity> alertList) { |
|
|
|
RealAttributeVo attest = new RealAttributeVo(); |
|
|
|
RealAttributeVo attest = new RealAttributeVo(); |
|
|
|
this.setAttbtParam(attest, real); |
|
|
|
this.setAttbtParam(attest, real); |
|
|
|
attest.setRealId(item.getMonitorId()); |
|
|
|
attest.setRealId(item.getMonitorId()); |
|
|
@ -567,8 +564,6 @@ public class MonitorServiceImpl implements MonitorService { |
|
|
|
default: |
|
|
|
default: |
|
|
|
throw new IllegalStateException("Unexpected type: " + type); |
|
|
|
throw new IllegalStateException("Unexpected type: " + type); |
|
|
|
} |
|
|
|
} |
|
|
|
// 故障信息设置
|
|
|
|
|
|
|
|
accidentDetails(attest, faultList, value); |
|
|
|
|
|
|
|
return attest; |
|
|
|
return attest; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -606,34 +601,6 @@ public class MonitorServiceImpl implements MonitorService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 故障信息设置 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param attest |
|
|
|
|
|
|
|
* @param faultList |
|
|
|
|
|
|
|
* @param value |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private void accidentDetails(RealAttributeVo attest, List<FdpFaultStatusVo> faultList, String value) { |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(faultList) || "-".equals(value)) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<FdpFaultStatusVo> fault = faultList.stream().filter(o -> o.getRealId().equals(attest.getRealId())).collect(Collectors.toList()); |
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(fault)) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
FdpFaultStatusVo fdpFaultStatusVo = fault.get(0); |
|
|
|
|
|
|
|
// 黄色
|
|
|
|
|
|
|
|
if (fdpFaultStatusVo.getValue() > greater_than_cache_final && fdpFaultStatusVo.getValue() < less_than_cache_final) { |
|
|
|
|
|
|
|
attest.setStatus(ConfigStatus.ConfigStatusEnum.YELLOW.getStatus()); |
|
|
|
|
|
|
|
// 橙色
|
|
|
|
|
|
|
|
} else if (fdpFaultStatusVo.getValue() >= be_equa_cache_final) { |
|
|
|
|
|
|
|
attest.setStatus(ConfigStatus.ConfigStatusEnum.ORANGE.getStatus()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
attest.setFdpRate(fdpFaultStatusVo.getValue()); |
|
|
|
|
|
|
|
attest.setFdpFaultId(fdpFaultStatusVo.getFaultId()); |
|
|
|
|
|
|
|
attest.setFdpMonitorId(fdpFaultStatusVo.getMonitorId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 重点属性类型-遥信 :数据逻辑处理 |
|
|
|
* 重点属性类型-遥信 :数据逻辑处理 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param attest |
|
|
|
* @param attest |
|
|
|