Browse Source

#月发电量统一

zhongwei
yang_shj 8 months ago
parent
commit
fc8acac8e9
  1. 33
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java

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

@ -40,7 +40,6 @@ import com.hnac.hzinfo.datasearch.soe.domian.SoeData;
import com.hnac.hzinfo.inspect.task.feign.IInspectTaskReportClient; import com.hnac.hzinfo.inspect.task.feign.IInspectTaskReportClient;
import com.hnac.hzinfo.inspect.task.vo.DutyInspectTaskVO; import com.hnac.hzinfo.inspect.task.vo.DutyInspectTaskVO;
import com.hnac.hzinfo.sdk.core.response.Result; import com.hnac.hzinfo.sdk.core.response.Result;
import com.sun.org.apache.xpath.internal.operations.NotEquals;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
@ -597,17 +596,33 @@ public class HydropowerServiceImpl implements HydropowerService {
response.setPlanPowerMon(this.getPlanPowerrMon(station.getCode())); response.setPlanPowerMon(this.getPlanPowerrMon(station.getCode()));
// 年计划发电量 // 年计划发电量
response.setPlanPowerYear(this.getPlanPowerYear(station.getCode())); response.setPlanPowerYear(this.getPlanPowerYear(station.getCode()));
// 月发电量、年发电量、年发电完成率 // 年发电量、年发电完成率
this.handleStationInfo(station.getRefDept(),response); this.handleStationInfo(station.getRefDept(),response);
// 水位、水位曲线 // 水位、水位曲线
this.handleWaterLeve(station.getCode(),response); this.handleWaterLeve(station.getCode(),response);
List<PowerMonthVo> powerMonths = this.handlePowerFinish(Collections.singletonList(station),map);
// 年发电量完成百分比 // 年发电量完成百分比
response.setPowerYearMap(this.handlePowerFinish(Collections.singletonList(station),map)); response.setPowerYearMap(powerMonths);
// 月发电量
response.setPowerMon(this.powerMon(powerMonths));
// 设备信息 // 设备信息
response.setDeviceList(this.getDevices(station,realList,targetList)); response.setDeviceList(this.getDevices(station,realList,targetList));
return response; return response;
} }
/**
* 月发电量
* @param powerMonths
* @return
*/
private float powerMon(List<PowerMonthVo> powerMonths) {
if(CollectionUtil.isEmpty(powerMonths)){
return 0.0f;
}
String mon = DateUtil.format(new Date(), "yyyy-MM-01");
return (float) powerMonths.stream().filter(o->mon.equals(o.getStrMonth())).mapToDouble(PowerMonthVo::getPower).sum();
}
/** /**
* 水电站-机组列表 * 水电站-机组列表
@ -833,9 +848,6 @@ public class HydropowerServiceImpl implements HydropowerService {
if(CollectionUtil.isEmpty(targetList)){ if(CollectionUtil.isEmpty(targetList)){
return; return;
} }
// 月发电量
float powerMont = (float) targetList.stream().filter(o-> deptId.equals(o.getDeptId())).mapToDouble(HydropowerUnitTargetVo::getPowerMon).sum();
response.setPowerMon(powerMont);
// 年发电量 // 年发电量
float powerYear = (float) targetList.stream().filter(o-> deptId.equals(o.getDeptId())).mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum(); float powerYear = (float) targetList.stream().filter(o-> deptId.equals(o.getDeptId())).mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum();
response.setPowerYear(powerYear); response.setPowerYear(powerYear);
@ -1047,8 +1059,6 @@ public class HydropowerServiceImpl implements HydropowerService {
if (CollectionUtil.isNotEmpty(targets)) { if (CollectionUtil.isNotEmpty(targets)) {
// 年发电量 // 年发电量
kpi.setGenerateYear(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum()); kpi.setGenerateYear(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum());
// 月发电量
kpi.setGenerateMon(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerMon).sum());
// 日发电量 // 日发电量
kpi.setGenerateDay(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum()); kpi.setGenerateDay(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum());
// 年计划发电量 // 年计划发电量
@ -1067,10 +1077,13 @@ public class HydropowerServiceImpl implements HydropowerService {
if (MapUtils.isEmpty(map)) { if (MapUtils.isEmpty(map)) {
return kpi; return kpi;
} }
List<PowerMonthVo> powerMonths = this.handlePowerFinish(stations,map);
// 今年发电趋势 // 今年发电趋势
kpi.setPowerMonthVoList(this.handlePowerFinish(stations,map)); kpi.setPowerMonthVoList(powerMonths);
// 近3年发电量 // 近3年发电量
kpi.setPowerYearVoList(this.generateThreeYear(stations.stream().map(StationEntity::getId).collect(Collectors.toList()),map)); kpi.setPowerYearVoList(this.generateThreeYear(stations.stream().map(StationEntity::getId).collect(Collectors.toList()),map));
// 月发电量
kpi.setGenerateMon(Double.valueOf(this.powerMon(powerMonths)));
return kpi; return kpi;
} }
@ -1388,6 +1401,7 @@ public class HydropowerServiceImpl implements HydropowerService {
countDownLatch.countDown(); countDownLatch.countDown();
}); });
// 消缺 // 消缺
exe.execute(()->{ exe.execute(()->{
ShortagesVo shortagesVo = mainTaskStatisticService.getShortage(start,end,Collections.singletonList(area.getDeptId())); ShortagesVo shortagesVo = mainTaskStatisticService.getShortage(start,end,Collections.singletonList(area.getDeptId()));
@ -1431,6 +1445,7 @@ public class HydropowerServiceImpl implements HydropowerService {
} }
/** /**
* 站点指标数据 * 站点指标数据
* @param stations * @param stations

Loading…
Cancel
Save