Commit a9cdbb3c authored by ZWT's avatar ZWT

feat(零碳): 长庆

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

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 43317c97
......@@ -31,8 +31,8 @@ import pps.core.prediction.mapper.ThirdActivePowerDailyUpdateViewMapper;
import pps.core.prediction.service.data.energy_consumption_analysis.DynamicQueryEnergyConsumptionAnalysisViewOutput;
import pps.core.prediction.service.data.energy_consumption_analysis.QueryEnergyConsumptionAnalysisInput;
import pps.core.prediction.service.data.home_page.*;
import pps.core.prediction.service.data.third_current_well_condition.GetThirdCurrentWellConditionViewOutput;
import pps.core.prediction.service.data.third_photovoltaic_power.GetCumulativePowerGenerationOutput;
import pps.core.prediction.service.data.wellhead_daily_production_situation.WellheadDailyProductionSituationJob;
import pps.core.prediction.utils.ServiceUtil;
import xstartup.annotation.XService;
import xstartup.annotation.XText;
......@@ -147,27 +147,52 @@ public class HomePageService {
public XSingleResult<GetWellOverviewViewOutput> getWellOverview(XContext context, GetStationViewInput input) {
String stationId = input.getStationId();
//实时井口
Map<String, Object> param = new HashMap<>(2);
param.put("Calc_Date", DateUtil.beginOfDay(DateUtil.date()));
String wellResult = ServiceUtil.doPostFormCq(context,
ThirdPartyApiConstant.CQ_WELL_TECH_DAILY,
param);
List<WellheadDailyProductionSituationJob> wellList = JSON.parseArray(wellResult, WellheadDailyProductionSituationJob.class);
ThirdPartyApiConstant.CQ_WELL_REAL_PV_DATA,
new HashMap<>(0));
List<GetThirdCurrentWellConditionViewOutput> wellList = JSON.parseArray(wellResult, GetThirdCurrentWellConditionViewOutput.class);
int openWellNumber = 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 (well.getWellStatus().equals("开井")) {
openWellNumber++;
} else {
stopWellNumber++;
}
}
}
}
BigDecimal cumulativeProduction = BigDecimal.ZERO;
BigDecimal powerGeneration = BigDecimal.ZERO;
BigDecimal powerConsumption = BigDecimal.ZERO;
//实时站
String stationResult = ServiceUtil.doPostFormCq(context,
ThirdPartyApiConstant.CQ_GROUP_REAL_PV_DATA,
new HashMap<>(0));
List<GetCumulativePowerGenerationOutput> stationList = JSON.parseArray(stationResult, GetCumulativePowerGenerationOutput.class);
int openWellNumber = 0;
int stopWellNumber = 0;
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());
}
}
}
return XSingleResult.success(GetWellOverviewViewOutput.builder()
.openWellNumber(openWellNumber)
.stopWellNumber(stopWellNumber)
.cumulativeProduction(BigDecimal.ZERO)
.powerGeneration(BigDecimal.ZERO)
.powerConsumption(BigDecimal.ZERO)
.cumulativeProduction(cumulativeProduction)
.powerGeneration(powerGeneration)
.powerConsumption(powerConsumption)
.build());
}
......
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