Commit 6f70564d authored by ZWT's avatar ZWT

feat(零碳): 长庆

1.修复登录页面登录接口验证码输入后不需要验证直接能登录的问题;
2.长庆演示,首页展示大屏功能修改,修改线路详情接口,增加查询日平均用电量逻辑,同时重构查询日产液量和日发电量逻辑,更新接口文档并完成接口冒烟测试,同时生成用例;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent a90fe834
......@@ -554,7 +554,7 @@ public class HomePageService {
* @return {@link XSingleResult}<{@link GetLineViewOutput}>
*/
@XText("首页模块--线路详情")
@XApiGet
@XApiGet(anonymous = true)
public XSingleResult<GetLineViewOutput> getLineView(XContext context, GetLineViewInput input) {
//查线路关联的井口
BigDecimal operatingLoad = BigDecimal.ZERO;
......@@ -570,50 +570,26 @@ public class HomePageService {
if (CollUtil.isNotEmpty(plantViewList)) {
areaName = this.getSysAreaPath(context, plantViewList.get(0).getAreaCode());
}
//查平均产液量
BigDecimal cumulativeProduction;
if (CollUtil.isEmpty(wellheadList)) {
cumulativeProduction = BigDecimal.ZERO;
} else {
WellheadDailyProductionSituationMapper mapper = context.getBean(WellheadDailyProductionSituationMapper.class);
cumulativeProduction = mapper.selectList(new QueryWrapper<WellheadDailyProductionSituationEnt>()
.select("IFNULL( AVG( daily_liquid_production ), 0 ) AS daily_liquid_production ")
.lambda()
.in(WellheadDailyProductionSituationEnt::getWellNumber, wellheadList.stream()
.map(DynamicQueryBasePowerLineWellheadViewOutput::getWellNumber)
.collect(Collectors.toList()))
.groupBy(WellheadDailyProductionSituationEnt::getWellNumber)
).stream()
.map(WellheadDailyProductionSituationEnt::getDailyLiquidProduction)
.reduce(BigDecimal.ZERO, BigDecimal::add)
.setScale(2, RoundingMode.HALF_UP);
}
//查平均发电量
BigDecimal powerGeneration;
if (CollUtil.isEmpty(plantViewList)) {
powerGeneration = BigDecimal.ZERO;
} else {
EnergyConsumptionAnalysisMapper analysisMapper = context.getBean(EnergyConsumptionAnalysisMapper.class);
powerGeneration = analysisMapper.selectList(new QueryWrapper<EnergyConsumptionAnalysisEnt>()
.select("IFNULL( AVG( power_generation ), 0 ) AS power_generation ")
.lambda()
.in(EnergyConsumptionAnalysisEnt::getStationName, plantViewList.stream()
.map(DynamicQueryBasePowerLinePlantViewOutput::getStationName)
.collect(Collectors.toList()))
.groupBy(EnergyConsumptionAnalysisEnt::getStationName)
).stream()
.map(EnergyConsumptionAnalysisEnt::getPowerGeneration)
.reduce(BigDecimal.ZERO, BigDecimal::add)
.setScale(2, RoundingMode.HALF_UP);
}
ThirdDailyAccumulationUpdateMapper mapper = context.getBean(ThirdDailyAccumulationUpdateMapper.class);
ThirdDailyAccumulationUpdateEnt dailyAccumulation = mapper.selectOne(new QueryWrapper<ThirdDailyAccumulationUpdateEnt>()
.select("IFNULL( AVG( photovoltaic_power ), 0 ) AS photovoltaic_power",
"IFNULL( AVG( daily_electricity_consumption ), 0 ) AS daily_electricity_consumption",
"IFNULL( AVG( daily_liquid_production ), 0 ) AS daily_liquid_production",
"IFNULL( AVG( in_place_consumption ), 0 ) AS in_place_consumption")
.lambda()
.in(ThirdDailyAccumulationUpdateEnt::getStationName, plantViewList.stream()
.map(DynamicQueryBasePowerLinePlantViewOutput::getStationName)
.collect(Collectors.toList()))
);
return XSingleResult.success(GetLineViewOutput.builder()
.wellList(wellheadList)
.operatingLoad(operatingLoad)
.cumulativeProduction(cumulativeProduction)
.cumulativeProduction(dailyAccumulation.getDailyLiquidProduction())
.photovoltaicPower(plantViewList.stream()
.map(DynamicQueryBasePowerLinePlantViewOutput::getTotalPower)
.reduce(BigDecimal.ZERO, BigDecimal::add))
.powerGeneration(powerGeneration)
.powerGeneration(dailyAccumulation.getPhotovoltaicPower())
.dailyElectricityConsumption(dailyAccumulation.getDailyElectricityConsumption())
.areaName(areaName)
.build());
}
......
......@@ -40,4 +40,7 @@ public class GetLineViewOutput {
@XText("发电量(kWh)")
private BigDecimal powerGeneration;
@XText("日累计用电量(KW·h)")
private BigDecimal dailyElectricityConsumption;
}
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