From 4376d3bc91373f41c41a5c00cf962283222cc995 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 22 Oct 2024 19:07:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E5=AF=BC=E5=85=A5=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E8=AF=B7=E6=B1=82=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1047839 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001047839 --- .../scenario/ApiScenarioSelectAssociateService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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); }