Commit 8f9bb4cf authored by ZWT's avatar ZWT

feat(吉林演示): 松原

1.排查并修复各时段间开优化功能执行异常导致未执行间开优化问题;
2.排查并修复15天间开优化功能执行后,优化结果时间段展示错乱问题;
3.排查并修复光伏功率预测展示功能,实际功率未展示问题;
4.排查并修复天气数据获取服务,数据处理后入库缺少数据问题;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent b58f0f1e
......@@ -1447,9 +1447,9 @@ public class EnergyConsumptionAnalysisService {
for (DynamicQueryBasePowerLineWellheadViewOutput out : wellheadList) {
set.add(out.getWellNumber());
if (CharSequenceUtil.equals(out.getRunTypeKey(), BusinessConstant.INTERVAL_PUMPING_WELL)) {
interOpenWellNumber++;
} else {
normallyOpenWellNumber++;
} else {
interOpenWellNumber++;
}
}
}
......@@ -1523,26 +1523,36 @@ public class EnergyConsumptionAnalysisService {
.eq(CharSequenceUtil.isNotBlank(wellStatus), ThirdCurrentWellConditionEnt::getWellStatus, wellStatus)
.eq(ThirdCurrentWellConditionEnt::getSystemSource, ServiceUtil.getOilFieldCode(context))
);
Map<String, ThirdCurrentWellConditionEnt> wellStatusMap;
if (CollUtil.isNotEmpty(list)) {
//当日间开
ISpaceOptimizeShortCloudService service = context.getBean(ISpaceOptimizeShortCloudService.class);
XListResult<GetSpaceOptimizeShortWellheadOutput> result = service.dailyOptimizationResult(context, GetSpaceOptimizeShortWellheadInput.builder()
.wellheadIds(wellIds)
.build());
result.throwIfFail();
List<GetSpaceOptimizeShortWellheadOutput> optimizeWellheadList = result.getResult();
Map<String, List<SpaceOptimizeDateDuration>> listMap;
if (CollUtil.isNotEmpty(optimizeWellheadList)) {
listMap = optimizeWellheadList.stream()
.collect(Collectors.toMap(GetSpaceOptimizeShortWellheadOutput::getWellNumber, GetSpaceOptimizeShortWellheadOutput::getOptimizeList));
} else {
listMap = Collections.emptyMap();
}
//查生效中的所有井口
BigDecimal nextOpen;
currentList = new ArrayList<>(list.size());
DateTime now = DateUtil.date();
for (ThirdCurrentWellConditionEnt ent : list) {
wellStatusMap = list.stream()
.collect(Collectors.toMap(ThirdCurrentWellConditionEnt::getWellNumber, Function.identity()));
} else {
wellStatusMap = Collections.emptyMap();
}
//当日间开
ISpaceOptimizeShortCloudService service = context.getBean(ISpaceOptimizeShortCloudService.class);
XListResult<GetSpaceOptimizeShortWellheadOutput> result = service.dailyOptimizationResult(context, GetSpaceOptimizeShortWellheadInput.builder()
.wellheadIds(wellIds)
.build());
result.throwIfFail();
List<GetSpaceOptimizeShortWellheadOutput> optimizeWellheadList = result.getResult();
Map<String, List<SpaceOptimizeDateDuration>> listMap;
if (CollUtil.isNotEmpty(optimizeWellheadList)) {
listMap = optimizeWellheadList.stream()
.collect(Collectors.toMap(GetSpaceOptimizeShortWellheadOutput::getWellNumber, GetSpaceOptimizeShortWellheadOutput::getOptimizeList));
} else {
listMap = Collections.emptyMap();
}
//封装数据
ThirdCurrentWellConditionEnt ent;
BigDecimal nextOpen;
DateTime now = DateUtil.date();
String currentWellStatus;
for (Map.Entry<String, DynamicQueryBasePowerLineWellheadViewOutput> entry : collect.entrySet()) {
if (wellStatusMap.containsKey(entry.getKey())) {
ent = wellStatusMap.get(entry.getKey());
currentWellStatus = ent.getWellStatus();
if (ObjectUtil.isNull(ent.getNextTime()) ||
CharSequenceUtil.contains(DateUtil.date(ent.getNextTime()).toString(), ThirdPartyApiConstant.DATE_FLAG) ||
DateUtil.compare(now, ent.getNextTime()) >= 0) {
......@@ -1550,17 +1560,21 @@ public class EnergyConsumptionAnalysisService {
} else {
nextOpen = BaseUtils.divide(BigDecimal.valueOf(DateUtil.between(ent.getNextTime(), now, DateUnit.MINUTE)), BusinessConstant.BIG_DECIMAL_60);
}
currentList.add(
GetRealTimeInfoOutput.builder()
.wellNumber(ent.getWellNumber())
.nextOpen(nextOpen)
.wellStatus(ent.getWellStatus())
.runTypeName(collect.get(ent.getWellNumber()).getRunTypeName())
.ratedPower(collect.get(ent.getWellNumber()).getRatedPower())
.optimizeList(listMap.getOrDefault(ent.getWellNumber(), Collections.emptyList()))
.build()
);
} else {
nextOpen = BigDecimal.ZERO;
currentWellStatus = "停井";
}
currentList = new ArrayList<>(list.size());
currentList.add(
GetRealTimeInfoOutput.builder()
.wellNumber(entry.getKey())
.nextOpen(nextOpen)
.wellStatus(currentWellStatus)
.runTypeName(entry.getValue().getRunTypeName())
.ratedPower(entry.getValue().getRatedPower())
.optimizeList(listMap.getOrDefault(entry.getKey(), Collections.emptyList()))
.build()
);
}
}
return XListResult.success(currentList);
......
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