public class GenerateCalculatorUtil {
//递归生成菜单树
public static List<DormStructure> getTree(int pid, List<DormStructure> list){
List<DormStructure> newTreeList = new ArrayList<>();
for (DormStructure item : list) {
if(pid==item.getDormParentId()) {
item.setChildren(getTree(item.getDormId(), list));
newTreeList.add(item);
}
}
return newTreeList;
}
}
递归查询树列表
最新推荐文章于 2023-07-07 17:19:56 发布
3559

被折叠的 条评论
为什么被折叠?



