Commit 2d9e0ce4 authored by ZWT's avatar ZWT

feat(能源管理系统): 测试问题修复

1.修改间开制度管理-长期间开优化模块详情接口,增加查询当月长期光伏预测功率数据逻辑;
2.开发光伏预测Cloud模块,条件查询每小时长期/中短期光伏预测发电量列表接口,完成接口冒烟测试;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 596cac43
......@@ -426,15 +426,15 @@ public class SpaceOptimizeBaseService {
}
/**
* 条件获取获取光伏预测各时段平均值列表
* 获取每小时平均发电量列表
*
* @param context 上下文
* @param input 输入
* @return {@link List}<{@link DynamicQueryPlantPredictedPowerOutput}>
*/
public List<DynamicQueryPlantPredictedPowerOutput> getAveragePowerGenerationListByPlantIds(XContext context, DynamicQueryPlantPredictedPowerInput input) {
public List<DynamicQueryPlantPredictedPowerOutput> getAveragePowerGenerationHourList(XContext context, DynamicQueryPlantPredictedPowerInput input) {
IPlantPredictedPowerCloudService cloudService = context.getBean(IPlantPredictedPowerCloudService.class);
XListResult<DynamicQueryPlantPredictedPowerOutput> result = cloudService.queryAveragePowerGenerationListByParam(context, input);
XListResult<DynamicQueryPlantPredictedPowerOutput> result = cloudService.queryAveragePowerGenerationHourListByParam(context, input);
result.throwIfFail();
return result.getResult();
}
......@@ -906,6 +906,20 @@ public class SpaceOptimizeBaseService {
);
}
/**
* 条件获取获取光伏预测各时段平均值列表
*
* @param context 上下文
* @param input 输入
* @return {@link List}<{@link DynamicQueryPlantPredictedPowerOutput}>
*/
private List<DynamicQueryPlantPredictedPowerOutput> getAveragePowerGenerationListByPlantIds(XContext context, DynamicQueryPlantPredictedPowerInput input) {
IPlantPredictedPowerCloudService cloudService = context.getBean(IPlantPredictedPowerCloudService.class);
XListResult<DynamicQueryPlantPredictedPowerOutput> result = cloudService.queryAveragePowerGenerationListByParam(context, input);
result.throwIfFail();
return result.getResult();
}
/**
* 按线路ID集合获取电站列表
*
......
......@@ -152,7 +152,7 @@ public class SpaceOptimizeLongPeriodService extends SpaceOptimizeBaseService {
//查功率预测信息
DateTime date = DateUtil.date(period.getCreateTime());
output.setPowerGenerationList(
super.getAveragePowerGenerationListByPlantIds(context, DynamicQueryPlantPredictedPowerInput.builder()
super.getAveragePowerGenerationHourList(context, DynamicQueryPlantPredictedPowerInput.builder()
.plantIds(super.getOptimizeLineRelation(context, CollUtil.newArrayList(detailEnt))
.getPlantIdsByLineIdMap()
.get(detailEnt.getLineId()))
......
......@@ -28,4 +28,15 @@ public interface IPlantPredictedPowerCloudService {
@XText("光伏预测Cloud模块--条件查询时段发电量平均值")
@XApiPost
XListResult<DynamicQueryPlantPredictedPowerOutput> queryAveragePowerGenerationListByParam(XContext context, DynamicQueryPlantPredictedPowerInput input);
/**
* 光伏预测Cloud模块--获取每小时平均发电量列表
*
* @param context 上下文
* @param input 输入
* @return {@link XListResult}<{@link DynamicQueryPlantPredictedPowerOutput}>
*/
@XText("光伏预测Cloud模块--获取每小时平均发电量列表")
@XApiPost
XListResult<DynamicQueryPlantPredictedPowerOutput> queryAveragePowerGenerationHourListByParam(XContext context, DynamicQueryPlantPredictedPowerInput input);
}
\ No newline at end of file
......@@ -65,6 +65,7 @@ public class PlantPredictedPowerCloudServiceImpl implements IPlantPredictedPower
PlantPredictedPowerLongTermDataEnt::getMonthTime,
PlantPredictedPowerLongTermDataEnt::getHourTime,
PlantPredictedPowerLongTermDataEnt::getMinTime)
.orderByAsc(PlantPredictedPowerLongTermDataEnt::getHourTime)
);
break;
case 1:
......@@ -87,6 +88,68 @@ public class PlantPredictedPowerCloudServiceImpl implements IPlantPredictedPower
PlantPredictedPowerDataEnt::getMonthTime,
PlantPredictedPowerDataEnt::getHourTime,
PlantPredictedPowerDataEnt::getMinTime)
.orderByAsc(PlantPredictedPowerDataEnt::getHourTime)
);
break;
default:
}
List<DynamicQueryPlantPredictedPowerOutput> outputs;
if (CollUtil.isEmpty(list)) {
outputs = new ArrayList<>(0);
} else {
outputs = XCopyUtils.copyNewList(list, DynamicQueryPlantPredictedPowerOutput.class);
}
return XListResult.success(outputs);
}
/**
* 光伏预测Cloud模块--获取每小时平均发电量列表
*
* @param context 上下文
* @param input 输入
* @return {@link XListResult}<{@link DynamicQueryPlantPredictedPowerOutput}>
*/
@Override
public XListResult<DynamicQueryPlantPredictedPowerOutput> queryAveragePowerGenerationHourListByParam(XContext context, DynamicQueryPlantPredictedPowerInput input) {
String plantId = input.getPlantId();
List<String> plantIds = input.getPlantIds();
String yearTime = input.getYearTime();
String monthTime = input.getMonthTime();
String startTime = input.getStartTime();
String endTime = input.getEndTime();
Integer dateType = input.getDateType();
List list = null;
switch (dateType) {
case 0:
PlantPredictedPowerLongTermDataMapper longTermDataMapper = context.getBean(PlantPredictedPowerLongTermDataMapper.class);
list = longTermDataMapper.selectList(
new QueryWrapper<PlantPredictedPowerLongTermDataEnt>()
.select("hour_time",
"AVG( power ) AS power")
.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::getHourTime)
.orderByAsc(PlantPredictedPowerLongTermDataEnt::getHourTime)
);
break;
case 1:
PlantPredictedPowerDataMapper mapper = context.getBean(PlantPredictedPowerDataMapper.class);
list = mapper.selectList(
new QueryWrapper<PlantPredictedPowerDataEnt>()
.select("hour_time",
"AVG( power ) AS power")
.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::getHourTime)
.orderByAsc(PlantPredictedPowerDataEnt::getHourTime)
);
break;
default:
......
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