mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-03 04:28:51 +08:00
fix(测试跟踪): 公共用例库查询报错
This commit is contained in:
parent
2f5ba3fc5e
commit
70faafe07a
@ -2148,7 +2148,7 @@ public class TestCaseService {
|
|||||||
TestCase testCase = testCaseMapper.selectByPrimaryKey(id);
|
TestCase testCase = testCaseMapper.selectByPrimaryKey(id);
|
||||||
if ((StringUtils.isNotEmpty(testCase.getMaintainer()) && testCase.getMaintainer().equals(SessionUtils.getUserId())) ||
|
if ((StringUtils.isNotEmpty(testCase.getMaintainer()) && testCase.getMaintainer().equals(SessionUtils.getUserId())) ||
|
||||||
(StringUtils.isNotEmpty(testCase.getCreateUser()) && testCase.getCreateUser().equals(SessionUtils.getUserId()))) {
|
(StringUtils.isNotEmpty(testCase.getCreateUser()) && testCase.getCreateUser().equals(SessionUtils.getUserId()))) {
|
||||||
this.deleteTestCasePublic(null , testCase.getRefId());
|
this.deleteTestCasePublic(null, testCase.getRefId());
|
||||||
} else {
|
} else {
|
||||||
MSException.throwException(Translator.get("check_owner_case"));
|
MSException.throwException(Translator.get("check_owner_case"));
|
||||||
}
|
}
|
||||||
@ -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<>();
|
||||||
@ -2472,7 +2480,7 @@ public class TestCaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteTestCasePublic(String versionId , String refId) {
|
public void deleteTestCasePublic(String versionId, String refId) {
|
||||||
TestCase testCase = new TestCase();
|
TestCase testCase = new TestCase();
|
||||||
testCase.setRefId(refId);
|
testCase.setRefId(refId);
|
||||||
testCase.setVersionId(versionId);
|
testCase.setVersionId(versionId);
|
||||||
|
Loading…
Reference in New Issue
Block a user