From e9454d273bf8bdd8d15fac31087eafaffaffceb0 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 30 Dec 2020 20:31:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=BE=91=E6=B5=8B=E8=AF=95=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/track/service/TestPlanService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index 002ade66fc..fa68a27d6c 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -213,6 +213,8 @@ public class TestPlanService { // 关联的项目下的用例idList List caseIds = null; + // 测试计划所属项目下的用例不解除关联 + projectIds.add(testPlan.getProjectId()); if (!CollectionUtils.isEmpty(projectIds)) { TestCaseExample example = new TestCaseExample(); example.createCriteria().andProjectIdIn(projectIds); @@ -220,7 +222,7 @@ public class TestPlanService { caseIds = caseList.stream().map(TestCase::getId).collect(Collectors.toList()); } - // 取消关联所属项目下的用例和计划的关系 + // 取消关联项目下的用例和计划的关系 TestPlanTestCaseExample testPlanTestCaseExample = new TestPlanTestCaseExample(); TestPlanTestCaseExample.Criteria criteria = testPlanTestCaseExample.createCriteria().andPlanIdEqualTo(testPlan.getId()); if (!CollectionUtils.isEmpty(caseIds)) {