From 467942fc59abbf90c003249b007fa6263cbfa38b Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Mon, 20 Nov 2023 16:26:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6=E7=AE=A1=E7=90=86=E4=B8=AD?= =?UTF-8?q?=E9=92=88=E5=AF=B9=E8=B7=9F=E7=9B=AE=E5=BD=95id=E7=9A=84?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/project/service/FileModuleService.java | 2 +- .../java/io/metersphere/project/service/ModuleTreeService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/service/FileModuleService.java b/backend/services/project-management/src/main/java/io/metersphere/project/service/FileModuleService.java index 5fa28f2d34..011236d403 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/service/FileModuleService.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/service/FileModuleService.java @@ -94,7 +94,7 @@ public class FileModuleService extends ModuleTreeService implements CleanupProje */ protected void checkDataValidity(FileModule fileModule) { FileModuleExample example = new FileModuleExample(); - if (!StringUtils.equals(fileModule.getParentId(), ModuleConstants.ROOT_NODE_PARENT_ID)) { + if (!StringUtils.equalsIgnoreCase(fileModule.getParentId(), ModuleConstants.ROOT_NODE_PARENT_ID)) { //检查父ID是否存在 example.createCriteria().andIdEqualTo(fileModule.getParentId()); if (fileModuleMapper.countByExample(example) == 0) { diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/service/ModuleTreeService.java b/backend/services/project-management/src/main/java/io/metersphere/project/service/ModuleTreeService.java index 148da19aa4..d6018522ce 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/service/ModuleTreeService.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/service/ModuleTreeService.java @@ -59,7 +59,7 @@ public abstract class ModuleTreeService { while (CollectionUtils.isNotEmpty(traverseList) && traverseList.size() != lastSize) { List notMatchedList = new ArrayList<>(); for (BaseTreeNode treeNode : traverseList) { - if (StringUtils.equals(treeNode.getParentId(), ModuleConstants.ROOT_NODE_PARENT_ID)) { + if (StringUtils.equalsIgnoreCase(treeNode.getParentId(), ModuleConstants.ROOT_NODE_PARENT_ID)) { BaseTreeNode node = new BaseTreeNode(treeNode.getId(), treeNode.getName(), treeNode.getType(), treeNode.getParentId()); baseTreeNodeList.add(node); baseTreeNodeMap.put(treeNode.getId(), node);