Esempio n. 1
0
 @RequestMapping("/authDataList")
 public void authDataList(HttpServletRequest request, HttpServletResponse response) {
   Map<String, Object> map = new HashMap<String, Object>();
   map.put("code", ServletRequestUtils.getStringParameter(request, "code", "").trim());
   map.put("name", ServletRequestUtils.getStringParameter(request, "name", "").trim());
   map.put("authType", ServletRequestUtils.getStringParameter(request, "authType", "").trim());
   map.put("isvalid", Constants.ISVALIAD_SHOW);
   String menuCode = ServletRequestUtils.getStringParameter(request, "menuCode", "").trim();
   List<String> menuIds = new ArrayList<String>();
   List<Menu> menuList = menuBusiness.findListByCode(menuCode);
   for (Menu menu : menuList) {
     menuIds.add(menu.getId().toString());
   }
   if (menuIds.size() > 0) {
     map.put("menuIds", menuIds);
   }
   Page<Auth> page = PageUtil.getPageObj(request);
   page = authBusiness.queryPage(map, page);
   List<Auth> authList = new ArrayList<Auth>();
   for (Auth auth : page.getResult()) {
     auth.setFullName(authBusiness.getFullParentName(auth.getId()));
     authList.add(auth);
   }
   page.setResult(authList);
   // 设置页面数据
   Map<String, Object> jsonMap = new HashMap<String, Object>();
   jsonMap.put("total", page.getTotalCount());
   jsonMap.put("rows", page.getResult());
   HtmlUtil.writerJson(response, jsonMap);
 }
Esempio n. 2
0
  @RequestMapping("/dataList")
  public void dataList(HttpServletRequest request, HttpServletResponse response) {
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("code", ServletRequestUtils.getStringParameter(request, "code", "").trim());
    map.put("name", ServletRequestUtils.getStringParameter(request, "name", "").trim());
    map.put("isvalid", ServletRequestUtils.getStringParameter(request, "isvalid", "").trim());
    Page<Role> page = PageUtil.getPageObj(request);
    page = roleBusiness.queryPage(map, page);

    // 设置页面数据
    Map<String, Object> jsonMap = new HashMap<String, Object>();
    jsonMap.put("total", page.getTotalCount());
    jsonMap.put("rows", page.getResult());
    HtmlUtil.writerJson(response, jsonMap);
  }