private ChooseOrganizationResponse queryGroup(ChooseOrganizationRequest request) { UserContext context = new UserContext(); context.setCorporationId(request.getSession().getCorporationId()); context.setUserId(request.getSession().getToken()); context.setLoginName(request.getSession().getLoginName()); context.setUserRoles(UserRoleTool.adaptToRole(request.getSession().getUserRoles())); TeamListVo teamListVo = new TeamListVo(); if (request.getCriteria().getPagination() != null) { PaginationDetail detail = new PaginationDetail(); detail.setLimit(request.getCriteria().getPagination().getLimit()); detail.setStart(request.getCriteria().getPagination().getStart()); teamListVo.setPaginationDetail(detail); } if (request.getCriteria().getKey() != null) teamListVo.setName(request.getCriteria().getKey()); if (request.getCriteria().getSorting() != null) { SortingDetail sortingDetail = new SortingDetail(); sortingDetail.setSort(request.getCriteria().getSorting().getSort()); sortingDetail.setDirection(request.getCriteria().getSorting().getDirection()); teamListVo.setSortingDetail(sortingDetail); } OrganSearchResult rs = new OrganSearchResult(); List<OrganicationClient> lt = new ArrayList<OrganicationClient>(); PageStore<TeamListVo> volist = teamService.teamList(context, teamListVo); for (TeamListVo team : volist.getResultList()) { OrganicationClient client = new OrganicationClient(); client.setId(team.getId()); client.setName(team.getName()); client.setType(OrganType.GROUP); lt.add(client); } rs.setResult(lt); rs.setTotal(volist.getResultCount()); return new ChooseOrganizationResponse(rs); }
@Override public PageStore<TeamListVo> teamList(SysUser caller, TeamListVo teamVo) { PageStore<Team> pageStore = new PageStore<Team>(); pageStore.setResultCount(teamDao.countTeam(teamVo)); List<Team> TeamList = teamDao.TeamList(teamVo); List<TeamListVo> TeamVoList = new ArrayList<TeamListVo>(); for (Team team : TeamList) { TeamVoList.add(convertFromTeamToVo(team)); } PageStore<TeamListVo> storeVo = new PageStore<TeamListVo>(); storeVo.setResultCount(pageStore.getResultCount()); storeVo.setResultList(TeamVoList); return storeVo; }