Browse Source

#功率24小时统计

zhongwei
yang_shj 8 months ago
parent
commit
88a7706ccb
  1. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerStationVo.java
  2. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  3. 26
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/service/impl/HzimsDataServiceImpl.java

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

@ -75,6 +75,9 @@ public class HydropowerStationVo {
@ApiModelProperty(value = "年发电量完成百分比") @ApiModelProperty(value = "年发电量完成百分比")
private List<PowerMonthVo> powerYearMap; private List<PowerMonthVo> powerYearMap;
@ApiModelProperty(value = "24小时机组有功功率")
private List<ActivePowerVo> activePowerVoList;
@ApiModelProperty(value = "设备信息") @ApiModelProperty(value = "设备信息")
private List<HydropowerUnitVo> deviceList; private List<HydropowerUnitVo> deviceList;
} }

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java

@ -1123,7 +1123,9 @@ public class RealTargetServiceImpl implements RealTargetService {
* @return * @return
*/ */
private List<ActivePowerVo> getLoadsByDay(EminfoAndEmParamVo device) { private List<ActivePowerVo> getLoadsByDay(EminfoAndEmParamVo device) {
String start = DateUtil.format(new Date(), DateUtil.PATTERN_DATE) + " 00:00:00"; Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.HOUR_OF_DAY,-24);
String start = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME);
String end = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME); String end = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME);
List<AnalyseDataTaosVO> records = dataService.periodTargetData(start, end, 3, 2, device.getEmCode(), HomePageConstant.PV_LOAD); List<AnalyseDataTaosVO> records = dataService.periodTargetData(start, end, 3, 2, device.getEmCode(), HomePageConstant.PV_LOAD);
if (CollectionUtil.isEmpty(records)) { if (CollectionUtil.isEmpty(records)) {

26
hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/service/impl/HzimsDataServiceImpl.java

@ -256,10 +256,36 @@ public class HzimsDataServiceImpl implements HzimsDataService {
this.handleWaterLeve(station.getCode(),response); this.handleWaterLeve(station.getCode(),response);
// 年发电量完成百分比 // 年发电量完成百分比
response.setPowerYearMap(this.handlePowerFinish(Collections.singletonList(station),map)); response.setPowerYearMap(this.handlePowerFinish(Collections.singletonList(station),map));
// 功率曲线
response.setActivePowerVoList(this.activePowers(station.getRefDept(),targetList));
return response; 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 * @param stationCode
* @return * @return

Loading…
Cancel
Save