Browse Source

Merge remote-tracking branch 'origin/feature/v2.0.0-data-auth' into feature/v2.0.0-data-auth

huangjy 4 years ago
parent
commit
ce44e09e5b

+ 5 - 0
dcuc-auth-model/src/main/java/com/dragoninfo/dcuc/auth/auth/dto/data/DataResourceTreeDTO.java

@@ -46,6 +46,11 @@ public class DataResourceTreeDTO {
      */
      */
     private Boolean treeNode;
     private Boolean treeNode;
 
 
+    /**
+     * 数据资源code与dataType拼接,以|拼接
+     */
+    private String codeDataTypeStr;
+
     /**
     /**
      * 父节点id
      * 父节点id
      */
      */

+ 9 - 0
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/business/IDataAuthBusiness.java

@@ -1,6 +1,7 @@
 package com.dragoninfo.dcuc.auth.auth.business;
 package com.dragoninfo.dcuc.auth.auth.business;
 
 
 import com.dragoninfo.dcuc.auth.auth.dto.data.DataClassifyDTO;
 import com.dragoninfo.dcuc.auth.auth.dto.data.DataClassifyDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.data.DataResourceDTO;
 import com.dragoninfo.dcuc.auth.auth.dto.data.SubDataAuthQueryDTO;
 import com.dragoninfo.dcuc.auth.auth.dto.data.SubDataAuthQueryDTO;
 
 
 import java.util.List;
 import java.util.List;
@@ -41,4 +42,12 @@ public interface IDataAuthBusiness {
      * @return
      * @return
      */
      */
     List<DataClassifyDTO> getSubDataAuthList(List<SubDataAuthQueryDTO> list);
     List<DataClassifyDTO> getSubDataAuthList(List<SubDataAuthQueryDTO> list);
+
+    /**
+     * 人员视角-有权限的数据资源查询(树结构)-根据身份证号查询
+     * @param idcard 身份证
+     * @param authType 授权类型
+     * @return
+     */
+    List<DataResourceDTO> userDataTreeByIdcard(String idcard, String authType);
 }
 }

+ 169 - 7
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/business/impl/DataAuthBusiness.java

@@ -1,28 +1,30 @@
 package com.dragoninfo.dcuc.auth.auth.business.impl;
 package com.dragoninfo.dcuc.auth.auth.business.impl;
 
 
 import com.dragoninfo.dcuc.app.enumresources.DataResourceEnum;
 import com.dragoninfo.dcuc.app.enumresources.DataResourceEnum;
+import com.dragoninfo.dcuc.app.facade.IDataResourceFacade;
+import com.dragoninfo.dcuc.app.vo.DataResourceClassifyVo;
+import com.dragoninfo.dcuc.app.vo.DataResourceTreeVo;
 import com.dragoninfo.dcuc.auth.auth.business.IDataAuthBusiness;
 import com.dragoninfo.dcuc.auth.auth.business.IDataAuthBusiness;
-import com.dragoninfo.dcuc.auth.auth.dto.data.DataAuthDTO;
-import com.dragoninfo.dcuc.auth.auth.dto.data.DataClassifyDTO;
-import com.dragoninfo.dcuc.auth.auth.dto.data.SubDataAuthQueryDTO;
-import com.dragoninfo.dcuc.auth.auth.dto.data.SubDataDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.data.*;
 import com.dragoninfo.dcuc.auth.auth.enumresources.SubDataAuthTypeEnum;
 import com.dragoninfo.dcuc.auth.auth.enumresources.SubDataAuthTypeEnum;
 import com.dragoninfo.dcuc.auth.auth.service.IBusService;
 import com.dragoninfo.dcuc.auth.auth.service.IBusService;
 import com.dragoninfo.dcuc.auth.auth.service.IDataAuthService;
 import com.dragoninfo.dcuc.auth.auth.service.IDataAuthService;
 import com.dragoninfo.dcuc.user.user.entity.UserInfo;
 import com.dragoninfo.dcuc.user.user.entity.UserInfo;
 import com.dragoninfo.dcuc.user.user.facade.IUserFacade;
 import com.dragoninfo.dcuc.user.user.facade.IUserFacade;
 import com.dragonsoft.duceap.base.enums.BooleanEnum;
 import com.dragonsoft.duceap.base.enums.BooleanEnum;
+import com.dragonsoft.duceap.commons.util.MapUtils;
 import com.dragonsoft.duceap.commons.util.collections.CollectionUtils;
 import com.dragonsoft.duceap.commons.util.collections.CollectionUtils;
 import com.dragonsoft.duceap.commons.util.string.StringUtils;
 import com.dragonsoft.duceap.commons.util.string.StringUtils;
 import com.dragonsoft.duceap.core.search.Searchable;
 import com.dragonsoft.duceap.core.search.Searchable;
 import com.dragonsoft.duceap.core.search.enums.SearchOperator;
 import com.dragonsoft.duceap.core.search.enums.SearchOperator;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
+import org.springframework.util.StopWatch;
 
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 /**
 /**
@@ -32,12 +34,18 @@ import java.util.stream.Collectors;
 @Slf4j
 @Slf4j
 @Component
 @Component
 public class DataAuthBusiness implements IDataAuthBusiness {
 public class DataAuthBusiness implements IDataAuthBusiness {
+
+    public static String idJoin = "|";
+
     @Autowired
     @Autowired
     private IUserFacade userFacade;
     private IUserFacade userFacade;
 
 
     @Autowired
     @Autowired
     private IDataAuthService dataAuthService;
     private IDataAuthService dataAuthService;
 
 
+    @Autowired
+    private IDataResourceFacade dataResourceFacade;
+
     @Autowired
     @Autowired
     private IBusService busService;
     private IBusService busService;
 
 
@@ -103,6 +111,45 @@ public class DataAuthBusiness implements IDataAuthBusiness {
         return classifyDTOS;
         return classifyDTOS;
     }
     }
 
 
+    @Override
+    public List<DataResourceDTO> userDataTreeByIdcard(String idcard, String authType) {
+        List<DataResourceDTO> resourceDTOS = new ArrayList<>();
+        //获取有权限的数据
+        List<DataClassifyDTO> dataClassifyDTOS = userDataAuthInfoByIdcard(idcard, authType);
+        if(CollectionUtils.isEmpty(dataClassifyDTOS)) {
+            return resourceDTOS;
+        }
+        //获取数据资源树
+        Map<String, DataResourceTreeVo> allTreeVosMap = getDataResourceTree(dataClassifyDTOS);
+
+        if(MapUtils.isEmpty(allTreeVosMap)){
+            return resourceDTOS;
+        }
+        //筛选有权限的树节点
+        List<DataResourceTreeVo> authTreeVoList = filterAuthTreeNode(dataClassifyDTOS, allTreeVosMap);
+
+        if(CollectionUtils.isEmpty(authTreeVoList)){
+            return resourceDTOS;
+        }
+
+        //将有权限的节点组装成树结构
+        List<DataResourceTreeVo> topTreeNodes = authTreeVoList.stream().filter(item -> item.getPId() == null).collect(Collectors.toList());
+        List<DataResourceTreeVo> childTreeNodes = authTreeVoList.stream().filter(item -> item.getPId() != null).collect(Collectors.toList());
+        for (DataResourceTreeVo topTreeNode : topTreeNodes) {
+            DataResourceTreeDTO topTreeDTO = convertToTreeDTO(topTreeNode, childTreeNodes);
+            final List<DataResourceTreeDTO> child = topTreeDTO.getChild();
+            if(CollectionUtils.isEmpty(child)){
+                continue;
+            }
+            //构建分级分类DTO
+            String id = topTreeDTO.getId();
+            DataResourceEnum dataEnum = DataResourceEnum.getByCode(id);
+            DataResourceDTO dataResourceDTO = new DataResourceDTO(dataEnum.getCode(),dataEnum.getLabel(),dataEnum.getAttrType().getValue());
+            dataResourceDTO.setNodes(new ArrayList<DataResourceTreeDTO>(){{addAll(child);}});
+            resourceDTOS.add(dataResourceDTO);
+        }
+        return resourceDTOS;
+    }
 
 
 
 
     private List<DataClassifyDTO> getDataClassifyDTOS(List<DataAuthDTO> authDTOS) {
     private List<DataClassifyDTO> getDataClassifyDTOS(List<DataAuthDTO> authDTOS) {
@@ -139,4 +186,119 @@ public class DataAuthBusiness implements IDataAuthBusiness {
         return classifyDTOS;
         return classifyDTOS;
     }
     }
 
 
+
+    /**
+     * 将TreeVo转为DTO
+     * @param topTreeNode 顶级节点
+     * @param childTreeNodes 有权限的子节点
+     * @return
+     */
+    private DataResourceTreeDTO convertToTreeDTO(DataResourceTreeVo topTreeNode, List<DataResourceTreeVo> childTreeNodes) {
+        DataResourceTreeDTO dto = new DataResourceTreeDTO();
+        BeanUtils.copyProperties(topTreeNode,dto,"child");
+        String id = topTreeNode.getId();
+        List<DataResourceTreeVo> childList = childTreeNodes.stream().filter(item -> item.getPId().equals(id)).collect(Collectors.toList());
+        if(CollectionUtils.isEmpty(childList)){
+            dto.setChild(null);
+            dto.setTreeNode(false);
+        }else {
+            List<DataResourceTreeDTO> list = new ArrayList<>();
+            for (DataResourceTreeVo child : childList) {
+                DataResourceTreeDTO childDTO = convertToTreeDTO(child,childTreeNodes);
+                list.add(childDTO);
+            }
+            dto.setChild(list);
+            dto.setTreeNode(true);
+        }
+        return dto;
+    }
+
+    /**
+     * 过滤有权限的树节点
+     * @param dataClassifyDTOS 有权限的分级分类数据
+     * @param allTreeVosMap 平铺的树节点
+     * @return
+     */
+    private List<DataResourceTreeVo> filterAuthTreeNode(List<DataClassifyDTO> dataClassifyDTOS, Map<String, DataResourceTreeVo> allTreeVosMap) {
+        List<SubDataDTO> authDatas = dataClassifyDTOS.stream()
+                .map(item -> item.getTickedDatas())
+                .flatMap(List::stream)
+                .collect(Collectors.toList());
+        Set<String> dataIds = authDatas.stream()
+                .map(item -> item.getClassifyCode() + idJoin + item.getDataId())
+                .collect(Collectors.toSet());
+        Set<String> authDataIds = new HashSet<>();
+        dataIds.stream().forEach(id->{
+            authDataIds.add(id);
+            String dataId = id;
+            int index;
+            while ((index = dataId.lastIndexOf(idJoin)) != -1){
+                authDataIds.add(dataId = dataId.substring(0, index));
+            }
+        });
+        //过滤有权限的树节点
+        return allTreeVosMap.entrySet().stream()
+                .filter(item -> authDataIds.contains(item.getKey()))
+                .collect(Collectors.mapping(Map.Entry::getValue, Collectors.toList()));
+    }
+
+    /**
+     * 获取所有数据资源树
+     * @param dataClassifyDTOS 有权限的分级分类数据
+     * @return 平铺的树节点
+     */
+    private Map<String, DataResourceTreeVo> getDataResourceTree(List<DataClassifyDTO> dataClassifyDTOS) {
+        Set<String> attrTypeSet = dataClassifyDTOS
+                .stream()
+                .map(dataClassifyDTO -> dataClassifyDTO.getAttrType())
+                .collect(Collectors.toSet());
+        StopWatch stopWatch  = new StopWatch();
+        stopWatch.start("get data resource tree");
+        //所有数据资源Map
+        Map<String, DataResourceTreeVo> allTreeVosMap = new HashMap<>();
+        List<CompletableFuture<List<DataResourceTreeVo>>> futureList = new ArrayList<>();
+
+        for (String attrType : attrTypeSet) {
+            //future多线程任务
+            //将树结构平铺成Map
+            //id唯一
+            CompletableFuture<List<DataResourceTreeVo>> cf = CompletableFuture.supplyAsync(()->{
+                List<DataResourceClassifyVo> dataResource = dataResourceFacade.getAllDataResourceTree(attrType);
+                List<DataResourceTreeVo> topTreeVos = dataResource.stream()
+                        .map(item -> item.getNodes())
+                        .flatMap(List::stream).collect(Collectors.toList());
+                return topTreeVos;
+            });
+            futureList.add(cf);
+        }
+        List<DataResourceTreeVo> result = CompletableFuture
+                .allOf(futureList.toArray(new CompletableFuture[futureList.size()]))
+                .thenApply(e -> futureList.stream().map(CompletableFuture::join).flatMap(List::stream).collect(Collectors.toList()))
+                .join();
+        convertTreeToMap(result,allTreeVosMap);
+        stopWatch.stop();
+        log.info("get data resource tree cost time:{}",stopWatch.getTotalTimeMillis());
+        return allTreeVosMap;
+    }
+
+    /**
+     * 将树结构平铺成Map
+     * id唯一 key
+     * @param topTreeVos 顶级树节点
+     * @param allTreeVosMap
+     * @return
+     */
+    private void convertTreeToMap(List<DataResourceTreeVo> topTreeVos, Map<String, DataResourceTreeVo> allTreeVosMap) {
+        for (DataResourceTreeVo topTreeVo : topTreeVos) {
+            String id = topTreeVo.getId();
+            allTreeVosMap.put(id, topTreeVo);
+            List<DataResourceTreeVo> child = topTreeVo.getChild();
+            if(CollectionUtils.isNotEmpty(child)){
+                convertTreeToMap(child, allTreeVosMap);
+                //将子级设置为null
+                topTreeVo.setChild(null);
+            }
+        }
+    }
+
 }
 }

+ 2 - 174
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/facade/DataAuthFacade.java

@@ -1,34 +1,17 @@
 package com.dragoninfo.dcuc.auth.auth.facade;
 package com.dragoninfo.dcuc.auth.auth.facade;
 
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.TypeReference;
-import com.dragoninfo.dcuc.app.enumresources.DataResourceEnum;
-import com.dragoninfo.dcuc.app.facade.IDataResourceFacade;
-import com.dragoninfo.dcuc.app.vo.DataResourceClassifyVo;
-import com.dragoninfo.dcuc.app.vo.DataResourceTreeVo;
 import com.dragoninfo.dcuc.auth.auth.business.IDataAuthBusiness;
 import com.dragoninfo.dcuc.auth.auth.business.IDataAuthBusiness;
-import com.dragoninfo.dcuc.auth.auth.dto.ResourceTypeQueryDTO;
 import com.dragoninfo.dcuc.auth.auth.dto.data.*;
 import com.dragoninfo.dcuc.auth.auth.dto.data.*;
-import com.dragoninfo.dcuc.auth.auth.service.IBusService;
 import com.dragoninfo.dcuc.auth.auth.service.IDataAuthService;
 import com.dragoninfo.dcuc.auth.auth.service.IDataAuthService;
 import com.dragoninfo.dcuc.auth.auth.service.impl.DataAuthServiceImpl;
 import com.dragoninfo.dcuc.auth.auth.service.impl.DataAuthServiceImpl;
 import com.dragoninfo.dcuc.auth.auth.vo.BusResultVO;
 import com.dragoninfo.dcuc.auth.auth.vo.BusResultVO;
 import com.dragonsoft.duceap.base.entity.search.SearchDTO;
 import com.dragonsoft.duceap.base.entity.search.SearchDTO;
-import com.dragonsoft.duceap.commons.util.MapUtils;
-import com.dragonsoft.duceap.commons.util.collections.CollectionUtils;
-import com.dragonsoft.duceap.core.search.Searchable;
-import com.dragonsoft.duceap.core.search.enums.SearchOperator;
-import com.dragonsoft.duceap.core.search.filter.Condition;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.StopWatch;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
-import java.util.*;
-import java.util.concurrent.CompletableFuture;
-import java.util.stream.Collectors;
+import java.util.List;
 
 
 /**
 /**
  * @author mazq
  * @author mazq
@@ -39,20 +22,12 @@ import java.util.stream.Collectors;
 @RequestMapping(value = "/dcuc/auth/dataAuthFacade")
 @RequestMapping(value = "/dcuc/auth/dataAuthFacade")
 public class DataAuthFacade implements IDataAuthFacade {
 public class DataAuthFacade implements IDataAuthFacade {
 
 
-    public static String idJoin = "|";
-
     @Autowired
     @Autowired
     private IDataAuthService dataAuthService;
     private IDataAuthService dataAuthService;
 
 
     @Autowired
     @Autowired
     private IDataAuthBusiness dataAuthBusiness;
     private IDataAuthBusiness dataAuthBusiness;
 
 
-    @Autowired
-    private IBusService busService;
-
-    @Autowired
-    private IDataResourceFacade dataResourceFacade;
-
     private static final String[] dataResourceClassifyLable = new String[]{DataAuthServiceImpl.dataLabelOneCodeStr,DataAuthServiceImpl.dataLabelTwoCodeStr,DataAuthServiceImpl.dataLabelThreeCodeStr,DataAuthServiceImpl.dataLabelFourCodeStr,DataAuthServiceImpl.dataLabelFiveCodeStr};
     private static final String[] dataResourceClassifyLable = new String[]{DataAuthServiceImpl.dataLabelOneCodeStr,DataAuthServiceImpl.dataLabelTwoCodeStr,DataAuthServiceImpl.dataLabelThreeCodeStr,DataAuthServiceImpl.dataLabelFourCodeStr,DataAuthServiceImpl.dataLabelFiveCodeStr};
 
 
     @Override
     @Override
@@ -112,155 +87,8 @@ public class DataAuthFacade implements IDataAuthFacade {
 
 
     @Override
     @Override
     public List<DataResourceDTO> userDataTreeByIdcard(String idcard, String authType) {
     public List<DataResourceDTO> userDataTreeByIdcard(String idcard, String authType) {
-        List<DataResourceDTO> resourceDTOS = new ArrayList<>();
-        //获取有权限的数据
-        List<DataClassifyDTO> dataClassifyDTOS = userDataAuthInfoByIdcard(idcard, authType);
-        if(CollectionUtils.isEmpty(dataClassifyDTOS)) {
-            return resourceDTOS;
-        }
-        //获取数据资源树
-        Map<String, DataResourceTreeVo> allTreeVosMap = getDataResourceTree(dataClassifyDTOS);
-
-        if(MapUtils.isEmpty(allTreeVosMap)){
-            return resourceDTOS;
-        }
-        //筛选有权限的树节点
-        List<DataResourceTreeVo> authTreeVoList = filterAuthTreeNode(dataClassifyDTOS, allTreeVosMap);
-
-        if(CollectionUtils.isEmpty(authTreeVoList)){
-            return resourceDTOS;
-        }
-
-        List<DataResourceDTO> dataResourceDTOS = new ArrayList<>();
-        //将有权限的节点组装成树结构
-        List<DataResourceTreeVo> topTreeNodes = authTreeVoList.stream().filter(item -> item.getPId() == null).collect(Collectors.toList());
-        List<DataResourceTreeVo> childTreeNodes = authTreeVoList.stream().filter(item -> item.getPId() != null).collect(Collectors.toList());
-        for (DataResourceTreeVo topTreeNode : topTreeNodes) {
-            DataResourceTreeDTO topTreeDTO = convertToTreeDTO(topTreeNode, childTreeNodes);
-            //构建分级分类DTO
-            String id = topTreeDTO.getId();
-            DataResourceEnum dataEnum = DataResourceEnum.getByCode(id);
-            DataResourceDTO dataResourceDTO = new DataResourceDTO(dataEnum.getCode(),dataEnum.getLabel(),dataEnum.getAttrType().getValue());
-            dataResourceDTO.setNodes(new ArrayList<DataResourceTreeDTO>(){{add(topTreeDTO);}});
-            dataResourceDTOS.add(dataResourceDTO);
-        }
-        return dataResourceDTOS;
-    }
-
-    /**
-     * 将TreeVo转为DTO
-     * @param topTreeNode 顶级节点
-     * @param childTreeNodes 有权限的子节点
-     * @return
-     */
-    private DataResourceTreeDTO convertToTreeDTO(DataResourceTreeVo topTreeNode, List<DataResourceTreeVo> childTreeNodes) {
-        DataResourceTreeDTO dto = new DataResourceTreeDTO();
-        BeanUtils.copyProperties(topTreeNode,dto,"child");
-        String id = topTreeNode.getId();
-        List<DataResourceTreeVo> childList = childTreeNodes.stream().filter(item -> item.getPId().equals(id)).collect(Collectors.toList());
-        if(CollectionUtils.isEmpty(childList)){
-            dto.setChild(null);
-            dto.setTreeNode(false);
-        }else {
-            List<DataResourceTreeDTO> list = new ArrayList<>();
-            for (DataResourceTreeVo child : childList) {
-                DataResourceTreeDTO childDTO = convertToTreeDTO(child,childTreeNodes);
-                list.add(childDTO);
-            }
-            dto.setChild(list);
-            dto.setTreeNode(true);
-        }
-        return dto;
-    }
-
-    /**
-     * 过滤有权限的树节点
-     * @param dataClassifyDTOS 有权限的分级分类数据
-     * @param allTreeVosMap 平铺的树节点
-     * @return
-     */
-    private List<DataResourceTreeVo> filterAuthTreeNode(List<DataClassifyDTO> dataClassifyDTOS, Map<String, DataResourceTreeVo> allTreeVosMap) {
-        List<SubDataDTO> authDatas = dataClassifyDTOS.stream()
-                .map(item -> item.getTickedDatas())
-                .flatMap(List::stream)
-                .collect(Collectors.toList());
-        Set<String> dataIds = authDatas.stream()
-                .map(item -> item.getClassifyCode() + idJoin + item.getDataId())
-                .collect(Collectors.toSet());
-        Set<String> authDataIds = new HashSet<>();
-        dataIds.stream().forEach(id->{
-            authDataIds.add(id);
-            String dataId = id;
-            int index;
-            while ((index = dataId.lastIndexOf(idJoin)) != -1){
-                authDataIds.add(dataId = dataId.substring(0, index));
-            }
-        });
-        //过滤有权限的树节点
-        return allTreeVosMap.entrySet().stream()
-                .filter(item -> authDataIds.contains(item.getKey()))
-                .collect(Collectors.mapping(Map.Entry::getValue, Collectors.toList()));
+        return dataAuthBusiness.userDataTreeByIdcard(idcard, authType);
     }
     }
 
 
-    /**
-     * 获取所有数据资源树
-     * @param dataClassifyDTOS 有权限的分级分类数据
-     * @return 平铺的树节点
-     */
-    private Map<String, DataResourceTreeVo> getDataResourceTree(List<DataClassifyDTO> dataClassifyDTOS) {
-        Set<String> attrTypeSet = dataClassifyDTOS
-                .stream()
-                .map(dataClassifyDTO -> dataClassifyDTO.getAttrType())
-                .collect(Collectors.toSet());
-        StopWatch stopWatch  = new StopWatch();
-        stopWatch.start("get data resource tree");
-        //所有数据资源Map
-        Map<String, DataResourceTreeVo> allTreeVosMap = new HashMap<>();
-        List<CompletableFuture<List<DataResourceTreeVo>>> futureList = new ArrayList<>();
-
-        for (String attrType : attrTypeSet) {
-            //future多线程任务
-            //将树结构平铺成Map
-            //id唯一
-            CompletableFuture<List<DataResourceTreeVo>> cf = CompletableFuture.supplyAsync(()->{
-                List<DataResourceClassifyVo> dataResource = dataResourceFacade.getAllDataResourceTree(attrType);
-                List<DataResourceTreeVo> topTreeVos = dataResource.stream()
-                        .map(item -> item.getNodes())
-                        .flatMap(List::stream).collect(Collectors.toList());
-                return topTreeVos;
-            });
-            futureList.add(cf);
-        }
-        List<DataResourceTreeVo> result = CompletableFuture
-                .allOf(futureList.toArray(new CompletableFuture[futureList.size()]))
-                .thenApply(e -> futureList.stream().map(CompletableFuture::join).flatMap(List::stream).collect(Collectors.toList()))
-                .join();
-        convertTreeToMap(result,allTreeVosMap);
-        stopWatch.stop();
-        log.info("get data resource tree cost time:{}",stopWatch.getTotalTimeMillis());
-        return allTreeVosMap;
-    }
-
-    /**
-     * 将树结构平铺成Map
-     * id唯一 key
-     * @param topTreeVos 顶级树节点
-     * @param allTreeVosMap
-     * @return
-     */
-    private void convertTreeToMap(List<DataResourceTreeVo> topTreeVos, Map<String, DataResourceTreeVo> allTreeVosMap) {
-        for (DataResourceTreeVo topTreeVo : topTreeVos) {
-            String id = topTreeVo.getId();
-            allTreeVosMap.put(id, topTreeVo);
-            List<DataResourceTreeVo> child = topTreeVo.getChild();
-            if(CollectionUtils.isNotEmpty(child)){
-                convertTreeToMap(child, allTreeVosMap);
-                //将子级设置为null
-                topTreeVo.setChild(null);
-            }
-        }
-    }
-
-
 
 
 }
 }