Commit cf1874fc authored by ZWT's avatar ZWT

feat(吉林演示): 松原

1.开发间开优化结果统计功能,创建间开优化效果统计表,生成对应代码;
2.修改15天,10天,3天,1天间开优化功能,修改代码结构;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 46de97ea
...@@ -1091,8 +1091,8 @@ public class SpaceOptimizeBaseService { ...@@ -1091,8 +1091,8 @@ public class SpaceOptimizeBaseService {
//查光伏预测 //查光伏预测
powerList = this.getAveragePower(context, DynamicQueryPlantPredictedPowerInput.builder() powerList = this.getAveragePower(context, DynamicQueryPlantPredictedPowerInput.builder()
.plantIds(plantIds) .plantIds(plantIds)
.startTime(begin.toString(BusinessConstant.DATE_FORMAT_DAY)) .startTime(DateUtil.offsetDay(begin, -1).toString(BusinessConstant.DATE_FORMAT_DAY))
.endTime(DateUtil.offsetDay(begin, 1).toString(BusinessConstant.DATE_FORMAT_DAY)) .endTime(begin.toString(BusinessConstant.DATE_FORMAT_DAY))
.dateType(dateType) .dateType(dateType)
.formatType(0) .formatType(0)
.build()); .build());
...@@ -2898,7 +2898,6 @@ public class SpaceOptimizeBaseService { ...@@ -2898,7 +2898,6 @@ public class SpaceOptimizeBaseService {
*/ */
private List<SpaceOptimizeWeight> zoningList(BigDecimal serviceRating, List<DateTime> rangeToList, List<DynamicQueryPlantPredictedPowerOutput> powerList, List<GetBasePriceStrategyDetailOutput> strategyList) { private List<SpaceOptimizeWeight> zoningList(BigDecimal serviceRating, List<DateTime> rangeToList, List<DynamicQueryPlantPredictedPowerOutput> powerList, List<GetBasePriceStrategyDetailOutput> strategyList) {
int rangeListSize = rangeToList.size(); int rangeListSize = rangeToList.size();
int strategyListSize = strategyList.size();
int rangeIndex = 0; int rangeIndex = 0;
int strategyIndex = 0; int strategyIndex = 0;
Map<Date, DynamicQueryPlantPredictedPowerOutput> powerMap; Map<Date, DynamicQueryPlantPredictedPowerOutput> powerMap;
...@@ -2910,28 +2909,30 @@ public class SpaceOptimizeBaseService { ...@@ -2910,28 +2909,30 @@ public class SpaceOptimizeBaseService {
} }
List<SpaceOptimizeWeight> weightList = new ArrayList<>(rangeListSize); List<SpaceOptimizeWeight> weightList = new ArrayList<>(rangeListSize);
DynamicQueryPlantPredictedPowerOutput firstPower; DynamicQueryPlantPredictedPowerOutput firstPower;
DynamicQueryPlantPredictedPowerOutput lastPower;
GetBasePriceStrategyDetailOutput firstStrategy; GetBasePriceStrategyDetailOutput firstStrategy;
GetBasePriceStrategyDetailOutput lastStrategy;
while (rangeListSize > 0 && rangeListSize > rangeIndex) { while (rangeListSize > 0 && rangeListSize > rangeIndex) {
boolean powerFlag = false; boolean powerFlag = false;
SpaceOptimizeWeight firstWeight = new SpaceOptimizeWeight(); SpaceOptimizeWeight firstWeight = new SpaceOptimizeWeight();
DateTime firstTime = rangeToList.get(rangeIndex); DateTime firstTime = rangeToList.get(rangeIndex);
firstWeight.setTimestamp(firstTime); firstWeight.setTimestamp(firstTime);
firstWeight.setTimeString(firstTime.toString());
firstWeight.setSort(rangeIndex); firstWeight.setSort(rangeIndex);
if (powerMap.containsKey(firstTime)) { if (powerMap.containsKey(firstTime)) {
firstPower = powerMap.get(firstTime); firstPower = powerMap.get(firstTime);
firstWeight.setPower(firstPower.getPower()); firstWeight.setPower(firstPower.getPower());
//判断发电量是否满足运行功率 //判断发电量是否满足运行功率
powerFlag = firstPower.getPower().compareTo(serviceRating) >= 0; powerFlag = firstPower.getPower().compareTo(BigDecimal.ZERO) > 0;
if (powerFlag) { if (powerFlag) {
firstWeight.setWeight(10); firstWeight.setWeight(10);
firstWeight.setGenerationTypeKey(BusinessConstant.PHOTOVOLTAIC); firstWeight.setGenerationTypeKey(BusinessConstant.PHOTOVOLTAIC);
} }
} }
firstStrategy = strategyList.get(strategyIndex); firstStrategy = strategyList.get(strategyIndex);
if (ObjectUtil.isNull(firstStrategy.getCloseTime()) && CharSequenceUtil.equals(firstStrategy.getEndTime(), BusinessConstant.END_OF_DAY_TIME)) {
firstStrategy.setCloseTime(BusinessConstant.DATE_FLAG);
}
//在市电峰谷时段内,且未满足运行功率,设置权重 //在市电峰谷时段内,且未满足运行功率,设置权重
if (DateUtil.isIn(firstTime, firstStrategy.getOpenTime(), ObjectUtil.isEmpty(firstStrategy.getCloseTime()) && CharSequenceUtil.equals(BusinessConstant.END_OF_DAY_TIME, firstStrategy.getStartTime()) ? BusinessConstant.DATE_FLAG : firstStrategy.getCloseTime())) { if (!powerFlag && DateUtil.isIn(firstTime, firstStrategy.getOpenTime(), ObjectUtil.isEmpty(firstStrategy.getCloseTime()) && CharSequenceUtil.equals(BusinessConstant.END_OF_DAY_TIME, firstStrategy.getStartTime()) ? BusinessConstant.DATE_FLAG : firstStrategy.getCloseTime())) {
if (CharSequenceUtil.equals(firstStrategy.getPeriodTypeKey(), "RUSH")) { if (CharSequenceUtil.equals(firstStrategy.getPeriodTypeKey(), "RUSH")) {
//尖峰时段要停井 //尖峰时段要停井
firstWeight.setWeight(0); firstWeight.setWeight(0);
...@@ -2944,41 +2945,6 @@ public class SpaceOptimizeBaseService { ...@@ -2944,41 +2945,6 @@ public class SpaceOptimizeBaseService {
} }
weightList.add(firstWeight); weightList.add(firstWeight);
rangeIndex++; rangeIndex++;
rangeListSize--;
//防止重复插入
if (rangeIndex >= rangeListSize) {
continue;
}
/*----------------------------------------------------*/
powerFlag = false;
SpaceOptimizeWeight lastWeight = new SpaceOptimizeWeight();
DateTime lastTime = rangeToList.get(rangeListSize);
lastWeight.setTimestamp(lastTime);
lastWeight.setSort(rangeListSize);
if (powerMap.containsKey(lastTime)) {
lastPower = powerMap.get(lastTime);
lastWeight.setPower(lastPower.getPower());
//判断发电量是否满足运行功率
powerFlag = lastPower.getPower().compareTo(serviceRating) >= 0;
if (powerFlag) {
lastWeight.setWeight(10);
lastWeight.setGenerationTypeKey(BusinessConstant.PHOTOVOLTAIC);
}
}
lastStrategy = strategyList.get(strategyListSize - 1);
//在市电峰谷时段内,且未满足运行功率,设置权重
if (DateUtil.isIn(lastTime, lastStrategy.getOpenTime(), ObjectUtil.isEmpty(lastStrategy.getCloseTime()) && CharSequenceUtil.equals(BusinessConstant.END_OF_DAY_TIME, lastStrategy.getEndTime()) ? BusinessConstant.DATE_FLAG : lastStrategy.getCloseTime())) {
if (CharSequenceUtil.equals(lastStrategy.getPeriodTypeKey(), "RUSH")) {
//尖峰时段要停井
lastWeight.setWeight(0);
} else if (!powerFlag) {
lastWeight.setWeight(this.getWeightByPeriodTypeKey(lastStrategy.getPeriodTypeKey()));
}
}
if (lastTime.compareTo(lastStrategy.getOpenTime()) <= 0) {
strategyListSize--;
}
weightList.add(lastWeight);
} }
//排序 //排序
weightList.sort(Comparator.comparing(SpaceOptimizeWeight::getSort)); weightList.sort(Comparator.comparing(SpaceOptimizeWeight::getSort));
......
...@@ -25,6 +25,11 @@ public class SpaceOptimizeWeight { ...@@ -25,6 +25,11 @@ public class SpaceOptimizeWeight {
*/ */
private DateTime timestamp; private DateTime timestamp;
/**
* 时间戳
*/
private String timeString;
/** /**
* 权重: * 权重:
* 光伏发电量: 10 + 发电量 * 光伏发电量: 10 + 发电量
......
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