@RequestMapping(params = "p=eyeView") public ModelAndView showEyeView(@ModelAttribute SYS_Role entity, HttpSession session) { SYS_User user = (SYS_User) session.getAttribute(Const.SESSION_USER); PageData pd = getPageData(); try { String sql = SQLUtil.getQuerySQL(SYS_Role.class).replace("\n", "") + " where RoleID='" + entity.getRoleID() + "'"; List<SYS_Role> entry = roleDao.query(SYS_Role.class, sql); List<SYS_Role> entrys = roleDao.findByCompanys(user.getOrgID()); for (SYS_Role sys_Role : entrys) { if (!(sys_Role.getCompanyID().equals(entry.get(0).getCompanyID()))) { entry.add(sys_Role); } } pd.put("role", entry); mv.addObject("model", pd); // mv.addObject("model", pd.put("entity", entry)); mv.setViewName("/system/role/system_role_eye"); } catch (Exception e) { return MessageUtil.exception(user, mv, e); } return MessageUtil.success(mv); }
@RequestMapping(params = "p=showAddView") public ModelAndView showAddView(@ModelAttribute SYS_User user, HttpSession session) { user = (SYS_User) session.getAttribute(Const.SESSION_USER); PageData pd = getPageData(); try { pd.put("role", roleDao.findByCompanys(user.getOrgID())); mv.addObject("model", pd); mv.setViewName("/system/role/system_role_add"); } catch (Exception e) { return MessageUtil.exception(user, mv, e); } return MessageUtil.success(mv); }