From 08848649e62d68c64fb13355c76b5836b76619c2 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Sun, 18 Sep 2022 20:48:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6=E5=BA=93=E7=9A=84=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E8=8A=82=E7=82=B9=E5=88=9B=E5=BB=BA=E6=97=B6=E7=9A=84?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复文件库的模块节点创建时的校验逻辑 --- .../io/metersphere/metadata/service/FileModuleService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/src/main/java/io/metersphere/metadata/service/FileModuleService.java b/backend/src/main/java/io/metersphere/metadata/service/FileModuleService.java index 18d23d211e..4ed7183c8e 100644 --- a/backend/src/main/java/io/metersphere/metadata/service/FileModuleService.java +++ b/backend/src/main/java/io/metersphere/metadata/service/FileModuleService.java @@ -201,7 +201,11 @@ public class FileModuleService extends NodeTreeService { } if (StringUtils.equalsIgnoreCase(node.getModuleType(), FileModuleTypeConstants.REPOSITORY.getValue())) { example.clear(); + criteria = example.createCriteria(); criteria.andNameEqualTo(node.getName()).andProjectIdEqualTo(node.getProjectId()).andModuleTypeEqualTo(FileModuleTypeConstants.REPOSITORY.getValue()); + if (StringUtils.isNotBlank(node.getId())) { + criteria.andIdNotEqualTo(node.getId()); + } if (fileModuleMapper.selectByExample(example).size() > 0) { MSException.throwException(Translator.get("repository_module_already_exists") + ": " + node.getName()); }