fix(测试跟踪): 公共用例库查询报错

This commit is contained in:
zhangdahai112 2022-01-21 13:44:43 +08:00 committed by zhangdahai112
parent 2f5ba3fc5e
commit 70faafe07a

View File

@ -2232,12 +2232,20 @@ public class TestCaseService {
ProjectExample projectExample = new ProjectExample(); ProjectExample projectExample = new ProjectExample();
projectExample.createCriteria().andIdIn(projectIds); projectExample.createCriteria().andIdIn(projectIds);
List<Project> projects = projectMapper.selectByExample(projectExample); List<Project> projects = new ArrayList<>();
if (CollectionUtils.isNotEmpty(projectIds)) {
projects = projectMapper.selectByExample(projectExample);
}
Map<String, String> projectNameMap = projects.stream().collect(Collectors.toMap(Project::getId, Project::getName)); Map<String, String> projectNameMap = projects.stream().collect(Collectors.toMap(Project::getId, Project::getName));
ProjectVersionExample versionExample = new ProjectVersionExample(); ProjectVersionExample versionExample = new ProjectVersionExample();
versionExample.createCriteria().andIdIn(versionIds); versionExample.createCriteria().andIdIn(versionIds);
List<ProjectVersion> projectVersions = projectVersionMapper.selectByExample(versionExample); List<ProjectVersion> projectVersions = new ArrayList<>();
if (CollectionUtils.isNotEmpty(versionIds)) {
projectVersions = projectVersionMapper.selectByExample(versionExample);
}
Map<String, String> verisonNameMap = projectVersions.stream().collect(Collectors.toMap(ProjectVersion::getId, ProjectVersion::getName)); Map<String, String> verisonNameMap = projectVersions.stream().collect(Collectors.toMap(ProjectVersion::getId, ProjectVersion::getName));
List<TestCaseTestDao> testCaseTestList = new ArrayList<>(); List<TestCaseTestDao> testCaseTestList = new ArrayList<>();