瀏覽代碼

质检-资料填报-新增节点报错提示调整

LHB 2 月之前
父節點
當前提交
9b9b7187cb

+ 3 - 3
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -4960,13 +4960,13 @@ public R<Object> customAddContractNode(@RequestBody CustomAddContractNodeDTO dto
 
             // 安全检测1:防止循环引用导致无限循环
             if (processedCount > totalNodes * 2) {
-                throw new IllegalStateException("处理节点数超过预期,可能存在循环引用。已处理: "
+                throw new ServiceException("处理节点数超过预期,可能存在循环引用。已处理: "
                         + processedCount + ",总节点: " + totalNodes);
             }
 
             // 安全检测2:防止路径过长
             if (parent.getAncestorsPId().split(",").length > MAX_DEPTH) {
-                throw new IllegalStateException("祖级路径超过最大深度限制: " + MAX_DEPTH);
+                throw new ServiceException("祖级路径超过最大深度限制: " + MAX_DEPTH);
             }
 
             List<WbsTreeContract> children = childrenMap.get(parent.getPKeyId());
@@ -4975,7 +4975,7 @@ public R<Object> customAddContractNode(@RequestBody CustomAddContractNodeDTO dto
             for (WbsTreeContract child : children) {
                 // 安全检测3:检查循环引用
                 if (visited.contains(child.getPKeyId())) {
-                    throw new IllegalStateException("检测到循环引用: 节点" + child.getPKeyId()
+                    throw new ServiceException("检测到循环引用: 节点" + child.getPKeyId()
                             + " -> 节点" + parent.getPKeyId());
                 }