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 { ...@@ -245,13 +245,15 @@ public class TBDataImportController {
private void initTree(List<JsonTrialBalanceTreeNode> nodes, String parentCode, List<JsonTrialBalanceTreeNode> sources) { private void initTree(List<JsonTrialBalanceTreeNode> nodes, String parentCode, List<JsonTrialBalanceTreeNode> sources) {
JsonTrialBalanceTreeNode tempNode; JsonTrialBalanceTreeNode tempNode;
//递归寻找子节点 //递归寻找子节点
List<JsonTrialBalanceTreeNode> tempTree = sources.stream().filter(item -> item.getParentCode().equals(parentCode)).collect(Collectors.toList()); if (sources != null && !sources.isEmpty()) {
for (JsonTrialBalanceTreeNode row : tempTree) { List<JsonTrialBalanceTreeNode> tempTree = sources.stream().filter(item -> item.getParentCode().equals(parentCode)).collect(Collectors.toList());
tempNode = new JsonTrialBalanceTreeNode(); for (JsonTrialBalanceTreeNode row : tempTree) {
CommonUtils.copyProperties(row, tempNode); tempNode = new JsonTrialBalanceTreeNode();
tempNode.setChildren(new ArrayList<>()); CommonUtils.copyProperties(row, tempNode);
nodes.add(tempNode); tempNode.setChildren(new ArrayList<>());
initTree(tempNode.getChildren(), row.getAcctCode(), sources); 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