Commit 6be71d8e authored by ZWT's avatar ZWT

feat(零碳): 长庆

1.修改极短期间开预测定时任务逻辑,解决优化后部分优化结果时间段过短问题;
2.修改心知天气气象数据获取及接收定时任务,解决天气数据通过邮件下载后,部分数据精度丢失问题;
3.修改首页各个接口逻辑,对小数类型字段进行处理,修改首页接口,增加小时保留两位四舍五入逻辑,同时解决线路详情接口部分查询逻辑报错问题;
4.能耗分析模块,能耗概览接口修改,修改查询逻辑,修改数据获取逻辑及绿电占比计算逻辑;
5.能耗分析模块,消纳曲线用电趋势接口修改,修改查询逻辑,修改数据获取逻辑及绿电占比计算逻辑;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent dc760262
......@@ -94,29 +94,30 @@ public class EnergyConsumptionAnalysisService {
List<DynamicQueryEnergyConsumptionAnalysisViewOutput> list = new ArrayList<>(16);
List<DynamicQueryBasePowerLineOutput> lineList = this.getBasePowerLineListByOuIdList(context, this.getOrgIdsByPath(context, input.getOuId()));
if (CollUtil.isNotEmpty(lineList)) {
List<String> lineIdList = lineList.stream()
.map(DynamicQueryBasePowerLineOutput::getId)
List<String> lineNameList = lineList.stream()
.map(DynamicQueryBasePowerLineOutput::getLineName)
.collect(Collectors.toList());
input.getBetweenDate();
EnergyConsumptionAnalysisMapper mapper = context.getBean(EnergyConsumptionAnalysisMapper.class);
List<EnergyConsumptionAnalysisEnt> analysisEntList = mapper.selectList(new QueryWrapper<EnergyConsumptionAnalysisEnt>()
.select("IFNULL( SUM( power_generation ), 0 ) AS power_generation",
"IFNULL( SUM( power_consumption ), 0 ) AS power_consumption",
"data_date")
ThirdDailyAccumulationUpdateMapper analysisMapper = context.getBean(ThirdDailyAccumulationUpdateMapper.class);
List<ThirdDailyAccumulationUpdateEnt> analysisEntList = analysisMapper.selectList(new QueryWrapper<ThirdDailyAccumulationUpdateEnt>()
.select("IFNULL( SUM( photovoltaic_power ), 0 ) AS photovoltaic_power",
"IFNULL( SUM( daily_electricity_consumption ), 0 ) AS daily_electricity_consumption",
"IFNULL( SUM( daily_liquid_production ), 0 ) AS daily_liquid_production",
"IFNULL( SUM( in_place_consumption ), 0 ) AS in_place_consumption",
"DATE( create_date ) AS create_date")
.lambda()
.in(EnergyConsumptionAnalysisEnt::getLineId, lineIdList)
.between(EnergyConsumptionAnalysisEnt::getDataDate, input.getStartTime(), input.getEndTime())
.groupBy(EnergyConsumptionAnalysisEnt::getDataDate)
.orderByAsc(EnergyConsumptionAnalysisEnt::getDataDate)
.in(ThirdDailyAccumulationUpdateEnt::getStationName, lineNameList)
.between(ThirdDailyAccumulationUpdateEnt::getCreateDate, input.getStartTime(), input.getEndTime())
.last("GROUP BY DATE( create_date ) ")
);
if (CollUtil.isNotEmpty(analysisEntList)) {
for (EnergyConsumptionAnalysisEnt ent : analysisEntList) {
for (ThirdDailyAccumulationUpdateEnt ent : analysisEntList) {
list.add(DynamicQueryEnergyConsumptionAnalysisViewOutput.builder()
.powerConsumption(ent.getPowerConsumption())
.powerGeneration(ent.getPowerGeneration())
.dataDate(ent.getDataDate())
.dateFormat(DateUtil.format(ent.getDataDate(), "MM-dd"))
.absorptionRate(this.getAbsorptionRate(ent.getPowerGeneration(), ent.getPowerConsumption()))
.powerConsumption(ent.getDailyElectricityConsumption())
.powerGeneration(ent.getPhotovoltaicPower())
.dataDate(ent.getCreateDate())
.dateFormat(DateUtil.format(ent.getCreateDate(), "MM-dd"))
.absorptionRate(this.getAbsorptionRate(ent.getInPlaceConsumption(), ent.getDailyElectricityConsumption()))
.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