Commit 3b6eaede authored by ZWT's avatar ZWT

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

[
1.统计分析-井组监控页功能开发,开发井组生产详情接口,完成接口冒烟测试并编写线上接口文档生成接口用例;
2.统计分析-井组监控页功能开发,开发井口实时信息接口,完成接口冒烟测试并编写线上接口文档生成接口用例;
3.统计分析-井组监控页功能开发,开发光伏电站发电详情接口,完成接口冒烟测试并编写线上接口文档生成接口用例;
4.统计分析-能耗分析页功能开发,开发今日/昨日/同期电量统计接口,完成接口冒烟测试并编写线上接口文档生成接口用例;
5.统计分析-能耗分析页功能开发,开发光伏发电趋势统计接口,完成接口冒烟测试并编写线上接口文档生成接口用例;
6.统计分析-能耗分析页功能开发,开发用能分析统计接口,完成接口冒烟测试并编写线上接口文档生成接口用例;
]
parent ed24d963
...@@ -152,17 +152,20 @@ public class EnergyConsumptionAnalysisService { ...@@ -152,17 +152,20 @@ public class EnergyConsumptionAnalysisService {
} }
input.getBetweenDate(); input.getBetweenDate();
DateTime endTime = DateUtil.offsetDay(input.getEndTime(), 1); DateTime endTime = DateUtil.offsetDay(input.getEndTime(), 1);
String oilFieldCode = ServiceUtil.getOilFieldCode(context);
//用电功率 //用电功率
Map<Date, BigDecimal> avgMap = this.queryPowerConsumptionHour(context, Map<Date, BigDecimal> avgMap = this.queryPowerConsumptionHour(context,
this.getPowerLineWellheadList(context, wellheadInput), this.getPowerLineWellheadList(context, wellheadInput),
input.getStartTime(), input.getStartTime(),
endTime endTime,
oilFieldCode
); );
//发电功率 //发电功率
Map<Date, BigDecimal> powerMap = this.queryGeneratedPowerHour(context, Map<Date, BigDecimal> powerMap = this.queryGeneratedPowerHour(context,
this.getPowerLinePlantViewList(context, plantInput), this.getPowerLinePlantViewList(context, plantInput),
input.getStartTime(), input.getStartTime(),
endTime endTime,
oilFieldCode
); );
//封装数据 //封装数据
return XListResult.success(this.setPowerAnalyseList(avgMap, powerMap, input.getStartTime(), input.getEndTime())); return XListResult.success(this.setPowerAnalyseList(avgMap, powerMap, input.getStartTime(), input.getEndTime()));
...@@ -558,13 +561,15 @@ public class EnergyConsumptionAnalysisService { ...@@ -558,13 +561,15 @@ public class EnergyConsumptionAnalysisService {
List<String> orgIds = this.getOrgIdsByPath(context, input.getOuId()); List<String> orgIds = this.getOrgIdsByPath(context, input.getOuId());
DateTime today = DateUtil.beginOfDay(DateUtil.date()); DateTime today = DateUtil.beginOfDay(DateUtil.date());
DateTime tomorrow = DateUtil.beginOfDay(DateUtil.tomorrow()); DateTime tomorrow = DateUtil.beginOfDay(DateUtil.tomorrow());
String oilFieldCode = ServiceUtil.getOilFieldCode(context);
//用电功率 //用电功率
Map<Date, BigDecimal> avgMap = this.queryPowerConsumptionHour(context, Map<Date, BigDecimal> avgMap = this.queryPowerConsumptionHour(context,
this.getPowerLineWellheadList(context, DynamicQueryBasePowerLineWellheadInput.builder() this.getPowerLineWellheadList(context, DynamicQueryBasePowerLineWellheadInput.builder()
.ouIds(orgIds) .ouIds(orgIds)
.build()), .build()),
today, today,
tomorrow tomorrow,
oilFieldCode
); );
//发电功率 //发电功率
Map<Date, BigDecimal> powerMap = this.queryGeneratedPowerHour(context, Map<Date, BigDecimal> powerMap = this.queryGeneratedPowerHour(context,
...@@ -572,7 +577,8 @@ public class EnergyConsumptionAnalysisService { ...@@ -572,7 +577,8 @@ public class EnergyConsumptionAnalysisService {
.ouIds(orgIds) .ouIds(orgIds)
.build()), .build()),
today, today,
tomorrow tomorrow,
oilFieldCode
); );
//封装数据 //封装数据
return XListResult.success(this.setPowerAnalyseList(avgMap, powerMap, today, tomorrow)); return XListResult.success(this.setPowerAnalyseList(avgMap, powerMap, today, tomorrow));
...@@ -1229,9 +1235,10 @@ public class EnergyConsumptionAnalysisService { ...@@ -1229,9 +1235,10 @@ public class EnergyConsumptionAnalysisService {
* @param wellheadList 井口一览表 * @param wellheadList 井口一览表
* @param startTime 开始时间 * @param startTime 开始时间
* @param endTime 结束时间 * @param endTime 结束时间
* @param oilFieldCode 环境
* @return {@link Map }<{@link Date }, {@link BigDecimal }> * @return {@link Map }<{@link Date }, {@link BigDecimal }>
*/ */
private Map<Date, BigDecimal> queryPowerConsumptionHour(XContext context, List<DynamicQueryBasePowerLineWellheadViewOutput> wellheadList, Date startTime, Date endTime) { private Map<Date, BigDecimal> queryPowerConsumptionHour(XContext context, List<DynamicQueryBasePowerLineWellheadViewOutput> wellheadList, Date startTime, Date endTime, String oilFieldCode) {
Map<Date, BigDecimal> avgMap; Map<Date, BigDecimal> avgMap;
if (CollUtil.isNotEmpty(wellheadList)) { if (CollUtil.isNotEmpty(wellheadList)) {
ThirdWellAvgActivePowerViewMapper mapper = context.getBean(ThirdWellAvgActivePowerViewMapper.class); ThirdWellAvgActivePowerViewMapper mapper = context.getBean(ThirdWellAvgActivePowerViewMapper.class);
...@@ -1241,6 +1248,7 @@ public class EnergyConsumptionAnalysisService { ...@@ -1241,6 +1248,7 @@ public class EnergyConsumptionAnalysisService {
.collect(Collectors.toList())) .collect(Collectors.toList()))
.startTime(startTime) .startTime(startTime)
.endTime(endTime) .endTime(endTime)
.systemSource(oilFieldCode)
.build()) .build())
.stream() .stream()
.collect(Collectors.toMap(ThirdWellAvgActivePowerView::getInputTime, ThirdWellAvgActivePowerView::getAvgActivePower)); .collect(Collectors.toMap(ThirdWellAvgActivePowerView::getInputTime, ThirdWellAvgActivePowerView::getAvgActivePower));
...@@ -1253,13 +1261,14 @@ public class EnergyConsumptionAnalysisService { ...@@ -1253,13 +1261,14 @@ public class EnergyConsumptionAnalysisService {
/** /**
* 查询发电功率 * 查询发电功率
* *
* @param context 上下文 * @param context 上下文
* @param plantList 工厂清单 * @param plantList 工厂清单
* @param startTime 开始时间 * @param startTime 开始时间
* @param endTime 结束时间 * @param endTime 结束时间
* @param oilFieldCode 环境
* @return {@link Map }<{@link Date }, {@link BigDecimal }> * @return {@link Map }<{@link Date }, {@link BigDecimal }>
*/ */
private Map<Date, BigDecimal> queryGeneratedPowerHour(XContext context, List<DynamicQueryBasePowerLinePlantViewOutput> plantList, Date startTime, Date endTime) { private Map<Date, BigDecimal> queryGeneratedPowerHour(XContext context, List<DynamicQueryBasePowerLinePlantViewOutput> plantList, Date startTime, Date endTime, String oilFieldCode) {
Map<Date, BigDecimal> powerMap; Map<Date, BigDecimal> powerMap;
if (CollUtil.isNotEmpty(plantList)) { if (CollUtil.isNotEmpty(plantList)) {
ThirdActivePowerViewMapper dailyUpdateMapper = context.getBean(ThirdActivePowerViewMapper.class); ThirdActivePowerViewMapper dailyUpdateMapper = context.getBean(ThirdActivePowerViewMapper.class);
...@@ -1269,6 +1278,7 @@ public class EnergyConsumptionAnalysisService { ...@@ -1269,6 +1278,7 @@ public class EnergyConsumptionAnalysisService {
.collect(Collectors.toList())) .collect(Collectors.toList()))
.startTime(startTime) .startTime(startTime)
.endTime(endTime) .endTime(endTime)
.systemSource(oilFieldCode)
.build()) .build())
.stream() .stream()
.collect(Collectors.toMap(ThirdActivePowerView::getCreateDate, ThirdActivePowerView::getPhotovoltaicPower)); .collect(Collectors.toMap(ThirdActivePowerView::getCreateDate, ThirdActivePowerView::getPhotovoltaicPower));
......
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