fix: 创建功能用例其他版本提示ID已存在
This commit is contained in:
parent
4374f42aa3
commit
35d3330b14
|
@ -254,11 +254,16 @@ public class TestCaseService {
|
|||
}
|
||||
|
||||
private void checkCustomNumExist(TestCaseWithBLOBs testCase) {
|
||||
String id = testCase.getId();
|
||||
TestCaseWithBLOBs testCaseWithBLOBs = testCaseMapper.selectByPrimaryKey(id);
|
||||
TestCaseExample example = new TestCaseExample();
|
||||
example.createCriteria()
|
||||
.andCustomNumEqualTo(testCase.getCustomNum())
|
||||
TestCaseExample.Criteria criteria = example.createCriteria();
|
||||
criteria.andCustomNumEqualTo(testCase.getCustomNum())
|
||||
.andProjectIdEqualTo(testCase.getProjectId())
|
||||
.andIdNotEqualTo(testCase.getId());
|
||||
if (testCaseWithBLOBs != null && StringUtils.isNotBlank(testCaseWithBLOBs.getRefId())) {
|
||||
criteria.andRefIdNotEqualTo(testCaseWithBLOBs.getRefId());
|
||||
}
|
||||
List<TestCase> list = testCaseMapper.selectByExample(example);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
MSException.throwException(Translator.get("custom_num_is_exist"));
|
||||
|
|
Loading…
Reference in New Issue