Browse Source

#新版电站页面修改

zhongwei
yang_shj 4 months ago
parent
commit
4db085ff1f
  1. 15
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerStationVo.java
  2. 13
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerUnitTargetVo.java
  3. 7
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/GenerationScheduledTask.java
  4. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java
  5. 14
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java

15
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;

13
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<ActivePowerVo> activePowerVoList;

7
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<String> loadThreeYearPowerGeneration(String param) {
//@XxlJob(LOAD_THREE_YEAR_POWER_GENERATION)
@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadThreeYearPowerGeneration() {
String param = "";
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}

4
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<String,List<ThreeGenerationEntity>> map = generations.stream().collect(Collectors.groupingBy(ThreeGenerationEntity::getStationId));
// 定义接收参数
Map<Long, Map<String, Float>> container = new HashMap<>();
Map<String, Map<String, Float>> container = new HashMap<>();
map.forEach((key, value) -> {
Optional<StationEntity> optional = stations.stream().filter(o -> o.getCode().equals(key)).findFirst();
if (!optional.isPresent()) {
@ -488,7 +488,7 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService {
Map<String, Float> 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);
}

14
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

Loading…
Cancel
Save