fix(测试用例): 导入的用例编辑时报错#1005409

--bug=1005409 --user=lyh 导入的用例编辑报错
https://www.tapd.cn/55049933/s/1029101
This commit is contained in:
shiziyuan9527 2021-07-26 14:34:21 +08:00 committed by 刘瑞斌
parent 8e27594fe6
commit a6ae92d275
1 changed files with 10 additions and 8 deletions

View File

@ -1157,14 +1157,16 @@ public class TestCaseService {
List<List<String>> selecteds = request.getSelected();
TestCaseTest test = new TestCaseTest();
LogUtil.info("关联的测试用例:" + selecteds);
selecteds.forEach(id -> {
test.setTestType(id.get(0));
test.setTestId(id.get(id.size() - 1));
test.setCreateTime(System.currentTimeMillis());
test.setUpdateTime(System.currentTimeMillis());
test.setTestCaseId(request.getId());
testCaseTestMapper.insert(test);
});
if (selecteds != null) {
selecteds.forEach(id -> {
test.setTestType(id.get(0));
test.setTestId(id.get(id.size() - 1));
test.setCreateTime(System.currentTimeMillis());
test.setUpdateTime(System.currentTimeMillis());
test.setTestCaseId(request.getId());
testCaseTestMapper.insert(test);
});
}
// 新选择了一个文件删除原来的文件
List<FileMetadata> updatedFiles = request.getUpdatedFileList();