|
|
@ -174,13 +174,7 @@ public class AreaDutyServiceImpl implements AreaDutyService { |
|
|
|
AreaTimelyVo timely = new AreaTimelyVo(); |
|
|
|
AreaTimelyVo timely = new AreaTimelyVo(); |
|
|
|
timely.setEventId(early.getFaultId()); |
|
|
|
timely.setEventId(early.getFaultId()); |
|
|
|
timely.setContent(early.getFinfo()); |
|
|
|
timely.setContent(early.getFinfo()); |
|
|
|
timely.setDeptName("未知"); |
|
|
|
timely.setDeptName(early.getStation()); |
|
|
|
if(!StringUtil.isEmpty(early.getStation())){ |
|
|
|
|
|
|
|
List<String> names = stations.stream().filter(o->o.getCode().equals(early.getStation())).map(StationEntity::getName).collect(Collectors.toList()); |
|
|
|
|
|
|
|
if(CollectionUtil.isNotEmpty(names)){ |
|
|
|
|
|
|
|
timely.setDeptName(names.get(0)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
timely.setTime(early.getCreateTime()); |
|
|
|
timely.setTime(early.getCreateTime()); |
|
|
|
//int sum = this.eventToHours(LocalDateTime.parse(early.getCreateTime(),DateUtil.DATETIME_FORMATTER));
|
|
|
|
//int sum = this.eventToHours(LocalDateTime.parse(early.getCreateTime(),DateUtil.DATETIME_FORMATTER));
|
|
|
|
timely.setType("智能预警"); |
|
|
|
timely.setType("智能预警"); |
|
|
@ -318,12 +312,12 @@ public class AreaDutyServiceImpl implements AreaDutyService { |
|
|
|
asset.setDevices(entry.getValue().stream().map(value->{ |
|
|
|
asset.setDevices(entry.getValue().stream().map(value->{ |
|
|
|
AreaAssetDeviceVo item = new AreaAssetDeviceVo(); |
|
|
|
AreaAssetDeviceVo item = new AreaAssetDeviceVo(); |
|
|
|
item.setDeptId(entry.getKey()); |
|
|
|
item.setDeptId(entry.getKey()); |
|
|
|
item.setDeviceCode(value.getEmCode()); |
|
|
|
item.setDeptName(asset.getDeptName()); |
|
|
|
item.setDeviceName(value.getName()); |
|
|
|
|
|
|
|
// 状态
|
|
|
|
// 状态
|
|
|
|
HydropowerUnitRealVo real = reals.stream().filter(o->o.getDeviceCode().equals(value.getEmCode())).min(Comparator.comparing(HydropowerUnitRealVo::getDeviceCode)).get(); |
|
|
|
HydropowerUnitRealVo real = reals.stream().filter(o->o.getDeviceCode().equals(value.getEmCode())).min(Comparator.comparing(HydropowerUnitRealVo::getDeviceCode)).get(); |
|
|
|
|
|
|
|
if(ObjectUtil.isEmpty(real)){ |
|
|
|
item.setStatus(2); |
|
|
|
item.setStatus(2); |
|
|
|
if(ObjectUtil.isNotEmpty(real) && Math.abs(real.getActivePower()) > 0){ |
|
|
|
}else if(Math.abs(real.getActivePower()) > 0){ |
|
|
|
item.setStatus(1); |
|
|
|
item.setStatus(1); |
|
|
|
} |
|
|
|
} |
|
|
|
return item; |
|
|
|
return item; |
|
|
|