/*** Click all function permission trees obtained by the role tree subnode * @ param roleID * @ return */public List
GetRoleRightManageTree (int roleID) {List
TreeNodeList = new ArrayList
(); TreeNode rootNode = new TreeNode ("root", "All functions"); // List of root nodes
FistTreeNodeList = new ArrayList
(); // List of upper-level nodes in the function group
FirstFuncGroupList = getFirstFuncGroup (); // get the id and namefor (FuncGroup fGroup: firstFuncGroupList) {TreeNode firstFuncGroupNode = new TreeNode ("firstFuncGroup" + fGroup. getGroupID (), fGroup. getGroupName (); firstFuncGroupNode. setIconCls ("icon-line"); fistTreeNodeList. add (firstFuncGroupNode); recurrenceFuncGroups (roleID, firstFuncGroupNode, fGroup);} rootNode. setChildren (fistTreeNodeList); treeNodeList. add (rootNode); return treeNodeList;}/*** role management -- Recursive Function Group * @ param roleID * @ param treeNode * @ param funcGroup */public void recurrenceFuncGroups (int roleID, treeNode treeNode, FuncGroup funcGroup) {List
TreeNodeFuncGroupList = new ArrayList
(); List
FuncGroupList = getFuncGroupFromGroupList (funcGroup. getGroupID (); if (funcGroupList. size ()> 0) {for (FuncGroup fGroup: funcGroupList) {TreeNode funcGroupNode = new TreeNode ("funcGroup" + fGroup. getGroupID (), fGroup. getGroupName (); funcGroupNode. setIconCls ("icon-folder"); treeNodeFuncGroupList. add (funcGroupNode); recurrenceFuncGroups (roleID, funcGroupNode, fGroup) ;}} List
FunctionNodeList = new ArrayList
(); // List of function nodes
FunctionList = getFunctionList (funcGroup. getGroupID (); // obtain all functions if (functionList. size ()> 0) {for (Function function: functionList) {TreeNode functionNode = new TreeNode ("function _" + function. getFunctionID (), function. getFunctionName (); functionNode. setIconCls ("icon-line"); functionNodeList. add (functionNode); List
RoleFunctionList = getRoleFunctionListByRoleID (roleID); for (RoleFunctionRelation roleFunctionRelation: roleFunctionList) {if (function. getFunctionID () = roleFunctionRelation. getFunctionID () {functionNode. setChecked (true) ;}} treeNodeFuncGroupList. add (functionNode) ;}} if (treeNodeFuncGroupList. size ()> 0) {treeNode. setChildren (treeNodeFuncGroupList );}}