Browse Source

Merge remote-tracking branch 'origin/prod-5.1.3' into prod-5.1.3

zhongwei
haungxing 3 months ago
parent
commit
3987b43b6e
  1. 7
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IPlanGenertionClient.java
  2. 2
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IPlanGenertionClientBack.java
  3. 9
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/feign/PlanGenertionClient.java
  4. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/impl/HydroelectricServiceImpl.java
  5. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
  6. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainSystemMonitoringServiceImpl.java

7
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IPlanGenertionClient.java

@ -76,12 +76,11 @@ public interface IPlanGenertionClient {
/** /**
* 年计划/实际发电量 * 年计划/实际发电量
* @param stationIds * @param param
* @param date
* @return * @return
*/ */
@GetMapping(GET_POWER_YEAR) @PostMapping(GET_POWER_YEAR)
Double getPlanPowerYear(@RequestParam(value = "stationIds", required = false) List<String> stationIds, @RequestParam(value = "date", required = false) String date); Double getPlanPowerYear(@RequestBody DevicePlanGenerationVo param);
/** /**
* 计划发电量查询 * 计划发电量查询

2
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IPlanGenertionClientBack.java

@ -48,7 +48,7 @@ public class IPlanGenertionClientBack implements IPlanGenertionClient {
} }
@Override @Override
public Double getPlanPowerYear(List<String> stationIds, String date) { public Double getPlanPowerYear(DevicePlanGenerationVo param) {
return null; return null;
} }

9
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/feign/PlanGenertionClient.java

@ -107,14 +107,13 @@ public class PlanGenertionClient implements IPlanGenertionClient{
/** /**
* 年计划发电量/实际发电量 * 年计划发电量/实际发电量
* @param stationIds * @param param
* @param date 'yyyy'
* @return * @return
*/ */
@GetMapping(GET_POWER_YEAR) @PostMapping(GET_POWER_YEAR)
@Override @Override
public Double getPlanPowerYear(List<String> stationIds, String date) { public Double getPlanPowerYear(DevicePlanGenerationVo param) {
return service.getPlanPowerYear(stationIds,date); return service.getPlanPowerYear(param.getStationIds(),param.getDate());
} }
/** /**

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/impl/HydroelectricServiceImpl.java

@ -363,7 +363,10 @@ public class HydroelectricServiceImpl implements HydroelectricService {
// 日发电量 // 日发电量
group.setGenerateDay(stationTargets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum()); group.setGenerateDay(stationTargets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum());
// 年计划发电量 // 年计划发电量
group.setGeneratePlanYear(planClient.getPlanPowerYear(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()), DateUtil.format(new Date(),"yyyy"))); DevicePlanGenerationVo planParam = new DevicePlanGenerationVo();
param.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
param.setDate(DateUtil.format(new Date(),"yyyy"));
group.setGeneratePlanYear(planClient.getPlanPowerYear(planParam));
if(group.getGeneratePlanYear() <= 0 || group.getGenerateYear() <= 0){ if(group.getGeneratePlanYear() <= 0 || group.getGenerateYear() <= 0){
group.setGenerateRate(0.0); group.setGenerateRate(0.0);
}else{ }else{

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

@ -756,7 +756,10 @@ public class HydropowerServiceImpl implements HydropowerService {
// 日发电量 // 日发电量
kpi.setGenerateDay(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum()); kpi.setGenerateDay(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum());
// 年计划发电量 // 年计划发电量
Double plan = planGenertionClient.getPlanPowerYear(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()), DateUtil.format(new Date(),"yyyy")); DevicePlanGenerationVo param = new DevicePlanGenerationVo();
param.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
param.setDate(DateUtil.format(new Date(),"yyyy"));
Double plan = planGenertionClient.getPlanPowerYear(param);
kpi.setPlan(plan); kpi.setPlan(plan);
if(Math.abs(plan) <= 0){ if(Math.abs(plan) <= 0){
kpi.setPlanRate(0.0); kpi.setPlanRate(0.0);

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainSystemMonitoringServiceImpl.java

@ -1386,7 +1386,10 @@ public class MainSystemMonitoringServiceImpl implements IMainSystemMonitoringSer
BigDecimal powerYear = value.entrySet().stream().filter(s -> listByYear.contains(s.getKey())).map(s -> BigDecimal.valueOf(s.getValue()).setScale(1, RoundingMode.UP)).reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal powerYear = value.entrySet().stream().filter(s -> listByYear.contains(s.getKey())).map(s -> BigDecimal.valueOf(s.getValue()).setScale(1, RoundingMode.UP)).reduce(BigDecimal.ZERO, BigDecimal::add);
stationReportVO.setFinishPowerYear(objDivide(String.valueOf(powerYear)).toString()); stationReportVO.setFinishPowerYear(objDivide(String.valueOf(powerYear)).toString());
//获取计划年发电量 //获取计划年发电量
Double planPowerYear = planGenertionClient.getPlanPowerYear(Collections.singletonList(stationEntity.getCode()), yearMon[0]); DevicePlanGenerationVo param = new DevicePlanGenerationVo();
param.setStationIds(Collections.singletonList(stationEntity.getCode()));
param.setDate(yearMon[0]);
Double planPowerYear = planGenertionClient.getPlanPowerYear(param);
stationReportVO.setPowerYearPlan(objDivide(String.valueOf(planPowerYear)).doubleValue()); stationReportVO.setPowerYearPlan(objDivide(String.valueOf(planPowerYear)).doubleValue());
if (ObjectUtil.isNotEmpty(stationReportVO.getPowerMonPlan()) if (ObjectUtil.isNotEmpty(stationReportVO.getPowerMonPlan())
&&ObjectUtil.isNotEmpty(stationReportVO.getFinishPowerMon()) &&ObjectUtil.isNotEmpty(stationReportVO.getFinishPowerMon())
@ -1483,7 +1486,10 @@ public class MainSystemMonitoringServiceImpl implements IMainSystemMonitoringSer
Double finishPowerYear = BigDecimal.valueOf(powerCountYear.get()).doubleValue(); Double finishPowerYear = BigDecimal.valueOf(powerCountYear.get()).doubleValue();
stationReportVO.setFinishPowerYear(objDivide(String.valueOf(finishPowerYear)).toString()); stationReportVO.setFinishPowerYear(objDivide(String.valueOf(finishPowerYear)).toString());
//当年的计划发电量 //当年的计划发电量
Double planPowerYear = planGenertionClient.getPlanPowerYear(Collections.singletonList(stationId), year); DevicePlanGenerationVo param = new DevicePlanGenerationVo();
param.setStationIds(Collections.singletonList(stationEntity.getCode()));
param.setDate(year);
Double planPowerYear = planGenertionClient.getPlanPowerYear(param);
stationReportVO.setPowerYearPlan(objDivide(String.valueOf(planPowerYear)).doubleValue()); stationReportVO.setPowerYearPlan(objDivide(String.valueOf(planPowerYear)).doubleValue());
//当月的计划发电量 //当月的计划发电量
R<Float> planPowerMonR = planGenertionClient.planGenerationMonthCount(stationId, month); R<Float> planPowerMonR = planGenertionClient.planGenerationMonthCount(stationId, month);

Loading…
Cancel
Save