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