Esempio n. 1
0
 @Action(
     value = CENTER,
     results = {@Result(name = SUCCESS, location = BaseAction.FOREPART + CENTER + JSP)})
 public String center() {
   /** ************************ TT ****************************************** */
   List<User> focusUserList =
       userService.getFocusList(User.class, (User) getSessionMap().get("user"));
   if (focusUserList.size() > 9) {
     focusUserList = focusUserList.subList(0, 9);
   }
   getRequestMap().put("focusUserList", focusUserList);
   List<Club> focusClubList =
       userService.getFocusList(Club.class, (User) getSessionMap().get("user"));
   if (focusClubList.size() > 9) {
     focusClubList = focusClubList.subList(0, 9);
   }
   getRequestMap().put("focusClubList", focusClubList);
   List<Merchant> focusMerchantList =
       userService.getFocusList(Merchant.class, (User) getSessionMap().get("user"));
   if (focusMerchantList.size() > 9) {
     focusMerchantList = focusMerchantList.subList(0, 9);
   }
   getRequestMap().put("focusMerchantList", focusMerchantList);
   super.getRequestMap().put("allUsers", userService.allUsers());
   user = (User) getSessionMap().get("user");
   /** ************************ 相册 ****************************************** */
   page = pictureService.getRelativeByHql(eachPageNumber, currentPage, totalPageNumber);
   pics = pictureService.findRelativePictureByHql(page);
   /** *********************** 相关说说 ****************************************** */
   page = talkingService.getRelativePageByHql(user, eachPageNumber, currentPage, 1);
   taks = talkingService.findRelativeTalkingByHql(page, user);
   return SUCCESS;
 }
Esempio n. 2
0
 // main :userHome
 @Action(
     value = MAIN,
     results = {@Result(name = SUCCESS, location = BaseAction.FOREPART + MAIN + JSP)})
 public String home() {
   /** ************************ TT ****************************************** */
   List<User> focusUserList =
       userService.getFocusList(User.class, (User) getSessionMap().get("user"));
   if (focusUserList.size() > 9) {
     focusUserList = focusUserList.subList(0, 9);
   }
   getRequestMap().put("focusUserList", focusUserList);
   List<Club> focusClubList =
       userService.getFocusList(Club.class, (User) getSessionMap().get("user"));
   if (focusClubList.size() > 9) {
     focusClubList = focusClubList.subList(0, 9);
   }
   getRequestMap().put("focusClubList", focusClubList);
   List<Merchant> focusMerchantList =
       userService.getFocusList(Merchant.class, (User) getSessionMap().get("user"));
   if (focusMerchantList.size() > 9) {
     focusMerchantList = focusMerchantList.subList(0, 9);
   }
   getRequestMap().put("focusMerchantList", focusMerchantList);
   super.getRequestMap().put("allUsers", userService.allUsers());
   if (null == user || null == user.getId()) {
     user = (User) getSessionMap().get("user");
     user = userService.findById(user.getId());
   } else {
     user = userService.findById(user.getId());
   }
   /** ************************ 指定用户相册 ****************************************** */
   page = pictureService.getMyPageByHql(user, 1, currentPage, 1);
   pics = pictureService.findMyPictureByHql(page, user);
   /** ************************* 指定用户线上活动 **************************************** */
   page = onlineActivityService.getOneOnlineActivityPageByHql(4, currentPage, 1, null, null, user);
   onlineActs = onlineActivityService.findOneClubOnlineActivityByHql(page, null, null, user);
   /** ************************ 指定用户说说说说 ****************************************** */
   page = talkingService.getMyPageByHql(user, 10, currentPage, 1);
   taks = talkingService.findMyTalkingByHql(page, user);
   return SUCCESS;
 }