From ce5df016927280fb0615e0884573c810c80c19a5 Mon Sep 17 00:00:00 2001 From: zhangdaihao Date: Tue, 28 Feb 2017 14:40:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90=E5=88=86?= =?UTF-8?q?=E9=85=8D=E9=97=AE=E9=A2=98BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/core/FunctionController.java | 91 +++++++++---------- .../webpage/system/function/function.jsp | 16 ++-- .../webpage/system/function/functionList.jsp | 52 +++++------ 3 files changed, 71 insertions(+), 88 deletions(-) diff --git a/src/main/java/org/jeecgframework/web/system/controller/core/FunctionController.java b/src/main/java/org/jeecgframework/web/system/controller/core/FunctionController.java index 834ed0ca..3ae671c9 100644 --- a/src/main/java/org/jeecgframework/web/system/controller/core/FunctionController.java +++ b/src/main/java/org/jeecgframework/web/system/controller/core/FunctionController.java @@ -72,18 +72,17 @@ public class FunctionController extends BaseController { public void setUserService(UserService userService) { this.userService = userService; } - + /** * 权限列表页面跳转 * * @return */ @RequestMapping(params = "function") - public ModelAndView function(Integer type,ModelMap model) { - model.addAttribute("type", type); + public ModelAndView function(ModelMap model) { return new ModelAndView("system/function/functionList"); } - + /** * 操作列表页面跳转 * @@ -91,7 +90,11 @@ public class FunctionController extends BaseController { */ @RequestMapping(params = "operation") public ModelAndView operation(HttpServletRequest request, String functionId) { + // ---------------------------------------------------------------- + // ---------------------------------------------------------------- request.setAttribute("functionId", functionId); + // ---------------------------------------------------------------- + // ---------------------------------------------------------------- return new ModelAndView("system/operation/operationList"); } @@ -103,7 +106,11 @@ public class FunctionController extends BaseController { @RequestMapping(params = "dataRule") public ModelAndView operationData(HttpServletRequest request, String functionId) { + // ---------------------------------------------------------------- + // ---------------------------------------------------------------- request.setAttribute("functionId", functionId); + // ---------------------------------------------------------------- + // ---------------------------------------------------------------- return new ModelAndView("system/dataRule/ruleDataList"); } @@ -135,10 +142,14 @@ public class FunctionController extends BaseController { public void opdategrid(HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) { CriteriaQuery cq = new CriteriaQuery(TSOperation.class, dataGrid); + // ---------------------------------------------------------------- + // ---------------------------------------------------------------- String functionId = oConvertUtils.getString(request .getParameter("functionId")); cq.eq("TSFunction.id", functionId); cq.add(); + // ---------------------------------------------------------------- + // ---------------------------------------------------------------- this.systemService.getDataGridReturn(cq, true); TagUtil.datagrid(response, dataGrid); } @@ -159,12 +170,14 @@ public class FunctionController extends BaseController { systemService .updateBySqlString("delete from t_s_role_function where functionid='" + function.getId() + "'"); + //update-begin--Author:张忠亮 Date:20150605 for:删除时,提示先删除页面权限和数据规则 try{ systemService.delete(function); }catch (Exception e){ e.printStackTrace(); message=MutiLangUtil.getMutiLangInstance().getLang("common.menu.del.fail"); } + //update-end--Author:张忠亮 Date:20150605 for:删除时,提示先删除页面权限和数据规则 systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); @@ -202,7 +215,7 @@ public class FunctionController extends BaseController { operation.getId()); message = MutiLangUtil.paramDelSuccess("common.operation"); userService.delete(operation); - +// ---author:jg_xugj----start-----date:20151211--------for:#779 【菜单问题】当删了t_s_operation表中记录时, t_s_role_function 表中operation 字段应该同步更新。 String operationId = operation.getId(); String hql = "from TSRoleFunction rolefun where rolefun.operation like '%"+operationId+"%'"; List roleFunctions= userService.findByQueryString(hql); @@ -214,7 +227,7 @@ public class FunctionController extends BaseController { roleFunction.setOperation(newOper); userService.updateEntitie(roleFunction); } - +// ---author:jg_xugj----start-----date:20151211--------for:#779 【菜单问题】当删了t_s_operation表中记录时, t_s_role_function 表中operation 字段应该同步更新。 systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); @@ -254,14 +267,12 @@ public class FunctionController extends BaseController { public AjaxJson saveFunction(TSFunction function, HttpServletRequest request) { String message = null; AjaxJson j = new AjaxJson(); + // ---------------------------------------------------------------- function.setFunctionUrl(function.getFunctionUrl().trim()); String functionOrder = function.getFunctionOrder(); if (StringUtils.isEmpty(functionOrder)) { function.setFunctionOrder("0"); } - if(function.getTSIcon() != null && oConvertUtils.isEmpty(function.getTSIcon().getId())){ - function.setTSIcon(null); - } if (function.getTSFunction().getId().equals("")) { function.setTSFunction(null); } else { @@ -273,11 +284,16 @@ public class FunctionController extends BaseController { message = MutiLangUtil.paramUpdSuccess("common.menu"); userService.saveOrUpdate(function); systemService.addLog(message, Globals.Log_Type_UPDATE,Globals.Log_Leavel_INFO); + // update-end--Author:anchao Date:20140914 for:Jeecg bug 20140914 菜单更新级别后显示混乱 List subFunction = systemService.findByProperty(TSFunction.class, "TSFunction.id", function.getId()); updateSubFunction(subFunction,function); + // update-end--Author:anchao Date:20140914 for:Jeecg bug 20140914 菜单更新级别后显示混乱 + // ---------------------------------------------------------------- systemService.flushRoleFunciton(function.getId(), function); + // ---------------------------------------------------------------- + } else { if (function.getFunctionLevel().equals(Globals.Function_Leave_ONE)) { List functionList = systemService.findByProperty( @@ -344,6 +360,7 @@ public class FunctionController extends BaseController { String functionid = req.getParameter("id"); List fuinctionlist = systemService.getList(TSFunction.class); req.setAttribute("flist", fuinctionlist); + // update-begin--Author:zhangguoming Date:20140509 for:添加云桌面图标管理 // List iconlist = systemService.getList(TSIcon.class); List iconlist = systemService .findByQueryString("from TSIcon where iconType != 3"); @@ -351,6 +368,7 @@ public class FunctionController extends BaseController { List iconDeskList = systemService .findByQueryString("from TSIcon where iconType = 3"); req.setAttribute("iconDeskList", iconDeskList); + // update-end--Author:zhangguoming Date:20140509 for:添加云桌面图标管理 if (functionid != null) { function = systemService.getEntity(TSFunction.class, functionid); req.setAttribute("function", function); @@ -364,30 +382,6 @@ public class FunctionController extends BaseController { } return new ModelAndView("system/function/function"); } - - /** - * 权限列表页面跳转 - * - * @return - */ - @RequestMapping(params = "addorupdateDataFunction") - public ModelAndView addorupdateDataFunction(TSFunction function, HttpServletRequest req) { - String functionid = req.getParameter("id"); - List fuinctionlist = systemService.getList(TSFunction.class); - req.setAttribute("flist", fuinctionlist); - if (functionid != null) { - function = systemService.getEntity(TSFunction.class, functionid); - req.setAttribute("function", function); - } - if (function.getTSFunction() != null - && function.getTSFunction().getId() != null) { - function.setFunctionLevel((short) 1); - function.setTSFunction((TSFunction) systemService.getEntity( - TSFunction.class, function.getTSFunction().getId())); - req.setAttribute("function", function); - } - return new ModelAndView("system/function/dataFunction"); - } /** * 操作列表页面跳转 @@ -433,14 +427,16 @@ public class FunctionController extends BaseController { cq.addOrder("functionOrder", SortDirection.asc); cq.add(); + //update--begin------author:scott--------------date:20151208-----------for:手工加载数据权限条件-------- //获取装载数据权限的条件HQL cq = HqlGenerateUtil.getDataAuthorConditionHql(cq, new TSFunction()); cq.add(); - + //update--end------author:scott--------------date:20151208-----------for:手工加载数据权限条件-------- List functionList = systemService.getListByCriteriaQuery(cq, false); - +// update-start-Author:zhangguoming Date:20140914 for:菜单管理页面:菜单排序 Collections.sort(functionList, new NumberComparator()); +// update-end-Author:zhangguoming Date:20140914 for:菜单管理页面:菜单排序 List treeGrids = new ArrayList(); TreeGridModel treeGridModel = new TreeGridModel(); treeGridModel.setIcon("TSIcon_iconPath"); @@ -452,7 +448,9 @@ public class FunctionController extends BaseController { treeGridModel.setChildList("TSFunctions"); // 添加排序字段 treeGridModel.setOrder("functionOrder"); + // update-begin--Author:chenj Date:20160722 for:添加菜单图标样式 treeGridModel.setIconStyle("functionIconStyle"); + // update-end--Author:chenj Date:20160722 for:添加菜单图标样式 treeGridModel.setFunctionType("functionType"); @@ -488,7 +486,7 @@ public class FunctionController extends BaseController { */ @RequestMapping(params = "setPFunction") @ResponseBody - public List setPFunction(Integer type,HttpServletRequest request, + public List setPFunction(HttpServletRequest request, ComboTree comboTree) { CriteriaQuery cq = new CriteriaQuery(TSFunction.class); if (null != request.getParameter("selfId")) { @@ -500,26 +498,16 @@ public class FunctionController extends BaseController { if (comboTree.getId() == null) { cq.isNull("TSFunction"); } - if(type != null){ - cq.eq("functionType", type.shortValue()); - } cq.add(); - List functionList = systemService.getListByCriteriaQuery( - cq, false); + List functionList = systemService.getListByCriteriaQuery(cq, false); List comboTrees = new ArrayList(); ComboTreeModel comboTreeModel = new ComboTreeModel("id","functionName", "TSFunctions"); - TSFunction defaultFunction = new TSFunction(); - if(type != null && type.intValue() == 0){ - defaultFunction.setFunctionName("请选择上级菜单管理"); - }else if(type != null && type.intValue() == 1){ - defaultFunction.setFunctionName("请选择上级数据权限"); - } - functionList.add(0, defaultFunction); - comboTrees = systemService.ComboTree(functionList, comboTreeModel, - null, false); + comboTrees = systemService.ComboTree(functionList, comboTreeModel,null, false); MutiLangUtil.setMutiTree(comboTrees); return comboTrees; } + + // update-end--Author:gaofeng Date:20140619 for:修改云桌面的搜索功能中的系统中应用内搜索 /** * 菜单模糊检索功能 * @@ -583,10 +571,13 @@ public class FunctionController extends BaseController { menuListMap = menuListMap + "很遗憾,在系统中没有检索到与“" + name + "”相关的信息!"; } // menuListMap = menuListMap + ""; + //System.out.println("-------------------------------" + menuListMap); req.setAttribute("menuListMap", menuListMap); return new ModelAndView("system/function/menuAppList"); } + // update-end--Author:gaofeng Date:20140619 for:修改云桌面的搜索功能中的系统中应用内搜索 + /** * * addorupdaterule 数据规则权限的编辑和新增 diff --git a/src/main/webapp/webpage/system/function/function.jsp b/src/main/webapp/webpage/system/function/function.jsp index a127a239..2bfbf501 100644 --- a/src/main/webapp/webpage/system/function/function.jsp +++ b/src/main/webapp/webpage/system/function/function.jsp @@ -9,8 +9,7 @@ $(function() { $('#cc').combotree({ - url : 'functionController.do?setPFunction&type=0&selfId=${function.id}', - + url : 'functionController.do?setPFunction&selfId=${function.id}', panelHeight: 200, width: 157, onClick: function(node){ @@ -44,10 +43,8 @@ $('#pfun').hide(); } }); - }); - function viewStyle(param) { var url = "<%=basePath%>/functionIconStyle.jsp?style = "+ param; //add("图标样式预览",url,'functionIconStyle',700,450); @@ -58,14 +55,13 @@ -
- +
+ <%--update-begin--Author:zhangguoming Date:20140509 for:云桌面图标管理--%>
+ <%--update-end--Author:zhangguoming Date:20140509 for:云桌面图标管理--%>
+ <%-- update-begin--Author:chenj Date:20160722 for:添加菜单图标样式 --%>
+ <%-- update-start--Author:chenj Date:20160729 for:增加图标样式预览页面 --%> [ace图标样式] [hplus图标样式] + <%-- update-end--Author:chenj Date:20160729 for:增加图标样式预览页面 --%>
+ <%-- update-end--Author:chenj Date:20160722 for:添加菜单图标样式 --%>
diff --git a/src/main/webapp/webpage/system/function/functionList.jsp b/src/main/webapp/webpage/system/function/functionList.jsp index 65354a41..fd886f4f 100644 --- a/src/main/webapp/webpage/system/function/functionList.jsp +++ b/src/main/webapp/webpage/system/function/functionList.jsp @@ -1,41 +1,27 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/context/mytags.jsp"%> +<%-- update-start--Author:duanql Date:20130619 for:操作按钮窗口显示控制--%>
<%-- update-end--Author:duanql Date:20130619 for:操作按钮窗口显示控制--%>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + +
+<%-- update-start--Author:duanql Date:20130619 for:操作按钮窗口显示控制--%>
', collapsed:true, @@ -53,6 +39,7 @@