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();