refactor(测试计划): 测试计划关联优化

This commit is contained in:
WangXu10 2024-07-17 14:45:59 +08:00 committed by 刘瑞斌
parent 38d0d3a161
commit 7f0a9900dd
1 changed files with 4 additions and 3 deletions

View File

@ -115,12 +115,13 @@ public abstract class TestPlanResourceService extends TestPlanSortService {
.flatMap(moduleSelectDTO -> moduleSelectDTO.getExcludeIds().stream()) .flatMap(moduleSelectDTO -> moduleSelectDTO.getExcludeIds().stream())
.toList(); .toList();
// 选中的ids // 选中的ids
List<String> selectIds = moduleMaps.values().stream() List<String> selectIds = moduleMaps.entrySet().stream()
.flatMap(moduleSelectDTO -> moduleSelectDTO.getSelectIds().stream()) .filter(entry -> BooleanUtils.isFalse(entry.getValue().isSelectAll()) && CollectionUtils.isNotEmpty(entry.getValue().getSelectIds()))
.map(Map.Entry::getKey)
.toList(); .toList();
// 全选的模块 // 全选的模块
List<String> moduleIds = moduleMaps.entrySet().stream() List<String> 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) .map(Map.Entry::getKey)
.toList(); .toList();