refactor(用例管理):用例评审详情计算生成默认模块

This commit is contained in:
guoyuqi 2024-01-29 19:14:51 +08:00 committed by 刘瑞斌
parent b3822a3607
commit 85cf4dad20
1 changed files with 2 additions and 2 deletions

View File

@ -618,9 +618,9 @@ public class CaseReviewFunctionalCaseService {
returnList.add(projectNode); returnList.add(projectNode);
List<String> projectModuleIds = moduleList.stream().map(FunctionalCaseModule::getId).toList(); List<String> projectModuleIds = moduleList.stream().map(FunctionalCaseModule::getId).toList();
List<BaseTreeNode> nodeByNodeIds = functionalCaseModuleService.getNodeByNodeIds(projectModuleIds); List<BaseTreeNode> nodeByNodeIds = functionalCaseModuleService.getNodeByNodeIds(projectModuleIds);
List<BaseTreeNode> list = nodeByNodeIds.stream().filter(t -> StringUtils.equalsIgnoreCase(t.getId(), ModuleConstants.DEFAULT_NODE_ID.toString())).toList(); List<BaseTreeNode> list = nodeByNodeIds.stream().filter(t -> StringUtils.equalsIgnoreCase(t.getId(), ModuleConstants.DEFAULT_NODE_ID)).toList();
boolean haveVirtualRootNode = list.isEmpty(); boolean haveVirtualRootNode = list.isEmpty();
List<BaseTreeNode> baseTreeNodes = functionalCaseModuleService.buildTreeAndCountResource(nodeByNodeIds, haveVirtualRootNode, Translator.get("default.module")); List<BaseTreeNode> baseTreeNodes = functionalCaseModuleService.buildTreeAndCountResource(nodeByNodeIds, !haveVirtualRootNode, Translator.get("default.module"));
for (BaseTreeNode baseTreeNode : baseTreeNodes) { for (BaseTreeNode baseTreeNode : baseTreeNodes) {
projectNode.addChild(baseTreeNode); projectNode.addChild(baseTreeNode);
} }