fix(测试跟踪): 功能用例复制功能未复制自定义字段
--bug=1027270 --user=王旭 【测试跟踪】功能用例-自定义字段-复制用例到其他模块-自定义字段内容消失 https://www.tapd.cn/55049933/s/1385069
This commit is contained in:
parent
2c11c028f9
commit
c754d78880
|
@ -3148,6 +3148,7 @@ public class TestCaseService {
|
|||
mapper.insert(testCase);
|
||||
|
||||
dealWithCopyOtherInfo(testCase, oldTestCaseId);
|
||||
copyCustomFields(oldTestCaseId, id);
|
||||
if (i % 50 == 0)
|
||||
sqlSession.flushStatements();
|
||||
}
|
||||
|
@ -3157,6 +3158,18 @@ public class TestCaseService {
|
|||
}
|
||||
}
|
||||
|
||||
private void copyCustomFields(String oldTestCaseId, String id) {
|
||||
CustomFieldTestCaseExample example = new CustomFieldTestCaseExample();
|
||||
example.createCriteria().andResourceIdEqualTo(oldTestCaseId);
|
||||
List<CustomFieldTestCase> customFieldTestCases = customFieldTestCaseMapper.selectByExampleWithBLOBs(example);
|
||||
if (CollectionUtils.isNotEmpty(customFieldTestCases)) {
|
||||
customFieldTestCases.forEach(customFieldTestCase -> {
|
||||
customFieldTestCase.setResourceId(id);
|
||||
customFieldTestCaseMapper.insertSelective(customFieldTestCase);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public List<TestCaseDTO> getTestCaseVersions(String caseId) {
|
||||
TestCaseWithBLOBs testCase = testCaseMapper.selectByPrimaryKey(caseId);
|
||||
if (testCase == null) {
|
||||
|
|
Loading…
Reference in New Issue