指标分类-监测点分类只统计当前部门信息

This commit is contained in:
wr
2024-02-22 09:52:33 +08:00
parent 4b75070d07
commit 70b1e81dd4
6 changed files with 62 additions and 120 deletions

View File

@@ -6,7 +6,6 @@ import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.param.StatisticsBizBaseParam; import com.njcn.common.pojo.param.StatisticsBizBaseParam;
import com.njcn.event.mapper.majornetwork.RStatEventDMapper; import com.njcn.event.mapper.majornetwork.RStatEventDMapper;
@@ -23,9 +22,7 @@ import com.njcn.system.enums.DicDataEnum;
import com.njcn.system.enums.DicDataTypeEnum; import com.njcn.system.enums.DicDataTypeEnum;
import com.njcn.system.pojo.po.DictData; import com.njcn.system.pojo.po.DictData;
import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.pojo.dto.DeptDTO; import com.njcn.user.pojo.po.Dept;
import com.njcn.web.utils.RequestUtil;
import com.njcn.web.utils.WebUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -70,12 +67,10 @@ public class RStatEventMServiceImpl extends ServiceImpl<RStatEventMMapper, RStat
//获取主网id信息 //获取主网id信息
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData(); DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
//获取当前部门下所有部门信息 //获取当前部门
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
baseParam.setIds(Collections.singletonList(dept.getCode()));
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
baseParam.setIds(deptIds);
//数据库查询 //数据库查询
List<RStatEventM> list = rStatEventMMapper.selectInfoList(baseParam,mainnetData.getId()); List<RStatEventM> list = rStatEventMMapper.selectInfoList(baseParam,mainnetData.getId());
@@ -161,11 +156,9 @@ public class RStatEventMServiceImpl extends ServiceImpl<RStatEventMMapper, RStat
List<RArrayVO> arrayVOList = new ArrayList<>(); List<RArrayVO> arrayVOList = new ArrayList<>();
//获取当前部门下所有部门信息 //获取当前部门下所有部门信息
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
baseParam.setIds(Collections.singletonList(dept.getCode()));
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
baseParam.setIds(deptIds);
//数据库查询 //数据库查询
List<RStatEventM> list = rStatEventMMapper.selectInfoList(baseParam,distributionData.getId()); List<RStatEventM> list = rStatEventMMapper.selectInfoList(baseParam,distributionData.getId());
@@ -257,12 +250,10 @@ public class RStatEventMServiceImpl extends ServiceImpl<RStatEventMMapper, RStat
//获取主网id信息 //获取主网id信息
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData(); DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
//获取当前部门下所有部门信息 //获取当前部门
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
baseParam.setIds(Collections.singletonList(dept.getCode()));
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
baseParam.setIds(deptIds);
//数据库查询 //数据库查询
List<RStatEventVoltageM> rStatHarmonicVoltageMS = rStatEventVoltageMMapper List<RStatEventVoltageM> rStatHarmonicVoltageMS = rStatEventVoltageMMapper
.selectInfoList(baseParam,mainnetData.getId(), measurementData.getId(),eventData.getId()); .selectInfoList(baseParam,mainnetData.getId(), measurementData.getId(),eventData.getId());
@@ -345,13 +336,10 @@ public class RStatEventMServiceImpl extends ServiceImpl<RStatEventMMapper, RStat
//获取主网id信息 //获取主网id信息
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData(); DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
//获取当前部门下所有部门信息 //获取当前部门
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
baseParam.setIds(Collections.singletonList(dept.getCode()));
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
baseParam.setIds(deptIds);
//数据库查询 //数据库查询
List<RStatEventD> rStatHarmonicVoltageMS = rStatEventDMapper List<RStatEventD> rStatHarmonicVoltageMS = rStatEventDMapper
.selectInfoList(baseParam,mainnetData.getId(), measurementDate.getId(),harmonicDate.getId()); .selectInfoList(baseParam,mainnetData.getId(), measurementDate.getId(),harmonicDate.getId());
@@ -430,11 +418,9 @@ public class RStatEventMServiceImpl extends ServiceImpl<RStatEventMMapper, RStat
//获取配网信息 //获取配网信息
DictData distributionData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData(); DictData distributionData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
//获取当前部门下所有部门信息 //获取当前部门下所有部门信息
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
baseParam.setIds(Collections.singletonList(dept.getCode()));
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
baseParam.setIds(deptIds);
//数据库查询 //数据库查询
List<RStatEventD> rStatHarmonicVoltageMS = rStatEventDMapper List<RStatEventD> rStatHarmonicVoltageMS = rStatEventDMapper
.selectInfoList(baseParam,distributionData.getId(), measurementData.getId(),eventData.getId()); .selectInfoList(baseParam,distributionData.getId(), measurementData.getId(),eventData.getId());

View File

@@ -2,13 +2,11 @@ package com.njcn.event.service.majornetwork.Impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.param.StatisticsBizBaseParam; import com.njcn.common.pojo.param.StatisticsBizBaseParam;
import com.njcn.event.mapper.majornetwork.RStatEventQMapper; import com.njcn.event.mapper.majornetwork.RStatEventQMapper;
import com.njcn.event.pojo.param.StatSubstationBizBaseParam; import com.njcn.event.pojo.param.StatSubstationBizBaseParam;
import com.njcn.event.pojo.po.RStatEventQ; import com.njcn.event.pojo.po.RStatEventQ;
import com.njcn.event.pojo.po.RStatEventY;
import com.njcn.event.pojo.vo.RArrayVO; import com.njcn.event.pojo.vo.RArrayVO;
import com.njcn.event.pojo.vo.RStatEventMVO; import com.njcn.event.pojo.vo.RStatEventMVO;
import com.njcn.event.service.majornetwork.RStatEventQService; import com.njcn.event.service.majornetwork.RStatEventQService;
@@ -17,9 +15,7 @@ import com.njcn.system.enums.DicDataEnum;
import com.njcn.system.enums.DicDataTypeEnum; import com.njcn.system.enums.DicDataTypeEnum;
import com.njcn.system.pojo.po.DictData; import com.njcn.system.pojo.po.DictData;
import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.pojo.dto.DeptDTO; import com.njcn.user.pojo.po.Dept;
import com.njcn.web.utils.RequestUtil;
import com.njcn.web.utils.WebUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -58,12 +54,10 @@ public class RStatEventQServiceImpl extends ServiceImpl<RStatEventQMapper, RStat
//获取主网id信息 //获取主网id信息
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData(); DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
//获取当前部门下所有部门信息 //获取当前部门
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
baseParam.setIds(Collections.singletonList(dept.getCode()));
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
baseParam.setIds(deptIds);
//数据库查询 //数据库查询
List<RStatEventQ> list = rStatEventQMapper.selectInfoList(baseParam,mainnetData.getId()); List<RStatEventQ> list = rStatEventQMapper.selectInfoList(baseParam,mainnetData.getId());
@@ -150,11 +144,9 @@ public class RStatEventQServiceImpl extends ServiceImpl<RStatEventQMapper, RStat
List<RArrayVO> arrayVOList = new ArrayList<>(); List<RArrayVO> arrayVOList = new ArrayList<>();
//获取当前部门下所有部门信息 //获取当前部门下所有部门信息
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
baseParam.setIds(Collections.singletonList(dept.getCode()));
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
baseParam.setIds(deptIds);
//数据库查询 //数据库查询
List<RStatEventQ> list = rStatEventQMapper.selectInfoList(baseParam,distributionData.getId()); List<RStatEventQ> list = rStatEventQMapper.selectInfoList(baseParam,distributionData.getId());

View File

@@ -16,6 +16,7 @@ import com.njcn.system.enums.DicDataTypeEnum;
import com.njcn.system.pojo.po.DictData; import com.njcn.system.pojo.po.DictData;
import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.pojo.dto.DeptDTO; import com.njcn.user.pojo.dto.DeptDTO;
import com.njcn.user.pojo.po.Dept;
import com.njcn.web.utils.WebUtil; import com.njcn.web.utils.WebUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -55,12 +56,10 @@ public class RStatEventYServiceImpl extends ServiceImpl<RStatEventYMapper, RStat
//获取主网id信息 //获取主网id信息
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData(); DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
//获取当前部门下所有部门信息 //获取当前部门
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
baseParam.setIds(Collections.singletonList(dept.getCode()));
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
baseParam.setIds(deptIds);
//数据库查询 //数据库查询
List<RStatEventY> list = rStatEventYMapper.selectInfoList(baseParam,mainnetData.getId()); List<RStatEventY> list = rStatEventYMapper.selectInfoList(baseParam,mainnetData.getId());
@@ -147,11 +146,9 @@ public class RStatEventYServiceImpl extends ServiceImpl<RStatEventYMapper, RStat
List<RArrayVO> arrayVOList = new ArrayList<>(); List<RArrayVO> arrayVOList = new ArrayList<>();
//获取当前部门下所有部门信息 //获取当前部门下所有部门信息
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class);
baseParam.setIds(Collections.singletonList(dept.getCode()));
StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class);
baseParam.setIds(deptIds);
//数据库查询 //数据库查询
List<RStatEventY> list = rStatEventYMapper.selectInfoList(baseParam,distributionData.getId()); List<RStatEventY> list = rStatEventYMapper.selectInfoList(baseParam,distributionData.getId());

View File

@@ -22,14 +22,12 @@ import com.njcn.harmonic.pojo.vo.RIconVO;
import com.njcn.harmonic.pojo.vo.RStatHarmonicMVO; import com.njcn.harmonic.pojo.vo.RStatHarmonicMVO;
import com.njcn.harmonic.service.majornetwork.RStatHarmonicMService; import com.njcn.harmonic.service.majornetwork.RStatHarmonicMService;
import com.njcn.device.pq.utils.PublicDateUtil; import com.njcn.device.pq.utils.PublicDateUtil;
import com.njcn.harmonic.utils.DeptUtil;
import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.enums.DicDataEnum; import com.njcn.system.enums.DicDataEnum;
import com.njcn.system.enums.DicDataTypeEnum; import com.njcn.system.enums.DicDataTypeEnum;
import com.njcn.system.pojo.po.DictData; import com.njcn.system.pojo.po.DictData;
import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.pojo.dto.DeptDTO; import com.njcn.user.pojo.po.Dept;
import com.njcn.web.utils.WebUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -77,13 +75,10 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData(); DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
//获取当前部门下所有部门信息 //获取当前部门信息
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
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); baseParam.setIds(Collections.singletonList(dept.getCode()));
//数据库查询 //数据库查询
List<RStatHarmonicM> list = rStatHarmonicMMapper.selectInfoList(baseParam, mainnetData.getId()); List<RStatHarmonicM> list = rStatHarmonicMMapper.selectInfoList(baseParam, mainnetData.getId());
@@ -199,12 +194,9 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
List<RIconVO> arrayVOList = new ArrayList<>(); List<RIconVO> arrayVOList = new ArrayList<>();
//获取当前部门下所有部门信息 //获取当前部门下所有部门信息
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
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); baseParam.setIds(Collections.singletonList(dept.getCode()));
//数据库查询 //数据库查询
List<RStatHarmonicVoltageM> rStatHarmonicVoltageMS = rStatHarmonicVoltageMMapper List<RStatHarmonicVoltageM> rStatHarmonicVoltageMS = rStatHarmonicVoltageMMapper
.selectInfoList(baseParam, mainnetData.getId(), measurementDate.getId(), harmonicDate.getId()); .selectInfoList(baseParam, mainnetData.getId(), measurementDate.getId(), harmonicDate.getId());
@@ -291,13 +283,10 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
//获取主网id信息 //获取主网id信息
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData(); DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
//获取当前部门下所有部门信息 //获取当前部门
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
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); baseParam.setIds(Collections.singletonList(dept.getCode()));
//数据库查询 //数据库查询
List<RStatHarmonicD> rStatHarmonicVoltageMS = rStatHarmonicDMapper List<RStatHarmonicD> rStatHarmonicVoltageMS = rStatHarmonicDMapper
.selectInfoList(baseParam, mainnetData.getId(), measurementDate.getId(), harmonicDate.getId()); .selectInfoList(baseParam, mainnetData.getId(), measurementDate.getId(), harmonicDate.getId());
@@ -359,12 +348,10 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
List<RArrayVO> arrayVOList = new ArrayList<>(); List<RArrayVO> arrayVOList = new ArrayList<>();
//获取当前部门下所有部门信息 //获取当前部门下所有部门信息
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); //获取当前部门
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId()); Dept dept = deptFeignClient.getDeptById(param.getId()).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); baseParam.setIds(Collections.singletonList(dept.getCode()));
//数据库查询 //数据库查询
List<RStatHarmonicM> list = rStatHarmonicMMapper.selectInfoList(baseParam, distributionData.getId()); List<RStatHarmonicM> list = rStatHarmonicMMapper.selectInfoList(baseParam, distributionData.getId());
@@ -455,13 +442,10 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl<RStatHarmonicMMapper,
//获取配网信息 //获取配网信息
DictData distributionData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData(); DictData distributionData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
//获取当前部门下所有部门信息 //获取当前部门
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
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); baseParam.setIds(Collections.singletonList(dept.getCode()));
//数据库查询 //数据库查询
List<RStatHarmonicD> rStatHarmonicVoltageMS = rStatHarmonicDMapper List<RStatHarmonicD> rStatHarmonicVoltageMS = rStatHarmonicDMapper
.selectInfoList(baseParam, distributionData.getId(), measurementDate.getId(), harmonicDate.getId()); .selectInfoList(baseParam, distributionData.getId(), measurementDate.getId(), harmonicDate.getId());

View File

@@ -10,14 +10,12 @@ import com.njcn.harmonic.pojo.po.RStatHarmonicQ;
import com.njcn.harmonic.pojo.vo.RArrayVO; import com.njcn.harmonic.pojo.vo.RArrayVO;
import com.njcn.harmonic.pojo.vo.RStatHarmonicMVO; import com.njcn.harmonic.pojo.vo.RStatHarmonicMVO;
import com.njcn.harmonic.service.majornetwork.RStatHarmonicQService; import com.njcn.harmonic.service.majornetwork.RStatHarmonicQService;
import com.njcn.harmonic.utils.DeptUtil;
import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.enums.DicDataEnum; import com.njcn.system.enums.DicDataEnum;
import com.njcn.system.enums.DicDataTypeEnum; import com.njcn.system.enums.DicDataTypeEnum;
import com.njcn.system.pojo.po.DictData; import com.njcn.system.pojo.po.DictData;
import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.pojo.dto.DeptDTO; import com.njcn.user.pojo.po.Dept;
import com.njcn.web.utils.WebUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -58,12 +56,9 @@ public class RStatHarmonicQServiceImpl extends ServiceImpl<RStatHarmonicQMapper,
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData(); DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
//获取当前部门下所有部门信息 //获取当前部门下所有部门信息
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
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); baseParam.setIds(Collections.singletonList(dept.getCode()));
//数据库查询 //数据库查询
List<RStatHarmonicQ> list = rStatHarmonicQMapper.selectInfoList(baseParam, mainnetData.getId()); List<RStatHarmonicQ> list = rStatHarmonicQMapper.selectInfoList(baseParam, mainnetData.getId());
@@ -150,13 +145,10 @@ public class RStatHarmonicQServiceImpl extends ServiceImpl<RStatHarmonicQMapper,
DictData distributionData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData(); DictData distributionData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
//初始化指标类型(横向) //初始化指标类型(横向)
List<RArrayVO> arrayVOList = new ArrayList<>(); List<RArrayVO> arrayVOList = new ArrayList<>();
//获取当前部门下所有部门信息 //获取当前部门
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
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); baseParam.setIds(Collections.singletonList(dept.getCode()));
//数据库查询 //数据库查询
List<RStatHarmonicQ> list = rStatHarmonicQMapper.selectInfoList(baseParam, distributionData.getId()); List<RStatHarmonicQ> list = rStatHarmonicQMapper.selectInfoList(baseParam, distributionData.getId());

View File

@@ -10,14 +10,12 @@ import com.njcn.harmonic.pojo.po.RStatHarmonicY;
import com.njcn.harmonic.pojo.vo.RArrayVO; import com.njcn.harmonic.pojo.vo.RArrayVO;
import com.njcn.harmonic.pojo.vo.RStatHarmonicMVO; import com.njcn.harmonic.pojo.vo.RStatHarmonicMVO;
import com.njcn.harmonic.service.majornetwork.RStatHarmonicYService; import com.njcn.harmonic.service.majornetwork.RStatHarmonicYService;
import com.njcn.harmonic.utils.DeptUtil;
import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.enums.DicDataEnum; import com.njcn.system.enums.DicDataEnum;
import com.njcn.system.enums.DicDataTypeEnum; import com.njcn.system.enums.DicDataTypeEnum;
import com.njcn.system.pojo.po.DictData; import com.njcn.system.pojo.po.DictData;
import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.pojo.dto.DeptDTO; import com.njcn.user.pojo.po.Dept;
import com.njcn.web.utils.WebUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -57,13 +55,9 @@ public class RStatHarmonicYServiceImpl extends ServiceImpl<RStatHarmonicYMapper,
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData(); DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
//获取当前部门下所有部门信息 //获取当前部门下所有部门信息
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
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); baseParam.setIds(Collections.singletonList(dept.getCode()));
//数据库查询 //数据库查询
List<RStatHarmonicY> list = rStatHarmonicYMapper.selectInfoList(baseParam, mainnetData.getId()); List<RStatHarmonicY> list = rStatHarmonicYMapper.selectInfoList(baseParam, mainnetData.getId());
@@ -152,13 +146,10 @@ public class RStatHarmonicYServiceImpl extends ServiceImpl<RStatHarmonicYMapper,
//初始化指标类型(横向) //初始化指标类型(横向)
List<RArrayVO> arrayVOList = new ArrayList<>(); List<RArrayVO> arrayVOList = new ArrayList<>();
//获取当前部门下所有部门信息 //获取当前部门
List<DeptDTO> deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
List<DeptDTO> deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId());
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); baseParam.setIds(Collections.singletonList(dept.getCode()));
//数据库查询 //数据库查询
List<RStatHarmonicY> list = rStatHarmonicYMapper.selectInfoList(baseParam, distributionData.getId()); List<RStatHarmonicY> list = rStatHarmonicYMapper.selectInfoList(baseParam, distributionData.getId());