fix(项目设置): 修复文件库的模块节点创建时的校验逻辑

修复文件库的模块节点创建时的校验逻辑
This commit is contained in:
song-tianyang 2022-09-18 20:48:43 +08:00 committed by 刘瑞斌
parent c0d8bfbb94
commit 6e88707811
1 changed files with 4 additions and 0 deletions

View File

@ -201,7 +201,11 @@ public class FileModuleService extends NodeTreeService<FileModuleVo> {
}
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());
}