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()); } /**