Commit 93b75c6c authored by neo.wang's avatar neo.wang

Merge branch 'dev_neo' into 'dev'

Dev neo

See merge request root/atms!88
parents 794ccd79 a391e4aa
......@@ -245,13 +245,15 @@ public class TBDataImportController {
private void initTree(List<JsonTrialBalanceTreeNode> nodes, String parentCode, List<JsonTrialBalanceTreeNode> sources) {
JsonTrialBalanceTreeNode tempNode;
//递归寻找子节点
List<JsonTrialBalanceTreeNode> tempTree = sources.stream().filter(item -> item.getParentCode().equals(parentCode)).collect(Collectors.toList());
for (JsonTrialBalanceTreeNode row : tempTree) {
tempNode = new JsonTrialBalanceTreeNode();
CommonUtils.copyProperties(row, tempNode);
tempNode.setChildren(new ArrayList<>());
nodes.add(tempNode);
initTree(tempNode.getChildren(), row.getAcctCode(), sources);
if (sources != null && !sources.isEmpty()) {
List<JsonTrialBalanceTreeNode> tempTree = sources.stream().filter(item -> item.getParentCode().equals(parentCode)).collect(Collectors.toList());
for (JsonTrialBalanceTreeNode row : tempTree) {
tempNode = new JsonTrialBalanceTreeNode();
CommonUtils.copyProperties(row, tempNode);
tempNode.setChildren(new ArrayList<>());
nodes.add(tempNode);
initTree(tempNode.getChildren(), row.getAcctCode(), sources);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment