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

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.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<RStatEventMMapper, RStat
//获取主网id信息
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
//获取当前部门下所有部门信息
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData();
List<String> 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<RStatEventM> list = rStatEventMMapper.selectInfoList(baseParam,mainnetData.getId());
@@ -161,11 +156,9 @@ public class RStatEventMServiceImpl extends ServiceImpl<RStatEventMMapper, RStat
List<RArrayVO> arrayVOList = new ArrayList<>();
//获取当前部门下所有部门信息
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData();
List<String> 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<RStatEventM> list = rStatEventMMapper.selectInfoList(baseParam,distributionData.getId());
@@ -257,12 +250,10 @@ public class RStatEventMServiceImpl extends ServiceImpl<RStatEventMMapper, RStat
//获取主网id信息
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
//获取当前部门下所有部门信息
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData();
List<String> 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<RStatEventVoltageM> rStatHarmonicVoltageMS = rStatEventVoltageMMapper
.selectInfoList(baseParam,mainnetData.getId(), measurementData.getId(),eventData.getId());
@@ -345,13 +336,10 @@ public class RStatEventMServiceImpl extends ServiceImpl<RStatEventMMapper, RStat
//获取主网id信息
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
//获取当前部门下所有部门信息
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData();
List<String> 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<RStatEventD> rStatHarmonicVoltageMS = rStatEventDMapper
.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();
//获取当前部门下所有部门信息
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData();
List<String> 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<RStatEventD> rStatHarmonicVoltageMS = rStatEventDMapper
.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.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<RStatEventQMapper, RStat
//获取主网id信息
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
//获取当前部门下所有部门信息
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData();
List<String> 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<RStatEventQ> list = rStatEventQMapper.selectInfoList(baseParam,mainnetData.getId());
@@ -150,11 +144,9 @@ public class RStatEventQServiceImpl extends ServiceImpl<RStatEventQMapper, RStat
List<RArrayVO> arrayVOList = new ArrayList<>();
//获取当前部门下所有部门信息
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData();
List<String> 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<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.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<RStatEventYMapper, RStat
//获取主网id信息
DictData mainnetData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
//获取当前部门下所有部门信息
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData();
List<String> 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<RStatEventY> list = rStatEventYMapper.selectInfoList(baseParam,mainnetData.getId());
@@ -147,11 +146,9 @@ public class RStatEventYServiceImpl extends ServiceImpl<RStatEventYMapper, RStat
List<RArrayVO> arrayVOList = new ArrayList<>();
//获取当前部门下所有部门信息
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData();
List<String> 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<RStatEventY> list = rStatEventYMapper.selectInfoList(baseParam,distributionData.getId());