This commit is contained in:
wangliwen 2022-08-30 10:41:01 +08:00
parent b835ce3f73
commit d8e44a1f49
1 changed files with 2 additions and 40 deletions

View File

@ -1898,48 +1898,10 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
@Override @Override
public List<Map> selectDevelopDoc() { public List<Map> selectDevelopDoc() {
//List<Map> result = new ArrayList<>();
//List<Map<String, Object>> dtoMaps = baseDao.selectDevelopDocResource();
//Map<String, List<Map<String, Object>>> resourceTypeMap = dtoMaps.stream().collect(Collectors.groupingBy(m -> m.get("type").toString()));
//resourceTypeMap.forEach((key, value) -> {
// if (!"组件服务".equals(key)) {
// Map<String, Object> 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<String, List> 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<Map> result = new ArrayList<>(); List<Map> result = new ArrayList<>();
List<Map<String, Object>> dtoMaps = baseDao.selectDevelopDocResource(); List<Map<String, Object>> dtoMaps = baseDao.selectDevelopDocResource();
Map<String, List<Map<String, Object>>> resourceTypeMap = dtoMaps.stream().collect(Collectors.groupingBy(m -> m.get("type").toString())); Map<String, List<Map<String, Object>>> 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())) { if (!"组件服务".equals(temp.getKey())) {
Map map = new HashMap(); Map map = new HashMap();
map.put("title", temp.getKey()); map.put("title", temp.getKey());
@ -1947,7 +1909,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
result.add(map); result.add(map);
} }
}); });
if (resourceTypeMap.get("组件服务") != null) { if (resourceTypeMap.containsKey("组件服务") && resourceTypeMap.get("组件服务") != null) {
Map componentMap = new HashMap(); Map componentMap = new HashMap();
componentMap.put("title", "组件服务"); componentMap.put("title", "组件服务");
Map<String, List> map = new ConcurrentHashMap<>(); Map<String, List> map = new ConcurrentHashMap<>();