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());