From 6e6c66687becd673c96c31131eb6bd2c49d6fd18 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Wed, 3 Jul 2024 18:23:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8A=B1=E5=90=8D=E5=86=8C=E6=A0=91=EF=BC=8C?= =?UTF-8?q?=E5=90=8C=E7=BA=A7=E6=83=85=E5=86=B5=E4=B8=8B=EF=BC=8C=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E5=B1=95=E7=A4=BA=E5=9C=A8=E5=88=86=E9=83=A8=E5=89=8D?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/organization/util/tree/SearchTreeUtil.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/com/engine/organization/util/tree/SearchTreeUtil.java b/src/com/engine/organization/util/tree/SearchTreeUtil.java index b1065faa..60b7ce31 100644 --- a/src/com/engine/organization/util/tree/SearchTreeUtil.java +++ b/src/com/engine/organization/util/tree/SearchTreeUtil.java @@ -116,16 +116,13 @@ public class SearchTreeUtil { Set leafIds = new HashSet<>(); List collect = treeList.stream().peek(e -> { Set treeNodes = new LinkedHashSet<>(); - List nodes = parentMap.get(e.getId()); - if (CollectionUtils.isNotEmpty(nodes)) { - treeNodes.addAll(nodes); - } if (isAdd && CollectionUtils.isNotEmpty(childMap.get(e.getId()))) { List searchTrees = childMap.get(e.getId()).stream().sorted(Comparator.comparing(SearchTree::getOrderNum)).collect(Collectors.toList()); treeNodes.addAll(searchTrees); } - if(CollectionUtils.isNotEmpty(treeNodes)){ - treeNodes = treeNodes.stream().sorted(Comparator.comparing(TreeNode::getType).reversed()).collect(Collectors.toCollection(LinkedHashSet::new)); + List nodes = parentMap.get(e.getId()); + if (CollectionUtils.isNotEmpty(nodes)) { + treeNodes.addAll(nodes); } e.setSubs(new ArrayList<>(treeNodes)); leafIds.add(e.getId());