Commit 37fa48fa authored by ZWT's avatar ZWT

feat(吉林演示): 松原

1.开发中间库表结构及数据导出功能,检查中间库表结构是否有变动,同时获取最新数据,验证数据是否更新;
2.创建场站每日信息统计记录表,新建场站日信息数据采集汇总定时任务,整理汇总场站纬度每日数据,完成功能验证;
3.针对吉林提供的统计数据,对吉林首页部分功能修改;
4.针对中间库每日井口数据统计表结构变动,修改井口日统计定时任务数据处理逻辑,完成功能验证;
5.修改日发电量统计定时任务,排查数据丢失问题,完成功能验证;
6.修改场站每日信息汇总统计定时任务,增加统计每日光伏发电量逻辑,修改表结构及数据结构和业务处理逻辑,完成功能验证;
7.修改吉林首页线路详情接口,区分部署环境,增加吉林个性化数据处理逻辑,完成接口冒烟测试;
8.修改实际发电功率统计定时任务,排查数据丢失问题,完成功能验证;
9.修改实际发电量统计定时任务,排查数据丢失问题,完成功能验证;
10.修改吉林首页井场效果评价数据统计接口,区分部署环境,增加吉林个性化数据处理逻辑,完成接口冒烟测试;
11.能耗分析页面开发吉林个性化功能,完成电量统计接口开发,编辑线上接口文档并生成接口用例,完成接口冒烟测试;
12.能耗分析页面开发吉林个性化功能,完成发电量统计接口开发,编辑线上接口文档并生成接口用例,完成接口冒烟测试;
13.能耗分析页面开发吉林个性化功能,完成用电量统计接口开发,编辑线上接口文档并生成接口用例,完成接口冒烟测试;
14.能耗分析页面开发吉林个性化功能,完成峰谷能耗对比分析接口开发,编辑线上接口文档并生成接口用例,完成接口冒烟测试;
15.能耗分析页面开发吉林个性化功能,完成用能分析接口开发,编辑线上接口文档并生成接口用例,完成接口冒烟测试;
16.间开效果评价页面开发吉林个性化功能,完成发电效益统计接口开发,编辑线上接口文档并生成接口用例,完成接口冒烟测试;
17.间开效果评价页面开发吉林个性化功能,完成发减碳量统计接口开发,编辑线上接口文档并生成接口用例,完成接口冒烟测试;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent fd4d715b
......@@ -68,6 +68,58 @@ public class EnergyConsumptionAnalysisService {
/*------------------------------ 间开效果评价(吉林) ------------------------------*/
/**
* 减碳量统计
*
* @param context 上下文
* @param input 输入
* @return {@link XListResult }<{@link GetEconomicBenefitsOutput }>
*/
@XText("间开效果评价--减碳量统计")
@XApiPost
public XListResult<GetEconomicBenefitsOutput> carbonStatisticsList(XContext context, GetStatisticsInput input) {
//日期初始化
input.getBetweenDate();
Date beginTime = input.getBeginTime();
Date endTime = input.getEndTime();
//查组织机构下所有线路
Set<String> lineNameSet = this.getLineNameSet(context, input.getOuId());
boolean yearFlag = input.getDateType().equals(3);
//统计
List<StationDailyProductionSituationEnt> currentList = this.getStationDailyStatisticsList(context, beginTime, endTime, lineNameSet, yearFlag);
List<StationDailyProductionSituationEnt> lastList = this.getStationDailyStatisticsList(context, DateUtil.offset(beginTime, DateField.YEAR, -1), DateUtil.offset(endTime, DateField.YEAR, -1), lineNameSet, yearFlag);
Map<Date, BigDecimal> currentMap;
if (CollUtil.isEmpty(currentList)) {
currentMap = Collections.emptyMap();
} else {
currentMap = currentList.stream()
.collect(Collectors.toMap(StationDailyProductionSituationEnt::getDataDate, StationDailyProductionSituationEnt::getPhotovoltaicPower));
}
Map<Date, BigDecimal> lastMap;
if (CollUtil.isEmpty(lastList)) {
lastMap = Collections.emptyMap();
} else {
lastMap = lastList.stream()
.collect(Collectors.toMap(StationDailyProductionSituationEnt::getDataDate, StationDailyProductionSituationEnt::getPhotovoltaicPower));
}
//数据封装
DateTime now = DateUtil.date();
List<DateTime> rangeToList = DateUtil.rangeToList(beginTime, endTime, yearFlag ? DateField.MONTH : DateField.DAY_OF_YEAR);
List<GetEconomicBenefitsOutput> outputs = new ArrayList<>(rangeToList.size());
GetEconomicBenefitsOutput output;
for (DateTime dateTime : rangeToList) {
if (DateUtil.compare(dateTime, now) > 0) {
break;
}
output = new GetEconomicBenefitsOutput();
output.setCarbonReduction(ServiceUtil.calculateCarbonReductionTon(currentMap.getOrDefault(dateTime, BigDecimal.ZERO)));
output.setLastCarbonReduction(ServiceUtil.calculateCarbonReductionTon(lastMap.getOrDefault(dateTime, BigDecimal.ZERO)));
output.setDateStr(yearFlag ? dateTime.toString("yyyy-MM") : dateTime.toDateStr());
outputs.add(output);
}
return XListResult.success(outputs);
}
/**
* 结果统计
*
......@@ -101,12 +153,11 @@ public class EnergyConsumptionAnalysisService {
.multiply(BigDecimal.valueOf(0.28)))
.setScale(2, RoundingMode.HALF_UP)
);
output.setCarbonReduction(statistics.getPhotovoltaicPower().multiply(BusinessConstant.BIG_DECIMAL_6_67).setScale(2, RoundingMode.HALF_UP));
output.setCarbonReduction(ServiceUtil.calculateCarbonReductionTon(statistics.getPhotovoltaicPower()));
}
return XSingleResult.success(output);
}
/*------------------------------ 能耗分析(吉林) ------------------------------*/
/**
......@@ -1679,7 +1730,7 @@ public class EnergyConsumptionAnalysisService {
BigDecimal economicBenefit;
if (photovoltaicPower.compareTo(BigDecimal.ZERO) > 0) {
economicBenefit = photovoltaicPower
.multiply(BigDecimal.valueOf(0.8))
.multiply(BigDecimal.valueOf(0.9302))
.setScale(2, RoundingMode.HALF_UP);
} else {
economicBenefit = BigDecimal.ZERO;
......
......@@ -30,9 +30,15 @@ public class GetEconomicBenefitsOutput {
@XText("减碳量(吨)")
private BigDecimal carbonReduction;
@XText("同期减碳量(吨)")
private BigDecimal lastCarbonReduction;
@XText("电费(元)")
private BigDecimal electricityFees;
@XText("节约电量")
private BigDecimal saveElectricity;
@XText("日期")
private String dateStr;
}
......@@ -426,25 +426,46 @@ public class ServiceUtil {
}
/**
* 计算累计减碳量
* 计算累计减碳量(万吨)
*
* @param photovoltaicPower 光伏发电
* @return {@link BigDecimal }
*/
public static BigDecimal calculateCarbonReduction(BigDecimal photovoltaicPower) {
return carbonReduction(photovoltaicPower, false);
}
/**
* 计算累计减碳量(吨)
*
* @param photovoltaicPower 光伏发电
* @return {@link BigDecimal }
*/
public static BigDecimal calculateCarbonReductionTon(BigDecimal photovoltaicPower) {
return carbonReduction(photovoltaicPower, true);
}
/*----------------------------------- 私有方法 -----------------------------------*/
/**
* 碳减排
*
* @param photovoltaicPower 光伏发电
* @param isTon 是吨
* @return {@link BigDecimal }
*/
private static BigDecimal carbonReduction(BigDecimal photovoltaicPower, boolean isTon) {
BigDecimal carbonReduction;
if (photovoltaicPower.compareTo(BigDecimal.ZERO) > 0) {
carbonReduction = photovoltaicPower
.multiply(BusinessConstant.BIG_DECIMAL_6_67)
.divide(BusinessConstant.BIG_DECIMAL_10000, 2, RoundingMode.HALF_UP);
.divide(isTon ? BigDecimal.ONE : BusinessConstant.BIG_DECIMAL_10000, 2, RoundingMode.HALF_UP);
} else {
carbonReduction = BigDecimal.ZERO;
}
return carbonReduction;
}
/*----------------------------------- 私有方法 -----------------------------------*/
/**
* 获取长庆接口Token
*
......
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