From d8e44a1f49c81052b08a3e2a881ba5e78ac89567 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 30 Aug 2022 10:41:01 +0800 Subject: [PATCH] ... --- .../service/impl/ResourceServiceImpl.java | 42 +------------------ 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 8a736367..61e46a4b 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -1898,48 +1898,10 @@ public class ResourceServiceImpl extends CrudServiceImpl selectDevelopDoc() { - //List result = new ArrayList<>(); - //List> dtoMaps = baseDao.selectDevelopDocResource(); - //Map>> resourceTypeMap = dtoMaps.stream().collect(Collectors.groupingBy(m -> m.get("type").toString())); - //resourceTypeMap.forEach((key, value) -> { - // if (!"组件服务".equals(key)) { - // Map map = new HashMap<>(); - // map.put("title", key); - // map.put("children", value); - // result.add(map); - // } - //}); - //if (resourceTypeMap.get("组件服务") != null) { - // Map componentMap = new HashMap(); - // componentMap.put("title", "组件服务"); - // Map map = new ConcurrentHashMap<>(); - // CompletableFuture.allOf(resourceTypeMap.get("组件服务").stream() - // .map(it -> CompletableFuture.runAsync(() -> selectAttrsByResourceId(Long.parseLong(it.get("id").toString())) - // .stream() - // .filter(temp -> "组件类型".equals(temp.getAttrType())) - // .forEach(attr -> { - // if (map.get(attr.getAttrValue()) != null) { - // map.get(attr.getAttrValue()).add(it); - // } else { - // map.put(attr.getAttrValue(), Collections.synchronizedList(new ArrayList() {{ - // add(it); - // }})); - // } - // }), executor)) - // .collect(Collectors.toList()) - // .toArray(new CompletableFuture[resourceTypeMap.get("组件服务").size()])) - // .join(); - // componentMap.put("children", map.entrySet().stream().map(it -> new HashMap() {{ - // put("title", it.getKey()); - // put("children", it.getValue()); - // }}).collect(Collectors.toList())); - // result.add(componentMap); - //} - //return result; List result = new ArrayList<>(); List> dtoMaps = baseDao.selectDevelopDocResource(); Map>> resourceTypeMap = dtoMaps.stream().collect(Collectors.groupingBy(m -> m.get("type").toString())); - resourceTypeMap.entrySet().stream().forEach(temp -> { + resourceTypeMap.entrySet().stream().filter(index -> !"组件服务".equals(index.getKey())).forEach(temp -> { if (!"组件服务".equals(temp.getKey())) { Map map = new HashMap(); map.put("title", temp.getKey()); @@ -1947,7 +1909,7 @@ public class ResourceServiceImpl extends CrudServiceImpl map = new ConcurrentHashMap<>();