huangtf 2 年之前
父節點
當前提交
ac3b49fdc8

+ 9 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/utils/ForestNodeMergerEx.java

@@ -105,6 +105,11 @@ public class ForestNodeMergerEx {
         getTreeList(srcTree,srcList);
         getTreeList(dstTree,dstList);
 
+        boolean bRootMatch = true;
+        if (dstTree.getFromId() != srcTree.getFromId())  {
+            bRootMatch = false;
+        }
+
         //将dst fromID全部入MAP,看看哪个没有
         for (E dst :dstList) {
             if (dst.getFromId() != null ) {
@@ -119,6 +124,10 @@ public class ForestNodeMergerEx {
             if (srcDstMap.get(src.getId())!= null) {
                 continue;
             }
+            if (src.getId() == srcTree.getId() && bRootMatch == false) {
+                continue;
+            }
+
             srcAddList.add(src);
         }