From 70b1e81dd41428b448a7466f6b49497a87d3780e Mon Sep 17 00:00:00 2001 From: wr <1754607820@qq.com> Date: Thu, 22 Feb 2024 09:52:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=87=E6=A0=87=E5=88=86=E7=B1=BB-=E7=9B=91?= =?UTF-8?q?=E6=B5=8B=E7=82=B9=E5=88=86=E7=B1=BB=E5=8F=AA=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E9=83=A8=E9=97=A8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Impl/RStatEventMServiceImpl.java | 52 +++++++------------ .../Impl/RStatEventQServiceImpl.java | 24 +++------ .../Impl/RStatEventYServiceImpl.java | 19 +++---- .../impl/RStatHarmonicMServiceImpl.java | 46 ++++++---------- .../impl/RStatHarmonicQServiceImpl.java | 20 +++---- .../impl/RStatHarmonicYServiceImpl.java | 21 +++----- 6 files changed, 62 insertions(+), 120 deletions(-) diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/RStatEventMServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/RStatEventMServiceImpl.java index 9cd7d78da..93914b889 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/RStatEventMServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/RStatEventMServiceImpl.java @@ -6,7 +6,6 @@ import cn.hutool.core.date.LocalDateTimeUtil; 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.njcn.common.pojo.param.StatisticsBizBaseParam; 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.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 com.njcn.user.pojo.po.Dept; import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; import org.springframework.stereotype.Service; @@ -70,12 +67,10 @@ public class RStatEventMServiceImpl extends ServiceImpl deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - - StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + //获取当前部门 + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); + StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List list = rStatEventMMapper.selectInfoList(baseParam,mainnetData.getId()); @@ -161,11 +156,9 @@ public class RStatEventMServiceImpl extends ServiceImpl arrayVOList = new ArrayList<>(); //获取当前部门下所有部门信息 - List deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - - StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); + StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List list = rStatEventMMapper.selectInfoList(baseParam,distributionData.getId()); @@ -257,12 +250,10 @@ public class RStatEventMServiceImpl extends ServiceImpl deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - - StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + //获取当前部门 + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); + StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List rStatHarmonicVoltageMS = rStatEventVoltageMMapper .selectInfoList(baseParam,mainnetData.getId(), measurementData.getId(),eventData.getId()); @@ -345,13 +336,10 @@ public class RStatEventMServiceImpl extends ServiceImpl deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - - - StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + //获取当前部门 + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); + StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List rStatHarmonicVoltageMS = rStatEventDMapper .selectInfoList(baseParam,mainnetData.getId(), measurementDate.getId(),harmonicDate.getId()); @@ -430,11 +418,9 @@ public class RStatEventMServiceImpl extends ServiceImpl deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - - StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); + StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List rStatHarmonicVoltageMS = rStatEventDMapper .selectInfoList(baseParam,distributionData.getId(), measurementData.getId(),eventData.getId()); diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/RStatEventQServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/RStatEventQServiceImpl.java index 2f47db996..1e968e07e 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/RStatEventQServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/RStatEventQServiceImpl.java @@ -2,13 +2,11 @@ package com.njcn.event.service.majornetwork.Impl; 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.service.impl.ServiceImpl; import com.njcn.common.pojo.param.StatisticsBizBaseParam; import com.njcn.event.mapper.majornetwork.RStatEventQMapper; import com.njcn.event.pojo.param.StatSubstationBizBaseParam; 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.RStatEventMVO; 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.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 com.njcn.user.pojo.po.Dept; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -58,12 +54,10 @@ public class RStatEventQServiceImpl extends ServiceImpl deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - - StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + //获取当前部门 + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); + StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List list = rStatEventQMapper.selectInfoList(baseParam,mainnetData.getId()); @@ -150,11 +144,9 @@ public class RStatEventQServiceImpl extends ServiceImpl arrayVOList = new ArrayList<>(); //获取当前部门下所有部门信息 - List deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - - StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); + StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List list = rStatEventQMapper.selectInfoList(baseParam,distributionData.getId()); diff --git a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/RStatEventYServiceImpl.java b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/RStatEventYServiceImpl.java index e57c5cbc0..643a89322 100644 --- a/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/RStatEventYServiceImpl.java +++ b/pqs-event/event-boot/src/main/java/com/njcn/event/service/majornetwork/Impl/RStatEventYServiceImpl.java @@ -16,6 +16,7 @@ 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.user.pojo.po.Dept; import com.njcn.web.utils.WebUtil; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -55,12 +56,10 @@ public class RStatEventYServiceImpl extends ServiceImpl deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - - StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + //获取当前部门 + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); + StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List list = rStatEventYMapper.selectInfoList(baseParam,mainnetData.getId()); @@ -147,11 +146,9 @@ public class RStatEventYServiceImpl extends ServiceImpl arrayVOList = new ArrayList<>(); //获取当前部门下所有部门信息 - List deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData(); - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - - StatSubstationBizBaseParam baseParam=BeanUtil.copyProperties(param,StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); + StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List list = rStatEventYMapper.selectInfoList(baseParam,distributionData.getId()); diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/majornetwork/impl/RStatHarmonicMServiceImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/majornetwork/impl/RStatHarmonicMServiceImpl.java index 0732e99f9..0d2c9472e 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/majornetwork/impl/RStatHarmonicMServiceImpl.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/majornetwork/impl/RStatHarmonicMServiceImpl.java @@ -22,14 +22,12 @@ import com.njcn.harmonic.pojo.vo.RIconVO; import com.njcn.harmonic.pojo.vo.RStatHarmonicMVO; import com.njcn.harmonic.service.majornetwork.RStatHarmonicMService; import com.njcn.device.pq.utils.PublicDateUtil; -import com.njcn.harmonic.utils.DeptUtil; import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.enums.DicDataEnum; import com.njcn.system.enums.DicDataTypeEnum; import com.njcn.system.pojo.po.DictData; import com.njcn.user.api.DeptFeignClient; -import com.njcn.user.pojo.dto.DeptDTO; -import com.njcn.web.utils.WebUtil; +import com.njcn.user.pojo.po.Dept; import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; import org.springframework.stereotype.Service; @@ -77,13 +75,10 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); - List deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId()); - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - + //获取当前部门信息 + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List list = rStatHarmonicMMapper.selectInfoList(baseParam, mainnetData.getId()); @@ -199,12 +194,9 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl arrayVOList = new ArrayList<>(); //获取当前部门下所有部门信息 - List deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); - List deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId()); - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List rStatHarmonicVoltageMS = rStatHarmonicVoltageMMapper .selectInfoList(baseParam, mainnetData.getId(), measurementDate.getId(), harmonicDate.getId()); @@ -291,13 +283,10 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); - List deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId()); - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - + //获取当前部门 + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List rStatHarmonicVoltageMS = rStatHarmonicDMapper .selectInfoList(baseParam, mainnetData.getId(), measurementDate.getId(), harmonicDate.getId()); @@ -359,12 +348,10 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl arrayVOList = new ArrayList<>(); //获取当前部门下所有部门信息 - List deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); - List deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId()); - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - + //获取当前部门 + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List list = rStatHarmonicMMapper.selectInfoList(baseParam, distributionData.getId()); @@ -455,13 +442,10 @@ public class RStatHarmonicMServiceImpl extends ServiceImpl deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); - List deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId()); - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - + //获取当前部门 + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List rStatHarmonicVoltageMS = rStatHarmonicDMapper .selectInfoList(baseParam, distributionData.getId(), measurementDate.getId(), harmonicDate.getId()); diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/majornetwork/impl/RStatHarmonicQServiceImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/majornetwork/impl/RStatHarmonicQServiceImpl.java index 85fa8c7c8..1065c0fec 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/majornetwork/impl/RStatHarmonicQServiceImpl.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/majornetwork/impl/RStatHarmonicQServiceImpl.java @@ -10,14 +10,12 @@ import com.njcn.harmonic.pojo.po.RStatHarmonicQ; import com.njcn.harmonic.pojo.vo.RArrayVO; import com.njcn.harmonic.pojo.vo.RStatHarmonicMVO; import com.njcn.harmonic.service.majornetwork.RStatHarmonicQService; -import com.njcn.harmonic.utils.DeptUtil; import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.enums.DicDataEnum; import com.njcn.system.enums.DicDataTypeEnum; import com.njcn.system.pojo.po.DictData; import com.njcn.user.api.DeptFeignClient; -import com.njcn.user.pojo.dto.DeptDTO; -import com.njcn.web.utils.WebUtil; +import com.njcn.user.pojo.po.Dept; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -58,12 +56,9 @@ public class RStatHarmonicQServiceImpl extends ServiceImpl deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); - List deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId()); - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List list = rStatHarmonicQMapper.selectInfoList(baseParam, mainnetData.getId()); @@ -150,13 +145,10 @@ public class RStatHarmonicQServiceImpl extends ServiceImpl arrayVOList = new ArrayList<>(); - //获取当前部门下所有部门信息 - List deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); - List deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId()); - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - + //获取当前部门 + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List list = rStatHarmonicQMapper.selectInfoList(baseParam, distributionData.getId()); diff --git a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/majornetwork/impl/RStatHarmonicYServiceImpl.java b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/majornetwork/impl/RStatHarmonicYServiceImpl.java index 4df438f7e..076bb7c0b 100644 --- a/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/majornetwork/impl/RStatHarmonicYServiceImpl.java +++ b/pqs-harmonic/harmonic-boot/src/main/java/com/njcn/harmonic/service/majornetwork/impl/RStatHarmonicYServiceImpl.java @@ -10,14 +10,12 @@ import com.njcn.harmonic.pojo.po.RStatHarmonicY; import com.njcn.harmonic.pojo.vo.RArrayVO; import com.njcn.harmonic.pojo.vo.RStatHarmonicMVO; import com.njcn.harmonic.service.majornetwork.RStatHarmonicYService; -import com.njcn.harmonic.utils.DeptUtil; import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.enums.DicDataEnum; import com.njcn.system.enums.DicDataTypeEnum; import com.njcn.system.pojo.po.DictData; import com.njcn.user.api.DeptFeignClient; -import com.njcn.user.pojo.dto.DeptDTO; -import com.njcn.web.utils.WebUtil; +import com.njcn.user.pojo.po.Dept; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -57,13 +55,9 @@ public class RStatHarmonicYServiceImpl extends ServiceImpl deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); - List deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId()); - - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List list = rStatHarmonicYMapper.selectInfoList(baseParam, mainnetData.getId()); @@ -152,13 +146,10 @@ public class RStatHarmonicYServiceImpl extends ServiceImpl arrayVOList = new ArrayList<>(); - //获取当前部门下所有部门信息 - List deptList = deptFeignClient.getDeptDescendantIndexes(param.getId(), WebUtil.filterDeptType()).getData(); - List deptDTOList = DeptUtil.getDeptSubsetVOList(deptList, param.getId()); - List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - + //获取当前部门 + Dept dept = deptFeignClient.getDeptById(param.getId()).getData(); StatSubstationBizBaseParam baseParam = BeanUtil.copyProperties(param, StatSubstationBizBaseParam.class); - baseParam.setIds(deptIds); + baseParam.setIds(Collections.singletonList(dept.getCode())); //数据库查询 List list = rStatHarmonicYMapper.selectInfoList(baseParam, distributionData.getId());