|
|
|
@ -256,10 +256,36 @@ public class HzimsDataServiceImpl implements HzimsDataService {
|
|
|
|
|
this.handleWaterLeve(station.getCode(),response); |
|
|
|
|
// 年发电量完成百分比
|
|
|
|
|
response.setPowerYearMap(this.handlePowerFinish(Collections.singletonList(station),map)); |
|
|
|
|
// 功率曲线
|
|
|
|
|
response.setActivePowerVoList(this.activePowers(station.getRefDept(),targetList)); |
|
|
|
|
return response; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 24小时功率曲线 |
|
|
|
|
* @param refDept |
|
|
|
|
* @param targetList |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private List<ActivePowerVo> activePowers(Long refDept, List<HydropowerUnitTargetVo> targetList) { |
|
|
|
|
if(CollectionUtil.isEmpty(targetList)){ |
|
|
|
|
return new ArrayList<>(); |
|
|
|
|
} |
|
|
|
|
List<ActivePowerVo> actives = new ArrayList<>(); |
|
|
|
|
targetList.stream().filter(o->o.getDeptId().equals(refDept)).map(HydropowerUnitTargetVo::getActivePowerVoList).collect(Collectors.toList()).forEach(actives::addAll); |
|
|
|
|
if(CollectionUtil.isEmpty(actives)){ |
|
|
|
|
return new ArrayList<>(); |
|
|
|
|
} |
|
|
|
|
Map<Integer,List<ActivePowerVo>> maps = actives.stream().collect(Collectors.groupingBy(ActivePowerVo::getHour)); |
|
|
|
|
return maps.entrySet().stream().map(entry->{ |
|
|
|
|
ActivePowerVo activePower = new ActivePowerVo(); |
|
|
|
|
activePower.setHour(entry.getKey()); |
|
|
|
|
activePower.setActivePower(String.valueOf(entry.getValue().stream().mapToDouble(o->Double.parseDouble(o.getActivePower())).sum())); |
|
|
|
|
return activePower; |
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 站点天气、降雨、水位 |
|
|
|
|
* @param stationCode |
|
|
|
|
* @return |
|
|
|
|