/** * 终端命令菜单 * * @return */ private String terminalCommandMenuJson() { JSONArray jsonArray = new JSONArray(); for (FuncModel root : authorizedFuncs) { // FuncModel root = (FuncModel) iterator.next(); if (root.getParentId() != 900700 || root.getDeleted()) continue; JSONObject rootJsonObject = new JSONObject(); rootJsonObject.put("id", "" + root.getEntityId()); rootJsonObject.put("text", root.getDescr()); rootJsonObject.put("icon", root.getIcon()); /** * if (this.selectUserFuncsMap.containsKey(root.getId())) rootJsonObject.put("checked", * Boolean.valueOf(true)); else { rootJsonObject.put("checked", Boolean.valueOf(false)); } */ JSONObject attributes = new JSONObject(); attributes.put("funcName", root.getFuncName()); // attributes.put("style", root.getStyle()); rootJsonObject.put("attributes", attributes); List subGroupInfos = findSubSyssFuncByParnetId(root.getEntityId()); genSubGroupsTreeJson(rootJsonObject, subGroupInfos); jsonArray.add(rootJsonObject); } return jsonArray.toString(); }
private List<FuncModel> findChidFuncByParentId( Integer parentId, List<FuncModel> authorizedFuncs) { List subSysFuncs = new ArrayList(); for (FuncModel sysFunc : authorizedFuncs) { if (sysFunc.getParentId() == parentId && sysFunc.getDeleted() == false) { subSysFuncs.add(sysFunc); } } Collections.sort(authorizedFuncs, new SysFuncComparator()); return subSysFuncs; }
private List<FuncModel> findSubSyssFuncByParnetId(Integer id) { List subSysFuncs = new ArrayList(); for (FuncModel sysFunc : this.authorizedFuncs) { if (sysFunc.getParentId() == id) { subSysFuncs.add(sysFunc); } } System.setProperty("java.util.Arrays.useLegacyMergeSort", "true"); Collections.sort(subSysFuncs, new SysFuncComparator()); return subSysFuncs; }
public String getMapToolMenu() { JSONArray jsonArray = new JSONArray(); for (FuncModel root : authorizedFuncs) { // FuncModel root = (FuncModel) iterator.next(); if (root.getParentId() != 900200 || root.getDeleted()) continue; JSONObject rootJsonObject = new JSONObject(); rootJsonObject.put("id", "" + root.getEntityId()); rootJsonObject.put("text", root.getDescr()); rootJsonObject.put("icon", root.getIcon()); rootJsonObject.put("code", root.getFuncName()); /** * if (this.selectUserFuncsMap.containsKey(root.getId())) rootJsonObject.put("checked", * Boolean.valueOf(true)); else { rootJsonObject.put("checked", Boolean.valueOf(false)); } */ JSONObject attributes = new JSONObject(); attributes.put("funcName", root.getFuncName()); // attributes.put("style", root.getStyle()); rootJsonObject.put("attributes", attributes); jsonArray.add(rootJsonObject); } return jsonArray.toString(); }