Commit f4d068fb authored by ZWT's avatar ZWT

feat(吉林演示): 松原

1.修改部分第三方数据处理定时任务,修改系统来源,将固定来源按环境区分改为动态获取;
2.修改统计分析-间开效果评价新页面累节电能接口,暂时无法获取电费信息,将电费信息默认做随机数处理;
3.修改统计分析-能耗分析新页面峰谷能耗对比分析接口,暂时无法获取电费信息,将电费信息默认做随机数处理;
4.吉林首页井场用能分析模块开放井场用能分析双坐标轴接口,备用;
5.修改首页光伏实时监控接口,解决选择查看部分采油厂接口报错提示异常问题;
6.修改统计分析能耗分析新页面今日昨日同期电量信息统计接口,增加添加默认值逻辑;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent bbf496e7
......@@ -32,9 +32,6 @@ import pps.cloud.space.service.data.space_optimize_short_wellhead.*;
import pps.cloud.space.service.data.well_daily_electricity_trend.GetWellDailyAverageInput;
import pps.cloud.space.service.data.well_daily_electricity_trend.GetWellDailyElectricityTrendInput;
import pps.cloud.space.service.data.well_daily_electricity_trend.GetWellDailyElectricityTrendOutput;
import pps.cloud.system.service.SysOrganizationCloudService;
import pps.cloud.system.service.data.sys_organization.GetAllOuListByOuIdInput;
import pps.cloud.system.service.data.sys_organization.GetSysOrganizationViewOutput;
import pps.core.common.constant.BusinessConstant;
import pps.core.common.utils.BaseUtils;
import pps.core.prediction.constant.ThirdPartyApiConstant;
......@@ -88,7 +85,7 @@ public class EnergyConsumptionAnalysisService {
if (CharSequenceUtil.isNotBlank(stationName)) {
plantInput.setLineName(stationName);
} else {
plantInput.setOuIds(this.getOrgIdsByPath(context, input.getOuId()));
plantInput.setOuIds(ServiceUtil.getOrgIdsByPath(context, input.getOuId()));
}
List<PowerStatisticsOutput> outputs;
List<DynamicQueryBasePowerLinePlantViewOutput> plantList = this.getPowerLinePlantViewList(context, plantInput);
......@@ -159,7 +156,7 @@ public class EnergyConsumptionAnalysisService {
wellheadInput.setLineName(stationName);
plantInput.setLineName(stationName);
} else {
List<String> orgIds = this.getOrgIdsByPath(context, input.getOuId());
List<String> orgIds = ServiceUtil.getOrgIdsByPath(context, input.getOuId());
wellheadInput.setOuIds(orgIds);
plantInput.setOuIds(orgIds);
}
......@@ -199,7 +196,7 @@ public class EnergyConsumptionAnalysisService {
if (CharSequenceUtil.isNotBlank(stationName)) {
plantInput.setLineName(stationName);
} else {
plantInput.setOuIds(this.getOrgIdsByPath(context, input.getOuId()));
plantInput.setOuIds(ServiceUtil.getOrgIdsByPath(context, input.getOuId()));
}
List<DynamicQueryBasePowerLinePlantViewOutput> plantList = this.getPowerLinePlantViewList(context, plantInput);
Map<Date, BigDecimal> nowMap;
......@@ -260,7 +257,7 @@ public class EnergyConsumptionAnalysisService {
if (CharSequenceUtil.isNotBlank(stationName)) {
plantInput.setLineName(stationName);
} else {
plantInput.setOuIds(this.getOrgIdsByPath(context, input.getOuId()));
plantInput.setOuIds(ServiceUtil.getOrgIdsByPath(context, input.getOuId()));
}
List<DynamicQueryBasePowerLinePlantViewOutput> plantList = this.getPowerLinePlantViewList(context, plantInput);
Map<Date, BigDecimal> nowMap;
......@@ -320,7 +317,7 @@ public class EnergyConsumptionAnalysisService {
if (CharSequenceUtil.isNotBlank(stationName)) {
plantInput.setLineName(stationName);
} else {
plantInput.setOuIds(this.getOrgIdsByPath(context, input.getOuId()));
plantInput.setOuIds(ServiceUtil.getOrgIdsByPath(context, input.getOuId()));
}
input.getBetweenDate();
Map<Date, GetLineDailyElectricityTrendOutput> collect;
......@@ -400,7 +397,7 @@ public class EnergyConsumptionAnalysisService {
BigDecimal powerConsumption;
//绿电占比
BigDecimal greenElectricityRate;
List<String> orgIds = this.getOrgIdsByPath(context, input.getOuId());
List<String> orgIds = ServiceUtil.getOrgIdsByPath(context, input.getOuId());
List<DynamicQueryBasePowerLinePlantViewOutput> plantList = this.getPowerLinePlantViewList(context, DynamicQueryBasePowerLinePlantInput.builder()
.ouIds(orgIds)
.build());
......@@ -493,7 +490,7 @@ public class EnergyConsumptionAnalysisService {
int stopWellNumber = 0;
List<GetThirdCurrentWellConditionOutput> currentList = Collections.emptyList();
GetWellFieldSituationOutput output = new GetWellFieldSituationOutput();
List<DynamicQueryBaseWellheadOutput> wellList = this.getWellListByOuId(context, this.getOrgIdsByPath(context, input.getOuId()));
List<DynamicQueryBaseWellheadOutput> wellList = this.getWellListByOuId(context, ServiceUtil.getOrgIdsByPath(context, input.getOuId()));
if (CollUtil.isNotEmpty(wellList)) {
sumWellNumber = wellList.size();
Set<String> set = new HashSet<>(wellList.size());
......@@ -572,7 +569,7 @@ public class EnergyConsumptionAnalysisService {
@XText("井场实时分析--本日用电对比")
@XApiGet
public XListResult<GetPowerAnalyseOutput> electricityConsumptionContrast(XContext context, GetEnergyConsumptionAnalysisInput input) {
List<String> orgIds = this.getOrgIdsByPath(context, input.getOuId());
List<String> orgIds = ServiceUtil.getOrgIdsByPath(context, input.getOuId());
DateTime today = DateUtil.beginOfDay(DateUtil.date());
DateTime tomorrow = DateUtil.beginOfDay(DateUtil.tomorrow());
String oilFieldCode = ServiceUtil.getOilFieldCode(context);
......@@ -612,7 +609,7 @@ public class EnergyConsumptionAnalysisService {
Map<Integer, BigDecimal> powerMap;
DateTime today = DateUtil.beginOfDay(DateUtil.date());
List<DynamicQueryBasePowerLinePlantViewOutput> plantList = this.getPowerLinePlantViewList(context, DynamicQueryBasePowerLinePlantInput.builder()
.ouIds(this.getOrgIdsByPath(context, input.getOuId()))
.ouIds(ServiceUtil.getOrgIdsByPath(context, input.getOuId()))
.build());
if (CollUtil.isNotEmpty(plantList)) {
List<String> plantIds = plantList.stream()
......@@ -672,7 +669,7 @@ public class EnergyConsumptionAnalysisService {
if (CharSequenceUtil.isNotBlank(stationName)) {
plantInput.setLineName(stationName);
} else {
plantInput.setOuIds(this.getOrgIdsByPath(context, input.getOuId()));
plantInput.setOuIds(ServiceUtil.getOrgIdsByPath(context, input.getOuId()));
}
BigDecimal accumulatePowerGeneration = BigDecimal.ZERO;
BigDecimal dailyElectricityConsumption = BigDecimal.ZERO;
......@@ -733,7 +730,7 @@ public class EnergyConsumptionAnalysisService {
if (CharSequenceUtil.isNotBlank(stationName)) {
plantInput.setLineName(stationName);
} else {
plantInput.setOuIds(this.getOrgIdsByPath(context, input.getOuId()));
plantInput.setOuIds(ServiceUtil.getOrgIdsByPath(context, input.getOuId()));
}
List<DynamicQueryBasePowerLinePlantViewOutput> plantList = this.getPowerLinePlantViewList(context, plantInput);
DateTime end = DateUtil.beginOfDay(DateUtil.yesterday());
......@@ -821,7 +818,7 @@ public class EnergyConsumptionAnalysisService {
if (CharSequenceUtil.isNotBlank(stationName)) {
wellheadInput.setLineName(stationName);
} else {
List<String> orgIds = this.getOrgIdsByPath(context, input.getOuId());
List<String> orgIds = ServiceUtil.getOrgIdsByPath(context, input.getOuId());
wellheadInput.setOuIds(orgIds);
}
List<DynamicQueryBasePowerLineWellheadViewOutput> wellheadList = this.getPowerLineWellheadList(context, wellheadInput);
......@@ -860,7 +857,7 @@ public class EnergyConsumptionAnalysisService {
@XApiGet
public XListResult<GetPowerGenerationDetailsOutput> powerGenerationDetails(XContext context, GetEnergyConsumptionAnalysisInput input) {
List<DynamicQueryBasePowerLinePlantViewOutput> plantList = this.getPowerLinePlantViewList(context, DynamicQueryBasePowerLinePlantInput.builder()
.ouIds(this.getOrgIdsByPath(context, input.getOuId()))
.ouIds(ServiceUtil.getOrgIdsByPath(context, input.getOuId()))
.build());
Map<Date, BigDecimal> nowMap;
Map<Date, BigDecimal> lastMap;
......@@ -941,7 +938,7 @@ public class EnergyConsumptionAnalysisService {
BigDecimal electricityConsumption = BigDecimal.ZERO;
BigDecimal carbonReduction = BigDecimal.ZERO;
BigDecimal economicBenefit = BigDecimal.ZERO;
List<String> orgIdsByPath = this.getOrgIdsByPath(context, input.getOuId());
List<String> orgIdsByPath = ServiceUtil.getOrgIdsByPath(context, input.getOuId());
String oilFieldCode = ServiceUtil.getOilFieldCode(context);
List<DynamicQueryBaseWellheadOutput> wellList = this.getWellListByOuId(context, orgIdsByPath);
if (CollUtil.isNotEmpty(wellList)) {
......@@ -1005,7 +1002,7 @@ public class EnergyConsumptionAnalysisService {
@XApiGet
public XListResult<GetRealTimeInfoOutput> wellRealTimeInfo(XContext context, GetEnergyConsumptionAnalysisInput input) {
List<GetRealTimeInfoOutput> currentList = Collections.emptyList();
List<DynamicQueryBaseWellheadOutput> wellList = this.getWellListByOuId(context, this.getOrgIdsByPath(context, input.getOuId()), input.getRunTypeKey());
List<DynamicQueryBaseWellheadOutput> wellList = this.getWellListByOuId(context, ServiceUtil.getOrgIdsByPath(context, input.getOuId()), input.getRunTypeKey());
if (CollUtil.isNotEmpty(wellList)) {
String wellStatus = input.getWellStatus();
Map<String, DynamicQueryBaseWellheadOutput> collect = new HashMap<>(wellList.size());
......@@ -1083,7 +1080,7 @@ public class EnergyConsumptionAnalysisService {
wellheadInput.setLineName(stationName);
plantInput.setLineName(stationName);
} else {
List<String> orgIds = this.getOrgIdsByPath(context, input.getOuId());
List<String> orgIds = ServiceUtil.getOrgIdsByPath(context, input.getOuId());
wellheadInput.setOuIds(orgIds);
plantInput.setOuIds(orgIds);
}
......@@ -1151,24 +1148,6 @@ public class EnergyConsumptionAnalysisService {
return absorptionRate;
}
/**
* 获取所有path包含组织ID的组织
*
* @param context 上下文
* @param ouId ou id
* @return {@link List}<{@link String}>
*/
private List<String> getOrgIdsByPath(XContext context, String ouId) {
SysOrganizationCloudService organizationCloudService = context.getBean(SysOrganizationCloudService.class);
GetAllOuListByOuIdInput ouIdInput = new GetAllOuListByOuIdInput();
ouIdInput.setOuId(ouId);
XListResult<GetSysOrganizationViewOutput> allListByOuId = organizationCloudService.getAllListByOuId(context, ouIdInput);
allListByOuId.throwIfFail();
return allListByOuId.getResult().stream()
.map(GetSysOrganizationViewOutput::getId)
.collect(Collectors.toList());
}
/**
* 查询组织列表下所有线路
*
......
......@@ -12,6 +12,9 @@ import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import pps.cloud.base.service.IConfigOilFieldCloudService;
import pps.cloud.base.service.data.config_oil_field.GetConfigOilFieldOutput;
import pps.cloud.system.service.SysOrganizationCloudService;
import pps.cloud.system.service.data.sys_organization.GetAllOuListByOuIdInput;
import pps.cloud.system.service.data.sys_organization.GetSysOrganizationViewOutput;
import pps.core.auth.HttpRequestClient;
import pps.core.common.cache.ThirdPartyConfigCache;
import pps.core.common.constant.BusinessConstant;
......@@ -29,6 +32,7 @@ import xstartup.base.XContext;
import xstartup.base.XStartup;
import xstartup.base.exception.XServiceException;
import xstartup.base.util.XHttpUtils;
import xstartup.data.XListResult;
import xstartup.data.XSingleResult;
import java.math.BigDecimal;
......@@ -289,6 +293,24 @@ public class ServiceUtil {
return ObjectUtil.defaultIfNull(currentConfig.getOilFieldCode(), BusinessConstant.DEFAULT_VALUE);
}
/**
* 获取所有path包含组织ID的组织
*
* @param context 上下文
* @param ouId ou id
* @return {@link List}<{@link String}>
*/
public static List<String> getOrgIdsByPath(XContext context, String ouId) {
SysOrganizationCloudService organizationCloudService = context.getBean(SysOrganizationCloudService.class);
GetAllOuListByOuIdInput ouIdInput = new GetAllOuListByOuIdInput();
ouIdInput.setOuId(ouId);
XListResult<GetSysOrganizationViewOutput> allListByOuId = organizationCloudService.getAllListByOuId(context, ouIdInput);
allListByOuId.throwIfFail();
return allListByOuId.getResult().stream()
.map(GetSysOrganizationViewOutput::getId)
.collect(Collectors.toList());
}
/*----------------------------------- 私有方法 -----------------------------------*/
/**
......
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