Java Code Examples for org.jeecg.modules.system.entity.SysPermission#isLeaf()

The following examples show how to use org.jeecg.modules.system.entity.SysPermission#isLeaf() . 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: 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 2
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 3
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 4
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 5
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 6
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 7
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 8
Source File: TreeModel.java    From jeecg-cloud with Apache License 2.0 5 votes vote down vote up
public TreeModel(SysPermission permission) {
	this.key = permission.getId();
	this.icon = permission.getIcon();
	this.parentId = permission.getParentId();
	this.title = permission.getName();
	this.slotTitle =  permission.getName();
	this.value = permission.getId();
	this.isLeaf = permission.isLeaf();
	this.label = permission.getName();
	if(!permission.isLeaf()) {
		this.children = new ArrayList<TreeModel>();
	}
}
 
Example 9
Source File: TreeModel.java    From teaching with Apache License 2.0 5 votes vote down vote up
public TreeModel(SysPermission permission) {
	this.key = permission.getId();
	this.icon = permission.getIcon();
	this.parentId = permission.getParentId();
	this.title = permission.getName();
	this.slotTitle =  permission.getName();
	this.value = permission.getId();
	this.isLeaf = permission.isLeaf();
	this.label = permission.getName();
	if(!permission.isLeaf()) {
		this.children = new ArrayList<TreeModel>();
	}
}
 
Example 10
Source File: TreeModel.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
public TreeModel(SysPermission permission) {
	this.key = permission.getId();
	this.icon = permission.getIcon();
	this.parentId = permission.getParentId();
	this.title = permission.getName();
	this.slotTitle =  permission.getName();
	this.value = permission.getId();
	this.isLeaf = permission.isLeaf();
	this.label = permission.getName();
	if(!permission.isLeaf()) {
		this.children = new ArrayList<TreeModel>();
	}
}
 
Example 11
Source File: TreeModel.java    From jeecg-boot-with-activiti with MIT License 5 votes vote down vote up
public TreeModel(SysPermission permission) {
	this.key = permission.getId();
	this.icon = permission.getIcon();
	this.parentId = permission.getParentId();
	this.title = permission.getName();
	this.slotTitle =  permission.getName();
	this.value = permission.getId();
	this.isLeaf = permission.isLeaf();
	this.label = permission.getName();
	if(!permission.isLeaf()) {
		this.children = new ArrayList<TreeModel>();
	}
}
 
Example 12
Source File: SysPermissionTree.java    From jeecg-boot-with-activiti with MIT License 5 votes vote down vote up
public SysPermissionTree(SysPermission permission) {
	this.key = permission.getId();
	this.id = permission.getId();
	this.perms = permission.getPerms();
	this.permsType = permission.getPermsType();
	this.component = permission.getComponent();
	this.createBy = permission.getCreateBy();
	this.createTime = permission.getCreateTime();
	this.delFlag = permission.getDelFlag();
	this.description = permission.getDescription();
	this.icon = permission.getIcon();
	this.isLeaf = permission.isLeaf();
	this.menuType = permission.getMenuType();
	this.name = permission.getName();
	this.parentId = permission.getParentId();
	this.sortNo = permission.getSortNo();
	this.updateBy = permission.getUpdateBy();
	this.updateTime = permission.getUpdateTime();
	this.redirect = permission.getRedirect();
	this.url = permission.getUrl();
	this.hidden = permission.isHidden();
	this.route = permission.isRoute();
	this.keepAlive = permission.isKeepAlive();
	this.alwaysShow= permission.isAlwaysShow();
	/*update_begin author:wuxianquan date:20190908 for:赋值 */
	this.internalOrExternal = permission.isInternalOrExternal();
	/*update_end author:wuxianquan date:20190908 for:赋值 */
	this.title=permission.getName();
	if (!permission.isLeaf()) {
		this.children = new ArrayList<SysPermissionTree>();
	}
	this.status = permission.getStatus();
}
 
Example 13
Source File: SysPermissionTree.java    From jeecg-boot with Apache License 2.0 5 votes vote down vote up
public SysPermissionTree(SysPermission permission) {
	this.key = permission.getId();
	this.id = permission.getId();
	this.perms = permission.getPerms();
	this.permsType = permission.getPermsType();
	this.component = permission.getComponent();
	this.createBy = permission.getCreateBy();
	this.createTime = permission.getCreateTime();
	this.delFlag = permission.getDelFlag();
	this.description = permission.getDescription();
	this.icon = permission.getIcon();
	this.isLeaf = permission.isLeaf();
	this.menuType = permission.getMenuType();
	this.name = permission.getName();
	this.parentId = permission.getParentId();
	this.sortNo = permission.getSortNo();
	this.updateBy = permission.getUpdateBy();
	this.updateTime = permission.getUpdateTime();
	this.redirect = permission.getRedirect();
	this.url = permission.getUrl();
	this.hidden = permission.isHidden();
	this.route = permission.isRoute();
	this.keepAlive = permission.isKeepAlive();
	this.alwaysShow= permission.isAlwaysShow();
	/*update_begin author:wuxianquan date:20190908 for:赋值 */
	this.internalOrExternal = permission.isInternalOrExternal();
	/*update_end author:wuxianquan date:20190908 for:赋值 */
	this.title=permission.getName();
	if (!permission.isLeaf()) {
		this.children = new ArrayList<SysPermissionTree>();
	}
	this.status = permission.getStatus();
}
 
Example 14
Source File: SysPermissionTree.java    From jeecg-cloud with Apache License 2.0 5 votes vote down vote up
public SysPermissionTree(SysPermission permission) {
	this.key = permission.getId();
	this.id = permission.getId();
	this.perms = permission.getPerms();
	this.permsType = permission.getPermsType();
	this.component = permission.getComponent();
	this.createBy = permission.getCreateBy();
	this.createTime = permission.getCreateTime();
	this.delFlag = permission.getDelFlag();
	this.description = permission.getDescription();
	this.icon = permission.getIcon();
	this.isLeaf = permission.isLeaf();
	this.menuType = permission.getMenuType();
	this.name = permission.getName();
	this.parentId = permission.getParentId();
	this.sortNo = permission.getSortNo();
	this.updateBy = permission.getUpdateBy();
	this.updateTime = permission.getUpdateTime();
	this.redirect = permission.getRedirect();
	this.url = permission.getUrl();
	this.hidden = permission.isHidden();
	this.route = permission.isRoute();
	this.keepAlive = permission.isKeepAlive();
	this.alwaysShow= permission.isAlwaysShow();
	/*update_begin author:wuxianquan date:20190908 for:赋值 */
	this.internalOrExternal = permission.isInternalOrExternal();
	/*update_end author:wuxianquan date:20190908 for:赋值 */
	this.title=permission.getName();
	if (!permission.isLeaf()) {
		this.children = new ArrayList<SysPermissionTree>();
	}
	this.status = permission.getStatus();
}
 
Example 15
Source File: NgAlainServiceImpl.java    From teaching with Apache License 2.0 4 votes vote down vote up
/**
 *  获取菜单JSON数组
 * @param jsonArray
 * @param metaList
 * @param parentJson
 */
private void getPermissionJsonArray(JSONArray jsonArray,List<SysPermission> metaList,JSONObject parentJson) {
    for (SysPermission permission : metaList) {
        if(permission.getMenuType()==null) {
            continue;
        }
        String tempPid = permission.getParentId();
        JSONObject json = getPermissionJsonObject(permission);
        if(parentJson==null && oConvertUtils.isEmpty(tempPid)) {
            jsonArray.add(json);
            if(!permission.isLeaf()) {
                getPermissionJsonArray(jsonArray, metaList, json);
            }
        }else if(parentJson!=null && oConvertUtils.isNotEmpty(tempPid) && tempPid.equals(parentJson.getString("id"))){
            if(permission.getMenuType()==0) {
                JSONObject metaJson = parentJson.getJSONObject("meta");
                if(metaJson.containsKey("permissionList")) {
                    metaJson.getJSONArray("permissionList").add(json);
                }else {
                    JSONArray permissionList = new JSONArray();
                    permissionList.add(json);
                    metaJson.put("permissionList", permissionList);
                }

            }else if(permission.getMenuType()==1) {
                if(parentJson.containsKey("children")) {
                    parentJson.getJSONArray("children").add(json);
                }else {
                    JSONArray children = new JSONArray();
                    children.add(json);
                    parentJson.put("children", children);
                }

                if(!permission.isLeaf()) {
                    getPermissionJsonArray(jsonArray, metaList, json);
                }
            }
        }


    }
}
 
Example 16
Source File: SysPermissionController.java    From teaching with Apache License 2.0 4 votes vote down vote up
/**
  *  获取菜单JSON数组
 * @param jsonArray
 * @param metaList
 * @param parentJson
 */
private void getPermissionJsonArray(JSONArray jsonArray, List<SysPermission> metaList, JSONObject parentJson) {
	for (SysPermission permission : metaList) {
		if (permission.getMenuType() == null) {
			continue;
		}
		String tempPid = permission.getParentId();
		JSONObject json = getPermissionJsonObject(permission);
		if(json==null) {
			continue;
		}
		if (parentJson == null && oConvertUtils.isEmpty(tempPid)) {
			jsonArray.add(json);
			if (!permission.isLeaf()) {
				getPermissionJsonArray(jsonArray, metaList, json);
			}
		} else if (parentJson != null && oConvertUtils.isNotEmpty(tempPid) && tempPid.equals(parentJson.getString("id"))) {
			// 类型( 0:一级菜单 1:子菜单 2:按钮 )
			if (permission.getMenuType().equals(CommonConstant.MENU_TYPE_2)) {
				JSONObject metaJson = parentJson.getJSONObject("meta");
				if (metaJson.containsKey("permissionList")) {
					metaJson.getJSONArray("permissionList").add(json);
				} else {
					JSONArray permissionList = new JSONArray();
					permissionList.add(json);
					metaJson.put("permissionList", permissionList);
				}
				// 类型( 0:一级菜单 1:子菜单 2:按钮 )
			} else if (permission.getMenuType().equals(CommonConstant.MENU_TYPE_1) || permission.getMenuType().equals(CommonConstant.MENU_TYPE_0)) {
				if (parentJson.containsKey("children")) {
					parentJson.getJSONArray("children").add(json);
				} else {
					JSONArray children = new JSONArray();
					children.add(json);
					parentJson.put("children", children);
				}

				if (!permission.isLeaf()) {
					getPermissionJsonArray(jsonArray, metaList, json);
				}
			}
		}

	}
}
 
Example 17
Source File: NgAlainServiceImpl.java    From jeecg-boot-with-activiti with MIT License 4 votes vote down vote up
/**
 *  获取菜单JSON数组
 * @param jsonArray
 * @param metaList
 * @param parentJson
 */
private void getPermissionJsonArray(JSONArray jsonArray,List<SysPermission> metaList,JSONObject parentJson) {
    for (SysPermission permission : metaList) {
        if(permission.getMenuType()==null) {
            continue;
        }
        String tempPid = permission.getParentId();
        JSONObject json = getPermissionJsonObject(permission);
        if(parentJson==null && oConvertUtils.isEmpty(tempPid)) {
            jsonArray.add(json);
            if(!permission.isLeaf()) {
                getPermissionJsonArray(jsonArray, metaList, json);
            }
        }else if(parentJson!=null && oConvertUtils.isNotEmpty(tempPid) && tempPid.equals(parentJson.getString("id"))){
            if(permission.getMenuType()==0) {
                JSONObject metaJson = parentJson.getJSONObject("meta");
                if(metaJson.containsKey("permissionList")) {
                    metaJson.getJSONArray("permissionList").add(json);
                }else {
                    JSONArray permissionList = new JSONArray();
                    permissionList.add(json);
                    metaJson.put("permissionList", permissionList);
                }

            }else if(permission.getMenuType()==1) {
                if(parentJson.containsKey("children")) {
                    parentJson.getJSONArray("children").add(json);
                }else {
                    JSONArray children = new JSONArray();
                    children.add(json);
                    parentJson.put("children", children);
                }

                if(!permission.isLeaf()) {
                    getPermissionJsonArray(jsonArray, metaList, json);
                }
            }
        }


    }
}
 
Example 18
Source File: NgAlainServiceImpl.java    From jeecg-boot with Apache License 2.0 4 votes vote down vote up
/**
 *  获取菜单JSON数组
 * @param jsonArray
 * @param metaList
 * @param parentJson
 */
private void getPermissionJsonArray(JSONArray jsonArray,List<SysPermission> metaList,JSONObject parentJson) {
    for (SysPermission permission : metaList) {
        if(permission.getMenuType()==null) {
            continue;
        }
        String tempPid = permission.getParentId();
        JSONObject json = getPermissionJsonObject(permission);
        if(parentJson==null && oConvertUtils.isEmpty(tempPid)) {
            jsonArray.add(json);
            if(!permission.isLeaf()) {
                getPermissionJsonArray(jsonArray, metaList, json);
            }
        }else if(parentJson!=null && oConvertUtils.isNotEmpty(tempPid) && tempPid.equals(parentJson.getString("id"))){
            if(permission.getMenuType()==0) {
                JSONObject metaJson = parentJson.getJSONObject("meta");
                if(metaJson.containsKey("permissionList")) {
                    metaJson.getJSONArray("permissionList").add(json);
                }else {
                    JSONArray permissionList = new JSONArray();
                    permissionList.add(json);
                    metaJson.put("permissionList", permissionList);
                }

            }else if(permission.getMenuType()==1) {
                if(parentJson.containsKey("children")) {
                    parentJson.getJSONArray("children").add(json);
                }else {
                    JSONArray children = new JSONArray();
                    children.add(json);
                    parentJson.put("children", children);
                }

                if(!permission.isLeaf()) {
                    getPermissionJsonArray(jsonArray, metaList, json);
                }
            }
        }


    }
}
 
Example 19
Source File: SysPermissionController.java    From jeecg-cloud with Apache License 2.0 4 votes vote down vote up
/**
  *  获取菜单JSON数组
 * @param jsonArray
 * @param metaList
 * @param parentJson
 */
private void getPermissionJsonArray(JSONArray jsonArray, List<SysPermission> metaList, JSONObject parentJson) {
	for (SysPermission permission : metaList) {
		if (permission.getMenuType() == null) {
			continue;
		}
		String tempPid = permission.getParentId();
		JSONObject json = getPermissionJsonObject(permission);
		if(json==null) {
			continue;
		}
		if (parentJson == null && oConvertUtils.isEmpty(tempPid)) {
			jsonArray.add(json);
			if (!permission.isLeaf()) {
				getPermissionJsonArray(jsonArray, metaList, json);
			}
		} else if (parentJson != null && oConvertUtils.isNotEmpty(tempPid) && tempPid.equals(parentJson.getString("id"))) {
			// 类型( 0:一级菜单 1:子菜单 2:按钮 )
			if (permission.getMenuType().equals(CommonConstant.MENU_TYPE_2)) {
				JSONObject metaJson = parentJson.getJSONObject("meta");
				if (metaJson.containsKey("permissionList")) {
					metaJson.getJSONArray("permissionList").add(json);
				} else {
					JSONArray permissionList = new JSONArray();
					permissionList.add(json);
					metaJson.put("permissionList", permissionList);
				}
				// 类型( 0:一级菜单 1:子菜单 2:按钮 )
			} else if (permission.getMenuType().equals(CommonConstant.MENU_TYPE_1) || permission.getMenuType().equals(CommonConstant.MENU_TYPE_0)) {
				if (parentJson.containsKey("children")) {
					parentJson.getJSONArray("children").add(json);
				} else {
					JSONArray children = new JSONArray();
					children.add(json);
					parentJson.put("children", children);
				}

				if (!permission.isLeaf()) {
					getPermissionJsonArray(jsonArray, metaList, json);
				}
			}
		}

	}
}
 
Example 20
Source File: SysPermissionController.java    From jeecg-boot with Apache License 2.0 4 votes vote down vote up
/**
  *  获取菜单JSON数组
 * @param jsonArray
 * @param metaList
 * @param parentJson
 */
private void getPermissionJsonArray(JSONArray jsonArray, List<SysPermission> metaList, JSONObject parentJson) {
	for (SysPermission permission : metaList) {
		if (permission.getMenuType() == null) {
			continue;
		}
		String tempPid = permission.getParentId();
		JSONObject json = getPermissionJsonObject(permission);
		if(json==null) {
			continue;
		}
		if (parentJson == null && oConvertUtils.isEmpty(tempPid)) {
			jsonArray.add(json);
			if (!permission.isLeaf()) {
				getPermissionJsonArray(jsonArray, metaList, json);
			}
		} else if (parentJson != null && oConvertUtils.isNotEmpty(tempPid) && tempPid.equals(parentJson.getString("id"))) {
			// 类型( 0:一级菜单 1:子菜单 2:按钮 )
			if (permission.getMenuType().equals(CommonConstant.MENU_TYPE_2)) {
				JSONObject metaJson = parentJson.getJSONObject("meta");
				if (metaJson.containsKey("permissionList")) {
					metaJson.getJSONArray("permissionList").add(json);
				} else {
					JSONArray permissionList = new JSONArray();
					permissionList.add(json);
					metaJson.put("permissionList", permissionList);
				}
				// 类型( 0:一级菜单 1:子菜单 2:按钮 )
			} else if (permission.getMenuType().equals(CommonConstant.MENU_TYPE_1) || permission.getMenuType().equals(CommonConstant.MENU_TYPE_0)) {
				if (parentJson.containsKey("children")) {
					parentJson.getJSONArray("children").add(json);
				} else {
					JSONArray children = new JSONArray();
					children.add(json);
					parentJson.put("children", children);
				}

				if (!permission.isLeaf()) {
					getPermissionJsonArray(jsonArray, metaList, json);
				}
			}
		}

	}
}