From 6841ab8f4c6efd40ad562978e80317d279fd23fe Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 5 Jul 2023 17:15:21 +0800 Subject: [PATCH] =?UTF-8?q?#=E6=99=BA=E8=83=BD=E7=94=9F=E4=BA=A7=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/operational/main/vo/EquipmentStateCountVo.java | 6 ++++++ .../hzims/operational/main/service/impl/SideHustleServiceImpl.java | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/EquipmentStateCountVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/EquipmentStateCountVo.java index 585cb77..62afe4a 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/EquipmentStateCountVo.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/EquipmentStateCountVo.java @@ -6,6 +6,9 @@ import lombok.Data; import java.util.List; +/** + * @author ysj + */ @Data @ApiModel(value = "站点设备统计对象") public class EquipmentStateCountVo { @@ -34,6 +37,9 @@ public class EquipmentStateCountVo { @ApiModelProperty(value = "备用数量") private Long backupCount; + @ApiModelProperty(value = "排序") + private Integer sort; + @ApiModelProperty(value = "设备") private List deviceVoList; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java index f89bd74..adc1d46 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java @@ -1200,6 +1200,7 @@ public class SideHustleServiceImpl implements ISideHustleService { List equipmentList = new ArrayList<>(); deptMap.forEach((key, value) -> { EquipmentStateCountVo equipmentCountVo = new EquipmentStateCountVo(); + equipmentCountVo.setSort(key.getSort()); equipmentCountVo.setDeptId(key.getId()); equipmentCountVo.setDeptName(key.getDeptName()); // 根据部门查询设备 @@ -1253,7 +1254,7 @@ public class SideHustleServiceImpl implements ISideHustleService { this.setDeviceInfo(R.getData(), deviceVoList, equipmentCountVo); equipmentList.add(equipmentCountVo); }); - return equipmentList; + return equipmentList.stream().sorted(Comparator.comparing(EquipmentStateCountVo::getSort)).collect(Collectors.toList()); } /**