fix(测试跟踪):修复用例excel导入时重复校验不准确问题。 (#1756)

Co-authored-by: 黎龙鑫 <lilongxinya@163.com>
Co-authored-by: jianxing <41557596+AgAngle@users.noreply.github.com>
This commit is contained in:
Ambitiousliga 2021-03-30 16:19:23 +08:00 committed by chenjianxing
parent 5c70925360
commit 2534eafcf0
1 changed files with 6 additions and 12 deletions

View File

@ -182,25 +182,19 @@ public class TestCaseService {
List<TestCaseWithBLOBs> caseList = testCaseMapper.selectByExampleWithBLOBs(example);
// 如果上边字段全部相同去检查 steps remark
boolean isExt = false;
String caseRemark = testCase.getRemark();
if (StringUtils.isBlank(caseRemark)) {
caseRemark = "";
}
// 如果上边字段全部相同去检查 remark steps
if (!CollectionUtils.isEmpty(caseList)) {
String caseRemark = testCase.getRemark();
String caseSteps = testCase.getSteps();
for (TestCaseWithBLOBs tc : caseList) {
String steps = tc.getSteps();
String remark = tc.getRemark();
if (StringUtils.equals(steps, testCase.getSteps()) && StringUtils.equals(remark, caseRemark)) {
//MSException.throwException(Translator.get("test_case_already_exists"));
isExt = true;
if (StringUtils.equals(steps, caseSteps) && StringUtils.equals(remark, caseRemark)) {
//MSException.throwException(Translator.get("test_case_already_exists"));
return tc;
}
}
}
if (isExt) {
return caseList.get(0);
}
}
return null;
}