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