From 388ded7a264fcabd2cd68205b9d074769fd357ac Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Thu, 28 Jul 2022 16:50:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E5=85=B3=E8=81=94=E7=94=A8=E4=BE=8B=E5=88=A0=E9=99=A4=E6=97=B6?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E8=AF=A6=E6=83=85=E4=B8=AD?= =?UTF-8?q?=E7=9B=B8=E5=BA=94=E7=94=A8=E4=BE=8B=E5=88=97=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=A0=91=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1015464 --user=宋昌昌 【测试跟踪】测试计划关联接口用例,把接口用例删除到回收站后执行测试计划还是会产生报告 https://www.tapd.cn/55049933/s/1214657 --- .../main/java/io/metersphere/api/service/ApiModuleService.java | 3 +++ .../io/metersphere/api/service/ApiScenarioModuleService.java | 2 ++ 2 files changed, 5 insertions(+) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java b/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java index 1dcef94c11..46dabdf24c 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java @@ -12,6 +12,7 @@ import io.metersphere.base.mapper.ApiTestCaseMapper; import io.metersphere.base.mapper.ext.ExtApiDefinitionMapper; import io.metersphere.base.mapper.ext.ExtApiModuleMapper; import io.metersphere.base.mapper.ext.ExtApiTestCaseMapper; +import io.metersphere.commons.constants.CommonConstants; import io.metersphere.commons.constants.TestCaseConstants; import io.metersphere.commons.exception.MSException; import io.metersphere.commons.utils.BeanUtils; @@ -229,10 +230,12 @@ public class ApiModuleService extends NodeTreeService { .collect(Collectors.toList()); List definitionIds = apiTestCaseService.selectCasesBydIds(caseIds).stream() + .filter(apiTestCase -> apiTestCase.getStatus() == null || !CommonConstants.TrashStatus.equals(apiTestCase.getStatus())) .map(ApiTestCase::getApiDefinitionId) .collect(Collectors.toList()); List dataNodeIds = apiDefinitionService.selectApiDefinitionBydIds(definitionIds).stream() + .filter(apiDefinition -> apiDefinition.getStatus() == null || !CommonConstants.TrashStatus.equals(apiDefinition.getStatus())) .map(ApiDefinition::getModuleId) .collect(Collectors.toList()); diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java index 04a862edd9..a1a96e266c 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java @@ -9,6 +9,7 @@ import io.metersphere.base.mapper.ApiScenarioMapper; import io.metersphere.base.mapper.ApiScenarioModuleMapper; import io.metersphere.base.mapper.ext.ExtApiScenarioMapper; import io.metersphere.base.mapper.ext.ExtApiScenarioModuleMapper; +import io.metersphere.commons.constants.CommonConstants; import io.metersphere.commons.constants.TestCaseConstants; import io.metersphere.commons.exception.MSException; import io.metersphere.commons.utils.SessionUtils; @@ -195,6 +196,7 @@ public class ApiScenarioModuleService extends NodeTreeService dataNodeIds = apiAutomationService.selectByIds(caseIds).stream() + .filter(apiScenario -> apiScenario.getStatus() == null || !CommonConstants.TrashStatus.equals(apiScenario.getStatus())) .map(ApiScenario::getApiScenarioModuleId) .collect(Collectors.toList());