@JSON @Log(logName = "根据地址查询") public String queryByAddr() throws CoreException { List<Authority> authorities = new ArrayList<Authority>(); try { if (StringUtils.isBlank(authority.getResources())) { logger.debug("query attribute is null."); super.writeError("请输入查询条件"); return ResultType.SUCCESS; } /*List<Authority> tempList = authorityService.queryByAddr(authority.getResources()); authorities = new ArrayList<Authority>(tempList); for(Authority au : tempList){ if(au.getUserType().getTypeId() == CONST.USER_TYPE_SUPER){ authorities.remove(au); } }*/ logger.debug("query by addr list size is " + authorities.size()); } catch (Exception e) { logger.error("queryByAddr error." + e); e.printStackTrace(); super.writeError(super.getSysError()); } super.writeRows(authorities); return ResultType.SUCCESS; }
@JSON @Log(logName = "加载列表") public String load() throws CoreException { logger.debug("******load authority resources"); List<Authority> authorityList = new ArrayList<Authority>(); try { authorityList = authorityService.list(); if (authorityList == null || authorityList.size() == 0) { super.writeError("查询无结果"); return ResultType.SUCCESS; } /*List<Authority> tempList = new ArrayList<Authority>(authorityList); for(Authority au : tempList){ if(au.getUserType().getTypeId() == CONST.USER_TYPE_SUPER){ authorityList.remove(au); } }*/ } catch (Exception e) { logger.error(""); e.printStackTrace(); } super.writeRows(authorityList); return ResultType.SUCCESS; }