fix(测试跟踪): 测试计划用例模块数量统计有误
This commit is contained in:
parent
3468cf1f7b
commit
2e1bcde9d4
|
@ -83,18 +83,18 @@ public class NodeTreeService<T extends TreeNodeDTO> {
|
||||||
return nodeTree;
|
return nodeTree;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<T> children = Optional.ofNullable(nodeTree.getChildren()).orElse(new ArrayList<>());
|
List<T> children = new ArrayList<>();
|
||||||
|
|
||||||
lowerNodes.forEach(node -> {
|
lowerNodes.forEach(node -> {
|
||||||
if (node.getParentId() != null && node.getParentId().equals(rootNode.getId())) {
|
if (node.getParentId() != null && node.getParentId().equals(rootNode.getId())) {
|
||||||
children.add(buildNodeTree(nodeLevelMap, node, countMap));
|
children.add(buildNodeTree(nodeLevelMap, node, countMap));
|
||||||
if (countMap != null) {
|
|
||||||
Integer childrenCount = children.stream().map(TreeNodeDTO::getCaseNum).reduce(Integer::sum).get();
|
|
||||||
nodeTree.setCaseNum(nodeTree.getCaseNum() + childrenCount);
|
|
||||||
}
|
|
||||||
nodeTree.setChildren(children);
|
nodeTree.setChildren(children);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (countMap != null && CollectionUtils.isNotEmpty(children)) {
|
||||||
|
Integer childrenCount = children.stream().map(TreeNodeDTO::getCaseNum).reduce(Integer::sum).get();
|
||||||
|
nodeTree.setCaseNum(nodeTree.getCaseNum() + childrenCount);
|
||||||
|
}
|
||||||
return nodeTree;
|
return nodeTree;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue