fix: 不同模块下的同级子模块也不能用一样的名称

--bug=1012846 --user=陈建星 【UI测试】UI元素库 和 UI自动化,不同模块下的同级子模块也不能用一样的名称 https://www.tapd.cn/55049933/s/1151418
This commit is contained in:
chenjianxing 2022-04-29 11:57:14 +08:00 committed by fit2-zhao
parent 0ba2b65660
commit 35f84f54a9
5 changed files with 28 additions and 9 deletions

View File

@ -272,8 +272,13 @@ public class ApiModuleService extends NodeTreeService<ApiModuleDTO> {
ApiModuleExample example = new ApiModuleExample();
ApiModuleExample.Criteria criteria = example.createCriteria();
criteria.andNameEqualTo(node.getName())
.andProjectIdEqualTo(node.getProjectId())
.andLevelEqualTo(node.getLevel());
.andProjectIdEqualTo(node.getProjectId());
if (StringUtils.isNotBlank(node.getParentId())) {
criteria.andParentIdEqualTo(node.getParentId());
} else {
criteria.andLevelEqualTo(node.getLevel());
}
if (StringUtils.isNotBlank(node.getProtocol())) {
criteria.andProtocolEqualTo(node.getProtocol());

View File

@ -233,8 +233,13 @@ public class ApiScenarioModuleService extends NodeTreeService<ApiScenarioModuleD
ApiScenarioModuleExample example = new ApiScenarioModuleExample();
ApiScenarioModuleExample.Criteria criteria = example.createCriteria();
criteria.andNameEqualTo(node.getName())
.andProjectIdEqualTo(node.getProjectId())
.andLevelEqualTo(node.getLevel());
.andProjectIdEqualTo(node.getProjectId());
if (StringUtils.isNotBlank(node.getParentId())) {
criteria.andParentIdEqualTo(node.getParentId());
} else {
criteria.andLevelEqualTo(node.getLevel());
}
if (StringUtils.isNotBlank(node.getId())) {
criteria.andIdNotEqualTo(node.getId());

View File

@ -34,7 +34,6 @@ public class RelationshipGraphData {
private Integer category; // 分组
private Integer x;
private Integer y;
private Boolean visited = false;
}
@Getter

View File

@ -93,8 +93,13 @@ public class BaseModuleService extends NodeTreeService<ModuleNodeDTO> {
TestCaseNodeExample example = new TestCaseNodeExample();
TestCaseNodeExample.Criteria criteria = example.createCriteria();
criteria.andNameEqualTo(node.getName())
.andProjectIdEqualTo(node.getProjectId())
.andLevelEqualTo(node.getLevel());
.andProjectIdEqualTo(node.getProjectId());
if (StringUtils.isNotBlank(node.getParentId())) {
criteria.andParentIdEqualTo(node.getParentId());
} else {
criteria.andLevelEqualTo(node.getLevel());
}
if (StringUtils.isNotBlank(node.getId())) {
criteria.andIdNotEqualTo(node.getId());

View File

@ -104,8 +104,13 @@ public class TestCaseNodeService extends NodeTreeService<TestCaseNodeDTO> {
TestCaseNodeExample example = new TestCaseNodeExample();
TestCaseNodeExample.Criteria criteria = example.createCriteria();
criteria.andNameEqualTo(node.getName())
.andProjectIdEqualTo(node.getProjectId())
.andLevelEqualTo(node.getLevel());
.andProjectIdEqualTo(node.getProjectId());
if (StringUtils.isNotBlank(node.getParentId())) {
criteria.andParentIdEqualTo(node.getParentId());
} else {
criteria.andLevelEqualTo(node.getLevel());
}
if (StringUtils.isNotBlank(node.getId())) {
criteria.andIdNotEqualTo(node.getId());