fix(测试跟踪): 关联用例删除时测试计划详情中相应用例列表的模块树显示问题

--bug=1015464 --user=宋昌昌 【测试跟踪】测试计划关联接口用例,把接口用例删除到回收站后执行测试计划还是会产生报告 https://www.tapd.cn/55049933/s/1214657
This commit is contained in:
song-cc-rock 2022-07-28 16:50:44 +08:00 committed by f2c-ci-robot[bot]
parent 1694c61bc4
commit 445840399e
2 changed files with 5 additions and 0 deletions

View File

@ -12,6 +12,7 @@ import io.metersphere.base.mapper.ApiTestCaseMapper;
import io.metersphere.base.mapper.ext.ExtApiDefinitionMapper; import io.metersphere.base.mapper.ext.ExtApiDefinitionMapper;
import io.metersphere.base.mapper.ext.ExtApiModuleMapper; import io.metersphere.base.mapper.ext.ExtApiModuleMapper;
import io.metersphere.base.mapper.ext.ExtApiTestCaseMapper; import io.metersphere.base.mapper.ext.ExtApiTestCaseMapper;
import io.metersphere.commons.constants.CommonConstants;
import io.metersphere.commons.constants.TestCaseConstants; import io.metersphere.commons.constants.TestCaseConstants;
import io.metersphere.commons.exception.MSException; import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.BeanUtils; import io.metersphere.commons.utils.BeanUtils;
@ -229,10 +230,12 @@ public class ApiModuleService extends NodeTreeService<ApiModuleDTO> {
.collect(Collectors.toList()); .collect(Collectors.toList());
List<String> definitionIds = apiTestCaseService.selectCasesBydIds(caseIds).stream() List<String> definitionIds = apiTestCaseService.selectCasesBydIds(caseIds).stream()
.filter(apiTestCase -> apiTestCase.getStatus() == null || !CommonConstants.TrashStatus.equals(apiTestCase.getStatus()))
.map(ApiTestCase::getApiDefinitionId) .map(ApiTestCase::getApiDefinitionId)
.collect(Collectors.toList()); .collect(Collectors.toList());
List<String> dataNodeIds = apiDefinitionService.selectApiDefinitionBydIds(definitionIds).stream() List<String> dataNodeIds = apiDefinitionService.selectApiDefinitionBydIds(definitionIds).stream()
.filter(apiDefinition -> apiDefinition.getStatus() == null || !CommonConstants.TrashStatus.equals(apiDefinition.getStatus()))
.map(ApiDefinition::getModuleId) .map(ApiDefinition::getModuleId)
.collect(Collectors.toList()); .collect(Collectors.toList());

View File

@ -9,6 +9,7 @@ import io.metersphere.base.mapper.ApiScenarioMapper;
import io.metersphere.base.mapper.ApiScenarioModuleMapper; import io.metersphere.base.mapper.ApiScenarioModuleMapper;
import io.metersphere.base.mapper.ext.ExtApiScenarioMapper; import io.metersphere.base.mapper.ext.ExtApiScenarioMapper;
import io.metersphere.base.mapper.ext.ExtApiScenarioModuleMapper; import io.metersphere.base.mapper.ext.ExtApiScenarioModuleMapper;
import io.metersphere.commons.constants.CommonConstants;
import io.metersphere.commons.constants.TestCaseConstants; import io.metersphere.commons.constants.TestCaseConstants;
import io.metersphere.commons.exception.MSException; import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.SessionUtils; import io.metersphere.commons.utils.SessionUtils;
@ -195,6 +196,7 @@ public class ApiScenarioModuleService extends NodeTreeService<ApiScenarioModuleD
.collect(Collectors.toList()); .collect(Collectors.toList());
List<String> dataNodeIds = apiAutomationService.selectByIds(caseIds).stream() List<String> dataNodeIds = apiAutomationService.selectByIds(caseIds).stream()
.filter(apiScenario -> apiScenario.getStatus() == null || !CommonConstants.TrashStatus.equals(apiScenario.getStatus()))
.map(ApiScenario::getApiScenarioModuleId) .map(ApiScenario::getApiScenarioModuleId)
.collect(Collectors.toList()); .collect(Collectors.toList());