|
|
@ -291,6 +291,8 @@ public class MonitorServiceImpl implements MonitorService { |
|
|
|
List<String> aborts = interruptionAlarmService.aborts(operations); |
|
|
|
List<String> aborts = interruptionAlarmService.aborts(operations); |
|
|
|
// 设备状态分类
|
|
|
|
// 设备状态分类
|
|
|
|
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); |
|
|
|
|
|
|
|
// 设备信息
|
|
|
|
|
|
|
|
List<EminfoAndEmParamVo> deviceParms = JSONObject.parseObject(redisTemplate.opsForValue().get(device_cache_final).toString(),new TypeReference<List<EminfoAndEmParamVo>>() {}); |
|
|
|
// 按10个站点一组分割属性配置
|
|
|
|
// 按10个站点一组分割属性配置
|
|
|
|
List<Map<String, List<StationAttributeEntity>>> limit = this.limitMapChunk(attributes); |
|
|
|
List<Map<String, List<StationAttributeEntity>>> limit = this.limitMapChunk(attributes); |
|
|
|
// 线程执行次数
|
|
|
|
// 线程执行次数
|
|
|
@ -305,8 +307,8 @@ public class MonitorServiceImpl implements MonitorService { |
|
|
|
RealStationVo realStation = new RealStationVo(); |
|
|
|
RealStationVo realStation = new RealStationVo(); |
|
|
|
// 设备信息
|
|
|
|
// 设备信息
|
|
|
|
List<RealDeviceVo> devices = this.monitorRealDevice(value,realTimeData); |
|
|
|
List<RealDeviceVo> devices = this.monitorRealDevice(value,realTimeData); |
|
|
|
// 设备状态
|
|
|
|
// 设备状态、装机容量
|
|
|
|
this.deviceStatus(devices,deviceClassifyMap); |
|
|
|
this.deviceParam(devices,deviceClassifyMap,deviceParms); |
|
|
|
realStation.setDeviceList(devices.stream().sorted(Comparator.comparing(RealDeviceVo::getDeviceName)).collect(Collectors.toList())); |
|
|
|
realStation.setDeviceList(devices.stream().sorted(Comparator.comparing(RealDeviceVo::getDeviceName)).collect(Collectors.toList())); |
|
|
|
// 站点基础信息: 编码、名称、限制水位、服务类型、机构、排序
|
|
|
|
// 站点基础信息: 编码、名称、限制水位、服务类型、机构、排序
|
|
|
|
this.stationBaseInfo(stations.stream().filter(station->key.equals(station.getCode())).findFirst(),sorts,realStation); |
|
|
|
this.stationBaseInfo(stations.stream().filter(station->key.equals(station.getCode())).findFirst(),sorts,realStation); |
|
|
@ -330,30 +332,33 @@ public class MonitorServiceImpl implements MonitorService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设置设备状态 |
|
|
|
* 设置设备状态、装机容量 |
|
|
|
* @param devices |
|
|
|
* @param devices |
|
|
|
* @param deviceClassifyMap |
|
|
|
* @param deviceClassifyMap |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void deviceStatus(List<RealDeviceVo> devices, Map<String, List<String>> deviceClassifyMap) { |
|
|
|
private void deviceParam(List<RealDeviceVo> devices, Map<String, List<String>> deviceClassifyMap,List<EminfoAndEmParamVo> deviceParams) { |
|
|
|
if (CollectionUtil.isEmpty(devices) || MapUtils.isEmpty(deviceClassifyMap)) { |
|
|
|
if (CollectionUtil.isEmpty(devices) || MapUtils.isEmpty(deviceClassifyMap)) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> faults = deviceClassifyMap.get(HomePageConstant.FAULT); |
|
|
|
List<String> faults = deviceClassifyMap.get(HomePageConstant.FAULT); |
|
|
|
List<String> overhaults = deviceClassifyMap.get(HomePageConstant.OVERHAUL); |
|
|
|
List<String> overhaults = deviceClassifyMap.get(HomePageConstant.OVERHAUL); |
|
|
|
devices.forEach(device -> { |
|
|
|
devices.forEach(device -> { |
|
|
|
int state = -1; |
|
|
|
device.setState(-1); |
|
|
|
if(StringUtil.isNotBlank(device.getDeviceCode())){ |
|
|
|
if(StringUtil.isNotBlank(device.getDeviceCode())){ |
|
|
|
// 故障
|
|
|
|
// 设备装机容量
|
|
|
|
|
|
|
|
if(CollectionUtil.isNotEmpty(deviceParams)){ |
|
|
|
|
|
|
|
Optional<EminfoAndEmParamVo> optional = deviceParams.stream().filter(param->param.getEmCode().equals(device.getDeviceCode())).findFirst(); |
|
|
|
|
|
|
|
optional.ifPresent(eminfoAndEmParamVo -> device.setInstalledCapacity(eminfoAndEmParamVo.getInstalledCapacity())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 设备状态 : 故障、检修
|
|
|
|
if (CollectionUtil.isNotEmpty(faults) && faults.contains(device.getDeviceCode())) { |
|
|
|
if (CollectionUtil.isNotEmpty(faults) && faults.contains(device.getDeviceCode())) { |
|
|
|
state = 4; |
|
|
|
device.setState(4); |
|
|
|
// 检修
|
|
|
|
|
|
|
|
} else if (CollectionUtil.isNotEmpty(overhaults) && overhaults.contains(device.getDeviceCode())) { |
|
|
|
} else if (CollectionUtil.isNotEmpty(overhaults) && overhaults.contains(device.getDeviceCode())) { |
|
|
|
state = 0; |
|
|
|
device.setState(0); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(state >= 0){ |
|
|
|
// 根据有功进行判断设备状态
|
|
|
|
device.setState(state); |
|
|
|
if(device.getState() < 0){ |
|
|
|
}else{ |
|
|
|
|
|
|
|
List<RealAttributeVo> attbts = device.getAttbtList(); |
|
|
|
List<RealAttributeVo> attbts = device.getAttbtList(); |
|
|
|
// 功率属性记录
|
|
|
|
// 功率属性记录
|
|
|
|
List<RealAttributeVo> powers = attbts.stream().filter(att-> HomePageConstant.powerList.contains(att.getName())).collect(Collectors.toList()); |
|
|
|
List<RealAttributeVo> powers = attbts.stream().filter(att-> HomePageConstant.powerList.contains(att.getName())).collect(Collectors.toList()); |
|
|
|