Commit 8ee234c7 authored by ZWT's avatar ZWT

feat[零碳项目]: 松原演示

[
1.修改日耗电日产液信息定时任务及井口生产情况表表结构,增加来源系统字段,同时修改代码批量插入逻辑;
2.修改日用电趋势计算定时任务,修改代码逻辑,增加区分来源系统逻辑;
3.修改能耗分析定时任务定时任务,修改代码逻辑,增加区分来源系统逻辑;
4.修改第三方有功功率定时任务,修改代码逻辑,增加区分来源系统逻辑;
5.修改第三方当日油井状态定时任务,修改代码逻辑,增加区分来源系统逻辑;
6.修改第三方井场日累计数据定时任务,修改代码逻辑,增加区分来源系统逻辑;
7.修改第三方光伏日发电量定时任务,修改代码逻辑,增加区分来源系统逻辑;
8.修改第三井平均有功功率作业定时任务,修改代码逻辑,增加区分来源系统逻辑;
9.修改日耗电日产液信息定时任务,修改代码逻辑,增加区分来源系统逻辑;
10.修改查15分钟电站实际功率接口,修改代码逻辑,增加区分来源系统逻辑;
]
parent f0393771
...@@ -169,7 +169,7 @@ public class EnergyConsumptionAnalysisService { ...@@ -169,7 +169,7 @@ public class EnergyConsumptionAnalysisService {
oilFieldCode oilFieldCode
); );
//封装数据 //封装数据
return XListResult.success(this.setPowerAnalyseList(avgMap, powerMap, input.getStartTime(), input.getEndTime())); return XListResult.success(this.setPowerAnalyseList(avgMap, powerMap, input.getStartTime(), input.getEndTime(), oilFieldCode));
} }
/** /**
...@@ -583,7 +583,7 @@ public class EnergyConsumptionAnalysisService { ...@@ -583,7 +583,7 @@ public class EnergyConsumptionAnalysisService {
oilFieldCode oilFieldCode
); );
//封装数据 //封装数据
return XListResult.success(this.setPowerAnalyseList(avgMap, powerMap, today, tomorrow)); return XListResult.success(this.setPowerAnalyseList(avgMap, powerMap, today, tomorrow, oilFieldCode));
} }
/** /**
...@@ -1334,17 +1334,18 @@ public class EnergyConsumptionAnalysisService { ...@@ -1334,17 +1334,18 @@ public class EnergyConsumptionAnalysisService {
* @param endTime 结束时间 * @param endTime 结束时间
* @return {@link List }<{@link GetPowerAnalyseOutput }> * @return {@link List }<{@link GetPowerAnalyseOutput }>
*/ */
private List<GetPowerAnalyseOutput> setPowerAnalyseList(Map<Date, BigDecimal> avgMap, Map<Date, BigDecimal> powerMap, Date startTime, Date endTime) { private List<GetPowerAnalyseOutput> setPowerAnalyseList(Map<Date, BigDecimal> avgMap, Map<Date, BigDecimal> powerMap, Date startTime, Date endTime, String oilFieldCode) {
//封装数据 //封装数据
List<DateTime> rangeToList = DateUtil.rangeToList(startTime, endTime, DateField.HOUR_OF_DAY); List<DateTime> rangeToList = DateUtil.rangeToList(startTime, endTime, DateField.HOUR_OF_DAY);
List<GetPowerAnalyseOutput> outputs = new ArrayList<>(rangeToList.size()); List<GetPowerAnalyseOutput> outputs = new ArrayList<>(rangeToList.size());
BigDecimal powerConsumption; BigDecimal powerConsumption;
BigDecimal powerGeneration; BigDecimal powerGeneration;
BigDecimal defaultPower = CharSequenceUtil.equals(oilFieldCode, BusinessConstant.ENV_CQ) ? BigDecimal.ZERO : null;
for (DateTime dateTime : rangeToList) { for (DateTime dateTime : rangeToList) {
if (avgMap.containsKey(dateTime)) { if (avgMap.containsKey(dateTime)) {
powerConsumption = avgMap.get(dateTime).setScale(2, RoundingMode.HALF_UP); powerConsumption = avgMap.get(dateTime).setScale(2, RoundingMode.HALF_UP);
} else { } else {
powerConsumption = BigDecimal.ZERO; powerConsumption = defaultPower;
} }
if (powerMap.containsKey(dateTime)) { if (powerMap.containsKey(dateTime)) {
powerGeneration = powerMap.get(dateTime).setScale(2, RoundingMode.HALF_UP); powerGeneration = powerMap.get(dateTime).setScale(2, RoundingMode.HALF_UP);
......
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