Commit a8b9e39e authored by ZWT's avatar ZWT

feat(零碳): 长庆

1.长庆演示首页功能开发,新增查询井场/场站列表接口,添加接口文档并完成接口冒烟测试;
2.长庆演示首页功能开发,新增总览信息统计接口,添加接口文档并完成接口冒烟测试;
3.长庆演示首页功能开发,新增用能分析统计接口,添加接口文档并完成接口冒烟测试;
4.长庆演示首页功能开发,新增累计用电统计接口,添加接口文档并完成接口冒烟测试;
5.长庆演示首页功能开发,新增光伏实时监控统计接口,添加接口文档并完成接口冒烟测试;
6.长庆演示首页功能开发,新增先导实验井间开制度统计接口,添加接口文档并完成接口冒烟测试;
7.长庆演示首页功能开发,新增零碳井场收益分析统计接口,添加接口文档并完成接口冒烟测试;
8.长庆演示首页功能开发,新增零碳井场实时监控接口,添加接口文档并完成接口冒烟测试;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 8bce30d7
...@@ -144,46 +144,50 @@ public class HomePageService { ...@@ -144,46 +144,50 @@ public class HomePageService {
@XApiGet @XApiGet
public XSingleResult<GetWellOverviewViewOutput> getWellOverview(XContext context, GetStationViewInput input) { public XSingleResult<GetWellOverviewViewOutput> getWellOverview(XContext context, GetStationViewInput input) {
String stationId = input.getStationId(); String stationId = input.getStationId();
//实时井口
String wellResult = ServiceUtil.doPostFormCq(context,
ThirdPartyApiConstant.CQ_WELL_REAL_PV_DATA,
new HashMap<>(0));
List<GetThirdCurrentWellConditionViewOutput> wellList = JSON.parseArray(wellResult, GetThirdCurrentWellConditionViewOutput.class);
int openWellNumber = 0; int openWellNumber = 0;
int stopWellNumber = 0; int stopWellNumber = 0;
if (CollUtil.isNotEmpty(wellList)) {
Set<String> set = this.getWellList(context, stationId).stream()
.map(DynamicQueryBaseWellheadOutput::getWellNumber)
.collect(Collectors.toSet());
for (GetThirdCurrentWellConditionViewOutput well : wellList) {
if (set.contains(well.getWellNumber())) {
if (CharSequenceUtil.equals(well.getWellStatus(), "开井")) {
openWellNumber++;
} else {
stopWellNumber++;
}
}
}
}
BigDecimal cumulativeProduction = BigDecimal.ZERO; BigDecimal cumulativeProduction = BigDecimal.ZERO;
BigDecimal powerGeneration = BigDecimal.ZERO; BigDecimal powerGeneration = BigDecimal.ZERO;
BigDecimal powerConsumption = BigDecimal.ZERO; BigDecimal powerConsumption = BigDecimal.ZERO;
//实时站 try {
String stationResult = ServiceUtil.doPostFormCq(context, //实时井口
ThirdPartyApiConstant.CQ_GROUP_REAL_PV_DATA, String wellResult = ServiceUtil.doPostFormCq(context,
new HashMap<>(0)); ThirdPartyApiConstant.CQ_WELL_REAL_PV_DATA,
List<GetCumulativePowerGenerationOutput> stationList = JSON.parseArray(stationResult, GetCumulativePowerGenerationOutput.class); new HashMap<>(0));
if (CollUtil.isNotEmpty(stationList)) { List<GetThirdCurrentWellConditionViewOutput> wellList = JSON.parseArray(wellResult, GetThirdCurrentWellConditionViewOutput.class);
Set<String> set = this.getPlantList(context, stationId).stream() if (CollUtil.isNotEmpty(wellList)) {
.map(GetBasePhotovoltaicPlantCloudOutput::getStationName) Set<String> set = this.getWellList(context, stationId).stream()
.collect(Collectors.toSet()); .map(DynamicQueryBaseWellheadOutput::getWellNumber)
for (GetCumulativePowerGenerationOutput station : stationList) { .collect(Collectors.toSet());
if (set.contains(station.getStationName())) { for (GetThirdCurrentWellConditionViewOutput well : wellList) {
cumulativeProduction = cumulativeProduction.add(station.getDailyLiquidProduction()); if (set.contains(well.getWellNumber())) {
powerGeneration = powerGeneration.add(station.getPhotovoltaicPower()); if (CharSequenceUtil.equals(well.getWellStatus(), "开井")) {
powerConsumption = powerConsumption.add(station.getDailyElectricityConsumption()); openWellNumber++;
} else {
stopWellNumber++;
}
}
}
}
//实时站
String stationResult = ServiceUtil.doPostFormCq(context,
ThirdPartyApiConstant.CQ_GROUP_REAL_PV_DATA,
new HashMap<>(0));
List<GetCumulativePowerGenerationOutput> stationList = JSON.parseArray(stationResult, GetCumulativePowerGenerationOutput.class);
if (CollUtil.isNotEmpty(stationList)) {
Set<String> set = this.getPlantList(context, stationId).stream()
.map(GetBasePhotovoltaicPlantCloudOutput::getStationName)
.collect(Collectors.toSet());
for (GetCumulativePowerGenerationOutput station : stationList) {
if (set.contains(station.getStationName())) {
cumulativeProduction = cumulativeProduction.add(station.getDailyLiquidProduction());
powerGeneration = powerGeneration.add(station.getPhotovoltaicPower());
powerConsumption = powerConsumption.add(station.getDailyElectricityConsumption());
}
} }
} }
} catch (Exception e) {
context.getLogger().error(e);
} }
return XSingleResult.success(GetWellOverviewViewOutput.builder() return XSingleResult.success(GetWellOverviewViewOutput.builder()
.openWellNumber(openWellNumber) .openWellNumber(openWellNumber)
......
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