合并代码提交
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
package com.njcn.harmonic.service.distribution;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.param.RStatOrgParam;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatOrgQ;
|
||||
import com.njcn.harmonic.pojo.vo.PwRStatOrgVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatOrgIndexVO;
|
||||
import com.njcn.harmonic.pojo.vo.RMpPartHarmonicDetailVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatOrgVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatSubstationOrg2VO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -34,4 +35,25 @@ public interface PwRStatOrgService extends IService<RStatOrgQ> {
|
||||
* @return
|
||||
*/
|
||||
List<PwRStatOrgVO> getRStatOrgIndex(StatSubstationBizBaseParam param);
|
||||
|
||||
/**
|
||||
* 配网稳态指标合格率明细表
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<PwRStatOrgVO.PwRStatOrgDetailVO> getRMpPassRateInfo(RStatOrgParam.PwRStatOrgParam param);
|
||||
|
||||
/**
|
||||
* 配网区域稳态指标超标分类统计表
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<RStatSubstationOrg2VO.PwRStatSubstationOrgVO> getRStatSubstationOrg(StatSubstationBizBaseParam param);
|
||||
|
||||
/**
|
||||
*配网区域稳态指标超标明细
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO> getRMpPartHarmonicDetail(StatSubstationBizBaseParam param);
|
||||
}
|
||||
|
||||
@@ -8,20 +8,17 @@ import com.njcn.device.pms.api.PwMonitorClient;
|
||||
import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.param.PwPmsMonitorParam;
|
||||
import com.njcn.harmonic.mapper.distribution.PwRStatOrgMapper;
|
||||
import com.njcn.harmonic.mapper.majornetwork.RStatOrgMMapper;
|
||||
import com.njcn.harmonic.mapper.majornetwork.RStatOrgQMapper;
|
||||
import com.njcn.harmonic.mapper.majornetwork.RStatOrgYMapper;
|
||||
import com.njcn.harmonic.mapper.majornetwork.*;
|
||||
import com.njcn.harmonic.pojo.param.RStatOrgParam;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatOrgQ;
|
||||
import com.njcn.harmonic.pojo.vo.PwRStatOrgVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatOrgVO;
|
||||
import com.njcn.harmonic.pojo.vo.*;
|
||||
import com.njcn.harmonic.service.distribution.PwRStatOrgService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -44,21 +41,28 @@ import java.util.stream.Collectors;
|
||||
@RequiredArgsConstructor
|
||||
public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOrgQ> implements PwRStatOrgService {
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final PwRStatOrgMapper pwRStatOrgMapper;
|
||||
private final RStatOrgYMapper rStatOrgYMapper;
|
||||
private final RStatOrgQMapper rStatOrgQMapper;
|
||||
private final RStatOrgMMapper rStatOrgMMapper;
|
||||
private final PwMonitorClient pwMonitorClient;
|
||||
private final RMpPassRateYMapper rMpPassRateYMapper;
|
||||
private final RMpPassRateQMapper rMpPassRateQMapper;
|
||||
private final RMpPassRateMMapper rMpPassRateMMapper;
|
||||
private final RMpSurplusHarmonicDetailMMapper rMpSurplusHarmonicDetailMMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<RStatOrgVO.PwRStatOrgVO> getRStatHarmonicAll(StatSubstationBizBaseParam param) {
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
|
||||
PwPmsMonitorParam pwPmsMonitorParam=new PwPmsMonitorParam();
|
||||
pwPmsMonitorParam.setOrgId(param.getId());
|
||||
pwPmsMonitorParam.setMonitorSort(param.getIds());
|
||||
List<PwPmsMonitorDTO> data = pwMonitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
//获取部门id集合
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getId).collect(Collectors.toList());
|
||||
Map<String, DeptDTO> deptMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getId, Function.identity()));
|
||||
List<String> deptIds = data.stream().map(PwPmsMonitorDTO::getOrgId).collect(Collectors.toList());
|
||||
Map<String, PwPmsMonitorDTO> deptMap = data.stream().collect(Collectors.toMap(PwPmsMonitorDTO::getOrgId, Function.identity()));
|
||||
//获取配网信息
|
||||
DictData distributionData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
|
||||
List<RStatOrgVO.PwRStatOrgVO> info = new ArrayList<>();
|
||||
@@ -85,8 +89,9 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
collect.forEach((key, value) -> {
|
||||
if (deptMap.containsKey(key)) {
|
||||
for (RStatOrgVO.PwRStatOrgVO org : value) {
|
||||
DeptDTO deptDTO = deptMap.get(key);
|
||||
org.setOrgName(deptDTO.getName());
|
||||
PwPmsMonitorDTO deptDTO = deptMap.get(key);
|
||||
org.setOrgName(deptDTO.getOrgName());
|
||||
org.setMonitorSort(deptDTO.getMonitorSort());
|
||||
newList.add(org);
|
||||
}
|
||||
}
|
||||
@@ -134,10 +139,303 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
for (PwRStatOrgVO vo : info) {
|
||||
if (dto.getOrgId().equals(vo.getOrgNo())) {
|
||||
vo.setOrgNo(dto.getOrgId());
|
||||
vo.setMonitorSort(dto.getMonitorSort());
|
||||
vo.setOrgName(dto.getOrgName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PwRStatOrgVO.PwRStatOrgDetailVO> getRMpPassRateInfo(RStatOrgParam.PwRStatOrgParam param) {
|
||||
//初始化对象
|
||||
List<RStatOrgIndexVO> info = new ArrayList<>();
|
||||
// 获取当前用户的部门的子部门信息
|
||||
PwPmsMonitorParam pwPmsMonitorParam=new PwPmsMonitorParam();
|
||||
//部门id
|
||||
pwPmsMonitorParam.setOrgId(param.getId());
|
||||
//变电站
|
||||
pwPmsMonitorParam.setPowerId(param.getPowerrIds());
|
||||
//电压等级
|
||||
pwPmsMonitorParam.setVoltageLevels(param.getVoltageLevels());
|
||||
//监测点类别
|
||||
pwPmsMonitorParam.setMonitorSort(param.getMonitorSort());
|
||||
//监测点名称
|
||||
pwPmsMonitorParam.setMonitorName(param.getMonitorName());
|
||||
List<PwPmsMonitorDTO> monitorDTOList = pwMonitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
Map<String, PwPmsMonitorDTO> monitorDTOMap = monitorDTOList.stream().collect(
|
||||
Collectors.toMap(PwPmsMonitorDTO::getMonitorId, Function.identity()));
|
||||
|
||||
if (CollectionUtil.isNotEmpty(monitorDTOList)) {
|
||||
//获取最新过滤的监测点id
|
||||
List<String> ids = monitorDTOList.stream().map(PwPmsMonitorDTO::getMonitorId).collect(Collectors.toList());
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(ids);
|
||||
// 类型(1年 2季度 3月份
|
||||
switch (param.getType().toString()) {
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
// 获取年稳态指标合格率明细表
|
||||
info = rMpPassRateYMapper.getYearPassRate(baseParam);
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
// 获取季稳态指标合格率明细表
|
||||
info = rMpPassRateQMapper.getQuarterPassRate(baseParam);
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
// 获取月稳态指标合格率明细表
|
||||
info = rMpPassRateMMapper.getMonthPassRate(baseParam);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(info)) {
|
||||
//初始化
|
||||
List<PwRStatOrgVO.PwRStatOrgDetailVO> temp = new ArrayList<>();
|
||||
//便利对象
|
||||
Map<String, RStatOrgIndexVO> collect = info.stream()
|
||||
.collect(Collectors.toMap(RStatOrgIndexVO::getMeasurementPointId, Function.identity()));
|
||||
collect.forEach((Key, value) -> {
|
||||
if (monitorDTOMap.containsKey(Key)) {
|
||||
//根据监测点信息,进行属性赋值
|
||||
PwPmsMonitorDTO pwPmsMonitorDTO = monitorDTOMap.get(Key);
|
||||
PwRStatOrgVO.PwRStatOrgDetailVO pwRStatOrgVO=new PwRStatOrgVO.PwRStatOrgDetailVO();
|
||||
pwRStatOrgVO.setMeasurementPointId(pwPmsMonitorDTO.getMonitorId());
|
||||
pwRStatOrgVO.setMeasurementPointName(pwPmsMonitorDTO.getMonitorName());
|
||||
pwRStatOrgVO.setMonitorVoltageName(pwPmsMonitorDTO.getVoltageLevel());
|
||||
pwRStatOrgVO.setPowerName(pwPmsMonitorDTO.getPowerName());
|
||||
pwRStatOrgVO.setOrgNo(pwPmsMonitorDTO.getOrgId());
|
||||
pwRStatOrgVO.setOrgName(pwPmsMonitorDTO.getOrgName());
|
||||
pwRStatOrgVO.setMonitorSort(pwPmsMonitorDTO.getMonitorSort());
|
||||
pwRStatOrgVO.setFreqPassRate(value.getFreqPassRate());
|
||||
pwRStatOrgVO.setVDevPassRate(value.getVDevPassRate());
|
||||
pwRStatOrgVO.setFlickerPassRate(value.getFlickerPassRate());
|
||||
temp.add(pwRStatOrgVO);
|
||||
}
|
||||
});
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RStatSubstationOrg2VO.PwRStatSubstationOrgVO> getRStatSubstationOrg(StatSubstationBizBaseParam param) {
|
||||
PwPmsMonitorParam pwPmsMonitorParam=new PwPmsMonitorParam();
|
||||
//部门id
|
||||
pwPmsMonitorParam.setOrgId(param.getId());
|
||||
//监测点类别
|
||||
pwPmsMonitorParam.setMonitorSort(param.getIds());
|
||||
//获取配网监测点信息
|
||||
List<PwPmsMonitorDTO> monitorDTOList = pwMonitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
Map<String, PwPmsMonitorDTO> monitorDTOMap = monitorDTOList.stream().collect(
|
||||
Collectors.toMap(PwPmsMonitorDTO::getOrgId, Function.identity()));
|
||||
|
||||
List<RStatSubstationOrg2VO.PwRStatSubstationOrgVO> info = new ArrayList<>();
|
||||
|
||||
if (CollectionUtil.isNotEmpty(monitorDTOList)) {
|
||||
// 根据暂态指标枚举查询暂态指标
|
||||
List<DictData> steadyStatis = dicDataFeignClient.getDicDataByTypeCode(
|
||||
DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
||||
List<RStatSubstationOrgVO> temp = new ArrayList<>();
|
||||
// 过滤出部门id
|
||||
List<String> deptIds = monitorDTOList.stream().map(PwPmsMonitorDTO::getOrgId).collect(Collectors.toList());
|
||||
param.setIds(deptIds);
|
||||
|
||||
//获取配网信息
|
||||
DictData distributionData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
|
||||
|
||||
switch (param.getType().toString()) {
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
// 获取年区域暂态指标分类统计表
|
||||
temp = rStatOrgYMapper.getYearRStatHarmonicOrgInfo(param, distributionData.getId());
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
// 获取季区域暂态指标分类统计表
|
||||
temp = rStatOrgQMapper.getQuarterRStatHarmonicOrgInfo(param, distributionData.getId());
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
// 获取月区域暂态指标分类统计表
|
||||
temp = rStatOrgMMapper.getMonthRStatHarmonicOrgInfo(param, distributionData.getId());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
Map<String, List<RStatSubstationOrgVO>> map = temp
|
||||
.stream().collect(Collectors.groupingBy(RStatSubstationOrgVO::getOrgNo));
|
||||
map.forEach((key, value) -> {
|
||||
RStatSubstationOrg2VO.PwRStatSubstationOrgVO vo = new RStatSubstationOrg2VO.PwRStatSubstationOrgVO();
|
||||
//获取部门信息
|
||||
if (monitorDTOMap.containsKey(key)) {
|
||||
PwPmsMonitorDTO pwPmsMonitorDTO = monitorDTOMap.get(key);
|
||||
vo.setOrgName(pwPmsMonitorDTO.getOrgName());
|
||||
vo.setMonitorSort(pwPmsMonitorDTO.getMonitorSort());
|
||||
}
|
||||
vo.setOrgNo(value.get(0).getOrgNo());
|
||||
vo.setDataDate(value.get(0).getDataDate());
|
||||
vo.setEffectiveMeasurementAverage(value.get(0).getEffectiveMeasurementAverage());
|
||||
vo.setEffectiveMeasurementAccrued(value.get(0).getEffectiveMeasurementAccrued());
|
||||
vo.setHarmonicMeasurementAverage(value.get(0).getHarmonicMeasurementAverage());
|
||||
vo.setHarmonicMeasurementAccrued(value.get(0).getHarmonicMeasurementAccrued());
|
||||
vo.setHarmonicMeasurementRatioAverage(value.get(0).getHarmonicMeasurementRatioAverage());
|
||||
vo.setHarmonicMeasurementRatioAccrued(value.get(0).getHarmonicMeasurementRatioAccrued());
|
||||
//遍历赋值
|
||||
for (RStatSubstationOrgVO orgVO : value) {
|
||||
for (DictData eventStati : steadyStatis) {
|
||||
if (eventStati.getId().equals(orgVO.getHarmonicType())) {
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.FREQUENCY_DEV)) {
|
||||
vo.setTAverage(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage(orgVO.getChainAverage());
|
||||
vo.setChainAccrued(orgVO.getChainAccrued());
|
||||
vo.setSameAverage(orgVO.getSameAverage());
|
||||
vo.setSameAccrued(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.VOLTAGE_DEV)) {
|
||||
vo.setTAverage1(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued1(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage1(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued1(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage1(orgVO.getChainAverage());
|
||||
vo.setChainAccrued1(orgVO.getChainAccrued());
|
||||
vo.setSameAverage1(orgVO.getSameAverage());
|
||||
vo.setSameAccrued1(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay1(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.FLICKER)) {
|
||||
vo.setTAverage2(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued2(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage2(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued2(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage2(orgVO.getChainAverage());
|
||||
vo.setChainAccrued2(orgVO.getChainAccrued());
|
||||
vo.setSameAverage2(orgVO.getSameAverage());
|
||||
vo.setSameAccrued2(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay2(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.HARMONIC_VOLTAGE)) {
|
||||
vo.setTAverage3(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued3(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage3(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued3(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage3(orgVO.getChainAverage());
|
||||
vo.setChainAccrued3(orgVO.getChainAccrued());
|
||||
vo.setSameAverage3(orgVO.getSameAverage());
|
||||
vo.setSameAccrued3(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay3(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.HARMONIC_CURRENT)) {
|
||||
vo.setTAverage4(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued4(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage4(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued4(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage4(orgVO.getChainAverage());
|
||||
vo.setChainAccrued4(orgVO.getChainAccrued());
|
||||
vo.setSameAverage4(orgVO.getSameAverage());
|
||||
vo.setSameAccrued4(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay4(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.INTERHARMONIC_VOLTAGE)) {
|
||||
vo.setTAverage5(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued5(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage5(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued5(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage5(orgVO.getChainAverage());
|
||||
vo.setChainAccrued5(orgVO.getChainAccrued());
|
||||
vo.setSameAverage5(orgVO.getSameAverage());
|
||||
vo.setSameAccrued5(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay5(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.PHASE_VOLTAGE)) {
|
||||
vo.setTAverage6(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued6(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage6(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued6(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage6(orgVO.getChainAverage());
|
||||
vo.setChainAccrued6(orgVO.getChainAccrued());
|
||||
vo.setSameAverage6(orgVO.getSameAverage());
|
||||
vo.setSameAccrued6(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay6(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.NEG_CURRENT)) {
|
||||
vo.setTAverage7(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued7(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage7(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued7(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage7(orgVO.getChainAverage());
|
||||
vo.setChainAccrued7(orgVO.getChainAccrued());
|
||||
vo.setSameAverage7(orgVO.getSameAverage());
|
||||
vo.setSameAccrued7(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay7(orgVO.getAverageOverDay());
|
||||
}
|
||||
if (eventStati.getCode().equals(RStatSubstationOrg2VO.TOTAL_INDICATOR)) {
|
||||
vo.setTAverage8(orgVO.getOverLimitMeasurementAverage());
|
||||
vo.setTAccrued8(orgVO.getOverLimitMeasurementAccrued());
|
||||
vo.setOAverage8(orgVO.getOverLimitMeasurementRatioAverage());
|
||||
vo.setOAccrued8(orgVO.getOverLimitMeasurementRatioAccrued());
|
||||
vo.setChainAverage8(orgVO.getChainAverage());
|
||||
vo.setChainAccrued8(orgVO.getChainAccrued());
|
||||
vo.setSameAverage8(orgVO.getSameAverage());
|
||||
vo.setSameAccrued8(orgVO.getSameAccrued());
|
||||
vo.setAverageOverDay8(orgVO.getAverageOverDay());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
info.add(vo);
|
||||
});
|
||||
return info;
|
||||
}
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO> getRMpPartHarmonicDetail(StatSubstationBizBaseParam param) {
|
||||
PwPmsMonitorParam pwPmsMonitorParam=new PwPmsMonitorParam();
|
||||
//部门id
|
||||
pwPmsMonitorParam.setOrgId(param.getId());
|
||||
//监测点类别
|
||||
pwPmsMonitorParam.setMonitorSort(param.getIds());
|
||||
//获取配网监测点信息
|
||||
List<PwPmsMonitorDTO> pwPmsMonitorDTOS = pwMonitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
Map<String, PwPmsMonitorDTO> pwPmsMonitorDTOMap = pwPmsMonitorDTOS.stream().collect(
|
||||
Collectors.toMap(PwPmsMonitorDTO::getMonitorId, Function.identity()));
|
||||
|
||||
if (CollectionUtil.isNotEmpty(pwPmsMonitorDTOS)) {
|
||||
//获取监测点id
|
||||
List<String> ids = pwPmsMonitorDTOS.stream().map(PwPmsMonitorDTO::getMonitorId).collect(Collectors.toList());
|
||||
//筛选出数据库对应监测点
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(ids);
|
||||
List<RMpPartHarmonicDetailVO> rMpPartHarmonicDetail = rMpSurplusHarmonicDetailMMapper.getRMpPartHarmonicDetail(baseParam);
|
||||
List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO> newList=BeanUtil.copyToList(
|
||||
rMpPartHarmonicDetail,RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO.class);
|
||||
if (CollectionUtil.isNotEmpty(newList)) {
|
||||
//因为只有月表,数据进行查询可能出现重复数据。进行分组
|
||||
Map<String, List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO>> detailVOMap = newList.stream()
|
||||
.collect(Collectors.groupingBy(RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO::getMeasurementPointId));
|
||||
detailVOMap.forEach((Key, value) -> {
|
||||
if (pwPmsMonitorDTOMap.containsKey(Key)) {
|
||||
PwPmsMonitorDTO dto1 = pwPmsMonitorDTOMap.get(Key);
|
||||
for (RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO rmp : value) {
|
||||
rmp.setOrgName(dto1.getOrgName());
|
||||
rmp.setPowerrName(dto1.getPowerName());
|
||||
rmp.setMeasurementPointName(dto1.getMonitorName());
|
||||
rmp.setMonitorSort(dto1.getMonitorSort());
|
||||
rmp.setMonitorVoltageName(dto1.getVoltageLevel());
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
return newList;
|
||||
}
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.List;
|
||||
public interface RMpPassRateService extends IService<RMpPassRateQ> {
|
||||
|
||||
/**
|
||||
* 稳态指标合格率明细表
|
||||
* 主网稳态指标合格率明细表
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
|
||||
Reference in New Issue
Block a user