Commit 99889a5f authored by ZWT's avatar ZWT

feat(零碳): 长庆

1.修改极短期间开预测定时任务逻辑,解决优化后部分优化结果时间段过短问题;
2.修改心知天气气象数据获取及接收定时任务,解决天气数据通过邮件下载后,部分数据精度丢失问题;
3.修改首页各个接口逻辑,对小数类型字段进行处理,修改首页接口,增加小时保留两位四舍五入逻辑,同时解决线路详情接口部分查询逻辑报错问题;
4.能耗分析模块,能耗概览接口修改,修改查询逻辑,修改数据获取逻辑及绿电占比计算逻辑;
5.能耗分析模块,消纳曲线用电趋势接口修改,修改查询逻辑,修改数据获取逻辑及绿电占比计算逻辑;
6.能耗分析模块,用电详情接口修改,修改查询逻辑,修改数据获取逻辑及绿电占比计算逻辑;
7.修改首页先导实验井间开制度模块接口查询逻辑,解决极短期间开优化修改后没有第一次开井时间标识导致数据查询不出来问题;
8.基础间开制度新增修改接口逻辑修改,删除防冻堵对井口处理逻辑;
9.极短期间开优化算法修改,增加防冻堵井开井时间优化逻辑;
10.提供长庆通过日期获取当日间开优化结果接口开发,完成接口冒烟测试并添加线上接口文档;
11.提供长庆1天光伏出力预测结果接口开发,完成接口冒烟测试并添加线上接口文档;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 27c81512
...@@ -14,6 +14,7 @@ import pps.core.prediction.mapper.PlantPredictedPowerMidTermMapper; ...@@ -14,6 +14,7 @@ import pps.core.prediction.mapper.PlantPredictedPowerMidTermMapper;
import pps.core.prediction.mapper.PlantPredictedPowerShortTermMapper; import pps.core.prediction.mapper.PlantPredictedPowerShortTermMapper;
import pps.core.prediction.service.data.predicted_api.PredictedApiInput; import pps.core.prediction.service.data.predicted_api.PredictedApiInput;
import pps.core.prediction.service.data.predicted_api.PredictedApiOutput; import pps.core.prediction.service.data.predicted_api.PredictedApiOutput;
import pps.core.prediction.service.data.predicted_api.PredictedApiPredictOutput;
import xstartup.annotation.XService; import xstartup.annotation.XService;
import xstartup.annotation.XText; import xstartup.annotation.XText;
import xstartup.base.XContext; import xstartup.base.XContext;
...@@ -21,8 +22,11 @@ import xstartup.base.util.XCopyUtils; ...@@ -21,8 +22,11 @@ import xstartup.base.util.XCopyUtils;
import xstartup.data.XListResult; import xstartup.data.XListResult;
import xstartup.feature.api.annotation.XApiPost; import xstartup.feature.api.annotation.XApiPost;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 预测API接口 * 预测API接口
...@@ -79,27 +83,55 @@ public class PredictedApiService { ...@@ -79,27 +83,55 @@ public class PredictedApiService {
@XApiPost(anonymous = true) @XApiPost(anonymous = true)
public XListResult<PredictedApiOutput> fifteenDayForecast(XContext context, PredictedApiInput input) { public XListResult<PredictedApiOutput> fifteenDayForecast(XContext context, PredictedApiInput input) {
String stationName = input.getStationName(); String stationName = input.getStationName();
if (CharSequenceUtil.isBlank(stationName)) {
return XListResult.success(Collections.emptyList());
}
//取电站 //取电站
List<GetBasePhotovoltaicPlantCloudOutput> plantList = this.getPhotovoltaicPlant(context, stationName); List<GetBasePhotovoltaicPlantCloudOutput> plantList = this.getPhotovoltaicPlant(context, stationName);
if (CollUtil.isEmpty(plantList)) { if (CollUtil.isEmpty(plantList)) {
return XListResult.success(Collections.emptyList()); return XListResult.success(Collections.emptyList());
} }
GetBasePhotovoltaicPlantCloudOutput plant = plantList.get(0);
//查发电量
DateTime begin = DateUtil.beginOfDay(DateUtil.date());
PlantPredictedPowerMidTermMapper mapper = context.getBean(PlantPredictedPowerMidTermMapper.class); PlantPredictedPowerMidTermMapper mapper = context.getBean(PlantPredictedPowerMidTermMapper.class);
List<PlantPredictedPowerMidTermEnt> list = mapper.selectList(new LambdaQueryWrapper<PlantPredictedPowerMidTermEnt>() List<PredictedApiOutput> outputs = new ArrayList<>(16);
.eq(PlantPredictedPowerMidTermEnt::getPlantId, plant.getId()) DateTime begin = DateUtil.beginOfDay(DateUtil.date());
.between(PlantPredictedPowerMidTermEnt::getDataDate, //判断是否取所有
begin.toString(), if (CharSequenceUtil.isBlank(stationName)) {
DateUtil.offsetDay(begin, 15).toString()) //取所有
.orderByAsc(PlantPredictedPowerMidTermEnt::getDataDate) Map<String, List<PlantPredictedPowerMidTermEnt>> collect = mapper.selectList(new LambdaQueryWrapper<PlantPredictedPowerMidTermEnt>()
); .in(PlantPredictedPowerMidTermEnt::getPlantId, plantList.stream()
//封装结果 .map(GetBasePhotovoltaicPlantCloudOutput::getId)
List<PredictedApiOutput> outputs = XCopyUtils.copyNewList(list, PredictedApiOutput.class); .collect(Collectors.toList()))
.between(PlantPredictedPowerMidTermEnt::getDataDate,
begin.toString(),
DateUtil.offsetDay(begin, 15).toString())
.orderByAsc(PlantPredictedPowerMidTermEnt::getDataDate)
).stream()
.collect(Collectors.groupingBy(PlantPredictedPowerMidTermEnt::getPlantId));
//封装
for (GetBasePhotovoltaicPlantCloudOutput plant : plantList) {
outputs.add(
PredictedApiOutput.builder()
.stationName(plant.getStationName())
.predictList(XCopyUtils.copyNewList(collect.get(plant.getId()), PredictedApiPredictOutput.class))
.build()
);
}
} else {
//取一条
GetBasePhotovoltaicPlantCloudOutput plant = plantList.get(0);
//查发电量
List<PlantPredictedPowerMidTermEnt> list = mapper.selectList(new LambdaQueryWrapper<PlantPredictedPowerMidTermEnt>()
.eq(PlantPredictedPowerMidTermEnt::getPlantId, plant.getId())
.between(PlantPredictedPowerMidTermEnt::getDataDate,
begin.toString(),
DateUtil.offsetDay(begin, 15).toString())
.orderByAsc(PlantPredictedPowerMidTermEnt::getDataDate)
);
List<PredictedApiPredictOutput> predictList = XCopyUtils.copyNewList(list, PredictedApiPredictOutput.class);
outputs.add(
PredictedApiOutput.builder()
.stationName(plant.getStationName())
.predictList(predictList)
.build()
);
}
return XListResult.success(outputs); return XListResult.success(outputs);
} }
......
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