fix(测试计划): 修复编辑测试计划缺陷

This commit is contained in:
shiziyuan9527 2020-12-30 20:31:49 +08:00
parent 03135592b0
commit e9454d273b
1 changed files with 3 additions and 1 deletions

View File

@ -213,6 +213,8 @@ public class TestPlanService {
// 关联的项目下的用例idList // 关联的项目下的用例idList
List<String> caseIds = null; List<String> caseIds = null;
// 测试计划所属项目下的用例不解除关联
projectIds.add(testPlan.getProjectId());
if (!CollectionUtils.isEmpty(projectIds)) { if (!CollectionUtils.isEmpty(projectIds)) {
TestCaseExample example = new TestCaseExample(); TestCaseExample example = new TestCaseExample();
example.createCriteria().andProjectIdIn(projectIds); example.createCriteria().andProjectIdIn(projectIds);
@ -220,7 +222,7 @@ public class TestPlanService {
caseIds = caseList.stream().map(TestCase::getId).collect(Collectors.toList()); caseIds = caseList.stream().map(TestCase::getId).collect(Collectors.toList());
} }
// 取消关联所属项目下的用例和计划的关系 // 取消关联项目下的用例和计划的关系
TestPlanTestCaseExample testPlanTestCaseExample = new TestPlanTestCaseExample(); TestPlanTestCaseExample testPlanTestCaseExample = new TestPlanTestCaseExample();
TestPlanTestCaseExample.Criteria criteria = testPlanTestCaseExample.createCriteria().andPlanIdEqualTo(testPlan.getId()); TestPlanTestCaseExample.Criteria criteria = testPlanTestCaseExample.createCriteria().andPlanIdEqualTo(testPlan.getId());
if (!CollectionUtils.isEmpty(caseIds)) { if (!CollectionUtils.isEmpty(caseIds)) {