获取树形结构
private List<Division> makeTree(List<?> list, String parentId){
//子类
List<Division> children = list.stream().filter(x -> x.getParentId().equals(parentId)).collect(Collectors.toList());
//非子类
List<Division> successor = list.stream().filter(x -> !x.getParentId().equals(parentId)).collect(Collectors.toList());
children.forEach(x->{
makeTree(successor,x.getId()).forEach(
y->x.getChildrenList().add(y)
);
});
return children;
}