|
@@ -25,6 +25,7 @@ import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.secure.BladeUser;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
+import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.constant.BladeConstant;
|
|
|
import org.springblade.core.tool.node.ForestNodeMerger;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
@@ -535,6 +536,34 @@ public class ArchiveTreeContractServiceImpl extends BaseServiceImpl<ArchiveTreeC
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 删除子树
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public boolean deleteTree(Long id) {
|
|
|
+ List<Long> ids = new ArrayList<>();
|
|
|
+
|
|
|
+ ArchiveTreeContract dstNode = this.getById(id);
|
|
|
+ if (dstNode == null ) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ArchiveTreeContractVO2> dstTrees = this.tree2Root(AuthUtil.getTenantId(),null,null,dstNode.getProjectId(),null);
|
|
|
+ if (dstTrees == null || dstTrees.size() == 0) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ ArchiveTreeContractVO2 subTree = ForestNodeMergerEx.getSubTree(dstTrees.get(0),id);
|
|
|
+
|
|
|
+ ForestNodeMergerEx.getChildrenIds(subTree,ids);
|
|
|
+
|
|
|
+ ids.add(id);
|
|
|
+
|
|
|
+ return this.deleteLogic(ids);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|