org.jeecg.modules.system.model.TreeModel Java Examples

The following examples show how to use org.jeecg.modules.system.model.TreeModel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SysRoleController.java    From jeecg-cloud with Apache License 2.0 6 votes vote down vote up
private void getTreeModelList(List<TreeModel> treeList,List<SysPermission> metaList,TreeModel temp) {
	for (SysPermission permission : metaList) {
		String tempPid = permission.getParentId();
		TreeModel tree = new TreeModel(permission.getId(), tempPid, permission.getName(),permission.getRuleFlag(), permission.isLeaf());
		if(temp==null && oConvertUtils.isEmpty(tempPid)) {
			treeList.add(tree);
			if(!tree.getIsLeaf()) {
				getTreeModelList(treeList, metaList, tree);
			}
		}else if(temp!=null && tempPid!=null && tempPid.equals(temp.getKey())){
			temp.getChildren().add(tree);
			if(!tree.getIsLeaf()) {
				getTreeModelList(treeList, metaList, tree);
			}
		}
		
	}
}
 
Example #2
Source File: SysDepartPermissionController.java    From jeecg-boot with Apache License 2.0 6 votes vote down vote up
private void getTreeModelList(List<TreeModel> treeList, List<SysPermission> metaList, TreeModel temp) {
 for (SysPermission permission : metaList) {
	 String tempPid = permission.getParentId();
	 TreeModel tree = new TreeModel(permission.getId(), tempPid, permission.getName(),permission.getRuleFlag(), permission.isLeaf());
	 if(temp==null && oConvertUtils.isEmpty(tempPid)) {
		 treeList.add(tree);
		 if(!tree.getIsLeaf()) {
			 getTreeModelList(treeList, metaList, tree);
		 }
	 }else if(temp!=null && tempPid!=null && tempPid.equals(temp.getKey())){
		 temp.getChildren().add(tree);
		 if(!tree.getIsLeaf()) {
			 getTreeModelList(treeList, metaList, tree);
		 }
	 }

 }
}
 
Example #3
Source File: SysPermissionController.java    From jeecg-boot with Apache License 2.0 6 votes vote down vote up
private void getTreeModelList(List<TreeModel> treeList, List<SysPermission> metaList, TreeModel temp) {
	for (SysPermission permission : metaList) {
		String tempPid = permission.getParentId();
		TreeModel tree = new TreeModel(permission);
		if (temp == null && oConvertUtils.isEmpty(tempPid)) {
			treeList.add(tree);
			if (!tree.getIsLeaf()) {
				getTreeModelList(treeList, metaList, tree);
			}
		} else if (temp != null && tempPid != null && tempPid.equals(temp.getKey())) {
			temp.getChildren().add(tree);
			if (!tree.getIsLeaf()) {
				getTreeModelList(treeList, metaList, tree);
			}
		}

	}
}
 
Example #4
Source File: SysPermissionController.java    From jeecg-boot with Apache License 2.0 6 votes vote down vote up
/**
 * 异步加载数据节点
 * 
 * @return
 */
@RequestMapping(value = "/queryListAsync", method = RequestMethod.GET)
public Result<List<TreeModel>> queryAsync(@RequestParam(name = "pid", required = false) String parentId) {
	Result<List<TreeModel>> result = new Result<>();
	try {
		List<TreeModel> list = sysPermissionService.queryListByParentId(parentId);
		if (list == null || list.size() <= 0) {
			result.error500("未找到角色信息");
		} else {
			result.setResult(list);
			result.setSuccess(true);
		}
	} catch (Exception e) {
		log.error(e.getMessage(), e);
	}

	return result;
}
 
Example #5
Source File: SysRoleController.java    From jeecg-boot with Apache License 2.0 6 votes vote down vote up
private void getTreeModelList(List<TreeModel> treeList,List<SysPermission> metaList,TreeModel temp) {
	for (SysPermission permission : metaList) {
		String tempPid = permission.getParentId();
		TreeModel tree = new TreeModel(permission.getId(), tempPid, permission.getName(),permission.getRuleFlag(), permission.isLeaf());
		if(temp==null && oConvertUtils.isEmpty(tempPid)) {
			treeList.add(tree);
			if(!tree.getIsLeaf()) {
				getTreeModelList(treeList, metaList, tree);
			}
		}else if(temp!=null && tempPid!=null && tempPid.equals(temp.getKey())){
			temp.getChildren().add(tree);
			if(!tree.getIsLeaf()) {
				getTreeModelList(treeList, metaList, tree);
			}
		}
		
	}
}
 
Example #6
Source File: SysRoleController.java    From jeecg-boot with Apache License 2.0 6 votes vote down vote up
/**
 * 用户角色授权功能,查询菜单权限树
 * @param request
 * @return
 */
@RequestMapping(value = "/queryTreeList", method = RequestMethod.GET)
public Result<Map<String,Object>> queryTreeList(HttpServletRequest request) {
	Result<Map<String,Object>> result = new Result<>();
	//全部权限ids
	List<String> ids = new ArrayList<>();
	try {
		LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
		query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
		query.orderByAsc(SysPermission::getSortNo);
		List<SysPermission> list = sysPermissionService.list(query);
		for(SysPermission sysPer : list) {
			ids.add(sysPer.getId());
		}
		List<TreeModel> treeList = new ArrayList<>();
		getTreeModelList(treeList, list, null);
		Map<String,Object> resMap = new HashMap<String,Object>();
		resMap.put("treeList", treeList); //全部树节点数据
		resMap.put("ids", ids);//全部树ids
		result.setResult(resMap);
		result.setSuccess(true);
	} catch (Exception e) {
		log.error(e.getMessage(), e);
	}
	return result;
}
 
Example #7
Source File: SysDepartPermissionController.java    From teaching with Apache License 2.0 6 votes vote down vote up
private void getTreeModelList(List<TreeModel> treeList, List<SysPermission> metaList, TreeModel temp) {
 for (SysPermission permission : metaList) {
	 String tempPid = permission.getParentId();
	 TreeModel tree = new TreeModel(permission.getId(), tempPid, permission.getName(),permission.getRuleFlag(), permission.isLeaf());
	 if(temp==null && oConvertUtils.isEmpty(tempPid)) {
		 treeList.add(tree);
		 if(!tree.getIsLeaf()) {
			 getTreeModelList(treeList, metaList, tree);
		 }
	 }else if(temp!=null && tempPid!=null && tempPid.equals(temp.getKey())){
		 temp.getChildren().add(tree);
		 if(!tree.getIsLeaf()) {
			 getTreeModelList(treeList, metaList, tree);
		 }
	 }

 }
}
 
Example #8
Source File: SysPermissionController.java    From teaching with Apache License 2.0 6 votes vote down vote up
private void getTreeModelList(List<TreeModel> treeList, List<SysPermission> metaList, TreeModel temp) {
	for (SysPermission permission : metaList) {
		String tempPid = permission.getParentId();
		TreeModel tree = new TreeModel(permission);
		if (temp == null && oConvertUtils.isEmpty(tempPid)) {
			treeList.add(tree);
			if (!tree.getIsLeaf()) {
				getTreeModelList(treeList, metaList, tree);
			}
		} else if (temp != null && tempPid != null && tempPid.equals(temp.getKey())) {
			temp.getChildren().add(tree);
			if (!tree.getIsLeaf()) {
				getTreeModelList(treeList, metaList, tree);
			}
		}

	}
}
 
Example #9
Source File: SysPermissionController.java    From teaching with Apache License 2.0 6 votes vote down vote up
/**
 * 异步加载数据节点
 * 
 * @return
 */
@RequestMapping(value = "/queryListAsync", method = RequestMethod.GET)
public Result<List<TreeModel>> queryAsync(@RequestParam(name = "pid", required = false) String parentId) {
	Result<List<TreeModel>> result = new Result<>();
	try {
		List<TreeModel> list = sysPermissionService.queryListByParentId(parentId);
		if (list == null || list.size() <= 0) {
			result.error500("未找到角色信息");
		} else {
			result.setResult(list);
			result.setSuccess(true);
		}
	} catch (Exception e) {
		log.error(e.getMessage(), e);
	}

	return result;
}
 
Example #10
Source File: SysRoleController.java    From teaching with Apache License 2.0 6 votes vote down vote up
private void getTreeModelList(List<TreeModel> treeList,List<SysPermission> metaList,TreeModel temp) {
	for (SysPermission permission : metaList) {
		String tempPid = permission.getParentId();
		TreeModel tree = new TreeModel(permission.getId(), tempPid, permission.getName(),permission.getRuleFlag(), permission.isLeaf());
		if(temp==null && oConvertUtils.isEmpty(tempPid)) {
			treeList.add(tree);
			if(!tree.getIsLeaf()) {
				getTreeModelList(treeList, metaList, tree);
			}
		}else if(temp!=null && tempPid!=null && tempPid.equals(temp.getKey())){
			temp.getChildren().add(tree);
			if(!tree.getIsLeaf()) {
				getTreeModelList(treeList, metaList, tree);
			}
		}
		
	}
}
 
Example #11
Source File: SysRoleController.java    From teaching with Apache License 2.0 6 votes vote down vote up
/**
 * 用户角色授权功能,查询菜单权限树
 * @param request
 * @return
 */
@RequestMapping(value = "/queryTreeList", method = RequestMethod.GET)
public Result<Map<String,Object>> queryTreeList(HttpServletRequest request) {
	Result<Map<String,Object>> result = new Result<>();
	//全部权限ids
	List<String> ids = new ArrayList<>();
	try {
		LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
		query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
		query.orderByAsc(SysPermission::getSortNo);
		List<SysPermission> list = sysPermissionService.list(query);
		for(SysPermission sysPer : list) {
			ids.add(sysPer.getId());
		}
		List<TreeModel> treeList = new ArrayList<>();
		getTreeModelList(treeList, list, null);
		Map<String,Object> resMap = new HashMap<String,Object>();
		resMap.put("treeList", treeList); //全部树节点数据
		resMap.put("ids", ids);//全部树ids
		result.setResult(resMap);
		result.setSuccess(true);
	} catch (Exception e) {
		log.error(e.getMessage(), e);
	}
	return result;
}
 
Example #12
Source File: SysPermissionController.java    From jeecg-boot-with-activiti with MIT License 6 votes vote down vote up
private void getTreeModelList(List<TreeModel> treeList, List<SysPermission> metaList, TreeModel temp) {
	for (SysPermission permission : metaList) {
		String tempPid = permission.getParentId();
		TreeModel tree = new TreeModel(permission);
		if (temp == null && oConvertUtils.isEmpty(tempPid)) {
			treeList.add(tree);
			if (!tree.getIsLeaf()) {
				getTreeModelList(treeList, metaList, tree);
			}
		} else if (temp != null && tempPid != null && tempPid.equals(temp.getKey())) {
			temp.getChildren().add(tree);
			if (!tree.getIsLeaf()) {
				getTreeModelList(treeList, metaList, tree);
			}
		}

	}
}
 
Example #13
Source File: SysPermissionController.java    From jeecg-boot-with-activiti with MIT License 6 votes vote down vote up
/**
 * 异步加载数据节点
 * 
 * @return
 */
@RequestMapping(value = "/queryListAsync", method = RequestMethod.GET)
public Result<List<TreeModel>> queryAsync(@RequestParam(name = "pid", required = false) String parentId) {
	Result<List<TreeModel>> result = new Result<>();
	try {
		List<TreeModel> list = sysPermissionService.queryListByParentId(parentId);
		if (list == null || list.size() <= 0) {
			result.error500("未找到角色信息");
		} else {
			result.setResult(list);
			result.setSuccess(true);
		}
	} catch (Exception e) {
		log.error(e.getMessage(), e);
	}

	return result;
}
 
Example #14
Source File: SysRoleController.java    From jeecg-boot-with-activiti with MIT License 6 votes vote down vote up
private void getTreeModelList(List<TreeModel> treeList,List<SysPermission> metaList,TreeModel temp) {
	for (SysPermission permission : metaList) {
		String tempPid = permission.getParentId();
		TreeModel tree = new TreeModel(permission.getId(), tempPid, permission.getName(),permission.getRuleFlag(), permission.isLeaf());
		if(temp==null && oConvertUtils.isEmpty(tempPid)) {
			treeList.add(tree);
			if(!tree.getIsLeaf()) {
				getTreeModelList(treeList, metaList, tree);
			}
		}else if(temp!=null && tempPid!=null && tempPid.equals(temp.getKey())){
			temp.getChildren().add(tree);
			if(!tree.getIsLeaf()) {
				getTreeModelList(treeList, metaList, tree);
			}
		}
		
	}
}
 
Example #15
Source File: SysPermissionController.java    From jeecg-cloud with Apache License 2.0 6 votes vote down vote up
private void getTreeModelList(List<TreeModel> treeList, List<SysPermission> metaList, TreeModel temp) {
	for (SysPermission permission : metaList) {
		String tempPid = permission.getParentId();
		TreeModel tree = new TreeModel(permission);
		if (temp == null && oConvertUtils.isEmpty(tempPid)) {
			treeList.add(tree);
			if (!tree.getIsLeaf()) {
				getTreeModelList(treeList, metaList, tree);
			}
		} else if (temp != null && tempPid != null && tempPid.equals(temp.getKey())) {
			temp.getChildren().add(tree);
			if (!tree.getIsLeaf()) {
				getTreeModelList(treeList, metaList, tree);
			}
		}

	}
}
 
Example #16
Source File: SysPermissionController.java    From jeecg-cloud with Apache License 2.0 6 votes vote down vote up
/**
 * 异步加载数据节点
 * 
 * @return
 */
@RequestMapping(value = "/queryListAsync", method = RequestMethod.GET)
public Result<List<TreeModel>> queryAsync(@RequestParam(name = "pid", required = false) String parentId) {
	Result<List<TreeModel>> result = new Result<>();
	try {
		List<TreeModel> list = sysPermissionService.queryListByParentId(parentId);
		if (list == null || list.size() <= 0) {
			result.error500("未找到角色信息");
		} else {
			result.setResult(list);
			result.setSuccess(true);
		}
	} catch (Exception e) {
		log.error(e.getMessage(), e);
	}

	return result;
}
 
Example #17
Source File: SysRoleController.java    From jeecg-boot-with-activiti with MIT License 6 votes vote down vote up
/**
 * 用户角色授权功能,查询菜单权限树
 * @param request
 * @return
 */
@RequestMapping(value = "/queryTreeList", method = RequestMethod.GET)
public Result<Map<String,Object>> queryTreeList(HttpServletRequest request) {
	Result<Map<String,Object>> result = new Result<>();
	//全部权限ids
	List<String> ids = new ArrayList<>();
	try {
		LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
		query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
		query.orderByAsc(SysPermission::getSortNo);
		List<SysPermission> list = sysPermissionService.list(query);
		for(SysPermission sysPer : list) {
			ids.add(sysPer.getId());
		}
		List<TreeModel> treeList = new ArrayList<>();
		getTreeModelList(treeList, list, null);
		Map<String,Object> resMap = new HashMap<String,Object>();
		resMap.put("treeList", treeList); //全部树节点数据
		resMap.put("ids", ids);//全部树ids
		result.setResult(resMap);
		result.setSuccess(true);
	} catch (Exception e) {
		log.error(e.getMessage(), e);
	}
	return result;
}
 
Example #18
Source File: SysRoleController.java    From jeecg-cloud with Apache License 2.0 6 votes vote down vote up
/**
 * 用户角色授权功能,查询菜单权限树
 * @param request
 * @return
 */
@RequestMapping(value = "/queryTreeList", method = RequestMethod.GET)
public Result<Map<String,Object>> queryTreeList(HttpServletRequest request) {
	Result<Map<String,Object>> result = new Result<>();
	//全部权限ids
	List<String> ids = new ArrayList<>();
	try {
		LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
		query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
		query.orderByAsc(SysPermission::getSortNo);
		List<SysPermission> list = sysPermissionService.list(query);
		for(SysPermission sysPer : list) {
			ids.add(sysPer.getId());
		}
		List<TreeModel> treeList = new ArrayList<>();
		getTreeModelList(treeList, list, null);
		Map<String,Object> resMap = new HashMap<String,Object>();
		resMap.put("treeList", treeList); //全部树节点数据
		resMap.put("ids", ids);//全部树ids
		result.setResult(resMap);
		result.setSuccess(true);
	} catch (Exception e) {
		log.error(e.getMessage(), e);
	}
	return result;
}
 
Example #19
Source File: SysDepartPermissionController.java    From jeecg-cloud with Apache License 2.0 6 votes vote down vote up
private void getTreeModelList(List<TreeModel> treeList, List<SysPermission> metaList, TreeModel temp) {
 for (SysPermission permission : metaList) {
	 String tempPid = permission.getParentId();
	 TreeModel tree = new TreeModel(permission.getId(), tempPid, permission.getName(),permission.getRuleFlag(), permission.isLeaf());
	 if(temp==null && oConvertUtils.isEmpty(tempPid)) {
		 treeList.add(tree);
		 if(!tree.getIsLeaf()) {
			 getTreeModelList(treeList, metaList, tree);
		 }
	 }else if(temp!=null && tempPid!=null && tempPid.equals(temp.getKey())){
		 temp.getChildren().add(tree);
		 if(!tree.getIsLeaf()) {
			 getTreeModelList(treeList, metaList, tree);
		 }
	 }

 }
}
 
Example #20
Source File: SysPermissionController.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
/**
 * 获取全部的权限树
 * 
 * @return
 */
@RequestMapping(value = "/queryTreeList", method = RequestMethod.GET)
public Result<Map<String, Object>> queryTreeList() {
	Result<Map<String, Object>> result = new Result<>();
	// 全部权限ids
	List<String> ids = new ArrayList<>();
	try {
		LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
		query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
		query.orderByAsc(SysPermission::getSortNo);
		List<SysPermission> list = sysPermissionService.list(query);
		for (SysPermission sysPer : list) {
			ids.add(sysPer.getId());
		}
		List<TreeModel> treeList = new ArrayList<>();
		getTreeModelList(treeList, list, null);

		Map<String, Object> resMap = new HashMap<String, Object>();
		resMap.put("treeList", treeList); // 全部树节点数据
		resMap.put("ids", ids);// 全部树ids
		result.setResult(resMap);
		result.setSuccess(true);
	} catch (Exception e) {
		log.error(e.getMessage(), e);
	}
	return result;
}
 
Example #21
Source File: SysDepartPermissionController.java    From jeecg-cloud with Apache License 2.0 5 votes vote down vote up
/**
 * 用户角色授权功能,查询菜单权限树
 * @param request
 * @return
 */
@RequestMapping(value = "/queryTreeListForDeptRole", method = RequestMethod.GET)
public Result<Map<String,Object>> queryTreeListForDeptRole(@RequestParam(name="departId",required=true) String departId,HttpServletRequest request) {
 Result<Map<String,Object>> result = new Result<>();
 //全部权限ids
 List<String> ids = new ArrayList<>();
 try {
	 LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
	 query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
	 query.orderByAsc(SysPermission::getSortNo);
	 query.inSql(SysPermission::getId,"select permission_id  from sys_depart_permission where depart_id='"+departId+"'");
	 List<SysPermission> list = sysPermissionService.list(query);
	 for(SysPermission sysPer : list) {
		 ids.add(sysPer.getId());
	 }
	 List<TreeModel> treeList = new ArrayList<>();
	 getTreeModelList(treeList, list, null);
	 Map<String,Object> resMap = new HashMap<String,Object>();
	 resMap.put("treeList", treeList); //全部树节点数据
	 resMap.put("ids", ids);//全部树ids
	 result.setResult(resMap);
	 result.setSuccess(true);
 } catch (Exception e) {
	 log.error(e.getMessage(), e);
 }
 return result;
}
 
Example #22
Source File: SysPermissionController.java    From jeecg-cloud with Apache License 2.0 5 votes vote down vote up
/**
 * 获取全部的权限树
 * 
 * @return
 */
@RequestMapping(value = "/queryTreeList", method = RequestMethod.GET)
public Result<Map<String, Object>> queryTreeList() {
	Result<Map<String, Object>> result = new Result<>();
	// 全部权限ids
	List<String> ids = new ArrayList<>();
	try {
		LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
		query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
		query.orderByAsc(SysPermission::getSortNo);
		List<SysPermission> list = sysPermissionService.list(query);
		for (SysPermission sysPer : list) {
			ids.add(sysPer.getId());
		}
		List<TreeModel> treeList = new ArrayList<>();
		getTreeModelList(treeList, list, null);

		Map<String, Object> resMap = new HashMap<String, Object>();
		resMap.put("treeList", treeList); // 全部树节点数据
		resMap.put("ids", ids);// 全部树ids
		result.setResult(resMap);
		result.setSuccess(true);
	} catch (Exception e) {
		log.error(e.getMessage(), e);
	}
	return result;
}
 
Example #23
Source File: SysDepartPermissionController.java    From teaching with Apache License 2.0 5 votes vote down vote up
/**
 * 用户角色授权功能,查询菜单权限树
 * @param request
 * @return
 */
@RequestMapping(value = "/queryTreeListForDeptRole", method = RequestMethod.GET)
public Result<Map<String,Object>> queryTreeListForDeptRole(@RequestParam(name="departId",required=true) String departId,HttpServletRequest request) {
 Result<Map<String,Object>> result = new Result<>();
 //全部权限ids
 List<String> ids = new ArrayList<>();
 try {
	 LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
	 query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
	 query.orderByAsc(SysPermission::getSortNo);
	 query.inSql(SysPermission::getId,"select permission_id  from sys_depart_permission where depart_id='"+departId+"'");
	 List<SysPermission> list = sysPermissionService.list(query);
	 for(SysPermission sysPer : list) {
		 ids.add(sysPer.getId());
	 }
	 List<TreeModel> treeList = new ArrayList<>();
	 getTreeModelList(treeList, list, null);
	 Map<String,Object> resMap = new HashMap<String,Object>();
	 resMap.put("treeList", treeList); //全部树节点数据
	 resMap.put("ids", ids);//全部树ids
	 result.setResult(resMap);
	 result.setSuccess(true);
 } catch (Exception e) {
	 log.error(e.getMessage(), e);
 }
 return result;
}
 
Example #24
Source File: SysDepartPermissionController.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
/**
 * 用户角色授权功能,查询菜单权限树
 * @param request
 * @return
 */
@RequestMapping(value = "/queryTreeListForDeptRole", method = RequestMethod.GET)
public Result<Map<String,Object>> queryTreeListForDeptRole(@RequestParam(name="departId",required=true) String departId,HttpServletRequest request) {
 Result<Map<String,Object>> result = new Result<>();
 //全部权限ids
 List<String> ids = new ArrayList<>();
 try {
	 LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
	 query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
	 query.orderByAsc(SysPermission::getSortNo);
	 query.inSql(SysPermission::getId,"select permission_id  from sys_depart_permission where depart_id='"+departId+"'");
	 List<SysPermission> list = sysPermissionService.list(query);
	 for(SysPermission sysPer : list) {
		 ids.add(sysPer.getId());
	 }
	 List<TreeModel> treeList = new ArrayList<>();
	 getTreeModelList(treeList, list, null);
	 Map<String,Object> resMap = new HashMap<String,Object>();
	 resMap.put("treeList", treeList); //全部树节点数据
	 resMap.put("ids", ids);//全部树ids
	 result.setResult(resMap);
	 result.setSuccess(true);
 } catch (Exception e) {
	 log.error(e.getMessage(), e);
 }
 return result;
}
 
Example #25
Source File: SysPermissionController.java    From teaching with Apache License 2.0 5 votes vote down vote up
/**
 * 获取全部的权限树
 * 
 * @return
 */
@RequestMapping(value = "/queryTreeList", method = RequestMethod.GET)
public Result<Map<String, Object>> queryTreeList() {
	Result<Map<String, Object>> result = new Result<>();
	// 全部权限ids
	List<String> ids = new ArrayList<>();
	try {
		LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
		query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
		query.orderByAsc(SysPermission::getSortNo);
		List<SysPermission> list = sysPermissionService.list(query);
		for (SysPermission sysPer : list) {
			ids.add(sysPer.getId());
		}
		List<TreeModel> treeList = new ArrayList<>();
		getTreeModelList(treeList, list, null);

		Map<String, Object> resMap = new HashMap<String, Object>();
		resMap.put("treeList", treeList); // 全部树节点数据
		resMap.put("ids", ids);// 全部树ids
		result.setResult(resMap);
		result.setSuccess(true);
	} catch (Exception e) {
		log.error(e.getMessage(), e);
	}
	return result;
}
 
Example #26
Source File: SysPermissionController.java    From jeecg-boot-with-activiti with MIT License 5 votes vote down vote up
/**
 * 获取全部的权限树
 * 
 * @return
 */
@RequestMapping(value = "/queryTreeList", method = RequestMethod.GET)
public Result<Map<String, Object>> queryTreeList() {
	Result<Map<String, Object>> result = new Result<>();
	// 全部权限ids
	List<String> ids = new ArrayList<>();
	try {
		LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
		query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
		query.orderByAsc(SysPermission::getSortNo);
		List<SysPermission> list = sysPermissionService.list(query);
		for (SysPermission sysPer : list) {
			ids.add(sysPer.getId());
		}
		List<TreeModel> treeList = new ArrayList<>();
		getTreeModelList(treeList, list, null);

		Map<String, Object> resMap = new HashMap<String, Object>();
		resMap.put("treeList", treeList); // 全部树节点数据
		resMap.put("ids", ids);// 全部树ids
		result.setResult(resMap);
		result.setSuccess(true);
	} catch (Exception e) {
		log.error(e.getMessage(), e);
	}
	return result;
}
 
Example #27
Source File: SysPermissionServiceImpl.java    From jeecg-cloud with Apache License 2.0 4 votes vote down vote up
@Override
public List<TreeModel> queryListByParentId(String parentId) {
	return sysPermissionMapper.queryListByParentId(parentId);
}
 
Example #28
Source File: SysPermissionServiceImpl.java    From teaching with Apache License 2.0 4 votes vote down vote up
@Override
public List<TreeModel> queryListByParentId(String parentId) {
	return sysPermissionMapper.queryListByParentId(parentId);
}
 
Example #29
Source File: SysPermissionServiceImpl.java    From jeecg-boot with Apache License 2.0 4 votes vote down vote up
@Override
public List<TreeModel> queryListByParentId(String parentId) {
	return sysPermissionMapper.queryListByParentId(parentId);
}
 
Example #30
Source File: SysPermissionServiceImpl.java    From jeecg-boot-with-activiti with MIT License 4 votes vote down vote up
@Override
public List<TreeModel> queryListByParentId(String parentId) {
	return sysPermissionMapper.queryListByParentId(parentId);
}