Commit b08ae750 authored by ZWT's avatar ZWT

feat(零碳): 长庆

1.修复登录页面登录接口验证码输入后不需要验证直接能登录的问题;
2.长庆演示,首页展示大屏功能修改,修改线路详情接口,增加查询日平均用电量逻辑,同时重构查询日产液量和日发电量逻辑,更新接口文档并完成接口冒烟测试,同时生成用例;
3.长庆极短期间开优化随动算法功能开发,设置自定义参数,初步完成极短时间,间开时间段优化测试功能;
4.间开制度管理模块,间开制度关联井口信息表表结构修改,增加"单次最高开井时长(h)","单次最低开井时长(h)","单次最高关井时长(h)","单次最低关井时长(h)"字段,同时修改数据表对应代码实体及表单参数,修改部分相关模块功能查询修改逻辑;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 2d00ead2
......@@ -373,7 +373,7 @@ public class SpaceOptimizeShortPeriodService extends SpaceOptimizeBaseService {
}
}
//时间处理并排序(处理后第一次开井时间的索引位置为0)
weightDurationList.sort(Comparator.comparing(SpaceOptimizeWeightDuration::getOpenTime));
weightDurationList.sort((o1, o2) -> o2.getWeight() - o1.getWeight());
List<SpaceOptimizeDurationDTO> optimizeDurationDTOList = new ArrayList<>(12);
//从前往后算时间
SpaceOptimizeWeightDuration weightDuration;
......@@ -394,31 +394,23 @@ public class SpaceOptimizeShortPeriodService extends SpaceOptimizeBaseService {
duration -= (long) startInterval * i;
openTime = DateUtil.offsetMinute(openTime, startInterval * i);
}
//偏移开井时间
//偏移开/关井时间
DateTime closeTime = weightDuration.getCloseTime();
if (CollUtil.isNotEmpty(optimizeDurationDTOList)) {
Date lastCloseTime = optimizeDurationDTOList.get(optimizeDurationDTOList.size() - 1).getCloseTime();
//计算当前开井时间和上一次关井时间的时间间隔
long l = openTime.between(lastCloseTime, DateUnit.MINUTE);
//比较时间
if (DateUtil.compare(lastCloseTime, openTime) > 0) {
//时间间隔-(超出部分时间+最小关井时长)
duration -= (l + minCloseMinute);
if (duration >= minOpenMinute) {
//如果剩余时长能满足最小开井时长,则计算开井时间(用关井时间往前推)
openTime = closeTime.offsetNew(DateField.MINUTE, (int) -duration);
} else {
continue;
}
} else {
SpaceOptimizeDurationDTO durationDTO = optimizeDurationDTOList.get(optimizeDurationDTOList.size() - 1);
Date lastOpenTime = durationDTO.getOpenTime();
Date lastCloseTime = durationDTO.getCloseTime();
long l;
//如果关井时间在上一次开井时间之前,判断是否需要偏移关井时间
if (DateUtil.compare(lastOpenTime, closeTime) >= 0) {
l = closeTime.between(lastOpenTime, DateUnit.MINUTE);
long l1 = l - minCloseMinute;
//小于0,说明不满足最小停井时间,需要补
if (l1 < 0) {
openTime = openTime.offsetNew(DateField.MINUTE, (int) -l1);
//偏移启动时间,判断时间区间是否满足最小开井时长
duration += l1;
//偏移关井时间
closeTime = closeTime.offsetNew(DateField.MINUTE, (int) -l1);
duration -= l1;
if (duration < minOpenMinute) {
//偏移关井时间
continue;
}
} else if (l1 > 0) {
......@@ -426,9 +418,43 @@ public class SpaceOptimizeShortPeriodService extends SpaceOptimizeBaseService {
if (l > maxCloseMinute) {
//调整当前权重
if (i1 > 0) {
//计算出本次应该的开井时间
openTime = DateUtil.offsetMinute(lastCloseTime, maxCloseMinute);
//取当前权重的开始索引作为范围结束
//计算出本次应该的开/关井时间
closeTime = DateUtil.offsetMinute(closeTime, (int) l - maxCloseMinute);
openTime = DateUtil.offsetMinute(openTime, (int) l - maxCloseMinute);
}
}
}
} else {
//计算当前开井时间和上一次关井时间的时间间隔
l = openTime.between(lastCloseTime, DateUnit.MINUTE);
//比较时间
if (DateUtil.compare(lastCloseTime, openTime) > 0) {
//时间间隔-(超出部分时间+最小关井时长)
duration -= (l + minCloseMinute);
if (duration >= minOpenMinute) {
//如果剩余时长能满足最小开井时长,则计算开井时间(用关井时间往前推)
openTime = closeTime.offsetNew(DateField.MINUTE, (int) -duration);
} else {
continue;
}
} else {
long l1 = l - minCloseMinute;
//小于0,说明不满足最小停井时间,需要补
if (l1 < 0) {
openTime = openTime.offsetNew(DateField.MINUTE, (int) -l1);
//偏移启动时间,判断时间区间是否满足最小开井时长
duration += l1;
if (duration < minOpenMinute) {
continue;
}
} else if (l1 > 0) {
//判断时间间隔是否超过最大停井时间
if (l > maxCloseMinute) {
//调整当前权重
if (i1 > 0) {
//计算出本次应该的开井时间
openTime = DateUtil.offsetMinute(lastCloseTime, maxCloseMinute);
//取当前权重的开始索引作为范围结束
// int endIndex = weightDuration.getOpenIndex();
// SpaceOptimizeWeight spaceOptimizeWeight;
// int beginIndex = 0;
......@@ -445,8 +471,9 @@ public class SpaceOptimizeShortPeriodService extends SpaceOptimizeBaseService {
// }
// //todo :判断时间区间是否连续(暂时不用,留着,不连续的处理会很麻烦)
// boolean b = endIndex - beginIndex == sub;
//修改本次区间的开始时间及时间间隔
duration = DateUtil.between(openTime, weightDuration.getCloseTime(), DateUnit.MINUTE);
//修改本次区间的开始时间及时间间隔
duration = DateUtil.between(openTime, weightDuration.getCloseTime(), DateUnit.MINUTE);
}
}
}
}
......@@ -505,6 +532,8 @@ public class SpaceOptimizeShortPeriodService extends SpaceOptimizeBaseService {
//结束循环
break;
}
//重新按开井时间排序
optimizeDurationDTOList.sort(Comparator.comparing(SpaceOptimizeDurationDTO::getOpenTime));
}
//判断是否需要补时间
if (sumOpenTime < dayOpenMinute) {
......
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