Commit 8ba2fb2d authored by ZWT's avatar ZWT

feat(能源管理系统): 间开优化定时任务

1.开发间开优化定期校准定时任务,配置表达式修改定时任务配置文件,创建cloud模块方法;
2.开发间开优化定期校准定时任务,完成业务逻辑开发;
3.修改间开制度管理模块定期校准新增功能,增加初始化校准历史业务逻辑;
4.开发间开优化短期间开优化定时任务,配置表达式修改定时任务配置文件,创建cloud模块方法;
5.修改长期间开优化定时任务,添加离网型线路数据处理逻辑;
6.创建储能预测电量数据(模拟数据测试用)表,生成对应代码,添加条件查询各时段储能预测数据Cloud模块接口;
7.修改长期间开优化定时任务,增加离网型算法计算储能可用时长逻辑;
8.修改长期间开优化定时任务,优化部分sql查询语句查询逻辑,优化代码结构;
9.光伏预测Cloud模块查询预测发电量接口修改,增加查询长期发电量逻辑;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 1980cf71
package pps.cloud.prediction.service.data.plant_predicted_power_data;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
......@@ -37,4 +38,8 @@ public class DynamicQueryPlantPredictedPowerInput {
@XText("结束时间")
private String endTime;
@NotNull(message = "缺少日期类型")
@XText("日期类型:0_长期;1_中短期")
private Integer dateType;
}
......@@ -7,7 +7,9 @@ import pps.cloud.prediction.service.IPlantPredictedPowerCloudService;
import pps.cloud.prediction.service.data.plant_predicted_power_data.DynamicQueryPlantPredictedPowerInput;
import pps.cloud.prediction.service.data.plant_predicted_power_data.DynamicQueryPlantPredictedPowerOutput;
import pps.core.prediction.entity.PlantPredictedPowerDataEnt;
import pps.core.prediction.entity.PlantPredictedPowerLongTermDataEnt;
import pps.core.prediction.mapper.PlantPredictedPowerDataMapper;
import pps.core.prediction.mapper.PlantPredictedPowerLongTermDataMapper;
import xstartup.annotation.XService;
import xstartup.base.XContext;
import xstartup.base.util.XCopyUtils;
......@@ -40,26 +42,55 @@ public class PlantPredictedPowerCloudServiceImpl implements IPlantPredictedPower
String monthTime = input.getMonthTime();
String startTime = input.getStartTime();
String endTime = input.getEndTime();
PlantPredictedPowerDataMapper mapper = context.getBean(PlantPredictedPowerDataMapper.class);
List<PlantPredictedPowerDataEnt> list = mapper.selectList(
new QueryWrapper<PlantPredictedPowerDataEnt>()
.select("year_time",
"month_time",
"hour_time",
"min_time",
"AVG( power ) AS power",
"STR_TO_DATE( CONCAT( hour_time, ':', min_time ), '%H:%i:%s' ) AS create_time")
.lambda()
.eq(StringUtils.isNotBlank(plantId), PlantPredictedPowerDataEnt::getPlantId, plantId)
.in(CollUtil.isNotEmpty(plantIds), PlantPredictedPowerDataEnt::getPlantId, plantIds)
.eq(StringUtils.isNotBlank(yearTime), PlantPredictedPowerDataEnt::getYearTime, yearTime)
.eq(StringUtils.isNotBlank(monthTime), PlantPredictedPowerDataEnt::getMonthTime, monthTime)
.between(!StringUtils.isAnyBlank(startTime, endTime), PlantPredictedPowerDataEnt::getDataDate, startTime, endTime)
.groupBy(PlantPredictedPowerDataEnt::getYearTime,
PlantPredictedPowerDataEnt::getMonthTime,
PlantPredictedPowerDataEnt::getHourTime,
PlantPredictedPowerDataEnt::getMinTime)
);
Integer dateType = input.getDateType();
List list = null;
switch (dateType) {
case 0:
PlantPredictedPowerLongTermDataMapper longTermDataMapper = context.getBean(PlantPredictedPowerLongTermDataMapper.class);
list = longTermDataMapper.selectList(
new QueryWrapper<PlantPredictedPowerLongTermDataEnt>()
.select("year_time",
"month_time",
"hour_time",
"min_time",
"AVG( power ) AS power",
"STR_TO_DATE( CONCAT( hour_time, ':', min_time ), '%H:%i:%s' ) AS create_time")
.lambda()
.eq(StringUtils.isNotBlank(plantId), PlantPredictedPowerLongTermDataEnt::getPlantId, plantId)
.in(CollUtil.isNotEmpty(plantIds), PlantPredictedPowerLongTermDataEnt::getPlantId, plantIds)
.eq(StringUtils.isNotBlank(yearTime), PlantPredictedPowerLongTermDataEnt::getYearTime, yearTime)
.eq(StringUtils.isNotBlank(monthTime), PlantPredictedPowerLongTermDataEnt::getMonthTime, monthTime)
.between(!StringUtils.isAnyBlank(startTime, endTime), PlantPredictedPowerLongTermDataEnt::getDataDate, startTime, endTime)
.groupBy(PlantPredictedPowerLongTermDataEnt::getYearTime,
PlantPredictedPowerLongTermDataEnt::getMonthTime,
PlantPredictedPowerLongTermDataEnt::getHourTime,
PlantPredictedPowerLongTermDataEnt::getMinTime)
);
break;
case 1:
PlantPredictedPowerDataMapper mapper = context.getBean(PlantPredictedPowerDataMapper.class);
list = mapper.selectList(
new QueryWrapper<PlantPredictedPowerDataEnt>()
.select("year_time",
"month_time",
"hour_time",
"min_time",
"AVG( power ) AS power",
"STR_TO_DATE( CONCAT( hour_time, ':', min_time ), '%H:%i:%s' ) AS create_time")
.lambda()
.eq(StringUtils.isNotBlank(plantId), PlantPredictedPowerDataEnt::getPlantId, plantId)
.in(CollUtil.isNotEmpty(plantIds), PlantPredictedPowerDataEnt::getPlantId, plantIds)
.eq(StringUtils.isNotBlank(yearTime), PlantPredictedPowerDataEnt::getYearTime, yearTime)
.eq(StringUtils.isNotBlank(monthTime), PlantPredictedPowerDataEnt::getMonthTime, monthTime)
.between(!StringUtils.isAnyBlank(startTime, endTime), PlantPredictedPowerDataEnt::getDataDate, startTime, endTime)
.groupBy(PlantPredictedPowerDataEnt::getYearTime,
PlantPredictedPowerDataEnt::getMonthTime,
PlantPredictedPowerDataEnt::getHourTime,
PlantPredictedPowerDataEnt::getMinTime)
);
break;
default:
}
List<DynamicQueryPlantPredictedPowerOutput> outputs;
if (CollUtil.isEmpty(list)) {
outputs = new ArrayList<>(0);
......
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