Browse Source

#区域站点排序

zhongwei
yang_shj 8 months ago
parent
commit
4a3c51c71a
  1. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/AppHydropowerStationVo.java
  2. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
  3. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/AppHydropowerStationVo.java

@ -47,6 +47,9 @@ public class AppHydropowerStationVo {
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double output;
@ApiModelProperty(value = "排序")
private Integer sort;
@ApiModelProperty(value = "运行天数")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer runDay;

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java

@ -1563,6 +1563,12 @@ public class HydropowerServiceImpl implements HydropowerService {
List<HydropowerUnitRealVo> reals = (List<HydropowerUnitRealVo>) redisTemplate.opsForValue().get(load_hydropower_unit_real_key);
return stations.stream().map(station -> {
AppHydropowerStationVo hydropower = new AppHydropowerStationVo();
R<Dept> dept = sysClient.getDept(station.getRefDept());
if(dept.isSuccess() && !ObjectUtil.isEmpty(dept.getData())){
hydropower.setSort(dept.getData().getSort());
}else{
hydropower.setSort(1);
}
hydropower.setDeptId(station.getRefDept());
hydropower.setDeptName(station.getName());
// 天气区间
@ -1615,7 +1621,7 @@ public class HydropowerServiceImpl implements HydropowerService {
// 负荷单位
hydropower.setLoadUnit("kW");
return hydropower;
}).collect(Collectors.toList());
}).sorted(Comparator.comparing(AppHydropowerStationVo::getSort)).collect(Collectors.toList());
}
/**

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java

@ -722,4 +722,19 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
// stationEntityList.stream().map(StationEntity::getCode).forEach(code -> projectClient.delete());
// }
}
/**
* 批量更新站点排序
*/
@Override
public boolean updateBatchSort(List<StationEntity> req) {
List<StationEntity> stations = new ArrayList<>();
for (StationEntity stationEntity : req) {
// 获取当前的站点信息
StationEntity station = this.getById(stationEntity.getId());
station.setSort(stationEntity.getSort());
stations.add(station);
}
return this.updateBatchById(stations);
}
}

Loading…
Cancel
Save