package com.njcn.harmonic.service.dim.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.harmonic.mapper.dim.*;
import com.njcn.harmonic.pojo.param.DimGlobalDataParam;
import com.njcn.harmonic.pojo.po.dim.*;
import com.njcn.harmonic.pojo.vo.DimGlobalDataStandVO;
import com.njcn.harmonic.pojo.vo.DimGlobalDataVO;
import com.njcn.harmonic.service.dim.DimGlobalDealService;
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.user.pojo.po.Dept;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * pqs
 *
 * @author cdf
 * @date 2023/11/27
 */
@Service
@RequiredArgsConstructor
public class DimGlobalDealServiceImpl implements DimGlobalDealService {

    private final DeptFeignClient deptFeignClient;
    private final DicDataFeignClient dicDataFeignClient;

    private final RDimBusGlobalDMapper rDimBusGlobalDMapper;
    private final RDimBusGlobalMMapper rDimBusGlobalMMapper;
    private final RDimBusGlobalYMapper rDimBusGlobalYMapper;

    private final RDimMonitorRateYMapper rDimMonitorRateYMapper;
    private final RDimMonitorRateMMapper rDimMonitorRateMMapper;
    private final RDimMonitorRateDMapper rDimMonitorRateDMapper;


    private final RDimBusTargetYPOMapper rDimBusTargetYPOMapper;
    private final RDimBusTargetMPOMapper rDimBusTargetMPOMapper;
    private final RDimBusTargetDPOMapper rDimBusTargetDPOMapper;


    private final RDimStationTargetYMapper rDimStationTargetYMapper;
    private final RDimStationTargetMMapper rDimStationTargetMMapper;
    private final RDimStationTargetDMapper rDimStationTargetDMapper;

    private final RDimBusStationEventYMapper rDimBusStationEventYMapper;
    private final RDimBusStationEventMMapper rDimBusStationEventMMapper;
    private final RDimBusStationEventDMapper rDimBusStationEventDMapper;


    private final RDimObjGlobalYMapper rDimObjGlobalYMapper;
    private final RDimObjGlobalMMapper rDimObjGlobalMMapper;
    private final RDimObjGlobalDMapper rDimObjGlobalDMapper;


    private final RDimObjRateYMapper rDimObjRateYMapper;
    private final RDimObjRateMMapper rDimObjRateMMapper;
    private final RDimObjRateDMapper rDimObjRateDMapper;


    private final RDimObjTargetYMapper rDimObjTargetYMapper;
    private final RDimObjTargetMMapper rDimObjTargetMMapper;
    private final RDimObjTargetDMapper rDimObjTargetDMapper;

    private final RDimObjEventYMapper rDimObjEventYMapper;
    private final RDimObjEventMMapper rDimObjEventMMapper;
    private final RDimObjEventDMapper rDimObjEventDMapper;


    private final RDimVoltageYMapper rDimVoltageYMapper;
    private final RDimVoltageMMapper rDimVoltageMMapper;
    private final RDimVoltageDMapper rDimVoltageDMapper;


    @Override
    public List<DimGlobalDataVO> dealGlobalData(DimGlobalDataParam dimGlobalDataParam) {
        List<DimGlobalDataVO> resultList = new ArrayList<>();
        Dept dept = deptFeignClient.getDeptByCode(dimGlobalDataParam.getOrgId()).getData();
        List<DeptDTO> deptList = deptFeignClient.getDepSonDetailByDeptId(dept.getId()).getData();
        List<String> deptCodeIds = deptList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
        List<DictData> dicList = new ArrayList<>();
        List<DictData> dicSecondList = new ArrayList<>();

        switch (dimGlobalDataParam.getType()) {
            case 1:
                //母线监测率（%）
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimMonitorRateY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimMonitorRateY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimMonitorRateY::getOrgId, deptCodeIds);
                        List<RDimMonitorRateY> yList = rDimMonitorRateYMapper.selectList(lambdaQueryWrapperY);
                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimMonitorRateY> mapY = yList.stream().collect(Collectors.toMap(RDimMonitorRateY::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapY.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getBusMonitorRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgId(d.getCode());
                                dimGlobalDataVO.setOrgName(d.getName());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimMonitorRateM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimMonitorRateM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimMonitorRateM::getOrgId, deptCodeIds);
                        List<RDimMonitorRateM> mList = rDimMonitorRateMMapper.selectList(lambdaQueryWrapperM);
                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimMonitorRateM> mapM = mList.stream().collect(Collectors.toMap(RDimMonitorRateM::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapM.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getBusMonitorRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimMonitorRateD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimMonitorRateD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimMonitorRateD::getOrgId, deptCodeIds);
                        List<RDimMonitorRateD> dList = rDimMonitorRateDMapper.selectList(lambdaQueryWrapperD);
                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimMonitorRateD> mapD = dList.stream().collect(Collectors.toMap(RDimMonitorRateD::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapD.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getBusMonitorRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                }
                break;
            case 2:
                //变电站/换流站监测率（%）
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimMonitorRateY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimMonitorRateY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimMonitorRateY::getOrgId, deptCodeIds);
                        List<RDimMonitorRateY> yList = rDimMonitorRateYMapper.selectList(lambdaQueryWrapperY);


                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimMonitorRateY> mapY = yList.stream().collect(Collectors.toMap(RDimMonitorRateY::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapY.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getStationMonitorRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimMonitorRateM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimMonitorRateM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimMonitorRateM::getOrgId, deptCodeIds);
                        List<RDimMonitorRateM> mList = rDimMonitorRateMMapper.selectList(lambdaQueryWrapperM);
                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimMonitorRateM> mapM = mList.stream().collect(Collectors.toMap(RDimMonitorRateM::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapM.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getBusMonitorRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimMonitorRateD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimMonitorRateD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimMonitorRateD::getOrgId, deptCodeIds);
                        List<RDimMonitorRateD> dList = rDimMonitorRateDMapper.selectList(lambdaQueryWrapperD);
                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimMonitorRateD> mapD = dList.stream().collect(Collectors.toMap(RDimMonitorRateD::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapD.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getBusMonitorRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                }
                break;
            case 3:
                //稳态指标超标或监测到暂态指标的变电站/换流站占比（%)
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimBusGlobalY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimBusGlobalY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusGlobalY::getOrgId, deptCodeIds);
                        List<RDimBusGlobalY> yList = rDimBusGlobalYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimBusGlobalY> mapY = yList.stream().collect(Collectors.toMap(RDimBusGlobalY::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapY.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimBusGlobalM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimBusGlobalM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusGlobalM::getOrgId, deptCodeIds);
                        List<RDimBusGlobalM> mList = rDimBusGlobalMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimBusGlobalM> mapM = mList.stream().collect(Collectors.toMap(RDimBusGlobalM::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapM.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimBusGlobalD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimBusGlobalD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusGlobalD::getOrgId, deptCodeIds);
                        List<RDimBusGlobalD> dList = rDimBusGlobalDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimBusGlobalD> mapD = dList.stream().collect(Collectors.toMap(RDimBusGlobalD::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapD.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                }
                break;
            case 4:
                //稳态指标超标或监测到暂态指标的变电站/换流站母线占比（%）
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimBusGlobalY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimBusGlobalY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusGlobalY::getOrgId, deptCodeIds);
                        List<RDimBusGlobalY> yList = rDimBusGlobalYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimBusGlobalY> mapY = yList.stream().collect(Collectors.toMap(RDimBusGlobalY::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapY.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getStationLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimBusGlobalM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimBusGlobalM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusGlobalM::getOrgId, deptCodeIds);
                        List<RDimBusGlobalM> mList = rDimBusGlobalMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimBusGlobalM> mapM = mList.stream().collect(Collectors.toMap(RDimBusGlobalM::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapM.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getStationLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimBusGlobalD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimBusGlobalD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusGlobalD::getOrgId, deptCodeIds);
                        List<RDimBusGlobalD> dList = rDimBusGlobalDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimBusGlobalD> mapD = dList.stream().collect(Collectors.toMap(RDimBusGlobalD::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapD.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getStationLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                }
                break;
            case 5:
                //稳态指标超标或监测到暂态指标的变电站/换流站平均占比（%）
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimBusGlobalY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimBusGlobalY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusGlobalY::getOrgId, deptCodeIds);
                        List<RDimBusGlobalY> yList = rDimBusGlobalYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimBusGlobalY> mapY = yList.stream().collect(Collectors.toMap(RDimBusGlobalY::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapY.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getStationLimitAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimBusGlobalM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimBusGlobalM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusGlobalM::getOrgId, deptCodeIds);
                        List<RDimBusGlobalM> mList = rDimBusGlobalMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimBusGlobalM> mapM = mList.stream().collect(Collectors.toMap(RDimBusGlobalM::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapM.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getStationLimitAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimBusGlobalD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimBusGlobalD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusGlobalD::getOrgId, deptCodeIds);
                        List<RDimBusGlobalD> dList = rDimBusGlobalDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimBusGlobalD> mapD = dList.stream().collect(Collectors.toMap(RDimBusGlobalD::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapD.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getStationLimitAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                }
                break;
            case 6:
                //稳态指标超标或监测到暂态指标的变电站/换流站母线平均占比（%）
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimBusGlobalY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimBusGlobalY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusGlobalY::getOrgId, deptCodeIds);
                        List<RDimBusGlobalY> yList = rDimBusGlobalYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimBusGlobalY> mapY = yList.stream().collect(Collectors.toMap(RDimBusGlobalY::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapY.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimBusGlobalM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimBusGlobalM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusGlobalM::getOrgId, deptCodeIds);
                        List<RDimBusGlobalM> mList = rDimBusGlobalMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimBusGlobalM> mapM = mList.stream().collect(Collectors.toMap(RDimBusGlobalM::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapM.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimBusGlobalD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimBusGlobalD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusGlobalD::getOrgId, deptCodeIds);
                        List<RDimBusGlobalD> dList = rDimBusGlobalDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimBusGlobalD> mapD = dList.stream().collect(Collectors.toMap(RDimBusGlobalD::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapD.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                }
                break;

            case 7:
                //母线**指标超标占比（%）
                if (StrUtil.isNotBlank(dimGlobalDataParam.getTargetType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getTargetType()).getData();
                    dicList.add(dictData);
                } else {
                    //查询全部指标
                    dicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
                    dicList = dicList.stream().filter(item -> item.getCode().equals(DicDataEnum.VOLTAGE_DEV.getCode()) || item.getCode().equals(DicDataEnum.THD_V.getCode()) || item.getCode().equals(DicDataEnum.phase_Voltage.getCode()) || item.getCode().equals(DicDataEnum.FLICKER.getCode())).collect(Collectors.toList());

                }
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimBusTargetYPO> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimBusTargetYPO::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusTargetYPO::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimBusTargetYPO::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimBusTargetYPO> yList = rDimBusTargetYPOMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimBusTargetYPO> mapY = yList.stream().collect(Collectors.toMap(item -> item.getOrgId()  + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    String mapKey = d.getCode()+dictData.getId();
                                    if (mapY.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(mapKey).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }

                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimBusTargetMPO> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimBusTargetMPO::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusTargetMPO::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimBusTargetMPO::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimBusTargetMPO> mList = rDimBusTargetMPOMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimBusTargetMPO> mapM = mList.stream().collect(Collectors.toMap(item -> item.getOrgId()  + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode()+dictData.getId();
                                    if (mapM.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(mapKey).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimBusTargetDPO> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimBusTargetDPO::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusTargetDPO::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimBusTargetDPO::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimBusTargetDPO> dList = rDimBusTargetDPOMapper.selectList(lambdaQueryWrapperD);


                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimBusTargetDPO> mapD = dList.stream().collect(Collectors.toMap(item -> item.getOrgId()  + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode()+dictData.getId();
                                    if (mapD.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(mapKey).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                }
                break;
            case 8:
                //母线**指标合格率（%）
                if (StrUtil.isNotBlank(dimGlobalDataParam.getTargetType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getTargetType()).getData();
                    dicList.add(dictData);
                } else {
                    //查询全部指标
                    dicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
                    dicList = dicList.stream().filter(item -> item.getCode().equals(DicDataEnum.VOLTAGE_DEV.getCode()) || item.getCode().equals(DicDataEnum.THD_V.getCode()) || item.getCode().equals(DicDataEnum.phase_Voltage.getCode()) || item.getCode().equals(DicDataEnum.FLICKER.getCode())).collect(Collectors.toList());

                }
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimBusTargetYPO> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimBusTargetYPO::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusTargetYPO::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimBusTargetYPO::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimBusTargetYPO> yList = rDimBusTargetYPOMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimBusTargetYPO> mapY = yList.stream().collect(Collectors.toMap(item -> item.getOrgId()  + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode()+dictData.getId();
                                    if (mapY.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(mapKey).getPassRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {

                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimBusTargetMPO> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimBusTargetMPO::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusTargetMPO::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimBusTargetMPO::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimBusTargetMPO> mList = rDimBusTargetMPOMapper.selectList(lambdaQueryWrapperM);


                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimBusTargetMPO> mapM = mList.stream().collect(Collectors.toMap(item -> item.getOrgId()  + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode()+dictData.getId();
                                    if (mapM.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(mapKey).getPassRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimBusTargetDPO> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimBusTargetDPO::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusTargetDPO::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimBusTargetDPO::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimBusTargetDPO> dList = rDimBusTargetDPOMapper.selectList(lambdaQueryWrapperD);


                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimBusTargetDPO> mapD = dList.stream().collect(Collectors.toMap(item -> item.getOrgId()  + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode()+dictData.getId();
                                    if (mapD.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(mapKey).getPassRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                }
                break;
            case 9:
                //母线**指标平均超标占比（%）
                if (StrUtil.isNotBlank(dimGlobalDataParam.getTargetType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getTargetType()).getData();
                    dicList.add(dictData);
                } else {
                    //查询全部指标
                    dicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
                    dicList = dicList.stream().filter(item -> item.getCode().equals(DicDataEnum.VOLTAGE_DEV.getCode()) || item.getCode().equals(DicDataEnum.THD_V.getCode()) || item.getCode().equals(DicDataEnum.phase_Voltage.getCode()) || item.getCode().equals(DicDataEnum.FLICKER.getCode())).collect(Collectors.toList());

                }
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimBusTargetYPO> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimBusTargetYPO::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusTargetYPO::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimBusTargetYPO::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimBusTargetYPO> yList = rDimBusTargetYPOMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimBusTargetYPO> mapY = yList.stream().collect(Collectors.toMap(item -> item.getOrgId()  + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode()+dictData.getId();
                                    if (mapY.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(mapKey).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimBusTargetMPO> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimBusTargetMPO::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusTargetMPO::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimBusTargetMPO::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimBusTargetMPO> mList = rDimBusTargetMPOMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimBusTargetMPO> mapM = mList.stream().collect(Collectors.toMap(item -> item.getOrgId()  + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode()+dictData.getId();
                                    if (mapM.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(mapKey).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimBusTargetDPO> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimBusTargetDPO::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusTargetDPO::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimBusTargetDPO::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimBusTargetDPO> dList = rDimBusTargetDPOMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimBusTargetDPO> mapD = dList.stream().collect(Collectors.toMap(item -> item.getOrgId()  + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode()+dictData.getId();
                                    if (mapD.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(mapKey).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                }
                break;
            case 10:
                //母线**指标平均合格率（%）
                if (StrUtil.isNotBlank(dimGlobalDataParam.getTargetType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getTargetType()).getData();
                    dicList.add(dictData);
                } else {
                    //查询全部指标
                    dicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
                    dicList = dicList.stream().filter(item -> item.getCode().equals(DicDataEnum.VOLTAGE_DEV.getCode()) || item.getCode().equals(DicDataEnum.THD_V.getCode()) || item.getCode().equals(DicDataEnum.phase_Voltage.getCode()) || item.getCode().equals(DicDataEnum.FLICKER.getCode())).collect(Collectors.toList());

                }
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimBusTargetYPO> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimBusTargetYPO::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusTargetYPO::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimBusTargetYPO::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimBusTargetYPO> yList = rDimBusTargetYPOMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimBusTargetYPO> mapY = yList.stream().collect(Collectors.toMap(item -> item.getOrgId()  + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode()+dictData.getId();
                                    if (mapY.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(mapKey).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimBusTargetMPO> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimBusTargetMPO::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusTargetMPO::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimBusTargetMPO::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimBusTargetMPO> mList = rDimBusTargetMPOMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimBusTargetMPO> mapM = mList.stream().collect(Collectors.toMap(item -> item.getOrgId()  + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode()+dictData.getId();
                                    if (mapM.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(mapKey).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    dimGlobalDataVO.setSecondType(dictData.getId());

                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    dimGlobalDataVO.setSecondType(dictData.getId());

                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimBusTargetDPO> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimBusTargetDPO::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusTargetDPO::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimBusTargetDPO::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimBusTargetDPO> dList = rDimBusTargetDPOMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimBusTargetDPO> mapD = dList.stream().collect(Collectors.toMap(item -> item.getOrgId()  + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode()+dictData.getId();
                                    if (mapD.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(mapKey).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    dimGlobalDataVO.setSecondType(dictData.getId());

                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    dimGlobalDataVO.setSecondType(dictData.getId());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                }
                break;


            case 11:
                //**kV变电站**指标超标占比（%）
                if (StrUtil.isNotBlank(dimGlobalDataParam.getMainType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getMainType()).getData();
                    dicList.add(dictData);
                } else {
                    //查询全部指标
                    dicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
                    dicList = dicList.stream().filter(item -> item.getCode().equals(DicDataEnum.DY_DC_500kV.getCode()) || item.getCode().equals(DicDataEnum.DY_220KV.getCode()) || item.getCode().equals(DicDataEnum.DY_110KV.getCode()) || item.getCode().equals(DicDataEnum.DY_35KV.getCode())).collect(Collectors.toList());
                }

                if (StrUtil.isNotBlank(dimGlobalDataParam.getTargetType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getTargetType()).getData();
                    dicSecondList.add(dictData);
                } else {
                    //查询全部指标
                    dicSecondList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
                    dicSecondList = dicSecondList.stream().filter(item -> item.getCode().equals(DicDataEnum.VOLTAGE_DEV.getCode()) || item.getCode().equals(DicDataEnum.THD_V.getCode()) || item.getCode().equals(DicDataEnum.phase_Voltage.getCode()) || item.getCode().equals(DicDataEnum.FLICKER.getCode())).collect(Collectors.toList());
                }

                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimStationTargetY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimStationTargetY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimStationTargetY::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimStationTargetY::getVoltageLevel, dimGlobalDataParam.getMainType())
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimStationTargetY::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimStationTargetY> yList = rDimStationTargetYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimStationTargetY> mapY = yList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getVoltageLevel() + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());

                                        String mapKey = d.getCode()+vlotage.getId()+dictData.getId();
                                        if (mapY.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(mapKey).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimStationTargetM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimStationTargetM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimStationTargetM::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimStationTargetM::getVoltageLevel, dimGlobalDataParam.getMainType())
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimStationTargetM::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimStationTargetM> mList = rDimStationTargetMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimStationTargetM> mapM = mList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getVoltageLevel() + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());

                                        String mapKey = d.getCode()+vlotage.getId()+dictData.getId();
                                        if (mapM.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(mapKey).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimStationTargetD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimStationTargetD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimStationTargetD::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimStationTargetD::getVoltageLevel, dimGlobalDataParam.getMainType())
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimStationTargetD::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimStationTargetD> dList = rDimStationTargetDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimStationTargetD> mapD = dList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getVoltageLevel() + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());

                                        String mapKey = d.getCode()+vlotage.getId()+dictData.getId();
                                        if (mapD.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(mapKey).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                }
                break;
            case 12:
                //**kV变电站**指标合格率（%）
                if (StrUtil.isNotBlank(dimGlobalDataParam.getMainType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getMainType()).getData();
                    dicList.add(dictData);
                } else {
                    //查询全部指标
                    dicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
                    dicList = dicList.stream().filter(item -> item.getCode().equals(DicDataEnum.DY_DC_500kV.getCode()) || item.getCode().equals(DicDataEnum.DY_220KV.getCode()) || item.getCode().equals(DicDataEnum.DY_110KV.getCode()) || item.getCode().equals(DicDataEnum.DY_35KV.getCode())).collect(Collectors.toList());
                }

                if (StrUtil.isNotBlank(dimGlobalDataParam.getTargetType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getTargetType()).getData();
                    dicSecondList.add(dictData);
                } else {
                    //查询全部指标
                    dicSecondList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
                    dicSecondList = dicSecondList.stream().filter(item -> item.getCode().equals(DicDataEnum.VOLTAGE_DEV.getCode()) || item.getCode().equals(DicDataEnum.THD_V.getCode()) || item.getCode().equals(DicDataEnum.phase_Voltage.getCode()) || item.getCode().equals(DicDataEnum.FLICKER.getCode())).collect(Collectors.toList());
                }

                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimStationTargetY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimStationTargetY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimStationTargetY::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimStationTargetY::getVoltageLevel, dimGlobalDataParam.getMainType())
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimStationTargetY::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimStationTargetY> yList = rDimStationTargetYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimStationTargetY> mapY = yList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getVoltageLevel() + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());

                                        String mapKey = d.getCode()+vlotage.getId()+dictData.getId();
                                        if (mapY.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(mapKey).getPassRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimStationTargetM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimStationTargetM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimStationTargetM::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimStationTargetM::getVoltageLevel, dimGlobalDataParam.getMainType())
                                .eq(RDimStationTargetM::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimStationTargetM> mList = rDimStationTargetMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimStationTargetM> mapM = mList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getVoltageLevel() + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());

                                        String mapKey = d.getCode()+vlotage.getId()+dictData.getId();
                                        if (mapM.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(mapKey).getPassRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimStationTargetD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimStationTargetD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimStationTargetD::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimStationTargetD::getVoltageLevel, dimGlobalDataParam.getMainType())
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimStationTargetD::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimStationTargetD> dList = rDimStationTargetDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimStationTargetD> mapD = dList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getVoltageLevel() + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());

                                        String mapKey = d.getCode()+vlotage.getId()+dictData.getId();
                                        if (mapD.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(mapKey).getPassRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                }
                break;
            case 13:
                //**kV变电站**指标平均超标占比（%）
                if (StrUtil.isNotBlank(dimGlobalDataParam.getMainType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getMainType()).getData();
                    dicList.add(dictData);
                } else {
                    //查询全部指标
                    dicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
                    dicList = dicList.stream().filter(item -> item.getCode().equals(DicDataEnum.DY_DC_500kV.getCode()) || item.getCode().equals(DicDataEnum.DY_220KV.getCode()) || item.getCode().equals(DicDataEnum.DY_110KV.getCode()) || item.getCode().equals(DicDataEnum.DY_35KV.getCode())).collect(Collectors.toList());
                }

                if (StrUtil.isNotBlank(dimGlobalDataParam.getTargetType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getTargetType()).getData();
                    dicSecondList.add(dictData);
                } else {
                    //查询全部指标
                    dicSecondList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
                    dicSecondList = dicSecondList.stream().filter(item -> item.getCode().equals(DicDataEnum.VOLTAGE_DEV.getCode()) || item.getCode().equals(DicDataEnum.THD_V.getCode()) || item.getCode().equals(DicDataEnum.phase_Voltage.getCode()) || item.getCode().equals(DicDataEnum.FLICKER.getCode())).collect(Collectors.toList());

                }

                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimStationTargetY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimStationTargetY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimStationTargetY::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimStationTargetY::getVoltageLevel, dimGlobalDataParam.getMainType())
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimStationTargetY::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimStationTargetY> yList = rDimStationTargetYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimStationTargetY> mapY = yList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getVoltageLevel() + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setOrgId(d.getCode());

                                        String mapKey = d.getCode()+vlotage.getId()+dictData.getId();
                                        if (mapY.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(mapKey).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimStationTargetM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimStationTargetM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimStationTargetM::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimStationTargetM::getVoltageLevel, dimGlobalDataParam.getMainType())
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimStationTargetM::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimStationTargetM> mList = rDimStationTargetMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimStationTargetM> mapM = mList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getVoltageLevel() + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setOrgId(d.getCode());

                                        String mapKey = d.getCode()+vlotage.getId()+dictData.getId();
                                        if (mapM.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(mapKey).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimStationTargetD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimStationTargetD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimStationTargetD::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimStationTargetD::getVoltageLevel, dimGlobalDataParam.getMainType())
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimStationTargetD::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimStationTargetD> dList = rDimStationTargetDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimStationTargetD> mapD = dList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getVoltageLevel() + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());

                                        String mapKey = d.getCode()+vlotage.getId()+dictData.getId();
                                        if (mapD.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(mapKey).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                }
                break;
            case 14:
                //**kV变电站**指标平均合格率（%）
                if (StrUtil.isNotBlank(dimGlobalDataParam.getMainType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getMainType()).getData();
                    dicList.add(dictData);
                } else {
                    //查询全部指标
                    dicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
                    dicList = dicList.stream().filter(item -> item.getCode().equals(DicDataEnum.DY_DC_500kV.getCode()) || item.getCode().equals(DicDataEnum.DY_220KV.getCode()) || item.getCode().equals(DicDataEnum.DY_110KV.getCode()) || item.getCode().equals(DicDataEnum.DY_35KV.getCode())).collect(Collectors.toList());
                }

                if (StrUtil.isNotBlank(dimGlobalDataParam.getTargetType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getTargetType()).getData();
                    dicSecondList.add(dictData);
                } else {
                    //查询全部指标
                    dicSecondList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
                    dicSecondList = dicSecondList.stream().filter(item -> item.getCode().equals(DicDataEnum.VOLTAGE_DEV.getCode()) || item.getCode().equals(DicDataEnum.THD_V.getCode()) || item.getCode().equals(DicDataEnum.phase_Voltage.getCode()) || item.getCode().equals(DicDataEnum.FLICKER.getCode())).collect(Collectors.toList());
                }

                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimStationTargetY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimStationTargetY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimStationTargetY::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimStationTargetY::getVoltageLevel, dimGlobalDataParam.getMainType())
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimStationTargetY::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimStationTargetY> yList = rDimStationTargetYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimStationTargetY> mapY = yList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getVoltageLevel() + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());

                                        String mapKey = d.getCode()+vlotage.getId()+dictData.getId();
                                        if (mapY.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(mapKey).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimStationTargetM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimStationTargetM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimStationTargetM::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimStationTargetM::getVoltageLevel, dimGlobalDataParam.getMainType())
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimStationTargetM::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimStationTargetM> mList = rDimStationTargetMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimStationTargetM> mapM = mList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getVoltageLevel() + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setOrgId(d.getCode());

                                        String mapKey = d.getCode()+vlotage.getId()+dictData.getId();
                                        if (mapM.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(mapKey).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimStationTargetD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimStationTargetD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimStationTargetD::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimStationTargetD::getVoltageLevel, dimGlobalDataParam.getMainType())
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()), RDimStationTargetD::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimStationTargetD> dList = rDimStationTargetDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimStationTargetD> mapD = dList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getVoltageLevel() + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());

                                        String mapKey = d.getCode()+vlotage.getId()+dictData.getId();
                                        if (mapD.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(mapKey).getPassAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData vlotage : dicList) {
                                    for (DictData dictData : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(vlotage.getId());
                                        dimGlobalDataVO.setSecondType(dictData.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                }
                break;

            case 15:
                //监测到暂态指标的变电站占比（%）
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimBusStationEventY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimBusStationEventY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusStationEventY::getOrgId, deptCodeIds);
                        List<RDimBusStationEventY> yList = rDimBusStationEventYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimBusStationEventY> mapY = yList.stream().collect(Collectors.toMap(RDimBusStationEventY::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapY.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getStationLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimBusStationEventM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimBusStationEventM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusStationEventM::getOrgId, deptCodeIds);
                        List<RDimBusStationEventM> mList = rDimBusStationEventMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimBusStationEventM> mapM = mList.stream().collect(Collectors.toMap(RDimBusStationEventM::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapM.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getStationLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimBusStationEventD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimBusStationEventD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusStationEventD::getOrgId, deptCodeIds);
                        List<RDimBusStationEventD> dList = rDimBusStationEventDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimBusStationEventD> mapD = dList.stream().collect(Collectors.toMap(RDimBusStationEventD::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapD.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getStationLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                }
                break;
            case 16:
                //变电站暂态指标发生频次（次/站）
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimBusStationEventY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimBusStationEventY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusStationEventY::getOrgId, deptCodeIds);
                        List<RDimBusStationEventY> yList = rDimBusStationEventYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimBusStationEventY> mapY = yList.stream().collect(Collectors.toMap(RDimBusStationEventY::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapY.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getStationFreq()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimBusStationEventM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimBusStationEventM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusStationEventM::getOrgId, deptCodeIds);
                        List<RDimBusStationEventM> mList = rDimBusStationEventMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimBusStationEventM> mapM = mList.stream().collect(Collectors.toMap(RDimBusStationEventM::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapM.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getStationFreq()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimBusStationEventD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimBusStationEventD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusStationEventD::getOrgId, deptCodeIds);
                        List<RDimBusStationEventD> dList = rDimBusStationEventDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimBusStationEventD> mapD = dList.stream().collect(Collectors.toMap(RDimBusStationEventD::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapD.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getStationFreq()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                }
                break;
            case 17:
                //监测到暂态指标的变电站母线占比（%）
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimBusStationEventY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimBusStationEventY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusStationEventY::getOrgId, deptCodeIds);
                        List<RDimBusStationEventY> yList = rDimBusStationEventYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimBusStationEventY> mapY = yList.stream().collect(Collectors.toMap(RDimBusStationEventY::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapY.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimBusStationEventM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimBusStationEventM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusStationEventM::getOrgId, deptCodeIds);
                        List<RDimBusStationEventM> mList = rDimBusStationEventMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimBusStationEventM> mapM = mList.stream().collect(Collectors.toMap(RDimBusStationEventM::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapM.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimBusStationEventD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimBusStationEventD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusStationEventD::getOrgId, deptCodeIds);
                        List<RDimBusStationEventD> dList = rDimBusStationEventDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimBusStationEventD> mapD = dList.stream().collect(Collectors.toMap(RDimBusStationEventD::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapD.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                }
                break;
            case 18:
                //变电站母线暂态指标发生频次（次/线）
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimBusStationEventY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimBusStationEventY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusStationEventY::getOrgId, deptCodeIds);
                        List<RDimBusStationEventY> yList = rDimBusStationEventYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimBusStationEventY> mapY = yList.stream().collect(Collectors.toMap(RDimBusStationEventY::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapY.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getLimitFreq()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimBusStationEventM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimBusStationEventM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusStationEventM::getOrgId, deptCodeIds);
                        List<RDimBusStationEventM> mList = rDimBusStationEventMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimBusStationEventM> mapM = mList.stream().collect(Collectors.toMap(RDimBusStationEventM::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapM.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getLimitFreq()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimBusStationEventD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimBusStationEventD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimBusStationEventD::getOrgId, deptCodeIds);
                        List<RDimBusStationEventD> dList = rDimBusStationEventDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimBusStationEventD> mapD = dList.stream().collect(Collectors.toMap(RDimBusStationEventD::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapD.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getLimitFreq()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                }
                break;

            case 19:
                //**源荷对象监测率（%）
                if (StrUtil.isNotBlank(dimGlobalDataParam.getMainType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getMainType()).getData();
                    dicList.add(dictData);
                } else {
                    //查询全部指标
                    dicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.MONITORING_LABELS.getCode()).getData();
                    dicList = dicList.stream().filter(item -> item.getCode().equals(DicDataEnum.TRACTION_STATION.getCode()) || item.getCode().equals(DicDataEnum.SENSITIVE_USERS.getCode()) || item.getCode().equals(DicDataEnum.WIND_FARM.getCode()) || item.getCode().equals(DicDataEnum.POWER_STATION.getCode())).collect(Collectors.toList());
                }
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimObjRateY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimObjRateY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjRateY::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotBlank(dimGlobalDataParam.getMainType()), RDimObjRateY::getObjType, dimGlobalDataParam.getMainType())
                        ;
                        List<RDimObjRateY> yList = rDimObjRateYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimObjRateY> mapY = yList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getObjType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setType(dictData.getId());
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode()+dictData.getId();
                                    if (mapY.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(mapKey).getObjMonitorRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimObjRateM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimObjRateM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjRateM::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjRateM::getObjType, dimGlobalDataParam.getMainType());
                        List<RDimObjRateM> mList = rDimObjRateMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimObjRateM> mapM = mList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getObjType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setType(dictData.getId());
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode()+dictData.getId();
                                    if (mapM.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(mapKey).getObjMonitorRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimObjRateD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimObjRateD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjRateD::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjRateD::getObjType, dimGlobalDataParam.getMainType());
                        List<RDimObjRateD> dList = rDimObjRateDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimObjRateD> mapD = dList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getObjType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setType(dictData.getId());
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode()+dictData.getId();
                                    if (mapD.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(mapKey).getObjMonitorRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                }
                break;
            case 20:
                //**源荷对象超标占比（%）
                if (StrUtil.isNotBlank(dimGlobalDataParam.getMainType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getMainType()).getData();
                    dicList.add(dictData);
                } else {
                    //查询全部指标
                    dicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.MONITORING_LABELS.getCode()).getData();
                    dicList = dicList.stream().filter(item -> item.getCode().equals(DicDataEnum.TRACTION_STATION.getCode()) || item.getCode().equals(DicDataEnum.SENSITIVE_USERS.getCode()) || item.getCode().equals(DicDataEnum.WIND_FARM.getCode()) || item.getCode().equals(DicDataEnum.POWER_STATION.getCode())).collect(Collectors.toList());
                }
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimObjGlobalY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimObjGlobalY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjGlobalY::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotBlank(dimGlobalDataParam.getMainType()), RDimObjGlobalY::getObjectType, dimGlobalDataParam.getMainType())
                        ;
                        List<RDimObjGlobalY> yList = rDimObjGlobalYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimObjGlobalY> mapY = yList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getObjectType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setType(dictData.getId());
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode() + dictData.getId();
                                    if (mapY.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(mapKey).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimObjGlobalM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimObjGlobalM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjGlobalM::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjGlobalM::getObjectType, dimGlobalDataParam.getMainType());
                        List<RDimObjGlobalM> mList = rDimObjGlobalMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimObjGlobalM> mapM = mList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getObjectType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode() + dictData.getId();
                                    if (mapM.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(mapKey).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimObjGlobalD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimObjGlobalD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjGlobalD::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjGlobalD::getObjectType, dimGlobalDataParam.getMainType());
                        List<RDimObjGlobalD> dList = rDimObjGlobalDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimObjGlobalD> mapD = dList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getObjectType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setType(dictData.getId());
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode() + dictData.getId();
                                    if (mapD.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(mapKey).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                }
                break;
            case 21:
                //**源荷对象平均超标占比（%）
                if (StrUtil.isNotBlank(dimGlobalDataParam.getMainType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getMainType()).getData();
                    dicList.add(dictData);
                } else {
                    //查询全部指标
                    dicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.MONITORING_LABELS.getCode()).getData();
                    dicList = dicList.stream().filter(item -> item.getCode().equals(DicDataEnum.TRACTION_STATION.getCode()) || item.getCode().equals(DicDataEnum.SENSITIVE_USERS.getCode()) || item.getCode().equals(DicDataEnum.WIND_FARM.getCode()) || item.getCode().equals(DicDataEnum.POWER_STATION.getCode())).collect(Collectors.toList());
                }

                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimObjGlobalY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimObjGlobalY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjGlobalY::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotBlank(dimGlobalDataParam.getMainType()), RDimObjGlobalY::getObjectType, dimGlobalDataParam.getMainType())
                        ;
                        List<RDimObjGlobalY> yList = rDimObjGlobalYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimObjGlobalY> mapY = yList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getObjectType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setType(dictData.getId());
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode() + dictData.getId();
                                    if (mapY.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(mapKey).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimObjGlobalM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimObjGlobalM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjGlobalM::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjGlobalM::getObjectType, dimGlobalDataParam.getMainType());
                        List<RDimObjGlobalM> mList = rDimObjGlobalMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimObjGlobalM> mapM = mList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getObjectType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    dimGlobalDataVO.setType(dictData.getId());

                                    String mapKey = d.getCode() + dictData.getId();
                                    if (mapM.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(mapKey).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimObjGlobalD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimObjGlobalD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjGlobalD::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjGlobalD::getObjectType, dimGlobalDataParam.getMainType());
                        List<RDimObjGlobalD> dList = rDimObjGlobalDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimObjGlobalD> mapD = dList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getObjectType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setType(dictData.getId());
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());

                                    String mapKey = d.getCode() + dictData.getId();
                                    if (mapD.containsKey(mapKey)) {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(mapKey).getLimitAvgRate()).setScale(2, RoundingMode.HALF_UP));
                                    } else {
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    }
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                    dimGlobalDataVO.setType(dictData.getId());
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                    dimGlobalDataVO.setOrgName(d.getName());
                                    dimGlobalDataVO.setOrgId(d.getCode());
                                    resultList.add(dimGlobalDataVO);
                                }
                            }
                        }
                        break;
                }
                break;

            case 22:
                //**源荷对象**指标超标占比（%）
                if (StrUtil.isNotBlank(dimGlobalDataParam.getMainType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getMainType()).getData();
                    dicList.add(dictData);
                } else {
                    //查询全部指标
                    dicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.MONITORING_LABELS.getCode()).getData();
                    dicList = dicList.stream().filter(item -> item.getCode().equals(DicDataEnum.TRACTION_STATION.getCode()) || item.getCode().equals(DicDataEnum.SENSITIVE_USERS.getCode()) || item.getCode().equals(DicDataEnum.WIND_FARM.getCode()) || item.getCode().equals(DicDataEnum.POWER_STATION.getCode())).collect(Collectors.toList());
                }

                if (StrUtil.isNotBlank(dimGlobalDataParam.getTargetType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getTargetType()).getData();
                    dicSecondList.add(dictData);
                } else {
                    //查询全部指标
                    dicSecondList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
                    dicSecondList = dicSecondList.stream().filter(item -> item.getCode().equals(DicDataEnum.THD_V.getCode()) || item.getCode().equals(DicDataEnum.HARMONIC_CURRENT.getCode()) || item.getCode().equals(DicDataEnum.phase_Voltage.getCode()) || item.getCode().equals(DicDataEnum.FLICKER.getCode()) || item.getCode().equals(DicDataEnum.NEG_CURRENT.getCode())).collect(Collectors.toList());
                }
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimObjTargetY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimObjTargetY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjTargetY::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotBlank(dimGlobalDataParam.getMainType()), RDimObjTargetY::getObjectType, dimGlobalDataParam.getMainType())
                                .eq(StrUtil.isNotBlank(dimGlobalDataParam.getTargetType()), RDimObjTargetY::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimObjTargetY> yList = rDimObjTargetYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimObjTargetY> mapY = yList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getObjectType() + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {

                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());

                                        String mapKey = d.getCode()+dictData.getId()+tart.getId();
                                        if (mapY.containsKey(d.getCode())) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(mapKey).getMonitorRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimObjTargetM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimObjTargetM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjTargetM::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjTargetM::getObjectType, dimGlobalDataParam.getMainType())
                                .eq(StrUtil.isNotBlank(dimGlobalDataParam.getTargetType()), RDimObjTargetM::getTargetType, dimGlobalDataParam.getTargetType());

                        List<RDimObjTargetM> mList = rDimObjTargetMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimObjTargetM> mapM = mList.stream().collect(Collectors.toMap(RDimObjTargetM::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());

                                        String mapKey = d.getCode()+dictData.getId()+tart.getId();
                                        if (mapM.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(mapKey).getMonitorRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimObjTargetD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimObjTargetD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjTargetD::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjTargetD::getObjectType, dimGlobalDataParam.getMainType());
                        List<RDimObjTargetD> dList = rDimObjTargetDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimObjTargetD> mapD = dList.stream().collect(Collectors.toMap(RDimObjTargetD::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());

                                        String mapKey = d.getCode()+dictData.getId()+tart.getId();
                                        if (mapD.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(mapKey).getMonitorRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                }

                break;

            case 23:
                //**源荷对象**指标平均超标占比（%）
                if (StrUtil.isNotBlank(dimGlobalDataParam.getMainType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getMainType()).getData();
                    dicList.add(dictData);
                } else {
                    //查询全部指标
                    dicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.MONITORING_LABELS.getCode()).getData();
                    dicList = dicList.stream().filter(item -> item.getCode().equals(DicDataEnum.TRACTION_STATION.getCode()) || item.getCode().equals(DicDataEnum.SENSITIVE_USERS.getCode()) || item.getCode().equals(DicDataEnum.WIND_FARM.getCode()) || item.getCode().equals(DicDataEnum.POWER_STATION.getCode())).collect(Collectors.toList());
                }

                if (StrUtil.isNotBlank(dimGlobalDataParam.getTargetType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getTargetType()).getData();
                    dicSecondList.add(dictData);
                } else {
                    //查询全部指标
                    dicSecondList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
                    dicSecondList = dicSecondList.stream().filter(item -> item.getCode().equals(DicDataEnum.THD_V.getCode()) || item.getCode().equals(DicDataEnum.HARMONIC_CURRENT.getCode()) || item.getCode().equals(DicDataEnum.phase_Voltage.getCode()) || item.getCode().equals(DicDataEnum.FLICKER.getCode()) || item.getCode().equals(DicDataEnum.NEG_CURRENT.getCode())).collect(Collectors.toList());
                }
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimObjTargetY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimObjTargetY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjTargetY::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotBlank(dimGlobalDataParam.getMainType()), RDimObjTargetY::getObjectType, dimGlobalDataParam.getMainType())
                                .eq(StrUtil.isNotBlank(dimGlobalDataParam.getTargetType()), RDimObjTargetY::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimObjTargetY> yList = rDimObjTargetYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimObjTargetY> mapY = yList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getObjectType() + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {

                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());

                                        String mapKey = d.getCode()+dictData.getId()+tart.getId();
                                        if (mapY.containsKey(d.getCode())) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(mapKey).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimObjTargetM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimObjTargetM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjTargetM::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjTargetM::getObjectType, dimGlobalDataParam.getMainType())
                                .eq(StrUtil.isNotBlank(dimGlobalDataParam.getTargetType()), RDimObjTargetM::getTargetType, dimGlobalDataParam.getTargetType());

                        List<RDimObjTargetM> mList = rDimObjTargetMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimObjTargetM> mapM = mList.stream().collect(Collectors.toMap(RDimObjTargetM::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());

                                        String mapKey = d.getCode()+dictData.getId()+tart.getId();
                                        if (mapM.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(mapKey).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimObjTargetD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimObjTargetD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjTargetD::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjTargetD::getObjectType, dimGlobalDataParam.getMainType());
                        List<RDimObjTargetD> dList = rDimObjTargetDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimObjTargetD> mapD = dList.stream().collect(Collectors.toMap(RDimObjTargetD::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());

                                        String mapKey = d.getCode()+dictData.getId()+tart.getId();
                                        if (mapD.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(mapKey).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                }

                break;

            case 24:
                //**源荷对象平均超标天数（天）
                if (StrUtil.isNotBlank(dimGlobalDataParam.getMainType())) {
                    DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getMainType()).getData();
                    dicList.add(dictData);
                } else {
                    //查询全部指标
                    dicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.MONITORING_LABELS.getCode()).getData();
                    dicList = dicList.stream().filter(item -> item.getCode().equals(DicDataEnum.TRACTION_STATION.getCode()) || item.getCode().equals(DicDataEnum.SENSITIVE_USERS.getCode()) || item.getCode().equals(DicDataEnum.WIND_FARM.getCode()) || item.getCode().equals(DicDataEnum.POWER_STATION.getCode())).collect(Collectors.toList());
                }

                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimObjTargetY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimObjTargetY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjTargetY::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotBlank(dimGlobalDataParam.getMainType()), RDimObjTargetY::getObjectType, dimGlobalDataParam.getMainType())
                                .eq(StrUtil.isNotBlank(dimGlobalDataParam.getTargetType()), RDimObjTargetY::getTargetType, dimGlobalDataParam.getTargetType());
                        List<RDimObjTargetY> yList = rDimObjTargetYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimObjTargetY> mapY = yList.stream().collect(Collectors.toMap(item -> item.getOrgId() + item.getObjectType() + item.getTargetType(), Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {

                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());

                                        String mapKey = d.getCode()+dictData.getId()+tart.getId();
                                        if (mapY.containsKey(d.getCode())) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(mapKey).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimObjTargetM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimObjTargetM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjTargetM::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjTargetM::getObjectType, dimGlobalDataParam.getMainType())
                                .eq(StrUtil.isNotBlank(dimGlobalDataParam.getTargetType()), RDimObjTargetM::getTargetType, dimGlobalDataParam.getTargetType());

                        List<RDimObjTargetM> mList = rDimObjTargetMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimObjTargetM> mapM = mList.stream().collect(Collectors.toMap(RDimObjTargetM::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());

                                        String mapKey = d.getCode()+dictData.getId()+tart.getId();
                                        if (mapM.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(mapKey).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimObjTargetD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimObjTargetD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjTargetD::getOrgId, deptCodeIds)
                                .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()), RDimObjTargetD::getObjectType, dimGlobalDataParam.getMainType());
                        List<RDimObjTargetD> dList = rDimObjTargetDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimObjTargetD> mapD = dList.stream().collect(Collectors.toMap(RDimObjTargetD::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());

                                        String mapKey = d.getCode()+dictData.getId()+tart.getId();
                                        if (mapD.containsKey(mapKey)) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(mapKey).getLimitRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                for (DictData dictData : dicList) {
                                    for (DictData tart : dicSecondList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setType(dictData.getId());
                                        dimGlobalDataVO.setSecondType(tart.getId());
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                                    }
                                }
                            }
                        }
                        break;
                }

                break;


            case 25:
                //监测到暂态指标的用户占比（%）
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimObjEventY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimObjEventY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjEventY::getOrgId, deptCodeIds);
                        List<RDimObjEventY> yList = rDimObjEventYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimObjEventY> mapY = yList.stream().collect(Collectors.toMap(RDimObjEventY::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());

                                        if (mapY.containsKey(d.getCode())) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getMonitorRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);

                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimObjEventM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimObjEventM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjEventM::getOrgId, deptCodeIds);

                        List<RDimObjEventM> mList = rDimObjEventMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimObjEventM> mapM = mList.stream().collect(Collectors.toMap(RDimObjEventM::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        if (mapM.containsKey(d.getCode())) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getMonitorRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimObjEventD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimObjEventD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjEventD::getOrgId, deptCodeIds);
                        List<RDimObjEventD> dList = rDimObjEventDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimObjEventD> mapD = dList.stream().collect(Collectors.toMap(RDimObjEventD::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        if (mapD.containsKey(d.getCode())) {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getMonitorRate()).setScale(2, RoundingMode.HALF_UP));
                                        } else {
                                            dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        }
                                        resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                        DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                        dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                        dimGlobalDataVO.setOrgName(d.getName());
                                        dimGlobalDataVO.setOrgId(d.getCode());
                                        resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                }
                break;
            case 26:
                //监测到暂态指标发生频次（次/户）
                switch (dimGlobalDataParam.getDateType()) {
                    case 1:
                        LambdaQueryWrapper<RDimObjEventY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperY.eq(RDimObjEventY::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjEventY::getOrgId, deptCodeIds);
                        List<RDimObjEventY> yList = rDimObjEventYMapper.selectList(lambdaQueryWrapperY);

                        if (CollectionUtil.isNotEmpty(yList)) {
                            Map<String, RDimObjEventY> mapY = yList.stream().collect(Collectors.toMap(RDimObjEventY::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());

                                if (mapY.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapY.get(d.getCode()).getLimitFreqRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);

                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 3:
                        LambdaQueryWrapper<RDimObjEventM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperM.eq(RDimObjEventM::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjEventM::getOrgId, deptCodeIds);

                        List<RDimObjEventM> mList = rDimObjEventMMapper.selectList(lambdaQueryWrapperM);

                        if (CollectionUtil.isNotEmpty(mList)) {
                            Map<String, RDimObjEventM> mapM = mList.stream().collect(Collectors.toMap(RDimObjEventM::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapM.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapM.get(d.getCode()).getLimitFreqRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                    case 5:
                        LambdaQueryWrapper<RDimObjEventD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                        lambdaQueryWrapperD.eq(RDimObjEventD::getStatisDate, dimGlobalDataParam.getQueryDate())
                                .in(RDimObjEventD::getOrgId, deptCodeIds);
                        List<RDimObjEventD> dList = rDimObjEventDMapper.selectList(lambdaQueryWrapperD);

                        if (CollectionUtil.isNotEmpty(dList)) {
                            Map<String, RDimObjEventD> mapD = dList.stream().collect(Collectors.toMap(RDimObjEventD::getOrgId, Function.identity()));
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                if (mapD.containsKey(d.getCode())) {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(mapD.get(d.getCode()).getLimitFreqRate()).setScale(2, RoundingMode.HALF_UP));
                                } else {
                                    dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                }
                                resultList.add(dimGlobalDataVO);
                            }
                        } else {
                            for (DeptDTO d : deptList) {
                                DimGlobalDataVO dimGlobalDataVO = new DimGlobalDataVO();
                                dimGlobalDataVO.setValue(BigDecimal.valueOf(3.14159));
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                        break;
                }
                break;

        }

        return resultList;
    }

    @Override
    public List<DimGlobalDataStandVO> standardDeviation(DimGlobalDataParam dimGlobalDataParam) {
        List<DimGlobalDataStandVO> resultList = new ArrayList<>();
        Dept dept = deptFeignClient.getDeptByCode(dimGlobalDataParam.getOrgId()).getData();
        List<DeptDTO> deptList = deptFeignClient.getDepSonDetailByDeptId(dept.getId()).getData();
        List<String> deptCodeIds = deptList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
        List<DictData> dicList = new ArrayList<>();
        List<String> secondDicList = new ArrayList<>();

        if (StrUtil.isNotBlank(dimGlobalDataParam.getMainType())) {
            DictData dictData = dicDataFeignClient.getDicDataById(dimGlobalDataParam.getMainType()).getData();
            dicList.add(dictData);
        } else {
            //查询全部指标
            dicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
            dicList = dicList.stream().filter(item -> item.getCode().equals(DicDataEnum.DY_DC_500kV.getCode()) || item.getCode().equals(DicDataEnum.DY_220KV.getCode()) || item.getCode().equals(DicDataEnum.DY_110KV.getCode()) || item.getCode().equals(DicDataEnum.DY_35KV.getCode())).collect(Collectors.toList());
        }

        if(StrUtil.isNotBlank(dimGlobalDataParam.getTargetType())){
            if(dimGlobalDataParam.getTargetType().equals("avg")){
                secondDicList.add("平均值");
            }else {
                secondDicList.add("标准差");
            }

        }else {
            secondDicList.add("平均值");
            secondDicList.add("标准差");
        }

        switch (dimGlobalDataParam.getDateType()) {
            case 1:
                LambdaQueryWrapper<RDimVoltageY> lambdaQueryWrapperY = new LambdaQueryWrapper<>();
                lambdaQueryWrapperY.eq(RDimVoltageY::getStatisDate, dimGlobalDataParam.getQueryDate())
                        .in(RDimVoltageY::getOrgId, deptCodeIds).
                         eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()),RDimVoltageY::getVoltageType,dimGlobalDataParam.getMainType())
                        .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()),RDimVoltageY::getDataType,dimGlobalDataParam.getTargetType());
                List<RDimVoltageY> yList = rDimVoltageYMapper.selectList(lambdaQueryWrapperY);

                if (CollectionUtil.isNotEmpty(yList)) {
                    Map<String, RDimVoltageY> mapY = yList.stream().collect(Collectors.toMap(item->item.getOrgId()+item.getVoltageType()+item.getDataType(), Function.identity()));
                    for (DeptDTO d : deptList) {
                        for (DictData dictData : dicList) {
                            for (String tart : secondDicList) {
                                DimGlobalDataStandVO dimGlobalDataVO = new DimGlobalDataStandVO();

                                String mapKey = d.getCode()+dictData.getId()+tart;
                                if (mapY.containsKey(mapKey)) {
                                    BeanUtil.copyProperties(mapY.get(d.getCode()),dimGlobalDataVO);
                                }
                                dimGlobalDataVO.setType(dictData.getId());
                                dimGlobalDataVO.setSecondType(tart);
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }

                    }
                } else {
                    for (DeptDTO d : deptList) {
                        for (DictData dictData : dicList) {
                            for (String tart : secondDicList) {
                                DimGlobalDataStandVO dimGlobalDataVO = new DimGlobalDataStandVO();
                                dimGlobalDataVO.setType(dictData.getId());
                                dimGlobalDataVO.setSecondType(tart);
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                    }
                }
                break;
            case 3:
                LambdaQueryWrapper<RDimVoltageM> lambdaQueryWrapperM = new LambdaQueryWrapper<>();
                lambdaQueryWrapperM.eq(RDimVoltageM::getStatisDate, dimGlobalDataParam.getQueryDate())
                        .in(RDimVoltageM::getOrgId, deptCodeIds).
                        eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()),RDimVoltageM::getVoltageType,dimGlobalDataParam.getMainType())
                        .eq(StrUtil.isNotEmpty(dimGlobalDataParam.getTargetType()),RDimVoltageM::getDataType,dimGlobalDataParam.getTargetType());
                List<RDimVoltageM> mList = rDimVoltageMMapper.selectList(lambdaQueryWrapperM);

                if (CollectionUtil.isNotEmpty(mList)) {
                    Map<String, RDimVoltageM> mapM = mList.stream().collect(Collectors.toMap(item->item.getOrgId()+item.getVoltageType()+item.getDataType(), Function.identity()));
                    for (DeptDTO d : deptList) {
                        for (DictData dictData : dicList) {
                            for (String tart : secondDicList) {
                                DimGlobalDataStandVO dimGlobalDataVO = new DimGlobalDataStandVO();

                                String mapKey = d.getCode()+dictData.getId()+tart;
                                if (mapM.containsKey(mapKey)) {
                                    BeanUtil.copyProperties(mapM.get(d.getCode()),dimGlobalDataVO);
                                }
                                dimGlobalDataVO.setType(dictData.getId());
                                dimGlobalDataVO.setSecondType(tart);
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }

                    }
                } else {
                    for (DeptDTO d : deptList) {
                        for (DictData dictData : dicList) {
                            for (String tart : secondDicList) {
                                DimGlobalDataStandVO dimGlobalDataVO = new DimGlobalDataStandVO();
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setType(dictData.getId());
                                dimGlobalDataVO.setSecondType(tart);
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                    }
                }
                break;
            case 5:
                LambdaQueryWrapper<RDimVoltageD> lambdaQueryWrapperD = new LambdaQueryWrapper<>();
                lambdaQueryWrapperD.eq(RDimVoltageD::getStatisDate, dimGlobalDataParam.getQueryDate())
                        .in(RDimVoltageD::getOrgId, deptCodeIds).
                        eq(StrUtil.isNotEmpty(dimGlobalDataParam.getMainType()),RDimVoltageD::getVoltageType,dimGlobalDataParam.getMainType());

                List<RDimVoltageD> dList = rDimVoltageDMapper.selectList(lambdaQueryWrapperD);

                if (CollectionUtil.isNotEmpty(dList)) {
                    Map<String, RDimVoltageD> mapD = dList.stream().collect(Collectors.toMap(item->item.getOrgId()+item.getVoltageType(), Function.identity()));
                    for (DeptDTO d : deptList) {
                        for (DictData dictData : dicList) {
                            for (String tart : secondDicList) {
                                DimGlobalDataStandVO dimGlobalDataVO = new DimGlobalDataStandVO();

                                String mapKey = d.getCode()+dictData.getId()+tart;
                                if (mapD.containsKey(mapKey)) {
                                    BeanUtil.copyProperties(mapD.get(d.getCode()),dimGlobalDataVO);
                                }
                                dimGlobalDataVO.setType(dictData.getId());
                                dimGlobalDataVO.setSecondType(tart);
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }

                    }
                } else {
                    for (DeptDTO d : deptList) {
                        for (DictData dictData : dicList) {
                            for (String tart : secondDicList) {
                                DimGlobalDataStandVO dimGlobalDataVO = new DimGlobalDataStandVO();
                                dimGlobalDataVO.setType(dictData.getId());
                                dimGlobalDataVO.setSecondType(tart);
                                dimGlobalDataVO.setOrgName(d.getName());
                                dimGlobalDataVO.setOrgId(d.getCode());
                                resultList.add(dimGlobalDataVO);
                            }
                        }
                    }
                }
                break;
            default:
               throw new BusinessException("参数校验异常!");
        }

        return resultList;
    }
}
