fix: 添加模块重名校验失效
This commit is contained in:
parent
0dece32c19
commit
1a78d6aedd
|
@ -272,17 +272,13 @@ public class ApiModuleService extends NodeTreeService<ApiModuleDTO> {
|
||||||
ApiModuleExample example = new ApiModuleExample();
|
ApiModuleExample example = new ApiModuleExample();
|
||||||
ApiModuleExample.Criteria criteria = example.createCriteria();
|
ApiModuleExample.Criteria criteria = example.createCriteria();
|
||||||
criteria.andNameEqualTo(node.getName())
|
criteria.andNameEqualTo(node.getName())
|
||||||
.andProjectIdEqualTo(node.getProjectId());
|
.andProjectIdEqualTo(node.getProjectId())
|
||||||
|
.andLevelEqualTo(node.getLevel());
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(node.getProtocol())) {
|
if (StringUtils.isNotBlank(node.getProtocol())) {
|
||||||
criteria.andProtocolEqualTo(node.getProtocol());
|
criteria.andProtocolEqualTo(node.getProtocol());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(node.getParentId())) {
|
|
||||||
criteria.andParentIdEqualTo(node.getParentId());
|
|
||||||
} else {
|
|
||||||
criteria.andParentIdIsNull();
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(node.getId())) {
|
if (StringUtils.isNotBlank(node.getId())) {
|
||||||
criteria.andIdNotEqualTo(node.getId());
|
criteria.andIdNotEqualTo(node.getId());
|
||||||
}
|
}
|
||||||
|
@ -296,12 +292,9 @@ public class ApiModuleService extends NodeTreeService<ApiModuleDTO> {
|
||||||
ApiModuleExample example = new ApiModuleExample();
|
ApiModuleExample example = new ApiModuleExample();
|
||||||
ApiModuleExample.Criteria criteria = example.createCriteria();
|
ApiModuleExample.Criteria criteria = example.createCriteria();
|
||||||
criteria.andNameEqualTo(node.getName())
|
criteria.andNameEqualTo(node.getName())
|
||||||
.andProjectIdEqualTo(node.getProjectId());
|
.andProjectIdEqualTo(node.getProjectId())
|
||||||
if (StringUtils.isNotBlank(node.getParentId())) {
|
.andLevelEqualTo(node.getLevel());
|
||||||
criteria.andParentIdEqualTo(node.getParentId());
|
|
||||||
} else {
|
|
||||||
criteria.andParentIdIsNull();
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(node.getId())) {
|
if (StringUtils.isNotBlank(node.getId())) {
|
||||||
criteria.andIdNotEqualTo(node.getId());
|
criteria.andIdNotEqualTo(node.getId());
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,12 +233,9 @@ public class ApiScenarioModuleService extends NodeTreeService<ApiScenarioModuleD
|
||||||
ApiScenarioModuleExample example = new ApiScenarioModuleExample();
|
ApiScenarioModuleExample example = new ApiScenarioModuleExample();
|
||||||
ApiScenarioModuleExample.Criteria criteria = example.createCriteria();
|
ApiScenarioModuleExample.Criteria criteria = example.createCriteria();
|
||||||
criteria.andNameEqualTo(node.getName())
|
criteria.andNameEqualTo(node.getName())
|
||||||
.andProjectIdEqualTo(node.getProjectId());
|
.andProjectIdEqualTo(node.getProjectId())
|
||||||
if (StringUtils.isNotBlank(node.getParentId())) {
|
.andLevelEqualTo(node.getLevel());
|
||||||
criteria.andParentIdEqualTo(node.getParentId());
|
|
||||||
} else {
|
|
||||||
criteria.andParentIdIsNull();
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(node.getId())) {
|
if (StringUtils.isNotBlank(node.getId())) {
|
||||||
criteria.andIdNotEqualTo(node.getId());
|
criteria.andIdNotEqualTo(node.getId());
|
||||||
}
|
}
|
||||||
|
@ -321,12 +318,9 @@ public class ApiScenarioModuleService extends NodeTreeService<ApiScenarioModuleD
|
||||||
ApiScenarioModuleExample example = new ApiScenarioModuleExample();
|
ApiScenarioModuleExample example = new ApiScenarioModuleExample();
|
||||||
ApiScenarioModuleExample.Criteria criteria = example.createCriteria();
|
ApiScenarioModuleExample.Criteria criteria = example.createCriteria();
|
||||||
criteria.andNameEqualTo(node.getName())
|
criteria.andNameEqualTo(node.getName())
|
||||||
.andProjectIdEqualTo(node.getProjectId());
|
.andProjectIdEqualTo(node.getProjectId())
|
||||||
if (StringUtils.isNotBlank(node.getParentId())) {
|
.andLevelEqualTo(node.getLevel());
|
||||||
criteria.andParentIdEqualTo(node.getParentId());
|
|
||||||
} else {
|
|
||||||
criteria.andParentIdIsNull();
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(node.getId())) {
|
if (StringUtils.isNotBlank(node.getId())) {
|
||||||
criteria.andIdNotEqualTo(node.getId());
|
criteria.andIdNotEqualTo(node.getId());
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,12 +93,9 @@ public class BaseModuleService extends NodeTreeService<ModuleNodeDTO> {
|
||||||
TestCaseNodeExample example = new TestCaseNodeExample();
|
TestCaseNodeExample example = new TestCaseNodeExample();
|
||||||
TestCaseNodeExample.Criteria criteria = example.createCriteria();
|
TestCaseNodeExample.Criteria criteria = example.createCriteria();
|
||||||
criteria.andNameEqualTo(node.getName())
|
criteria.andNameEqualTo(node.getName())
|
||||||
.andProjectIdEqualTo(node.getProjectId());
|
.andProjectIdEqualTo(node.getProjectId())
|
||||||
if (StringUtils.isNotBlank(node.getParentId())) {
|
.andLevelEqualTo(node.getLevel());
|
||||||
criteria.andParentIdEqualTo(node.getParentId());
|
|
||||||
} else {
|
|
||||||
criteria.andParentIdIsNull();
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(node.getId())) {
|
if (StringUtils.isNotBlank(node.getId())) {
|
||||||
criteria.andIdNotEqualTo(node.getId());
|
criteria.andIdNotEqualTo(node.getId());
|
||||||
}
|
}
|
||||||
|
@ -575,12 +572,9 @@ public class BaseModuleService extends NodeTreeService<ModuleNodeDTO> {
|
||||||
TestCaseNodeExample example = new TestCaseNodeExample();
|
TestCaseNodeExample example = new TestCaseNodeExample();
|
||||||
TestCaseNodeExample.Criteria criteria = example.createCriteria();
|
TestCaseNodeExample.Criteria criteria = example.createCriteria();
|
||||||
criteria.andNameEqualTo(node.getName())
|
criteria.andNameEqualTo(node.getName())
|
||||||
.andProjectIdEqualTo(node.getProjectId());
|
.andProjectIdEqualTo(node.getProjectId())
|
||||||
if (StringUtils.isNotBlank(node.getParentId())) {
|
.andLevelEqualTo(node.getLevel());
|
||||||
criteria.andParentIdEqualTo(node.getParentId());
|
|
||||||
} else {
|
|
||||||
criteria.andParentIdIsNull();
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(node.getId())) {
|
if (StringUtils.isNotBlank(node.getId())) {
|
||||||
criteria.andIdNotEqualTo(node.getId());
|
criteria.andIdNotEqualTo(node.getId());
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,12 +104,9 @@ public class TestCaseNodeService extends NodeTreeService<TestCaseNodeDTO> {
|
||||||
TestCaseNodeExample example = new TestCaseNodeExample();
|
TestCaseNodeExample example = new TestCaseNodeExample();
|
||||||
TestCaseNodeExample.Criteria criteria = example.createCriteria();
|
TestCaseNodeExample.Criteria criteria = example.createCriteria();
|
||||||
criteria.andNameEqualTo(node.getName())
|
criteria.andNameEqualTo(node.getName())
|
||||||
.andProjectIdEqualTo(node.getProjectId());
|
.andProjectIdEqualTo(node.getProjectId())
|
||||||
if (StringUtils.isNotBlank(node.getParentId())) {
|
.andLevelEqualTo(node.getLevel());
|
||||||
criteria.andParentIdEqualTo(node.getParentId());
|
|
||||||
} else {
|
|
||||||
criteria.andParentIdIsNull();
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(node.getId())) {
|
if (StringUtils.isNotBlank(node.getId())) {
|
||||||
criteria.andIdNotEqualTo(node.getId());
|
criteria.andIdNotEqualTo(node.getId());
|
||||||
}
|
}
|
||||||
|
@ -658,12 +655,10 @@ public class TestCaseNodeService extends NodeTreeService<TestCaseNodeDTO> {
|
||||||
if (module == null && StringUtils.isNotEmpty(node.getName())) {
|
if (module == null && StringUtils.isNotEmpty(node.getName())) {
|
||||||
TestCaseNodeExample example = new TestCaseNodeExample();
|
TestCaseNodeExample example = new TestCaseNodeExample();
|
||||||
TestCaseNodeExample.Criteria criteria = example.createCriteria();
|
TestCaseNodeExample.Criteria criteria = example.createCriteria();
|
||||||
criteria.andNameEqualTo(node.getName()).andProjectIdEqualTo(node.getProjectId());
|
criteria.andNameEqualTo(node.getName()).
|
||||||
if (StringUtils.isNotEmpty(node.getParentId())) {
|
andProjectIdEqualTo(node.getProjectId())
|
||||||
criteria.andParentIdEqualTo(node.getParentId());
|
.andLevelEqualTo(node.getLevel());
|
||||||
} else {
|
|
||||||
criteria.andParentIdIsNull();
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotEmpty(node.getId())) {
|
if (StringUtils.isNotEmpty(node.getId())) {
|
||||||
criteria.andIdNotEqualTo(node.getId());
|
criteria.andIdNotEqualTo(node.getId());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue