From 7f0a9900dd38d711a2ee2730a48943c4d343a20d Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Wed, 17 Jul 2024 14:45:59 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):?= =?UTF-8?q?=20=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E5=85=B3=E8=81=94?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/plan/service/TestPlanResourceService.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanResourceService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanResourceService.java index 97170bc6c4..2e5541ea98 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanResourceService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanResourceService.java @@ -115,12 +115,13 @@ public abstract class TestPlanResourceService extends TestPlanSortService { .flatMap(moduleSelectDTO -> moduleSelectDTO.getExcludeIds().stream()) .toList(); // 选中的ids - List selectIds = moduleMaps.values().stream() - .flatMap(moduleSelectDTO -> moduleSelectDTO.getSelectIds().stream()) + List selectIds = moduleMaps.entrySet().stream() + .filter(entry -> BooleanUtils.isFalse(entry.getValue().isSelectAll()) && CollectionUtils.isNotEmpty(entry.getValue().getSelectIds())) + .map(Map.Entry::getKey) .toList(); // 全选的模块 List moduleIds = moduleMaps.entrySet().stream() - .filter(entry -> BooleanUtils.isTrue(entry.getValue().isSelectAll()) && CollectionUtils.isEmpty(entry.getValue().getSelectIds())) + .filter(entry -> BooleanUtils.isTrue(entry.getValue().isSelectAll())) .map(Map.Entry::getKey) .toList();