Browse Source

#云服务去除数据中断校验

zhongwei
yang_shj 7 months ago
parent
commit
725c3fbee2
  1. 43
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java

43
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java

@ -295,8 +295,6 @@ public class MonitorServiceImpl implements MonitorService {
List<StAlarmRecordEntity> alertList = alertService.list(new LambdaQueryWrapper<StAlarmRecordEntity>() {{
orderByDesc(StAlarmRecordEntity::getCreateTime);
}});
// 获取所有故障记录
List<FdpFaultStatusVo> faultList = this.getFdpFaultAll();
// 所有设备分类
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> 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();
// 分割,每个map限制10个长度
@ -339,7 +337,7 @@ public class MonitorServiceImpl implements MonitorService {
deviceVo.setDeviceName(device);
deviceVo.setDeviceCode(attbt.get(0).getEmCode());
// 设备处理
this.handleDevice(attbt, map, deviceVo, alertList, faultList);
this.handleDevice(attbt, map, deviceVo, alertList);
deviceList.add(deviceVo);
});
// 设备状态
@ -389,8 +387,7 @@ public class MonitorServiceImpl implements MonitorService {
* @param device
*/
private void handleDevice(List<StationAttributeEntity> list, Map<String, Map<String, String>> map,
RealDeviceVo device, List<StAlarmRecordEntity> alertList,
List<FdpFaultStatusVo> faultList) {
RealDeviceVo device, List<StAlarmRecordEntity> alertList) {
if (CollectionUtil.isEmpty(list) || MapUtils.isEmpty(map)) {
return;
}
@ -410,7 +407,7 @@ public class MonitorServiceImpl implements MonitorService {
attbtList.add(realAttributeVo);
return;
}
realAttributeVo = handleAttbt(item, real, alertList, faultList);
realAttributeVo = handleAttbt(item, real, alertList);
if (ObjectUtil.isEmpty(realAttributeVo)) {
return;
}
@ -536,7 +533,7 @@ public class MonitorServiceImpl implements MonitorService {
* @return
*/
private RealAttributeVo handleAttbt(StationAttributeEntity item, Map<String, String> real,
List<StAlarmRecordEntity> alertList, List<FdpFaultStatusVo> faultList) {
List<StAlarmRecordEntity> alertList) {
RealAttributeVo attest = new RealAttributeVo();
this.setAttbtParam(attest, real);
attest.setRealId(item.getMonitorId());
@ -567,8 +564,6 @@ public class MonitorServiceImpl implements MonitorService {
default:
throw new IllegalStateException("Unexpected type: " + type);
}
// 故障信息设置
accidentDetails(attest, faultList, value);
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

Loading…
Cancel
Save