您的位置:首页 > 其它

关于多层级树形结构的项目列表

2016-10-31 20:12 337 查看
这里记录一下
public static List<Map> getTreeDep(List<Department> depList,Long parentId){List<Map> mapList=new ArrayList<Map>();for(Department department:depList){if(department.getParentId()==parentId){Map map=new HashedMap();map.put("id",department.getId());map.put("text",department.getName());map.put("state",department.getIsDelete());map.put("iconCls","emptyico");map.put("children",getTreeDep(depList,department.getId()));mapList.add(map);}}return mapList;}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: