Commit bece0a29 authored by ZWT's avatar ZWT

feat(零碳): 长庆

1.长庆演示首页功能开发,新增采油厂统计信息查询接口,添加线上接口并完成接口冒烟测试;
2.长庆演示首页功能开发,新增线路图查询接口,添加线上接口并完成接口冒烟测试;
3.长庆演示首页功能开发,新增线路详情查询接口,添加线上接口并完成接口冒烟测试;
4.对接第三方接口,完成获取井场日累计数据接口调用,创建数据表,同时生成对应代码,开发定时任务及对外接口,完成第三方数据接入及系统展示功能,添加线上接口文档并完成接口及定时任务冒烟测试;
5.对接第三方接口,完成获取第三方单井平均有功功率接口调用,创建数据表,同时生成对应代码,开发定时任务及对外接口,完成第三方数据接入及系统展示功能,添加线上接口文档并完成接口及定时任务冒烟测试;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent b13d9175
...@@ -120,7 +120,7 @@ public class HomePageService { ...@@ -120,7 +120,7 @@ public class HomePageService {
String stationId = input.getStationId(); String stationId = input.getStationId();
List<DynamicQueryBaseWellheadOutput> wellList = this.getWellList(context, stationId); List<DynamicQueryBaseWellheadOutput> wellList = this.getWellList(context, stationId);
List<GetBasePhotovoltaicPlantCloudOutput> plantList = this.getPlantList(context, stationId, null); List<GetBasePhotovoltaicPlantCloudOutput> plantList = this.getPlantList(context, stationId, null);
List<DynamicQueryBasePowerLineOutput> lineList = this.getLineList(context, stationId, "10"); List<DynamicQueryBasePowerLineOutput> lineList = this.getLineList(context, stationId, "10", null);
List<DynamicQueryBaseEnergyStorageDeviceOutput> storageList = this.getStorageList(context, stationId); List<DynamicQueryBaseEnergyStorageDeviceOutput> storageList = this.getStorageList(context, stationId);
return XSingleResult.success(GetOverviewViewOutput.builder() return XSingleResult.success(GetOverviewViewOutput.builder()
.wellNumber(wellList.size()) .wellNumber(wellList.size())
...@@ -429,7 +429,7 @@ public class HomePageService { ...@@ -429,7 +429,7 @@ public class HomePageService {
@XApiGet @XApiGet
public XSingleResult<GetIncomeAnalysisOutput> getIncomeAnalysis(XContext context, GetStationViewInput input) { public XSingleResult<GetIncomeAnalysisOutput> getIncomeAnalysis(XContext context, GetStationViewInput input) {
String stationId = input.getStationId(); String stationId = input.getStationId();
List<String> lineIdList = this.getLineList(context, stationId, null).stream() List<String> lineIdList = this.getLineList(context, stationId, null, null).stream()
.map(DynamicQueryBasePowerLineOutput::getId) .map(DynamicQueryBasePowerLineOutput::getId)
.collect(Collectors.toList()); .collect(Collectors.toList());
DateTime yesterday = DateUtil.beginOfDay(DateUtil.yesterday()); DateTime yesterday = DateUtil.beginOfDay(DateUtil.yesterday());
...@@ -511,7 +511,7 @@ public class HomePageService { ...@@ -511,7 +511,7 @@ public class HomePageService {
operatingLoad = operatingLoad.add(Optional.ofNullable(well.getRatedPower()).orElse(BigDecimal.ZERO)); operatingLoad = operatingLoad.add(Optional.ofNullable(well.getRatedPower()).orElse(BigDecimal.ZERO));
} }
//线路统计 //线路统计
List<DynamicQueryBasePowerLineOutput> lineList = this.getLineList(context, stationId, "10"); List<DynamicQueryBasePowerLineOutput> lineList = this.getLineList(context, stationId, "10", null);
//光伏电站 //光伏电站
List<GetBasePhotovoltaicPlantCloudOutput> plantList = this.getPlantList(context, stationId, null); List<GetBasePhotovoltaicPlantCloudOutput> plantList = this.getPlantList(context, stationId, null);
//储能电站 //储能电站
...@@ -546,7 +546,7 @@ public class HomePageService { ...@@ -546,7 +546,7 @@ public class HomePageService {
return XListResult.error(context, BusinessError.MissingoilExtractionPlantID); return XListResult.error(context, BusinessError.MissingoilExtractionPlantID);
} }
//十千伏线路 //十千伏线路
List<DynamicQueryBasePowerLineOutput> lineList = this.getLineList(context, stationId, "10"); List<DynamicQueryBasePowerLineOutput> lineList = this.getLineList(context, stationId, "10", null);
List<GetBranchingProgramOutput> outputs = new ArrayList<>(lineList.size()); List<GetBranchingProgramOutput> outputs = new ArrayList<>(lineList.size());
for (DynamicQueryBasePowerLineOutput line : lineList) { for (DynamicQueryBasePowerLineOutput line : lineList) {
outputs.add(GetBranchingProgramOutput.builder() outputs.add(GetBranchingProgramOutput.builder()
...@@ -582,10 +582,30 @@ public class HomePageService { ...@@ -582,10 +582,30 @@ public class HomePageService {
if (CollUtil.isNotEmpty(plantViewList)) { if (CollUtil.isNotEmpty(plantViewList)) {
areaName = this.getSysAreaPath(context, plantViewList.get(0).getAreaCode()); areaName = this.getSysAreaPath(context, plantViewList.get(0).getAreaCode());
} }
BigDecimal cumulativeProduction = BigDecimal.ZERO;
try {
//实时站
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.getLineList(context, null, null, input.getLineId()).stream()
.map(DynamicQueryBasePowerLineOutput::getLineName)
.collect(Collectors.toSet());
for (GetCumulativePowerGenerationOutput station : stationList) {
if (set.contains(station.getStationName())) {
cumulativeProduction = cumulativeProduction.add(station.getDailyLiquidProduction());
}
}
}
} catch (Exception e) {
context.getLogger().error(e);
}
return XSingleResult.success(GetLineViewOutput.builder() return XSingleResult.success(GetLineViewOutput.builder()
.wellList(wellheadList) .wellList(wellheadList)
.operatingLoad(operatingLoad) .operatingLoad(operatingLoad)
.cumulativeProduction(BigDecimal.ZERO) .cumulativeProduction(cumulativeProduction)
.photovoltaicPower(plantViewList.stream() .photovoltaicPower(plantViewList.stream()
.map(DynamicQueryBasePowerLinePlantViewOutput::getTotalPower) .map(DynamicQueryBasePowerLinePlantViewOutput::getTotalPower)
.reduce(BigDecimal.ZERO, BigDecimal::add)) .reduce(BigDecimal.ZERO, BigDecimal::add))
...@@ -753,9 +773,10 @@ public class HomePageService { ...@@ -753,9 +773,10 @@ public class HomePageService {
* @param lineTypeKey 线型键 * @param lineTypeKey 线型键
* @return {@link List}<{@link DynamicQueryBasePowerLineOutput}> * @return {@link List}<{@link DynamicQueryBasePowerLineOutput}>
*/ */
private List<DynamicQueryBasePowerLineOutput> getLineList(XContext context, String stationId, String lineTypeKey) { private List<DynamicQueryBasePowerLineOutput> getLineList(XContext context, String stationId, String lineTypeKey, String lineId) {
IBasePowerLineCloudService service = context.getBean(IBasePowerLineCloudService.class); IBasePowerLineCloudService service = context.getBean(IBasePowerLineCloudService.class);
XListResult<DynamicQueryBasePowerLineOutput> result = service.getBasePowerLineList(context, DynamicQueryBasePowerLineInput.builder() XListResult<DynamicQueryBasePowerLineOutput> result = service.getBasePowerLineList(context, DynamicQueryBasePowerLineInput.builder()
.lineId(lineId)
.ouId(stationId) .ouId(stationId)
.lineTypeKey(lineTypeKey) .lineTypeKey(lineTypeKey)
.build()); .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