fix(测试用例): 导出用例子模块未导出问题

--bug=1046089 --user=王旭 【测试用例】github#32941导出excle格式的用例,导出是选择了所属模块,但是excle中所属模块内容为空 https://www.tapd.cn/55049933/s/1574745
This commit is contained in:
WangXu10 2024-09-05 11:32:41 +08:00 committed by Craftsman
parent 22c5bb9125
commit dd6a088a92
1 changed files with 13 additions and 3 deletions

View File

@ -882,7 +882,17 @@ public class FunctionalCaseFileService {
*/ */
private Map<String, String> getModuleMap(String projectId) { private Map<String, String> getModuleMap(String projectId) {
List<BaseTreeNode> moduleTree = functionalCaseModuleService.getTree(projectId); List<BaseTreeNode> moduleTree = functionalCaseModuleService.getTree(projectId);
Map<String, String> moduleMap = moduleTree.stream().collect(Collectors.toMap(BaseTreeNode::getId, BaseTreeNode::getPath)); Map<String, String> moduleMap = buildModuleMap(moduleTree, new HashMap());
return moduleMap;
}
private Map<String, String> buildModuleMap(List<BaseTreeNode> moduleTree, Map<String, String> moduleMap) {
for (BaseTreeNode treeNode : moduleTree) {
moduleMap.put(treeNode.getId(), treeNode.getPath());
if (CollectionUtils.isNotEmpty(treeNode.getChildren())) {
buildModuleMap(treeNode.getChildren(), moduleMap);
}
}
return moduleMap; return moduleMap;
} }