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

--bug=1015464 --user=宋昌昌 【测试跟踪】测试计划关联接口用例,把接口用例删除到回收站后执行测试计划还是会产生报告 https://www.tapd.cn/55049933/s/1214657
This commit is contained in:
MeterSphere Bot 2022-08-02 16:35:26 +08:00 committed by GitHub
parent 837d5e01a9
commit 2f371fcefe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import io.metersphere.base.mapper.ApiModuleMapper;
import io.metersphere.base.mapper.ApiTestCaseMapper;
import io.metersphere.base.mapper.ext.ExtApiDefinitionMapper;
import io.metersphere.base.mapper.ext.ExtApiModuleMapper;
import io.metersphere.commons.constants.CommonConstants;
import io.metersphere.commons.constants.TestCaseConstants;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.BeanUtils;
@ -226,10 +227,12 @@ public class ApiModuleService extends NodeTreeService<ApiModuleDTO> {
.collect(Collectors.toList());
List<String> definitionIds = apiTestCaseService.selectCasesBydIds(caseIds).stream()
.filter(apiTestCase -> !StringUtils.equals(CommonConstants.TrashStatus, apiTestCase.getStatus()))
.map(ApiTestCase::getApiDefinitionId)
.collect(Collectors.toList());
List<String> dataNodeIds = apiDefinitionService.selectApiDefinitionBydIds(definitionIds).stream()
.filter(apiDefinition -> !StringUtils.equals(CommonConstants.TrashStatus, apiDefinition.getStatus()))
.map(ApiDefinition::getModuleId)
.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.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<ApiScenarioModuleD
.collect(Collectors.toList());
List<String> dataNodeIds = apiAutomationService.selectByIds(caseIds).stream()
.filter(apiScenario -> !StringUtils.equals(CommonConstants.TrashStatus, apiScenario.getStatus()))
.map(ApiScenario::getApiScenarioModuleId)
.collect(Collectors.toList());