fix: 修复 树结构工具类BUG

pull/9/head
Carina 3 years ago
parent 4b9cf64eda
commit 5f2d2c36f1

@ -112,13 +112,13 @@ public enum TreeBuildUtil {
List<String> excludeFields = ListUtil.list(false);
excludeFields.addAll(DEF_EXCLUDE_FIELDS);
excludeFields.add(config.getIdKey());
excludeFields.add(config.getParentIdKey());
excludeFields.add(config.getWeightKey());
excludeFields.add(treeConfig.getIdKey());
excludeFields.add(treeConfig.getParentIdKey());
excludeFields.add(treeConfig.getWeightKey());
//转换器
return TreeUtil.build(dataList, defParentId, treeConfig,
(treeNode, tree) -> handlerTreeNode(treeNode, tree, config, excludeFields));
(treeNode, tree) -> handlerTreeNode(treeNode, tree, treeConfig, excludeFields));
}
/**
@ -155,9 +155,9 @@ public enum TreeBuildUtil {
final TreeNodeConfig treeConfig = ObjectUtil.defaultIfNull(config, TreeNodeConfig.DEFAULT_CONFIG);
List<String> excludeFields = ListUtil.list(false);
excludeFields.addAll(DEF_EXCLUDE_FIELDS);
excludeFields.add(config.getIdKey());
excludeFields.add(config.getParentIdKey());
excludeFields.add(config.getWeightKey());
excludeFields.add(treeConfig.getIdKey());
excludeFields.add(treeConfig.getParentIdKey());
excludeFields.add(treeConfig.getWeightKey());
//转换器
List<Tree<Object>> treeNodes = Lists.newArrayListWithCapacity(dataList.size());

Loading…
Cancel
Save