From aafd3cdee50c6ddf7e961b0897046a7191b1c652 Mon Sep 17 00:00:00 2001 From: tyty Date: Mon, 4 Sep 2023 09:19:58 +0800 Subject: [PATCH] revert add text.text --- .../hzims/operational/census/vo/AreaAssetDeviceVo.java | 7 ++----- .../hzims/fdp/service/impl/FdpMonitorServiceImpl.java | 2 +- .../census/service/impl/AreaDutyServiceImpl.java | 16 +++++----------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/AreaAssetDeviceVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/AreaAssetDeviceVo.java index 56ce3a8..fa6f71d 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/AreaAssetDeviceVo.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/AreaAssetDeviceVo.java @@ -16,11 +16,8 @@ public class AreaAssetDeviceVo { @ApiModelProperty(value = "机构Id") private Long deptId; - @ApiModelProperty(value = "设备名称") - private String deviceCode; - - @ApiModelProperty(value = "设备名称") - private String deviceName; + @ApiModelProperty(value = "机构名称") + private String deptName; @ApiModelProperty(value = "状态") private Integer status; diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java index ba577d3..ccf9ee1 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java @@ -638,7 +638,7 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl 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(); - item.setStatus(2); - if(ObjectUtil.isNotEmpty(real) && Math.abs(real.getActivePower()) > 0){ + if(ObjectUtil.isEmpty(real)){ + item.setStatus(2); + }else if(Math.abs(real.getActivePower()) > 0){ item.setStatus(1); } return item;