コード例 #1
0
ファイル: OrganizationMgrImpl.java プロジェクト: noikiy/RAP
  @Override
  public List<Corporation> getCorporationListWithPager(int pageNum, int pageSize) {

    List<Corporation> list = organizationDao.getCorporationListWithPager(pageNum, pageSize);

    for (Corporation c : list) {
      long memberNum = organizationDao.getMemberNumOfCorporation(c.getId());
      c.setMemberNum(memberNum + 1); // +1 project creator
      c.setHasAccess(true);
      c.setCreatorName(accountMgr.getUser(c.getUserId()).getName());
    }
    return list;
  }
コード例 #2
0
ファイル: OrganizationMgrImpl.java プロジェクト: noikiy/RAP
 @Override
 public List<Corporation> getCorporationListWithPager(long userId, int pageNum, int pageSize) {
   User user = accountMgr.getUser(userId);
   if (user.isAdmin()) {
     return getCorporationListWithPager(pageNum, pageSize);
   }
   List<Corporation> list = organizationDao.getCorporationListWithPager(userId, pageNum, pageSize);
   for (Corporation c : list) {
     long memberNum = organizationDao.getMemberNumOfCorporation(c.getId());
     c.setMemberNum(memberNum + 1); // +1 project creator
     c.setHasAccess(canUserManageCorp(userId, c.getId()));
     c.setCreatorName(accountMgr.getUser(c.getUserId()).getName());
   }
   return list;
 }