diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerStationVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerStationVo.java index 6b34729..34a14a1 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerStationVo.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerStationVo.java @@ -45,30 +45,33 @@ public class HydropowerStationVo { @ApiModelProperty(value = "总发电负荷单位") private String powerUnit; + @ApiModelProperty(value = "容量利用率") + private Double capacityRate; + @ApiModelProperty(value = "月计划发电量") private Float planPowerMon; - @ApiModelProperty(value = "年计划发电量") - private Float planPowerYear; - @ApiModelProperty(value = "月发电量") private Float powerMon; @ApiModelProperty(value = "月发电量完成率") private Double powerRateMon; + @ApiModelProperty(value = "年计划发电量") + private Float planPowerYear; + @ApiModelProperty(value = "年发电量") private Float powerYear; + @ApiModelProperty(value = "年发电完成率") + private Double powerRateYear; + @ApiModelProperty(value = "今日发电量") private Float powerDay; @ApiModelProperty(value = "昨日发电量") private Float powerYesterDay; - @ApiModelProperty(value = "年发电完成率") - private Double powerRateYear; - @ApiModelProperty(value = "站点实时温度") private String temp; diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerUnitTargetVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerUnitTargetVo.java index ad37e5a..68ab05c 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerUnitTargetVo.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerUnitTargetVo.java @@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; -import java.util.Map; /** * @author ysj @@ -41,6 +40,18 @@ public class HydropowerUnitTargetVo { @ApiModelProperty(value = "昨日发电量") private Float powerYesterDay; + @ApiModelProperty(value = "本次开机时间") + private String startTime; + + @ApiModelProperty(value = "本次开机时长") + private Double startupDuration; + + @ApiModelProperty(value = "年停机时长") + private Double shutDownDurationYear; + + @ApiModelProperty(value = "年开机时长") + private Double startupDurationYear; + @ApiModelProperty(value = "当日机组有功功率") private List activePowerVoList; diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/GenerationScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/GenerationScheduledTask.java index b574b22..29b4042 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/GenerationScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/GenerationScheduledTask.java @@ -8,6 +8,7 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.Arrays; @@ -74,8 +75,10 @@ public class GenerationScheduledTask { * @param param * @return */ - @XxlJob(LOAD_THREE_YEAR_POWER_GENERATION) - public ReturnT loadThreeYearPowerGeneration(String param) { + //@XxlJob(LOAD_THREE_YEAR_POWER_GENERATION) + @Scheduled(cron = "0/40 * * * * ? ") + public ReturnT loadThreeYearPowerGeneration() { + String param = ""; if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java index 0259de2..de2d8f6 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java @@ -476,7 +476,7 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { } Map> map = generations.stream().collect(Collectors.groupingBy(ThreeGenerationEntity::getStationId)); // 定义接收参数 - Map> container = new HashMap<>(); + Map> container = new HashMap<>(); map.forEach((key, value) -> { Optional optional = stations.stream().filter(o -> o.getCode().equals(key)).findFirst(); if (!optional.isPresent()) { @@ -488,7 +488,7 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { Map son = new HashMap<>(); // 遍历月份数据 months.entrySet().stream().sorted(Map.Entry.comparingByKey()).forEach(iter -> son.put(iter.getKey(), (float) iter.getValue().stream().mapToDouble(o -> o.getGenerate().doubleValue()).sum())); - container.put(optional.get().getId(), son); + container.put(optional.get().getCode(), son); }); redisTemplate.opsForValue().set(recent_year_power_data, container); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java index 0e32c6d..d646a32 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java @@ -161,6 +161,8 @@ public class HydropowerServiceImpl implements HydropowerService { response.setPowerSum(this.getPowerSum(realList,station.getRefDept())); // 总有功单位 response.setPowerUnit(this.getPowerUnit(realList,station.getRefDept())); + // 容量利用率 + response.setCapacityRate(this.getCapacityRate(response)); // 月计划发电量 response.setPlanPowerMon(this.getPlanPowerrMon(station.getCode())); // 年计划发电量 @@ -179,6 +181,18 @@ public class HydropowerServiceImpl implements HydropowerService { } /** + * 容量利用率 + * @param response + * @return + */ + private double getCapacityRate(HydropowerStationVo response) { + if(response.getInstalledCapacity() > 0 && response.getPowerSum() > 0){ + return BigDecimal.valueOf(response.getPowerSum() / response.getInstalledCapacity() * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); + } + return 0.0; + } + + /** * 今日、昨日发电量 * @param station * @param targetList