合并代码
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package com.njcn.harmonic.service.algorithm;
|
||||
|
||||
import com.njcn.harmonic.pojo.po.RStatFile;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2022-12-28
|
||||
*/
|
||||
public interface RStatFileService extends IService<RStatFile> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.harmonic.service.algorithm.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.harmonic.mapper.algorithm.RStatFileMapper;
|
||||
import com.njcn.harmonic.pojo.po.RStatFile;
|
||||
|
||||
import com.njcn.harmonic.service.algorithm.RStatFileService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2022-12-28
|
||||
*/
|
||||
@Service
|
||||
public class RStatFileServiceImpl extends ServiceImpl<RStatFileMapper, RStatFile> implements RStatFileService {
|
||||
|
||||
}
|
||||
@@ -23,6 +23,7 @@ public interface PwRStatOrgService extends IService<RStatOrgQ> {
|
||||
|
||||
/**
|
||||
* 配网查询区域超标统计
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -38,6 +39,7 @@ public interface PwRStatOrgService extends IService<RStatOrgQ> {
|
||||
|
||||
/**
|
||||
* 配网稳态指标合格率明细表
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -45,13 +47,15 @@ public interface PwRStatOrgService extends IService<RStatOrgQ> {
|
||||
|
||||
/**
|
||||
* 配网区域稳态指标超标分类统计表
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<RStatSubstationOrg2VO.PwRStatSubstationOrgVO> getRStatSubstationOrg(StatSubstationBizBaseParam param);
|
||||
|
||||
/**
|
||||
*配网区域稳态指标超标明细
|
||||
* 配网区域稳态指标超标明细
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -71,20 +71,20 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
switch (String.valueOf(param.getType())) {
|
||||
//查询区域超标统计-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
info = pwRStatOrgMapper.selectListY(param,deptIds,distributionData.getId());
|
||||
info = pwRStatOrgMapper.selectListY(param, deptIds, distributionData.getId());
|
||||
break;
|
||||
//查询区域超标统计-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
info = pwRStatOrgMapper.selectListQ(param,deptIds,distributionData.getId());
|
||||
info = pwRStatOrgMapper.selectListQ(param, deptIds, distributionData.getId());
|
||||
break;
|
||||
//查询各区域超标统计-月数据
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
info = pwRStatOrgMapper.selectListM(param,deptIds,distributionData.getId());
|
||||
info = pwRStatOrgMapper.selectListM(param, deptIds, distributionData.getId());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if(CollectionUtil.isNotEmpty(info)){
|
||||
if (CollectionUtil.isNotEmpty(info)) {
|
||||
Map<String, List<RStatOrgVO.PwRStatOrgVO>> collect = info.stream().collect(
|
||||
Collectors.groupingBy(RStatOrgVO.PwRStatOrgVO::getOrgNo));
|
||||
collect.forEach((key, value) -> {
|
||||
@@ -98,7 +98,7 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
});
|
||||
return newList;
|
||||
}
|
||||
return Lists.newArrayList();
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -114,7 +114,7 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
|
||||
//获取配网信息
|
||||
DictData distributionData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
|
||||
List<PwRStatOrgVO> info=new ArrayList<>();
|
||||
List<PwRStatOrgVO> info = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(deptDTOList)) {
|
||||
// 过滤出部门id
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
@@ -153,7 +153,7 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
//初始化对象
|
||||
List<RStatOrgIndexVO> info = new ArrayList<>();
|
||||
// 获取当前用户的部门的子部门信息
|
||||
PwPmsMonitorParam pwPmsMonitorParam=new PwPmsMonitorParam();
|
||||
PwPmsMonitorParam pwPmsMonitorParam = new PwPmsMonitorParam();
|
||||
//部门id
|
||||
pwPmsMonitorParam.setOrgId(param.getId());
|
||||
//变电站
|
||||
@@ -165,10 +165,10 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
//监测点名称
|
||||
pwPmsMonitorParam.setMonitorName(param.getMonitorName());
|
||||
List<PwPmsMonitorDTO> monitorDTOList = pwMonitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
Map<String, PwPmsMonitorDTO> monitorDTOMap = monitorDTOList.stream().collect(
|
||||
Collectors.toMap(PwPmsMonitorDTO::getMonitorId, Function.identity(),(key1,key2) ->key2));
|
||||
|
||||
if (CollectionUtil.isNotEmpty(monitorDTOList)) {
|
||||
Map<String, PwPmsMonitorDTO> monitorDTOMap = monitorDTOList.stream().collect(
|
||||
Collectors.toMap(PwPmsMonitorDTO::getMonitorId, Function.identity(), (key1, key2) -> key2));
|
||||
//获取最新过滤的监测点id
|
||||
List<String> ids = monitorDTOList.stream().map(PwPmsMonitorDTO::getMonitorId).collect(Collectors.toList());
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
@@ -201,7 +201,7 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
if (monitorDTOMap.containsKey(Key)) {
|
||||
//根据监测点信息,进行属性赋值
|
||||
PwPmsMonitorDTO pwPmsMonitorDTO = monitorDTOMap.get(Key);
|
||||
PwRStatOrgVO.PwRStatOrgDetailVO pwRStatOrgVO=new PwRStatOrgVO.PwRStatOrgDetailVO();
|
||||
PwRStatOrgVO.PwRStatOrgDetailVO pwRStatOrgVO = new PwRStatOrgVO.PwRStatOrgDetailVO();
|
||||
pwRStatOrgVO.setMeasurementPointId(pwPmsMonitorDTO.getMonitorId());
|
||||
pwRStatOrgVO.setMeasurementPointName(pwPmsMonitorDTO.getMonitorName());
|
||||
pwRStatOrgVO.setMonitorVoltageName(pwPmsMonitorDTO.getVoltageLevel());
|
||||
@@ -241,15 +241,15 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
switch (param.getType().toString()) {
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
// 获取年区域暂态指标分类统计表
|
||||
temp = rStatOrgYMapper.getYearRStatHarmonicOrgInfo(param,deptIds, distributionData.getId());
|
||||
temp = rStatOrgYMapper.getYearRStatHarmonicOrgInfo(param, deptIds, distributionData.getId());
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
// 获取季区域暂态指标分类统计表
|
||||
temp = rStatOrgQMapper.getQuarterRStatHarmonicOrgInfo(param,deptIds,distributionData.getId());
|
||||
temp = rStatOrgQMapper.getQuarterRStatHarmonicOrgInfo(param, deptIds, distributionData.getId());
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
// 获取月区域暂态指标分类统计表
|
||||
temp = rStatOrgMMapper.getMonthRStatHarmonicOrgInfo(param,deptIds,distributionData.getId());
|
||||
temp = rStatOrgMMapper.getMonthRStatHarmonicOrgInfo(param, deptIds, distributionData.getId());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -389,7 +389,7 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
|
||||
@Override
|
||||
public List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO> getRMpPartHarmonicDetail(RStatOrgParam.PwRStatOrgParam param) {
|
||||
PwPmsMonitorParam pwPmsMonitorParam=new PwPmsMonitorParam();
|
||||
PwPmsMonitorParam pwPmsMonitorParam = new PwPmsMonitorParam();
|
||||
//部门id
|
||||
pwPmsMonitorParam.setOrgId(param.getId());
|
||||
//电压等级
|
||||
@@ -401,7 +401,7 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
//获取配网监测点信息
|
||||
List<PwPmsMonitorDTO> pwPmsMonitorDTOS = pwMonitorClient.getPwMonitorList(pwPmsMonitorParam).getData();
|
||||
Map<String, PwPmsMonitorDTO> pwPmsMonitorDTOMap = pwPmsMonitorDTOS.stream().collect(
|
||||
Collectors.toMap(PwPmsMonitorDTO::getMonitorId,Function.identity(),(key1, key2) -> key2));
|
||||
Collectors.toMap(PwPmsMonitorDTO::getMonitorId, Function.identity(), (key1, key2) -> key2));
|
||||
|
||||
if (CollectionUtil.isNotEmpty(pwPmsMonitorDTOS)) {
|
||||
//获取监测点id
|
||||
@@ -410,8 +410,8 @@ public class PwRStatOrgServiceImpl extends ServiceImpl<PwRStatOrgMapper, RStatOr
|
||||
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);
|
||||
List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO> newList = BeanUtil.copyToList(
|
||||
rMpPartHarmonicDetail, RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO.class);
|
||||
if (CollectionUtil.isNotEmpty(newList)) {
|
||||
//因为只有月表,数据进行查询可能出现重复数据。进行分组
|
||||
Map<String, List<RMpPartHarmonicDetailVO.PwRMpPartHarmonicDetailDVO>> detailVOMap = newList.stream()
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
@@ -22,6 +22,7 @@ public interface RStatHarmonicMService extends IService<RStatHarmonicM> {
|
||||
|
||||
/**
|
||||
* 主网查询查询监测点稳态指标 日/月点数
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -29,6 +30,7 @@ public interface RStatHarmonicMService extends IService<RStatHarmonicM> {
|
||||
|
||||
/**
|
||||
* 主网稳态电铁-频率偏差-电压统计图
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -36,6 +38,7 @@ public interface RStatHarmonicMService extends IService<RStatHarmonicM> {
|
||||
|
||||
/**
|
||||
* 主网稳态电铁-频率偏差-越线日期统计图
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -43,6 +46,7 @@ public interface RStatHarmonicMService extends IService<RStatHarmonicM> {
|
||||
|
||||
/**
|
||||
* 配网查询监测点稳态指标(月)
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -50,6 +54,7 @@ public interface RStatHarmonicMService extends IService<RStatHarmonicM> {
|
||||
|
||||
/**
|
||||
* 配网监测点-频率偏差-越线日期统计图
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.njcn.harmonic.service.majornetwork;
|
||||
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.param.OverviewParam;
|
||||
import com.njcn.harmonic.pojo.param.RStatHarmonicMParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgM;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.harmonic.pojo.vo.OverviewVO;
|
||||
import com.njcn.harmonic.pojo.vo.RArrayVO;
|
||||
import com.njcn.harmonic.pojo.vo.RIconVO;
|
||||
|
||||
@@ -50,4 +52,13 @@ public interface RStatHarmonicOrgMService extends IService<RStatHarmonicOrgM> {
|
||||
* @return
|
||||
*/
|
||||
List<RIconVO> getPwRStatHarmonicOrgMIcon(RStatHarmonicMParam param);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分布式光伏概览-稳态指标超标占比
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<OverviewVO.GroupVO> getExcessiveProportion(OverviewParam param);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public interface RStatHarmonicOrgYService extends IService<RStatHarmonicOrgY> {
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<RIconVO> getPwRStatHarmonicOrgYOldIcon(RStatHarmonicMParam param,Integer type);
|
||||
List<RIconVO> getPwRStatHarmonicOrgYOldIcon(RStatHarmonicMParam param, Integer type);
|
||||
|
||||
|
||||
/**
|
||||
@@ -50,7 +50,7 @@ public interface RStatHarmonicOrgYService extends IService<RStatHarmonicOrgY> {
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<RArrayVO> getPwRStatHarmonicYOldAll(StatisticsBizBaseParam param,Integer type);
|
||||
List<RArrayVO> getPwRStatHarmonicYOldAll(StatisticsBizBaseParam param, Integer type);
|
||||
|
||||
/**
|
||||
* 配网查询各单位稳态指标(年 )统计暂不使用
|
||||
@@ -69,5 +69,4 @@ public interface RStatHarmonicOrgYService extends IService<RStatHarmonicOrgY> {
|
||||
List<RIconVO> getPwRStatHarmonicOrgYIcon(RStatHarmonicMParam param);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -9,23 +9,25 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
* @author wr
|
||||
* @since 2022-10-12
|
||||
*/
|
||||
public interface RStatHarmonicQService extends IService<RStatHarmonicQ> {
|
||||
|
||||
/**
|
||||
* 主网查询监测点稳态指标(季)
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<RArrayVO> getRStatHarmonicQAll(StatisticsBizBaseParam param);
|
||||
|
||||
/**
|
||||
* 配网查询监测点稳态指标(季)
|
||||
* 配网查询监测点稳态指标(季)
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -9,10 +9,10 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* 配网指标分类概览-监测点分类总览
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
* @author wr
|
||||
* @since 2022-10-12
|
||||
*/
|
||||
public interface RStatHarmonicYService extends IService<RStatHarmonicY> {
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
@@ -19,6 +19,7 @@ public interface RStatLoadTypeService extends IService<RStatLoadTypeM> {
|
||||
|
||||
/**
|
||||
* 区域干扰源电流类指标超标统计
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -19,6 +19,7 @@ public interface RStatOrgMService extends IService<RStatOrgM> {
|
||||
|
||||
/**
|
||||
* 查询区域超标统计-月数据
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -19,6 +19,7 @@ public interface RStatOrgQService extends IService<RStatOrgQ> {
|
||||
|
||||
/**
|
||||
* 查询区域超标统计-季数据
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -80,10 +80,10 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicM> list = rStatHarmonicMMapper.selectInfoList(baseParam,mainnetData.getId());
|
||||
List<RStatHarmonicM> list = rStatHarmonicMMapper.selectInfoList(baseParam, mainnetData.getId());
|
||||
|
||||
//初始化指标类型(横向)
|
||||
List<RArrayVO> arrayVOList = new ArrayList<>();
|
||||
@@ -119,7 +119,7 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
List<RStatHarmonicMVO> b = new ArrayList<>();
|
||||
b.addAll(rm);
|
||||
for (RStatHarmonicM rStatHarmonicM : value) {
|
||||
if(interferenceMap.containsKey(rStatHarmonicM.getMeasurementTypeClass())){
|
||||
if (interferenceMap.containsKey(rStatHarmonicM.getMeasurementTypeClass())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(rStatHarmonicM, RStatHarmonicMVO.class);
|
||||
DictData data1 = interferenceMap.get(rStatHarmonicM.getMeasurementTypeClass());
|
||||
r.setHarmonicName(data1.getName());
|
||||
@@ -196,11 +196,11 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicVoltageM> rStatHarmonicVoltageMS = rStatHarmonicVoltageMMapper
|
||||
.selectInfoList(baseParam,mainnetData.getId(), measurementDate.getId(),harmonicDate.getId());
|
||||
.selectInfoList(baseParam, mainnetData.getId(), measurementDate.getId(), harmonicDate.getId());
|
||||
|
||||
//将数据转换为map进行便利
|
||||
Map<String, RStatHarmonicVoltageM> voltageMMap = rStatHarmonicVoltageMS.stream()
|
||||
@@ -283,11 +283,11 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicD> rStatHarmonicVoltageMS = rStatHarmonicDMapper
|
||||
.selectInfoList(baseParam,mainnetData.getId(), measurementDate.getId(),harmonicDate.getId());
|
||||
.selectInfoList(baseParam, mainnetData.getId(), measurementDate.getId(), harmonicDate.getId());
|
||||
|
||||
Map<LocalDate, List<RStatHarmonicD>> collect =
|
||||
rStatHarmonicVoltageMS.stream().collect(Collectors.groupingBy(RStatHarmonicD::getDataDate));
|
||||
@@ -349,10 +349,10 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicM> list = rStatHarmonicMMapper.selectInfoList(baseParam,distributionData.getId());
|
||||
List<RStatHarmonicM> list = rStatHarmonicMMapper.selectInfoList(baseParam, distributionData.getId());
|
||||
|
||||
//根据稳态指标分组
|
||||
Map<String, List<RStatHarmonicM>> measurementMap = list.stream().collect(Collectors.groupingBy(RStatHarmonicM::getHarmonicType));
|
||||
@@ -368,7 +368,7 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
for (RStatHarmonicM statHarmonic : value) {
|
||||
if(lineMap.containsKey(statHarmonic.getMeasurementTypeClass())){
|
||||
if (lineMap.containsKey(statHarmonic.getMeasurementTypeClass())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(statHarmonic, RStatHarmonicMVO.class);
|
||||
DictData data1 = lineMap.get(statHarmonic.getMeasurementTypeClass());
|
||||
r.setHarmonicName(data1.getName());
|
||||
@@ -445,11 +445,11 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicD> rStatHarmonicVoltageMS = rStatHarmonicDMapper
|
||||
.selectInfoList(baseParam,distributionData.getId(), measurementDate.getId(),harmonicDate.getId());
|
||||
.selectInfoList(baseParam, distributionData.getId(), measurementDate.getId(), harmonicDate.getId());
|
||||
|
||||
Map<LocalDate, List<RStatHarmonicD>> collect =
|
||||
rStatHarmonicVoltageMS.stream().collect(Collectors.groupingBy(RStatHarmonicD::getDataDate));
|
||||
|
||||
@@ -2,14 +2,18 @@ package com.njcn.harmonic.service.majornetwork.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.param.OverviewParam;
|
||||
import com.njcn.harmonic.pojo.param.RStatHarmonicMParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgM;
|
||||
import com.njcn.harmonic.mapper.StatHarmonicOrgMMapper;
|
||||
import com.njcn.harmonic.pojo.po.RStatHarmonicOrgQ;
|
||||
import com.njcn.harmonic.pojo.vo.OverviewVO;
|
||||
import com.njcn.harmonic.pojo.vo.RArrayVO;
|
||||
import com.njcn.harmonic.pojo.vo.RIconVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatHarmonicMVO;
|
||||
@@ -24,8 +28,10 @@ import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.checkerframework.checker.units.qual.K;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.security.Key;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
@@ -51,7 +57,7 @@ public class RStatHarmonicOrgMServiceImpl extends ServiceImpl<StatHarmonicOrgMMa
|
||||
public List<RArrayVO> getRStatHarmonicMAll(StatisticsBizBaseParam param) {
|
||||
//子节点 获取所有得各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
//获取部门id集合
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
@@ -142,7 +148,7 @@ public class RStatHarmonicOrgMServiceImpl extends ServiceImpl<StatHarmonicOrgMMa
|
||||
public List<RIconVO> getRStatHarmonicOrgMIcon(RStatHarmonicMParam param) {
|
||||
//子节点 获取所有得各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
Map<String, DeptDTO> deptMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, Function.identity()));
|
||||
//获取部门id集合
|
||||
@@ -231,7 +237,7 @@ public class RStatHarmonicOrgMServiceImpl extends ServiceImpl<StatHarmonicOrgMMa
|
||||
|
||||
//子节点 获取所有得各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
//获取部门id集合
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
@@ -260,7 +266,7 @@ public class RStatHarmonicOrgMServiceImpl extends ServiceImpl<StatHarmonicOrgMMa
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
for (RStatHarmonicOrgM statHarmonic : value) {
|
||||
if(deptMap.containsKey(statHarmonic.getOrgNo())){
|
||||
if (deptMap.containsKey(statHarmonic.getOrgNo())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(statHarmonic, RStatHarmonicMVO.class);
|
||||
DeptDTO deptDTO = deptMap.get(statHarmonic.getOrgNo());
|
||||
r.setHarmonicName(deptDTO.getName());
|
||||
@@ -303,8 +309,8 @@ public class RStatHarmonicOrgMServiceImpl extends ServiceImpl<StatHarmonicOrgMMa
|
||||
public List<RIconVO> getPwRStatHarmonicOrgMIcon(RStatHarmonicMParam param) {
|
||||
//各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
Map<String, DeptDTO> deptMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, Function.identity()));
|
||||
//获取部门id集合
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
@@ -382,6 +388,81 @@ public class RStatHarmonicOrgMServiceImpl extends ServiceImpl<StatHarmonicOrgMMa
|
||||
return arrayVOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OverviewVO.GroupVO> getExcessiveProportion(OverviewParam param) {
|
||||
List<OverviewVO.GroupVO> info=new ArrayList<>();
|
||||
//指标类型
|
||||
List<DictData> steadyData = dicDataFeignClient.getDicDataByTypeCode
|
||||
(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
||||
//监测点类型
|
||||
List<DictData> lineData = dicDataFeignClient.getDicDataByTypeCode
|
||||
(DicDataTypeEnum.LINE_SORT.getCode()).getData();
|
||||
|
||||
//获取部门数据
|
||||
List<DeptDTO> deptDTOS = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
if(CollectionUtil.isNotEmpty(deptDTOS)){
|
||||
List<String> collect = deptDTOS.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
//获取配网数据类型
|
||||
DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
|
||||
List<OverviewVO> overviewVOS = statHarmonicOrgMMapper.selectYoY(param, collect, data.getId());
|
||||
|
||||
Map<String, List<OverviewVO>> overviewVOMap = overviewVOS.stream().collect(
|
||||
Collectors.groupingBy(OverviewVO::getMonitorSort));
|
||||
|
||||
overviewVOMap.forEach((key,value)->{
|
||||
OverviewVO.GroupVO groupVO = new OverviewVO.GroupVO();
|
||||
|
||||
Map<String, List<OverviewVO>> listMap = value.stream().collect(Collectors.groupingBy(OverviewVO::getHarmonicType));
|
||||
List<DictData> notDict = steadyData.stream().filter(r -> !listMap.containsKey(r.getId()))
|
||||
.collect(Collectors.toList());
|
||||
//生成默认值
|
||||
if(CollectionUtil.isNotEmpty(notDict)){
|
||||
groupVO.setMonitorSort(key);
|
||||
OverviewVO overviewVO;
|
||||
for (DictData dictData : notDict) {
|
||||
overviewVO=new OverviewVO();
|
||||
overviewVO.setMonitorSort(key);
|
||||
overviewVO.setHarmonicType(dictData.getId());
|
||||
overviewVO.setSumNum("0");
|
||||
overviewVO.setYtbSumNum("0");
|
||||
overviewVO.setYhbSumNum("0");
|
||||
overviewVO.setSameNum("0");
|
||||
overviewVO.setRingNum("0");
|
||||
value.add(overviewVO);
|
||||
}
|
||||
groupVO.setSubset(value);
|
||||
}
|
||||
info.add(groupVO);
|
||||
});
|
||||
|
||||
List<DictData> notDict = lineData.stream().filter(r -> !overviewVOMap.containsKey(r.getId()))
|
||||
.collect(Collectors.toList());
|
||||
if(CollectionUtil.isNotEmpty(notDict)){
|
||||
OverviewVO.GroupVO overviewVO;
|
||||
OverviewVO vo;
|
||||
for (DictData dictData : notDict) {
|
||||
overviewVO=new OverviewVO.GroupVO();
|
||||
overviewVO.setMonitorSort(dictData.getId());
|
||||
List<OverviewVO> vos=new ArrayList<>();
|
||||
for (DictData lineDatum : steadyData) {
|
||||
vo=new OverviewVO();
|
||||
vo.setMonitorSort(dictData.getId());
|
||||
vo.setHarmonicType(lineDatum.getId());
|
||||
vo.setSumNum("0");
|
||||
vo.setYtbSumNum("0");
|
||||
vo.setYhbSumNum("0");
|
||||
vo.setSameNum("0");
|
||||
vo.setRingNum("0");
|
||||
vos.add(vo);
|
||||
}
|
||||
overviewVO.setSubset(vos);
|
||||
info.add(overviewVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 便利赋值
|
||||
*
|
||||
|
||||
@@ -56,7 +56,7 @@ public class RStatHarmonicOrgQServiceImpl extends ServiceImpl<StatHarmonicOrgQMa
|
||||
|
||||
//子节点 获取所有得各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
//获取部门id集合
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
@@ -85,7 +85,7 @@ public class RStatHarmonicOrgQServiceImpl extends ServiceImpl<StatHarmonicOrgQMa
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
for (RStatHarmonicOrgQ statHarmonic : value) {
|
||||
if(deptMap.containsKey(statHarmonic.getOrgNo())){
|
||||
if (deptMap.containsKey(statHarmonic.getOrgNo())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(statHarmonic, RStatHarmonicMVO.class);
|
||||
DeptDTO deptDTO = deptMap.get(statHarmonic.getOrgNo());
|
||||
r.setHarmonicName(deptDTO.getName());
|
||||
@@ -124,7 +124,7 @@ public class RStatHarmonicOrgQServiceImpl extends ServiceImpl<StatHarmonicOrgQMa
|
||||
public List<RIconVO> getRStatHarmonicOrgQIcon(RStatHarmonicMParam param) {
|
||||
//子节点 获取所有得各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
Map<String, DeptDTO> deptMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, Function.identity()));
|
||||
//获取部门id集合
|
||||
@@ -210,7 +210,7 @@ public class RStatHarmonicOrgQServiceImpl extends ServiceImpl<StatHarmonicOrgQMa
|
||||
|
||||
//子节点 获取所有得各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
//获取部门id集合
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
@@ -239,7 +239,7 @@ public class RStatHarmonicOrgQServiceImpl extends ServiceImpl<StatHarmonicOrgQMa
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
for (RStatHarmonicOrgQ statHarmonic : value) {
|
||||
if(deptMap.containsKey(statHarmonic.getOrgNo())){
|
||||
if (deptMap.containsKey(statHarmonic.getOrgNo())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(statHarmonic, RStatHarmonicMVO.class);
|
||||
DeptDTO deptDTO = deptMap.get(statHarmonic.getOrgNo());
|
||||
r.setHarmonicName(deptDTO.getName());
|
||||
@@ -278,7 +278,7 @@ public class RStatHarmonicOrgQServiceImpl extends ServiceImpl<StatHarmonicOrgQMa
|
||||
public List<RIconVO> getPwRStatHarmonicOrgQIcon(RStatHarmonicMParam param) {
|
||||
//各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
Map<String, DeptDTO> deptMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, Function.identity()));
|
||||
//获取部门id集合
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
@@ -73,15 +73,15 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
StatSubstationBizBaseParam baseParam;
|
||||
//初始化指标类型(横向)
|
||||
List<RArrayVO> arrayVOList = new ArrayList<>();
|
||||
List<RStatHarmonicVO> newList=new ArrayList<>();
|
||||
List<RStatHarmonicVO> newList = new ArrayList<>();
|
||||
for (DeptLevelVO deptLevelVO : deptLevelVOList) {
|
||||
//数据库查询
|
||||
baseParam=BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
//没有子部门说明就是最底层部门
|
||||
if(CollUtil.isNotEmpty(deptLevelVO.getDeptList())){
|
||||
if (CollUtil.isNotEmpty(deptLevelVO.getDeptList())) {
|
||||
List<String> deptCodeS = deptLevelVO.getDeptList().stream().map(DeptLevelVO::getCode).collect(Collectors.toList());
|
||||
baseParam.setIds(deptCodeS);
|
||||
}else{
|
||||
} else {
|
||||
baseParam.setIds(Arrays.asList(deptLevelVO.getCode()));
|
||||
}
|
||||
//区分 年 季 月
|
||||
@@ -90,15 +90,15 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
switch (string) {
|
||||
//查询各单位累计超标监测点数-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
list = statHarmonicOrgYMapper.selectInfoList(baseParam,steadyDataIds,mainnetData.getId());
|
||||
list = statHarmonicOrgYMapper.selectInfoList(baseParam, steadyDataIds, mainnetData.getId());
|
||||
break;
|
||||
//查询各单位累计超标监测点数-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
list = statHarmonicOrgQMapper.selectInfoList(baseParam,steadyDataIds,mainnetData.getId());
|
||||
list = statHarmonicOrgQMapper.selectInfoList(baseParam, steadyDataIds, mainnetData.getId());
|
||||
break;
|
||||
//查询各单位累计超标监测点数-月数据
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
list = statHarmonicOrgMMapper.selectInfoList(baseParam,steadyDataIds,mainnetData.getId());
|
||||
list = statHarmonicOrgMMapper.selectInfoList(baseParam, steadyDataIds, mainnetData.getId());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -114,7 +114,7 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
}
|
||||
RStatHarmonicVO org;
|
||||
for (DictData notData : notMeasurementList) {
|
||||
org=new RStatHarmonicVO();
|
||||
org = new RStatHarmonicVO();
|
||||
org.setOrgNo(deptLevelVO.getCode());
|
||||
org.setHarmonicType(notData.getId());
|
||||
org.setOverLimitMeasurementAverage(0);
|
||||
@@ -132,16 +132,16 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
|
||||
//重新生成数据结构
|
||||
harmonicMap.forEach((key, value) -> {
|
||||
if(lineTypeMap.containsKey(key)){
|
||||
RArrayVO arrayVO=new RArrayVO();
|
||||
if (lineTypeMap.containsKey(key)) {
|
||||
RArrayVO arrayVO = new RArrayVO();
|
||||
DictData data = lineTypeMap.get(key);
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
List<RStatHarmonicMVO> b=new ArrayList<>();
|
||||
List<RStatHarmonicMVO> b = new ArrayList<>();
|
||||
for (RStatHarmonicVO orgY : value) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(orgY, RStatHarmonicMVO.class);
|
||||
DeptLevelVO data1 = deptMap.get(orgY.getOrgNo());
|
||||
if (ObjectUtil.isNotNull(data1)){
|
||||
if (ObjectUtil.isNotNull(data1)) {
|
||||
r.setHarmonicName(data1.getName());
|
||||
r.setSort(data1.getSort());
|
||||
r.setOverDay(0);
|
||||
@@ -172,21 +172,21 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
|
||||
DictData harmonicData;
|
||||
//判断是是否传入检测点信息值(电压)
|
||||
if(StrUtil.isBlank(param.getStasisID())&&StrUtil.isBlank(param.getMonitorID())){
|
||||
if (StrUtil.isBlank(param.getStasisID()) && StrUtil.isBlank(param.getMonitorID())) {
|
||||
//指标对象类型
|
||||
List<DictData> indicatorTypeDate = dicDataFeignClient.getDicDataByTypeCode(
|
||||
DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
||||
indicatorTypeDate.sort(Comparator.comparing(data -> data.getSort()));
|
||||
harmonicData =indicatorTypeDate.get(0);
|
||||
}else{
|
||||
harmonicData = indicatorTypeDate.get(0);
|
||||
} else {
|
||||
//获取指标对象(频率偏差)
|
||||
harmonicData= dicDataFeignClient.getDicDataById(
|
||||
harmonicData = dicDataFeignClient.getDicDataById(
|
||||
param.getStasisID()).getData();
|
||||
}
|
||||
|
||||
//初始化指标类型(横向)
|
||||
StatSubstationBizBaseParam baseParam;
|
||||
List<RIconVO> arrayVOList=new ArrayList<>();
|
||||
List<RIconVO> arrayVOList = new ArrayList<>();
|
||||
for (DeptLevelVO deptLevelVO : deptLevelVOList) {
|
||||
//数据库查询
|
||||
baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
@@ -220,13 +220,13 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
RIconVO rIconVO = new RIconVO();
|
||||
rIconVO.setRowName(deptLevelVO.getName());
|
||||
rIconVO.setSort(deptLevelVO.getSort());
|
||||
if(CollUtil.isNotEmpty(list)){
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
rIconVO.setOverLimitMeasurementAccrued(list.get(0).getOverLimitMeasurementAccrued());
|
||||
rIconVO.setOverLimitMeasurementAverage(list.get(0).getOverLimitMeasurementAverage());
|
||||
rIconVO.setOverLimitMeasurementRatioAccrued(list.get(0).getOverLimitMeasurementRatioAccrued());
|
||||
rIconVO.setOverLimitMeasurementRatioAverage(list.get(0).getOverLimitMeasurementRatioAverage());
|
||||
rIconVO.setAverageOverDay(list.get(0).getAverageOverDay());
|
||||
}else{
|
||||
} else {
|
||||
rIconVO.setOverLimitMeasurementAverage(0);
|
||||
rIconVO.setOverLimitMeasurementAccrued(0);
|
||||
rIconVO.setOverLimitMeasurementRatioAverage(0.0F);
|
||||
@@ -263,15 +263,15 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
StatSubstationBizBaseParam baseParam;
|
||||
//初始化指标类型(横向)
|
||||
List<RArrayVO> arrayVOList = new ArrayList<>();
|
||||
List<RStatHarmonicVO> newList=new ArrayList<>();
|
||||
List<RStatHarmonicVO> newList = new ArrayList<>();
|
||||
for (DeptLevelVO deptLevelVO : deptLevelVOList) {
|
||||
//数据库查询
|
||||
baseParam=BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
//没有子部门说明就是最底层部门
|
||||
if(CollUtil.isNotEmpty(deptLevelVO.getDeptList())){
|
||||
if (CollUtil.isNotEmpty(deptLevelVO.getDeptList())) {
|
||||
List<String> deptCodeS = deptLevelVO.getDeptList().stream().map(DeptLevelVO::getCode).collect(Collectors.toList());
|
||||
baseParam.setIds(deptCodeS);
|
||||
}else{
|
||||
} else {
|
||||
baseParam.setIds(Arrays.asList(deptLevelVO.getCode()));
|
||||
}
|
||||
//区分 年 季 月
|
||||
@@ -280,15 +280,15 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
switch (string) {
|
||||
//查询各单位累计超标监测点数-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
list = statHarmonicOrgYMapper.selectInfoList(baseParam,steadyDataIds,distributionData.getId());
|
||||
list = statHarmonicOrgYMapper.selectInfoList(baseParam, steadyDataIds, distributionData.getId());
|
||||
break;
|
||||
//查询各单位累计超标监测点数-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
list = statHarmonicOrgQMapper.selectInfoList(baseParam,steadyDataIds,distributionData.getId());
|
||||
list = statHarmonicOrgQMapper.selectInfoList(baseParam, steadyDataIds, distributionData.getId());
|
||||
break;
|
||||
//查询各单位累计超标监测点数-月数据
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
list = statHarmonicOrgMMapper.selectInfoList(baseParam,steadyDataIds,distributionData.getId());
|
||||
list = statHarmonicOrgMMapper.selectInfoList(baseParam, steadyDataIds, distributionData.getId());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -305,7 +305,7 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
}
|
||||
RStatHarmonicVO org;
|
||||
for (DictData notData : notMeasurementList) {
|
||||
org=new RStatHarmonicVO();
|
||||
org = new RStatHarmonicVO();
|
||||
org.setOrgNo(deptLevelVO.getCode());
|
||||
org.setHarmonicType(notData.getId());
|
||||
org.setOverLimitMeasurementAverage(0);
|
||||
@@ -323,16 +323,16 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
|
||||
//重新生成数据结构
|
||||
harmonicMap.forEach((key, value) -> {
|
||||
if(lineTypeMap.containsKey(key)){
|
||||
RArrayVO arrayVO=new RArrayVO();
|
||||
if (lineTypeMap.containsKey(key)) {
|
||||
RArrayVO arrayVO = new RArrayVO();
|
||||
DictData data = lineTypeMap.get(key);
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
List<RStatHarmonicMVO> b=new ArrayList<>();
|
||||
List<RStatHarmonicMVO> b = new ArrayList<>();
|
||||
for (RStatHarmonicVO orgY : value) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(orgY, RStatHarmonicMVO.class);
|
||||
DeptLevelVO data1 = deptMap.get(orgY.getOrgNo());
|
||||
if (ObjectUtil.isNotNull(data1)){
|
||||
if (ObjectUtil.isNotNull(data1)) {
|
||||
r.setHarmonicName(data1.getName());
|
||||
r.setSort(data1.getSort());
|
||||
r.setOverDay(0);
|
||||
@@ -350,7 +350,7 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RArrayVO> getPwRStatHarmonicYOldAll(StatisticsBizBaseParam param,Integer type) {
|
||||
public List<RArrayVO> getPwRStatHarmonicYOldAll(StatisticsBizBaseParam param, Integer type) {
|
||||
//对象主节点 获取所有的稳态类型
|
||||
List<DictData> steadyData = dicDataFeignClient.getDicDataByTypeCode(
|
||||
DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
||||
@@ -359,17 +359,17 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
|
||||
//子节点 获取所有得各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
//获取部门id集合
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
Map<String, DeptDTO> deptMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, Function.identity()));
|
||||
|
||||
DictData dictData ;
|
||||
if(type==1){
|
||||
DictData dictData;
|
||||
if (type == 1) {
|
||||
//获取主网信息
|
||||
dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
|
||||
}else{
|
||||
} else {
|
||||
//获取配网信息
|
||||
dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
|
||||
}
|
||||
@@ -395,7 +395,7 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
for (RStatHarmonicOrgY statHarmonic : value) {
|
||||
if(deptMap.containsKey(statHarmonic.getOrgNo())){
|
||||
if (deptMap.containsKey(statHarmonic.getOrgNo())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(statHarmonic, RStatHarmonicMVO.class);
|
||||
DeptDTO deptDTO = deptMap.get(statHarmonic.getOrgNo());
|
||||
r.setHarmonicName(deptDTO.getName());
|
||||
@@ -443,21 +443,21 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
|
||||
DictData harmonicData;
|
||||
//判断是是否传入检测点信息值(电压)
|
||||
if(StrUtil.isBlank(param.getStasisID())&&StrUtil.isBlank(param.getMonitorID())){
|
||||
if (StrUtil.isBlank(param.getStasisID()) && StrUtil.isBlank(param.getMonitorID())) {
|
||||
//指标对象类型
|
||||
List<DictData> indicatorTypeDate = dicDataFeignClient.getDicDataByTypeCode(
|
||||
DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
||||
indicatorTypeDate.sort(Comparator.comparing(data -> data.getSort()));
|
||||
harmonicData =indicatorTypeDate.get(0);
|
||||
}else{
|
||||
harmonicData = indicatorTypeDate.get(0);
|
||||
} else {
|
||||
//获取指标对象(频率偏差)
|
||||
harmonicData= dicDataFeignClient.getDicDataById(
|
||||
harmonicData = dicDataFeignClient.getDicDataById(
|
||||
param.getStasisID()).getData();
|
||||
}
|
||||
|
||||
//初始化指标类型(横向)
|
||||
StatSubstationBizBaseParam baseParam;
|
||||
List<RIconVO> arrayVOList=new ArrayList<>();
|
||||
List<RIconVO> arrayVOList = new ArrayList<>();
|
||||
for (DeptLevelVO deptLevelVO : deptLevelVOList) {
|
||||
//数据库查询
|
||||
baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
@@ -491,13 +491,13 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
RIconVO rIconVO = new RIconVO();
|
||||
rIconVO.setRowName(deptLevelVO.getName());
|
||||
rIconVO.setSort(deptLevelVO.getSort());
|
||||
if(CollUtil.isNotEmpty(list)){
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
rIconVO.setOverLimitMeasurementAccrued(list.get(0).getOverLimitMeasurementAccrued());
|
||||
rIconVO.setOverLimitMeasurementAverage(list.get(0).getOverLimitMeasurementAverage());
|
||||
rIconVO.setOverLimitMeasurementRatioAccrued(list.get(0).getOverLimitMeasurementRatioAccrued());
|
||||
rIconVO.setOverLimitMeasurementRatioAverage(list.get(0).getOverLimitMeasurementRatioAverage());
|
||||
rIconVO.setAverageOverDay(list.get(0).getAverageOverDay());
|
||||
}else{
|
||||
} else {
|
||||
rIconVO.setOverLimitMeasurementAverage(0);
|
||||
rIconVO.setOverLimitMeasurementAccrued(0);
|
||||
rIconVO.setOverLimitMeasurementRatioAverage(0.0F);
|
||||
@@ -512,10 +512,10 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RIconVO> getPwRStatHarmonicOrgYOldIcon(RStatHarmonicMParam param,Integer type) {
|
||||
public List<RIconVO> getPwRStatHarmonicOrgYOldIcon(RStatHarmonicMParam param, Integer type) {
|
||||
//各单位类型
|
||||
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<DeptDTO> deptDTOList= DeptUtil.getDeptSubsetVOList(deptList,param.getId());
|
||||
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
|
||||
|
||||
Map<String, DeptDTO> deptMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, Function.identity()));
|
||||
//获取部门id集合
|
||||
@@ -538,11 +538,11 @@ public class RStatHarmonicOrgYServiceImpl extends ServiceImpl<StatHarmonicOrgYMa
|
||||
Assert.isTrue(
|
||||
CollUtil.isNotEmpty(deptDTOList) || ObjectUtil.isNotNull(harmonicData)
|
||||
, "各单位或者指标类型为空,请检查入参是否准确");
|
||||
DictData dictData ;
|
||||
if(type==1){
|
||||
DictData dictData;
|
||||
if (type == 1) {
|
||||
//获取主网信息
|
||||
dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
|
||||
}else{
|
||||
} else {
|
||||
//获取配网信息
|
||||
dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
|
||||
}
|
||||
|
||||
@@ -60,10 +60,10 @@ public class RStatHarmonicQServiceImpl extends ServiceImpl<RStatHarmonicQMapper,
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicQ> list = rStatHarmonicQMapper.selectInfoList(baseParam,mainnetData.getId());
|
||||
List<RStatHarmonicQ> list = rStatHarmonicQMapper.selectInfoList(baseParam, mainnetData.getId());
|
||||
|
||||
//初始化指标类型(横向)
|
||||
List<RArrayVO> arrayVOList = new ArrayList<>();
|
||||
@@ -100,7 +100,7 @@ public class RStatHarmonicQServiceImpl extends ServiceImpl<RStatHarmonicQMapper,
|
||||
List<RStatHarmonicMVO> b = new ArrayList<>();
|
||||
b.addAll(rm);
|
||||
for (RStatHarmonicQ rStatHarmonicQ : value) {
|
||||
if(interferenceMap.containsKey(rStatHarmonicQ.getMeasurementTypeClass())){
|
||||
if (interferenceMap.containsKey(rStatHarmonicQ.getMeasurementTypeClass())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(rStatHarmonicQ, RStatHarmonicMVO.class);
|
||||
DictData data1 = interferenceMap.get(rStatHarmonicQ.getMeasurementTypeClass());
|
||||
r.setHarmonicName(data1.getName());
|
||||
@@ -152,10 +152,10 @@ public class RStatHarmonicQServiceImpl extends ServiceImpl<RStatHarmonicQMapper,
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicQ> list = rStatHarmonicQMapper.selectInfoList(baseParam,distributionData.getId());
|
||||
List<RStatHarmonicQ> list = rStatHarmonicQMapper.selectInfoList(baseParam, distributionData.getId());
|
||||
|
||||
//根据稳态指标分组
|
||||
Map<String, List<RStatHarmonicQ>> measurementMap = list.stream().collect(Collectors.groupingBy(RStatHarmonicQ::getHarmonicType));
|
||||
@@ -171,7 +171,7 @@ public class RStatHarmonicQServiceImpl extends ServiceImpl<RStatHarmonicQMapper,
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
for (RStatHarmonicQ statHarmonic : value) {
|
||||
if(lineMap.containsKey(statHarmonic.getMeasurementTypeClass())){
|
||||
if (lineMap.containsKey(statHarmonic.getMeasurementTypeClass())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(statHarmonic, RStatHarmonicMVO.class);
|
||||
DictData data1 = lineMap.get(statHarmonic.getMeasurementTypeClass());
|
||||
r.setHarmonicName(data1.getName());
|
||||
|
||||
@@ -16,7 +16,6 @@ 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.RequestUtil;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -30,7 +29,7 @@ import java.util.stream.Collectors;
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author rui.wu
|
||||
* @author wr
|
||||
* @since 2022-10-12
|
||||
*/
|
||||
@Service
|
||||
@@ -60,10 +59,10 @@ public class RStatHarmonicYServiceImpl extends ServiceImpl<RStatHarmonicYMapper,
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicY> list = rStatHarmonicYMapper.selectInfoList(baseParam,mainnetData.getId());
|
||||
List<RStatHarmonicY> list = rStatHarmonicYMapper.selectInfoList(baseParam, mainnetData.getId());
|
||||
|
||||
//初始化指标类型(横向)
|
||||
List<RArrayVO> arrayVOList = new ArrayList<>();
|
||||
@@ -102,7 +101,7 @@ public class RStatHarmonicYServiceImpl extends ServiceImpl<RStatHarmonicYMapper,
|
||||
List<RStatHarmonicMVO> b = new ArrayList<>();
|
||||
b.addAll(rm);
|
||||
for (RStatHarmonicY rStatHarmonicY : value) {
|
||||
if(interferenceMap.containsKey(rStatHarmonicY.getMeasurementTypeClass())){
|
||||
if (interferenceMap.containsKey(rStatHarmonicY.getMeasurementTypeClass())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(rStatHarmonicY, RStatHarmonicMVO.class);
|
||||
DictData data1 = interferenceMap.get(rStatHarmonicY.getMeasurementTypeClass());
|
||||
r.setHarmonicName(data1.getName());
|
||||
@@ -154,16 +153,16 @@ public class RStatHarmonicYServiceImpl extends ServiceImpl<RStatHarmonicYMapper,
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
|
||||
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
|
||||
StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
|
||||
baseParam.setIds(deptIds);
|
||||
//数据库查询
|
||||
List<RStatHarmonicY> list = rStatHarmonicYMapper.selectInfoList(baseParam,distributionData.getId());
|
||||
List<RStatHarmonicY> list = rStatHarmonicYMapper.selectInfoList(baseParam, distributionData.getId());
|
||||
|
||||
//根据稳态指标分组
|
||||
Map<String, List<RStatHarmonicY>> measurementMap = list.stream().collect(Collectors.groupingBy(RStatHarmonicY::getHarmonicType));
|
||||
|
||||
//判断对象是否为空
|
||||
if(CollUtil.isNotEmpty(list)){
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
//重新生成数据结构
|
||||
measurementMap.forEach((key, value) -> {
|
||||
List<RStatHarmonicMVO> eventVO = new ArrayList<>();
|
||||
@@ -173,7 +172,7 @@ public class RStatHarmonicYServiceImpl extends ServiceImpl<RStatHarmonicYMapper,
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
for (RStatHarmonicY statHarmonic : value) {
|
||||
if(lineMap.containsKey(statHarmonic.getMeasurementTypeClass())){
|
||||
if (lineMap.containsKey(statHarmonic.getMeasurementTypeClass())) {
|
||||
RStatHarmonicMVO r = BeanUtil.copyProperties(statHarmonic, RStatHarmonicMVO.class);
|
||||
DictData data1 = lineMap.get(statHarmonic.getMeasurementTypeClass());
|
||||
r.setHarmonicName(data1.getName());
|
||||
|
||||
@@ -82,7 +82,7 @@ public class RStatLoadTypeServiceImpl extends ServiceImpl<RStatLoadTypeMMapper,
|
||||
|
||||
}
|
||||
|
||||
if(CollectionUtil.isNotEmpty(temp)){
|
||||
if (CollectionUtil.isNotEmpty(temp)) {
|
||||
// 匹配单位名称
|
||||
for (DeptDTO dto : data) {
|
||||
for (RStatLoadTypeVO vo : temp) {
|
||||
|
||||
@@ -78,7 +78,7 @@ public class RStatOrgBusbarVoltageServiceImpl extends ServiceImpl<RStatOrgBusbar
|
||||
if (CollectionUtil.isNotEmpty(temp)) {
|
||||
//获取母线集合
|
||||
List<String> busbarIds = temp.stream().map(RStatOrgBusbarVoltageVO::getBusbarId).collect(Collectors.toList());
|
||||
PmsGeneratrixParam generatrixParam=new PmsGeneratrixParam();
|
||||
PmsGeneratrixParam generatrixParam = new PmsGeneratrixParam();
|
||||
generatrixParam.setGeneratrixIds(busbarIds);
|
||||
generatrixParam.setGeneratrixVoltageLevel(param.getIds());
|
||||
List<GeneratrixAndPowerStationDTO> generatrixDTO = pmsGeneratrixClient.getGeneratrixAndPowerStationInfo(generatrixParam).getData();
|
||||
@@ -89,7 +89,7 @@ public class RStatOrgBusbarVoltageServiceImpl extends ServiceImpl<RStatOrgBusbar
|
||||
if (deptMap.containsKey(key)) {
|
||||
DeptDTO deptDTO = deptMap.get(key);
|
||||
value.setOrgName(deptDTO.getName());
|
||||
if(generatrixMap.containsKey(value.getBusbarId())){
|
||||
if (generatrixMap.containsKey(value.getBusbarId())) {
|
||||
GeneratrixAndPowerStationDTO dto = generatrixMap.get(value.getBusbarId());
|
||||
value.setBusbarVoltageLevel(dto.getGeneratrixVoltageLevel());
|
||||
value.setPowerStationName(dto.getPowerName());
|
||||
|
||||
@@ -130,20 +130,20 @@ public class RStatOrgYServiceImpl extends ServiceImpl<RStatOrgYMapper, RStatOrgY
|
||||
switch (param.getType().toString()) {
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
// 获取年区域暂态指标分类统计表
|
||||
temp = rStatOrgYMapper.getYearRStatHarmonicOrgInfo(baseParam,deptIds, mainnetData.getId());
|
||||
temp = rStatOrgYMapper.getYearRStatHarmonicOrgInfo(baseParam, deptIds, mainnetData.getId());
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
// 获取季区域暂态指标分类统计表
|
||||
temp = rStatOrgQMapper.getQuarterRStatHarmonicOrgInfo(baseParam,deptIds, mainnetData.getId());
|
||||
temp = rStatOrgQMapper.getQuarterRStatHarmonicOrgInfo(baseParam, deptIds, mainnetData.getId());
|
||||
break;
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
// 获取月区域暂态指标分类统计表
|
||||
temp = rStatOrgMMapper.getMonthRStatHarmonicOrgInfo(baseParam,deptIds, mainnetData.getId());
|
||||
temp = rStatOrgMMapper.getMonthRStatHarmonicOrgInfo(baseParam, deptIds, mainnetData.getId());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if(CollUtil.isNotEmpty(temp)){
|
||||
if (CollUtil.isNotEmpty(temp)) {
|
||||
Map<String, List<RStatSubstationOrgVO>> map = temp
|
||||
.stream().collect(Collectors.groupingBy(RStatSubstationOrgVO::getOrgNo));
|
||||
map.forEach((key, value) -> {
|
||||
@@ -305,9 +305,9 @@ public class RStatOrgYServiceImpl extends ServiceImpl<RStatOrgYMapper, RStatOrgY
|
||||
List<String> infoIds = new ArrayList<>();
|
||||
Map<String, PmsMonitorDTO> pmsMonitorDTOMap = pmsMonitorDTOS.stream().filter(
|
||||
v -> {
|
||||
if(infoIds.contains(v.getPowerrId())){
|
||||
if (infoIds.contains(v.getPowerrId())) {
|
||||
return false;
|
||||
}else {
|
||||
} else {
|
||||
infoIds.add(v.getPowerrId());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.njcn.harmonic.service.specialanalysis;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.param.PowerQualityParam;
|
||||
import com.njcn.harmonic.pojo.vo.RMpPvPowerDetailVO;
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ public interface RMpWpPowerDetailMService extends IService<RMpWpPowerDetailM> {
|
||||
|
||||
/**
|
||||
* 详细数据表分页查询
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -26,6 +27,7 @@ public interface RMpWpPowerDetailMService extends IService<RMpWpPowerDetailM> {
|
||||
|
||||
/**
|
||||
* 电气化铁路分页查询
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -2,11 +2,15 @@ package com.njcn.harmonic.service.specialanalysis;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.harmonic.pojo.param.OverviewParam;
|
||||
import com.njcn.harmonic.pojo.param.PowerQualityParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatOrgPvPowerQualityQPO;
|
||||
import com.njcn.harmonic.pojo.vo.OverviewVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatOrgPvDetailVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatOrgPvPowerStreamVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分布式光伏_台区电能质量明细
|
||||
*
|
||||
@@ -17,6 +21,7 @@ public interface RStatOrgPvPowerQualityService extends IService<RStatOrgPvPowerQ
|
||||
|
||||
/**
|
||||
* 低功率因数统计分页查询
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -24,8 +29,17 @@ public interface RStatOrgPvPowerQualityService extends IService<RStatOrgPvPowerQ
|
||||
|
||||
/**
|
||||
* 详细数据表分页查询
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Page<RStatOrgPvDetailVO> getPowerQualityInfo(PowerQualityParam.PowerQualityDetailInfoParam param);
|
||||
|
||||
|
||||
/**
|
||||
* 分布式光伏概览-电压问题
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<OverviewVO.GroupVO> getVoltage(OverviewParam param);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,14 +4,12 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
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.pojo.param.PowerQualityParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpPvPowerDetailMPO;
|
||||
import com.njcn.harmonic.pojo.vo.RMpPvPowerDetailVO;
|
||||
import com.njcn.harmonic.pojo.vo.RMpWpPowerDetailVO;
|
||||
import com.njcn.harmonic.service.specialanalysis.DistributedPvVolOverService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -26,7 +26,6 @@ import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -81,47 +81,47 @@ public class RMpWpPowerDetailMServiceImpl extends ServiceImpl<RMpWpPowerDetailMM
|
||||
//查询区域超标统计-年数据
|
||||
case BizParamConstant.STAT_BIZ_YEAR:
|
||||
Page<RMpWpPowerDetailY> pageY = rMpWpPowerDetailYMapper.selectPage(new Page<>(param.getPageNum(), param.getPageSize())
|
||||
,new LambdaQueryWrapper<RMpWpPowerDetailY>()
|
||||
.in(RMpWpPowerDetailY::getMeasurementPointId,monitorIds)
|
||||
.eq(RMpWpPowerDetailY::getMonitorTag,param.getMonitorTag())
|
||||
, new LambdaQueryWrapper<RMpWpPowerDetailY>()
|
||||
.in(RMpWpPowerDetailY::getMeasurementPointId, monitorIds)
|
||||
.eq(RMpWpPowerDetailY::getMonitorTag, param.getMonitorTag())
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RMpWpPowerDetailY::getDataDate, param.getStartTime())
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RMpWpPowerDetailY::getDataDate, param.getEndTime())
|
||||
);
|
||||
List<RMpWpPowerDetailVO> rMpWpPowerDetailVOS = BeanUtil.copyToList(pageY.getRecords(), RMpWpPowerDetailVO.class);
|
||||
page=BeanUtil.copyProperties(pageY,Page.class);
|
||||
page = BeanUtil.copyProperties(pageY, Page.class);
|
||||
page.setRecords(rMpWpPowerDetailVOS);
|
||||
break;
|
||||
//查询区域超标统计-季数据
|
||||
case BizParamConstant.STAT_BIZ_QUARTER:
|
||||
Page<RMpWpPowerDetailQ> pageList = rMpWpPowerDetailQMapper.selectPage(new Page<>(param.getPageNum(), param.getPageSize())
|
||||
,new LambdaQueryWrapper<RMpWpPowerDetailQ>()
|
||||
.in(RMpWpPowerDetailQ::getMeasurementPointId,monitorIds)
|
||||
.eq(RMpWpPowerDetailQ::getMonitorTag,param.getMonitorTag())
|
||||
, new LambdaQueryWrapper<RMpWpPowerDetailQ>()
|
||||
.in(RMpWpPowerDetailQ::getMeasurementPointId, monitorIds)
|
||||
.eq(RMpWpPowerDetailQ::getMonitorTag, param.getMonitorTag())
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RMpWpPowerDetailQ::getDataDate, param.getStartTime())
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RMpWpPowerDetailQ::getDataDate, param.getEndTime())
|
||||
);
|
||||
List<RMpWpPowerDetailVO> rMpWpPowerDetailVOS2 = BeanUtil.copyToList(pageList.getRecords(), RMpWpPowerDetailVO.class);
|
||||
page=BeanUtil.copyProperties(pageList,Page.class);
|
||||
page = BeanUtil.copyProperties(pageList, Page.class);
|
||||
page.setRecords(rMpWpPowerDetailVOS2);
|
||||
break;
|
||||
//查询各区域超标统计-月数据
|
||||
case BizParamConstant.STAT_BIZ_MONTH:
|
||||
Page<RMpWpPowerDetailM> page1= this.page(new Page<>(param.getPageNum(), param.getPageSize())
|
||||
,new LambdaQueryWrapper<RMpWpPowerDetailM>()
|
||||
.in(RMpWpPowerDetailM::getMeasurementPointId,monitorIds)
|
||||
.eq(RMpWpPowerDetailM::getMonitorTag,param.getMonitorTag())
|
||||
Page<RMpWpPowerDetailM> page1 = this.page(new Page<>(param.getPageNum(), param.getPageSize())
|
||||
, new LambdaQueryWrapper<RMpWpPowerDetailM>()
|
||||
.in(RMpWpPowerDetailM::getMeasurementPointId, monitorIds)
|
||||
.eq(RMpWpPowerDetailM::getMonitorTag, param.getMonitorTag())
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RMpWpPowerDetailM::getDataDate, param.getStartTime())
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RMpWpPowerDetailM::getDataDate, param.getEndTime())
|
||||
);
|
||||
List<RMpWpPowerDetailVO> rMpWpPowerDetailVOS3 = BeanUtil.copyToList(page1.getRecords(), RMpWpPowerDetailVO.class);
|
||||
page=BeanUtil.copyProperties(page1,Page.class);
|
||||
page = BeanUtil.copyProperties(page1, Page.class);
|
||||
page.setRecords(rMpWpPowerDetailVOS3);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
page.getRecords().stream().forEach(vo->{
|
||||
if(monitorMap.containsKey(vo.getMeasurementPointId())){
|
||||
page.getRecords().stream().forEach(vo -> {
|
||||
if (monitorMap.containsKey(vo.getMeasurementPointId())) {
|
||||
PmsMonitorDTO monitorDTO = monitorMap.get(vo.getMeasurementPointId());
|
||||
vo.setOrgName(monitorDTO.getOrgName());
|
||||
vo.setMeasurementPointName(monitorDTO.getName());
|
||||
@@ -137,7 +137,7 @@ public class RMpWpPowerDetailMServiceImpl extends ServiceImpl<RMpWpPowerDetailMM
|
||||
List<String> deptIds = deptDTOS.stream().map(Dept::getCode).collect(Collectors.toList());
|
||||
|
||||
//根据部门信息,获取牵引站信息
|
||||
PmsTractionStationParam stationParam=new PmsTractionStationParam();
|
||||
PmsTractionStationParam stationParam = new PmsTractionStationParam();
|
||||
stationParam.setOrgIds(deptIds);
|
||||
List<PmsTractionStationDTO> tractionStationDTOS = tractionStationClient.getPmsTractionStationInfo(stationParam).getData();
|
||||
|
||||
@@ -153,18 +153,18 @@ public class RMpWpPowerDetailMServiceImpl extends ServiceImpl<RMpWpPowerDetailMM
|
||||
);
|
||||
|
||||
List<RMpRailwayTractionDetailVO> newList = BeanUtil.copyToList(oldPage.getRecords(), RMpRailwayTractionDetailVO.class);
|
||||
newList.stream().forEach(vo->{
|
||||
if(dtoMap.containsKey(vo.getTractionStationId())){
|
||||
PmsTractionStationDTO dto = dtoMap.get(vo.getTractionStationId());
|
||||
vo.setOrgName(dto.getOrgName());
|
||||
vo.setRailwayType(dto.getRailwayType());
|
||||
vo.setTractionStationName(dto.getName());
|
||||
vo.setRailwayLineName(dto.getRailwayLineName());
|
||||
vo.setVoltageLevel(dto.getVoltageLevel());
|
||||
vo.setRatedCapacity(dto.getRatedCapacity());
|
||||
}
|
||||
newList.stream().forEach(vo -> {
|
||||
if (dtoMap.containsKey(vo.getTractionStationId())) {
|
||||
PmsTractionStationDTO dto = dtoMap.get(vo.getTractionStationId());
|
||||
vo.setOrgName(dto.getOrgName());
|
||||
vo.setRailwayType(dto.getRailwayType());
|
||||
vo.setTractionStationName(dto.getName());
|
||||
vo.setRailwayLineName(dto.getRailwayLineName());
|
||||
vo.setVoltageLevel(dto.getVoltageLevel());
|
||||
vo.setRatedCapacity(dto.getRatedCapacity());
|
||||
}
|
||||
});
|
||||
Page<RMpRailwayTractionDetailVO> page=BeanUtil.copyProperties(oldPage,Page.class);
|
||||
Page<RMpRailwayTractionDetailVO> page = BeanUtil.copyProperties(oldPage, Page.class);
|
||||
page.setRecords(newList);
|
||||
return page;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
@@ -12,10 +13,14 @@ 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.specialanalysis.*;
|
||||
import com.njcn.harmonic.pojo.param.OverviewParam;
|
||||
import com.njcn.harmonic.pojo.param.PowerQualityParam;
|
||||
import com.njcn.harmonic.pojo.po.RStatOrgPvPowerQualityMPO;
|
||||
import com.njcn.harmonic.pojo.po.RStatOrgPvPowerQualityQPO;
|
||||
import com.njcn.harmonic.pojo.vo.OverviewVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatOrgPvDetailVO;
|
||||
import com.njcn.harmonic.pojo.vo.RStatOrgPvPowerStreamVO;
|
||||
import com.njcn.harmonic.service.specialanalysis.RStatOrgPvPowerQualityMService;
|
||||
import com.njcn.harmonic.service.specialanalysis.RStatOrgPvPowerQualityService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
@@ -46,42 +51,43 @@ public class RStatOrgPvPowerQualityServiceImpl extends ServiceImpl<RStatOrgPvPow
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final PwMonitorClient pwMonitorClient;
|
||||
private final RStatOrgPvPowerQualityMMapper rStatOrgPvPowerQualityMMapper;
|
||||
|
||||
@Override
|
||||
public Page<RStatOrgPvPowerStreamVO> getPowerQualityStream(PowerQualityParam param) {
|
||||
PowerQualityParam.PowerQualityDetailParam bearParam= BeanUtil.copyProperties(param, PowerQualityParam.PowerQualityDetailParam.class);
|
||||
Map<String,String> list=new HashMap<>(3);
|
||||
PowerQualityParam.PowerQualityDetailParam bearParam = BeanUtil.copyProperties(param, PowerQualityParam.PowerQualityDetailParam.class);
|
||||
Map<String, String> list = new HashMap<>(3);
|
||||
List<DictData> dictDataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.AREA_PQ_EVENT_TYPE.getCode()).getData();
|
||||
if(CollectionUtil.isEmpty(dictDataList)){
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "台区电能质量事件类型为空");
|
||||
if (CollectionUtil.isEmpty(dictDataList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "台区电能质量事件类型为空");
|
||||
}
|
||||
//获取部门id集合
|
||||
List<Dept> deptDTOS = deptFeignClient.getDirectSonSelf(param.getId()).getData();
|
||||
if(CollectionUtil.isEmpty(deptDTOS)){
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "获取部门信息为空");
|
||||
if (CollectionUtil.isEmpty(deptDTOS)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "获取部门信息为空");
|
||||
}
|
||||
Map<String, Dept> deptDTOMap = deptDTOS.stream().collect
|
||||
(Collectors.toMap(Dept::getCode, Function.identity(), (key, key2) -> key2));
|
||||
List<String> OrgNOS = deptDTOS.stream().map(Dept::getCode).collect(Collectors.toList());
|
||||
//根据字典Code,取出字典id,拼入sql中
|
||||
dictDataList.stream().forEach(dictData ->{
|
||||
if(DicDataEnum.EVENT_TYPE_L.getCode().equals(dictData.getCode())){
|
||||
list.put("eventTypeL",dictData.getId());
|
||||
}
|
||||
if(DicDataEnum.EVENT_TYPE_P.getCode().equals(dictData.getCode())){
|
||||
Console.log(list);
|
||||
list.put("eventTypeP",dictData.getId());
|
||||
}
|
||||
if(DicDataEnum.EVENT_TYPE_O.getCode().equals(dictData.getCode())){
|
||||
list.put("eventTypeO",dictData.getId());
|
||||
}
|
||||
});
|
||||
dictDataList.stream().forEach(dictData -> {
|
||||
if (DicDataEnum.EVENT_TYPE_L.getCode().equals(dictData.getCode())) {
|
||||
list.put("eventTypeL", dictData.getId());
|
||||
}
|
||||
if (DicDataEnum.EVENT_TYPE_P.getCode().equals(dictData.getCode())) {
|
||||
Console.log(list);
|
||||
list.put("eventTypeP", dictData.getId());
|
||||
}
|
||||
if (DicDataEnum.EVENT_TYPE_O.getCode().equals(dictData.getCode())) {
|
||||
list.put("eventTypeO", dictData.getId());
|
||||
}
|
||||
});
|
||||
bearParam.setMapId(list);
|
||||
bearParam.setOrgNos(OrgNOS);
|
||||
//数据分页查询
|
||||
Page<RStatOrgPvPowerStreamVO> page = rStatOrgPvPowerQualityYPOMapper.selectListPage(new Page<>(param.getPageNum(), param.getPageSize()), bearParam);
|
||||
page.getRecords().stream().forEach(vo->{
|
||||
if(deptDTOMap.containsKey(vo.getOrgNo())){
|
||||
page.getRecords().stream().forEach(vo -> {
|
||||
if (deptDTOMap.containsKey(vo.getOrgNo())) {
|
||||
Dept deptDTO = deptDTOMap.get(vo.getOrgNo());
|
||||
vo.setOrgNo(deptDTO.getName());
|
||||
}
|
||||
@@ -98,7 +104,7 @@ public class RStatOrgPvPowerQualityServiceImpl extends ServiceImpl<RStatOrgPvPow
|
||||
//监测点类别
|
||||
pwPmsMonitorParam.setMonitorSort(param.getMonitorSort());
|
||||
//获取监测点信息
|
||||
PowerQualityParam.PowerQualityDetailParam bearParam= BeanUtil.copyProperties(param, PowerQualityParam.PowerQualityDetailParam.class);
|
||||
PowerQualityParam.PowerQualityDetailParam bearParam = BeanUtil.copyProperties(param, PowerQualityParam.PowerQualityDetailParam.class);
|
||||
List<PwPmsMonitorDTO> pwMonitorList = pwMonitorClient.getPwPhotovoltaicMonitorList(pwPmsMonitorParam).getData();
|
||||
if (CollUtil.isEmpty(pwMonitorList)) {
|
||||
return new Page<>();
|
||||
@@ -112,8 +118,8 @@ public class RStatOrgPvPowerQualityServiceImpl extends ServiceImpl<RStatOrgPvPow
|
||||
bearParam.setOrgNos(monitorIds);
|
||||
//数据库分页查询
|
||||
Page<RStatOrgPvDetailVO> page = rStatOrgPvPowerQualityYPOMapper.selectDetailListPage(new Page<>(param.getPageNum(), param.getPageSize()), bearParam);
|
||||
page.getRecords().stream().forEach(vo->{
|
||||
if(monitorMap.containsKey(vo.getMeasurementPointId())){
|
||||
page.getRecords().stream().forEach(vo -> {
|
||||
if (monitorMap.containsKey(vo.getMeasurementPointId())) {
|
||||
PwPmsMonitorDTO monitorDTO = monitorMap.get(vo.getMeasurementPointId());
|
||||
vo.setOrgNo(monitorDTO.getOrgId());
|
||||
vo.setOrgName(monitorDTO.getOrgName());
|
||||
@@ -124,4 +130,58 @@ public class RStatOrgPvPowerQualityServiceImpl extends ServiceImpl<RStatOrgPvPow
|
||||
});
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OverviewVO.GroupVO> getVoltage(OverviewParam param) {
|
||||
List<OverviewVO.GroupVO> vos=new ArrayList<>();
|
||||
//获取部门信息
|
||||
List<DeptDTO> deptDTOS = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData();
|
||||
|
||||
if(CollectionUtil.isNotEmpty(deptDTOS)){
|
||||
//获取台区电能质量事件类型
|
||||
List<DictData> areaType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.AREA_PQ_EVENT_TYPE.getCode()).getData();
|
||||
if(CollectionUtil.isNotEmpty(deptDTOS)){
|
||||
List<String> typeID=new ArrayList<>();
|
||||
//取出电压相关的字典
|
||||
for (DictData dictData : areaType) {
|
||||
//电压 电压越上限15%以上
|
||||
if(DicDataEnum.EVENT_TYPE_T.getCode().equals(dictData.getCode())){
|
||||
typeID.add(dictData.getId());
|
||||
}
|
||||
//电压 电压越上限7%-15%
|
||||
if(DicDataEnum.EVENT_TYPE_R.getCode().equals(dictData.getCode())){
|
||||
typeID.add(dictData.getId());
|
||||
}
|
||||
//电压 超标3%-10%
|
||||
if(DicDataEnum.EVENT_TYPE_Z.getCode().equals(dictData.getCode())){
|
||||
typeID.add(dictData.getId());
|
||||
}
|
||||
//电压 超标10%以下
|
||||
if(DicDataEnum.EVENT_TYPE_X.getCode().equals(dictData.getCode())){
|
||||
typeID.add(dictData.getId());
|
||||
}
|
||||
|
||||
}
|
||||
//数据库查询
|
||||
List<String> deptCodes = deptDTOS.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
List<OverviewVO.VoltageVO> voltageVOS = rStatOrgPvPowerQualityMMapper.selectVoltage(deptCodes, typeID);
|
||||
if(CollectionUtil.isNotEmpty(voltageVOS)){
|
||||
Map<String, List<OverviewVO.VoltageVO>> voltageMap = voltageVOS.stream().collect(
|
||||
Collectors.groupingBy(OverviewVO.VoltageVO::getMonitoringObject));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user