Commit a6c5b6d9 authored by ZWT's avatar ZWT

feat(吉林演示): 松原

1.修改风资源监控页面历史风向统计接口,解决只能统计出一种风向问题,完成接口冒烟测试;
2.修改风资源监控页面风电站运行状态接口,解决没有启动状态时无法查询数据问题,完成接口冒烟测试;
3.修改风资源监控页面发电功率预测接口,增加使用模拟数据生成风电实际功率,完成接口冒烟测试;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 328bbc8c
...@@ -195,7 +195,25 @@ public class WindPredictionFutureService { ...@@ -195,7 +195,25 @@ public class WindPredictionFutureService {
if (CollUtil.isEmpty(turbineList)) { if (CollUtil.isEmpty(turbineList)) {
return XListResult.success(Collections.emptyList()); return XListResult.success(Collections.emptyList());
} }
List<String> stationIds = turbineList.stream().map(BaseModel::getId).collect(Collectors.toList()); List<String> stationIds = turbineList.stream()
.map(BaseModel::getId)
.collect(Collectors.toList());
//实际发电量
ThirdWindPowerGenerationMapper generationMapper = context.getBean(ThirdWindPowerGenerationMapper.class);
List<ThirdWindPowerGenerationEnt> generationList = generationMapper.selectList(new QueryWrapper<ThirdWindPowerGenerationEnt>()
.select("IFNULL( SUM( actual_power ), 0 ) AS actual_power", "collect_time")
.groupBy("collect_time")
.lambda()
.in(ThirdWindPowerGenerationEnt::getStationId, stationIds)
.between(ThirdWindPowerGenerationEnt::getCollectTime, startTime, endTime)
);
Map<Date, BigDecimal> powerMap;
if (CollUtil.isNotEmpty(generationList)) {
powerMap = generationList.stream()
.collect(Collectors.toMap(ThirdWindPowerGenerationEnt::getCollectTime, ThirdWindPowerGenerationEnt::getActualPower));
} else {
powerMap = Collections.emptyMap();
}
//计算中期截至时间 //计算中期截至时间
Date midEnd = DateUtil.offsetDay(now, BusinessConstant.TEN); Date midEnd = DateUtil.offsetDay(now, BusinessConstant.TEN);
if (DateUtil.compare(midEnd, endTime) > 0) { if (DateUtil.compare(midEnd, endTime) > 0) {
...@@ -225,8 +243,7 @@ public class WindPredictionFutureService { ...@@ -225,8 +243,7 @@ public class WindPredictionFutureService {
.midPredictedPower(midMap.getOrDefault(dateTime, BigDecimal.ZERO)) .midPredictedPower(midMap.getOrDefault(dateTime, BigDecimal.ZERO))
.shortPredictedPower(shortMap.getOrDefault(dateTime, BigDecimal.ZERO)) .shortPredictedPower(shortMap.getOrDefault(dateTime, BigDecimal.ZERO))
.ultraShortPredictedPower(ultraShortMap.getOrDefault(dateTime, BigDecimal.ZERO)) .ultraShortPredictedPower(ultraShortMap.getOrDefault(dateTime, BigDecimal.ZERO))
//todo 暂时没接数据 .actualPower(powerMap.getOrDefault(dateTime, BigDecimal.ZERO))
.actualPower(BigDecimal.ZERO)
.build() .build()
); );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment