Commit f7e75c4d authored by ZWT's avatar ZWT

feat(零碳): 长庆演示系统新增功能

1.修改第三方日累计数据推送表表结构,增加日累计储能放电量字段,同时修改代码对应实体及mapper文件,修改相关接口增加储能日累计放电量接收逻辑;
2.修改首页井场收益分析模块接口,修改获取储能累计放电量逻辑;
3.设计并创建井口日用电趋势表,生成对应实体类及mapper文件;
4.统计分析模块,新增本月累计节电经济效益查询接口,添加线上接口文档并完成接口冒烟测试;
5.统计分析模块,新增本月累计减碳量查询接口,添加线上接口文档并完成接口冒烟测试;
6.统计分析模块,新增光伏发电趋势查询接口,添加线上接口文档并完成接口冒烟测试;
7.统计分析模块,新增月度总览查询接口,添加线上接口文档并完成接口冒烟测试;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 204ce06a
......@@ -15,12 +15,10 @@ import pps.core.prediction.mapper.ConfigShowMapper;
import pps.core.prediction.mapper.PlantPredictedPowerShortTermMapper;
import pps.core.prediction.mapper.ThirdActivePowerViewMapper;
import pps.core.prediction.service.data.plant_predicted_power_data.GetPredictedPowerOutput;
import pps.core.prediction.service.data.plant_predicted_power_mid_term.GetPlantPredictedPowerMidTermOutput;
import pps.core.prediction.service.data.plant_predicted_power_short_term.GetPlantPredictedPowerShortTermInput;
import xstartup.annotation.XService;
import xstartup.annotation.XText;
import xstartup.base.XContext;
import xstartup.base.util.XCopyUtils;
import xstartup.base.util.XDateUtils;
import xstartup.base.util.XStringUtils;
import xstartup.data.XListResult;
......@@ -41,15 +39,17 @@ import java.util.stream.Collectors;
@XText("电站预测功率短期72小时数据")
public class PlantPredictedPowerShortTermService {
/**
* 三天功率预测
*
* @param context 上下文
* @param input 输入
* @return {@link XListResult }<{@link GetPredictedPowerOutput }>
*/
@XApiGet
@XText("根据电站预测3天的预测数据")
public XListResult<GetPlantPredictedPowerMidTermOutput> getThreePlantPredictedPowerShortTermList(XContext context, GetPlantPredictedPowerShortTermInput input) {
PlantPredictedPowerShortTermMapper mapper = context.getBean(PlantPredictedPowerShortTermMapper.class);
QueryWrapper<PlantPredictedPowerShortTermEnt> queryWrapper = setQueryWrapper(input.getPlantId(), input.getStartTime(), 3);
List<PlantPredictedPowerShortTermEnt> list = mapper.selectList(queryWrapper);
List<GetPlantPredictedPowerMidTermOutput> outputs = XCopyUtils.copyNewList(list, GetPlantPredictedPowerMidTermOutput.class);
ThirdActivePowerServiceHelper.getActivePower(context, outputs, input.getPlantId(), null);
return XListResult.success(outputs);
public XListResult<GetPredictedPowerOutput> getThreePlantPredictedPowerShortTermList(XContext context, GetPlantPredictedPowerShortTermInput input) {
return XListResult.success(this.getPredictedPowerOutput(context, input.getStartTime(), input.getPlantId(), 3));
}
/**
......@@ -62,9 +62,22 @@ public class PlantPredictedPowerShortTermService {
@XApiGet
@XText("根据电站预测1天的预测数据")
public XListResult<GetPredictedPowerOutput> getOnePlantPredictedPowerShortTermList(XContext context, GetPlantPredictedPowerShortTermInput input) {
return XListResult.success(this.getPredictedPowerOutput(context, input.getStartTime(), input.getPlantId(), 1));
}
/**
* 获得预测功率输出
*
* @param context 上下文
* @param inputTimeStr 输入时间str
* @param stationId 工作站id
* @param offsetDay 抵消日
* @return {@link List }<{@link GetPredictedPowerOutput }>
*/
private List<GetPredictedPowerOutput> getPredictedPowerOutput(XContext context, String inputTimeStr, String stationId, int offsetDay) {
//判断是否需要启用演示配置
DateTime date = DateUtil.date();
DateTime inputTime = DateUtil.parse(input.getStartTime(), BusinessConstant.DATE_FORMAT_DAY);
DateTime inputTime = DateUtil.parse(inputTimeStr, BusinessConstant.DATE_FORMAT_DAY);
ConfigShowMapper configMapper = context.getBean(ConfigShowMapper.class);
ConfigShowEnt configShowEnt = configMapper.selectOne(new LambdaQueryWrapper<ConfigShowEnt>()
.last("LIMIT 1"));
......@@ -86,11 +99,11 @@ public class PlantPredictedPowerShortTermService {
betweenDay = 0;
}
DateTime beginTime = DateUtil.offsetMinute(day, -1);
DateTime endTime = DateUtil.offsetDay(day, 1);
DateTime endTime = DateUtil.offsetDay(day, offsetDay);
//查一天预测
PlantPredictedPowerShortTermMapper mapper = context.getBean(PlantPredictedPowerShortTermMapper.class);
List<PlantPredictedPowerShortTermEnt> predictedList = mapper.selectList(new LambdaQueryWrapper<PlantPredictedPowerShortTermEnt>()
.eq(PlantPredictedPowerShortTermEnt::getPlantId, input.getPlantId())
.eq(PlantPredictedPowerShortTermEnt::getPlantId, stationId)
.between(PlantPredictedPowerShortTermEnt::getDataDate, beginTime, endTime)
.orderByAsc(PlantPredictedPowerShortTermEnt::getDataDate)
);
......@@ -104,7 +117,7 @@ public class PlantPredictedPowerShortTermService {
//查实际功率
ThirdActivePowerViewMapper powerMapper = context.getBean(ThirdActivePowerViewMapper.class);
List<ThirdActivePowerView> powerList = powerMapper.selectAvgPower15(ThirdActivePowerView.builder()
.stationId(input.getPlantId())
.stationId(stationId)
.startTime(beginTime)
.endTime(showTime)
.build());
......@@ -133,7 +146,7 @@ public class PlantPredictedPowerShortTermService {
}
outputs.add(output);
}
return XListResult.success(outputs);
return outputs;
}
private QueryWrapper<PlantPredictedPowerShortTermEnt> setQueryWrapper(String plantId, String startTime, Integer days) {
......
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