diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioSelectAssociateService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioSelectAssociateService.java index 0c5de298c6..8066ac7a61 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioSelectAssociateService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioSelectAssociateService.java @@ -49,12 +49,15 @@ public class ApiScenarioSelectAssociateService { case "SCENARIO": List apiScenarioStepDTOs = handleApiScenarioData(request.get(key)); steps.addAll(apiScenarioStepDTOs); + break; case "CASE": List apiCaseStepDTOs = handleApiCaseData(request.get(key)); steps.addAll(apiCaseStepDTOs); + break; default: List apiStepDTOs = handleApiData(request.get(key)); steps.addAll(apiStepDTOs); + break; } } return steps; @@ -126,20 +129,20 @@ public class ApiScenarioSelectAssociateService { moduleMaps.remove(MODULE_ALL); if (selectAllModule) { // 选择了全部模块 - List apiTestCaseList = extApiTestCaseMapper.selectAllApiCaseWithAssociate(request.getProjectId(), request.getProtocols()); + List apiTestCaseList = extApiTestCaseMapper.selectAllApiCaseWithAssociate(request.getProjectId(), request.getProtocols()); getCaseSteps(request, apiTestCaseList, steps); } else { AssociateCaseDTO dto = getCaseIds(moduleMaps); List apiTestCaseList = new ArrayList<>(); //获取全选的模块数据 if (CollectionUtils.isNotEmpty(dto.getModuleIds())) { - apiTestCaseList = extApiTestCaseMapper.getListBySelectModulesWithAssociate( request.getProjectId(), dto.getModuleIds(), request.getProtocols()); + apiTestCaseList = extApiTestCaseMapper.getListBySelectModulesWithAssociate(request.getProjectId(), dto.getModuleIds(), request.getProtocols()); } if (CollectionUtils.isNotEmpty(dto.getSelectIds())) { CollectionUtils.removeAll(dto.getSelectIds(), apiTestCaseList.stream().map(ApiTestCase::getId).toList()); //获取选中的ids数据 - List selectIdList = extApiTestCaseMapper.getListBySelectIdsWithAssociate(request.getProjectId(), dto.getSelectIds(), request.getProtocols()); + List selectIdList = extApiTestCaseMapper.getListBySelectIdsWithAssociate(request.getProjectId(), dto.getSelectIds(), request.getProtocols()); apiTestCaseList.addAll(selectIdList); }