コード例 #1
0
  /** 列表 */
  @RequestMapping(value = "/list")
  public ModelAndView listUsers(HttpSession session, Page page) throws Exception {
    logBefore(logger, "特别推荐列表");
    mv.clear();
    try {
      pd = this.getPageData();

      // 检索条件================================
      String title = pd.getString("title");
      if (null != title && !"".equals(title)) {
        title = title.trim();
        pd.put("title", title);
      }
      // 检索条件================================

      page.setPd(pd);
      List<PageData> varList = featuredService.list(page);

      /*调用权限*/
      this
          .getHC(); // ================================================================================
      /*调用权限*/

      mv.setViewName("information/featured/featured_list");
      mv.addObject("varList", varList);
      mv.addObject("pd", pd);
    } catch (Exception e) {
      logger.error(e.toString(), e);
    }

    return mv;
  }
コード例 #2
0
ファイル: ImgmsgController.java プロジェクト: treejames/oem
 /** 列表 */
 @RequestMapping(value = "/list")
 public ModelAndView list(Page page) {
   logBefore(logger, "列表Imgmsg");
   if (!Jurisdiction.buttonJurisdiction(menuUrl, "cha")) {
     return null;
   } // 校验权限
   ModelAndView mv = this.getModelAndView();
   PageData pd = new PageData();
   try {
     pd = this.getPageData();
     String KEYWORD = pd.getString("KEYWORD");
     if (null != KEYWORD && !"".equals(KEYWORD)) {
       pd.put("KEYWORD", KEYWORD.trim());
     }
     page.setPd(pd);
     List<PageData> varList = imgmsgService.list(page); // 列出Imgmsg列表
     mv.setViewName("weixin/imgmsg/imgmsg_list");
     mv.addObject("varList", varList);
     mv.addObject("pd", pd);
     mv.addObject(Const.SESSION_QX, this.getHC()); // 按钮权限
   } catch (Exception e) {
     logger.error(e.toString(), e);
   }
   return mv;
 }
コード例 #3
0
ファイル: UserController.java プロジェクト: yankaili2006/zxtd
  /** 显示用户列表(用户组) */
  @RequestMapping(value = "/listUsers")
  public ModelAndView listUsers(Page page) throws Exception {
    ModelAndView mv = this.getModelAndView();
    PageData pd = new PageData();
    pd = this.getPageData();

    String USERNAME = pd.getString("USERNAME");

    if (null != USERNAME && !"".equals(USERNAME)) {
      USERNAME = USERNAME.trim();
      pd.put("USERNAME", USERNAME);
    }

    String lastLoginStart = pd.getString("lastLoginStart");
    String lastLoginEnd = pd.getString("lastLoginEnd");

    if (lastLoginStart != null && !"".equals(lastLoginStart)) {
      lastLoginStart = lastLoginStart + " 00:00:00";
      pd.put("lastLoginStart", lastLoginStart);
    }
    if (lastLoginEnd != null && !"".equals(lastLoginEnd)) {
      lastLoginEnd = lastLoginEnd + " 00:00:00";
      pd.put("lastLoginEnd", lastLoginEnd);
    }

    // 从session获取用户信息
    Subject currentUser = SecurityUtils.getSubject();
    Session session = currentUser.getSession();
    User user = (User) session.getAttribute(Const.SESSION_USER);
    pd.put("USERID", user.getUSER_ID());
    pd.put("ROLEID", user.getROLE_ID());

    logger.info("pd:" + gson.toJson(pd));

    page.setPd(pd);
    List<PageData> userList = null;
    List<Role> roleList = null;
    if (userService.isAdmin(user.getROLE_ID())) {
      userList = userService.listPdPageUser(page); // 列出用户列表
      roleList = roleService.listAllERRoles(); // 列出所有角色

    } else if (userService.isCooper(user.getROLE_ID())) {
      userList = userService.listSubUser(page); // 列出用户列表
      roleList = roleService.listSubUserRole(userService.SUBUSER_CODE); // 列出所有二级角色
    }

    mv.setViewName("system/user/user_list");
    mv.addObject("userList", userList);
    mv.addObject("roleList", roleList);

    mv.addObject("pd", pd);
    mv.addObject(Const.SESSION_QX, this.getHC()); // 按钮权限
    return mv;
  }