Browse Source

#智能生产排序

zhongwei
yang_shj 1 year ago
parent
commit
6841ab8f4c
  1. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/EquipmentStateCountVo.java
  2. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java

6
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; import java.util.List;
/**
* @author ysj
*/
@Data @Data
@ApiModel(value = "站点设备统计对象") @ApiModel(value = "站点设备统计对象")
public class EquipmentStateCountVo { public class EquipmentStateCountVo {
@ -34,6 +37,9 @@ public class EquipmentStateCountVo {
@ApiModelProperty(value = "备用数量") @ApiModelProperty(value = "备用数量")
private Long backupCount; private Long backupCount;
@ApiModelProperty(value = "排序")
private Integer sort;
@ApiModelProperty(value = "设备") @ApiModelProperty(value = "设备")
private List<DeviceVo> deviceVoList; private List<DeviceVo> deviceVoList;
} }

3
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<EquipmentStateCountVo> equipmentList = new ArrayList<>(); List<EquipmentStateCountVo> equipmentList = new ArrayList<>();
deptMap.forEach((key, value) -> { deptMap.forEach((key, value) -> {
EquipmentStateCountVo equipmentCountVo = new EquipmentStateCountVo(); EquipmentStateCountVo equipmentCountVo = new EquipmentStateCountVo();
equipmentCountVo.setSort(key.getSort());
equipmentCountVo.setDeptId(key.getId()); equipmentCountVo.setDeptId(key.getId());
equipmentCountVo.setDeptName(key.getDeptName()); equipmentCountVo.setDeptName(key.getDeptName());
// 根据部门查询设备 // 根据部门查询设备
@ -1253,7 +1254,7 @@ public class SideHustleServiceImpl implements ISideHustleService {
this.setDeviceInfo(R.getData(), deviceVoList, equipmentCountVo); this.setDeviceInfo(R.getData(), deviceVoList, equipmentCountVo);
equipmentList.add(equipmentCountVo); equipmentList.add(equipmentCountVo);
}); });
return equipmentList; return equipmentList.stream().sorted(Comparator.comparing(EquipmentStateCountVo::getSort)).collect(Collectors.toList());
} }
/** /**

Loading…
Cancel
Save