Commit 2f17d400 authored by ZWT's avatar ZWT

feat(零碳): 长庆

1.修复登录页面登录接口验证码输入后不需要验证直接能登录的问题;
2.长庆演示,首页展示大屏功能修改,修改线路详情接口,增加查询日平均用电量逻辑,同时重构查询日产液量和日发电量逻辑,更新接口文档并完成接口冒烟测试,同时生成用例;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent caa1d599
......@@ -267,7 +267,7 @@ public class SpaceOptimizeShortPeriodService extends SpaceOptimizeBaseService {
.sorted(Comparator.comparing(SpaceOptimizeWeight::getSort))
.collect(Collectors.toList());
SpaceOptimizeWeight weight;
//测试用 ====== start
//测试用 ====== start -----------------------------------------------
int dayOpen = 15;
int dayOpenMinute = dayOpen * 60;
int maxOpen = 5;
......@@ -279,7 +279,38 @@ public class SpaceOptimizeShortPeriodService extends SpaceOptimizeBaseService {
int minCloseMinute = minClose * 60;
int maxCloseMinute = maxClose * 60;
int sumMinute = minCloseMinute + maxOpenMinute;
//测试用 ====== end
//测试用 ====== end -----------------------------------------------
//取权重最高的开始位置
int maxIndex = 0;
int weightNum = 0;
for (int i1 = 0; i1 < weightList.size(); i1++) {
if (weightList.get(i1).getWeight() > weightNum) {
weightNum = weightList.get(i1).getWeight();
maxIndex = i1;
}
}
//时间处理,重构时间段
if (maxIndex > 0) {
//取最后一段时间
SpaceOptimizeWeight endWeight = weightList.get(weightList.size() - 1);
Iterator<SpaceOptimizeWeight> iterator = weightList.iterator();
int index = 0;
while (iterator.hasNext() && index < maxIndex) {
index++;
SpaceOptimizeWeight next = iterator.next();
DateTime offsetDay = DateUtil.offsetDay(next.getTimestamp(), 1);
if (endWeight.getTimestamp().equals(offsetDay)) {
iterator.remove();
continue;
}
next.setTimestamp(offsetDay);
next.setSort(next.getSort() + endWeight.getSort());
}
}
weightList = weightList.stream()
.sorted(Comparator.comparing(SpaceOptimizeWeight::getSort))
.collect(Collectors.toList());
//分级取时间段
List<SpaceOptimizeWeightDuration> weightDurationList = new ArrayList<>(32);
long between;
......@@ -314,12 +345,13 @@ public class SpaceOptimizeShortPeriodService extends SpaceOptimizeBaseService {
}
}
}
//时间处理并排序
weightDurationList = weightDurationList.stream()
.sorted(Comparator.comparing(SpaceOptimizeWeightDuration::getOpenTime))
.collect(Collectors.toList());
//计算第一次启动时间
int startIndex = 0;
int weightNum = 0;
weightNum = 0;
for (int i1 = 0; i1 < weightDurationList.size(); i1++) {
if (weightDurationList.get(i1).getWeight() > weightNum) {
weightNum = weightDurationList.get(i1).getWeight();
......
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