Example #1
0
  public String execute() {
    //		System.out.println("DEFAULT_PAGESIZE   "+DEFAULT_PAGESIZE);
    UserDiamondStatsService userDiamondStatsService =
        ServiceCacheFactory.getServiceCache().getService(UserDiamondStatsService.class);
    IPage<UserDiamondStats> page = null;

    if (isCommit != null && isCommit == "TF" || isCommit.equalsIgnoreCase("TF")) {
      isCommit = "F";
    }
    // 判断是否是条件查询
    if (getStartDate() == null && getEndDate() == null) {
      page = userDiamondStatsService.findList(DEFAULT_PAGESIZE, super.getToPage());
    } else {
      page =
          userDiamondStatsService.findListInDate(
              DEFAULT_PAGESIZE, super.getToPage(), getStartDate(), getEndDate());
    }

    if (page != null) {
      statsList = (List<UserDiamondStats>) page.getData();
      for (UserDiamondStats stats : statsList) {
        int sysNum = stats.getSysNum();
        TGameServer tGameServer = DataSourceManager.getInstatnce().getGameServerMap().get(sysNum);
        stats.setServerName(tGameServer.getServerAlias());
      }
      super.setTotalPage(page.getTotalPage());
      super.setTotalSize(page.getTotalSize());
    }
    return SUCCESS;
  }
Example #2
0
 public String execute() {
   ActiveEventService activeEventService =
       ServiceCacheFactory.getServiceCache().getService(ActiveEventService.class);
   IPage<ActiveEvent> list =
       activeEventService.findPageList(
           super.getToPage(), ALDAdminPageActionSupport.DEFAULT_PAGESIZE);
   if (list != null) {
     activeEventList = (List<ActiveEvent>) list.getData();
     super.setTotalPage(list.getTotalPage());
     super.setTotalSize(list.getTotalSize());
   }
   return SUCCESS;
 }
Example #3
0
  @Override
  public String execute() throws Exception {
    UserGoldLogService userGoldLogService =
        ServiceCacheFactory.getServiceCache().getService(UserGoldLogService.class);
    if (isCommit.equals("T")) {
      String searchUserId = super.searchUser();

      // 搜索玩家的时候出错了,返回
      if (super.getErroDescrip() != null) {
        return SUCCESS;
      }
      IPage<Object> list =
          userGoldLogService.findPageLogListByCondition(
              searchUserId,
              super.getStartDate(),
              super.getEndDate(),
              searchCategory,
              searchType,
              super.getToPage(),
              super.getPageSize());
      count =
          userGoldLogService.countAll(1, searchUserId, super.getStartDate(), super.getEndDate());
      useCount =
          userGoldLogService.countAll(2, searchUserId, super.getStartDate(), super.getEndDate());

      if (list != null) {
        List<Object> ll = (List<Object>) list.getData();
        for (int i = 0; i < ll.size(); i++) {
          Object[] arr = (Object[]) ll.get(i);
          UserGoldLog log = new UserGoldLog();
          log.setUserId(arr[0].toString());
          log.setUserName(arr[1].toString());
          log.setLodoId(Integer.valueOf(arr[2].toString()));
          log.setUserLevel(Integer.valueOf(arr[3].toString()));
          log.setCategory(Integer.valueOf(arr[4].toString()));
          log.setType(Integer.valueOf(arr[5].toString()));
          log.setChangeNum(Integer.valueOf(arr[6].toString()));
          log.setTime(
              new Timestamp(
                  DateUtil.stringtoDate(arr[7].toString(), DateUtil.FORMAT_ONE).getTime()));
          userGoldLogList.add(log);
        }
        super.setTotalPage(list.getTotalPage());
        super.setTotalSize(list.getTotalSize());
      }
    }

    return SUCCESS;
  }
Example #4
0
  @Override
  public String execute() {
    UserMallRankStatsService userMallRankStatsService =
        ServiceCacheFactory.getServiceCache().getService(UserMallRankStatsService.class);
    TTreasureConstantService treasureConstantService =
        ServiceCacheFactory.getServiceCache().getService(TTreasureConstantService.class);
    treasureIdNameMap = treasureConstantService.findMallTreasureIdNameMap();
    IPage<UserMallRankStats> page = null;
    if (getStartDate() != null && getEndDate() != null) {
      page =
          userMallRankStatsService.findListInDate(
              super.getPageSize(), super.getToPage(), getStartDate(), getEndDate());
    } else {
      page = userMallRankStatsService.findList(super.getPageSize(), super.getToPage());
    }
    if (page != null) {
      List<UserMallRankStats> list = (List<UserMallRankStats>) page.getData();
      if (list != null && list.size() > 0) {
        for (UserMallRankStats stats : list) {
          String date = DateUtil.dateToString(stats.getTime(), DateUtil.LONG_DATE_FORMAT);
          if (statsMap.containsKey(date)) {
            statsMap.get(date).add(stats);
          } else {
            List<UserMallRankStats> ll = new ArrayList<UserMallRankStats>();
            ll.add(stats);
            statsMap.put(date, ll);
          }
        }
      }
      super.setTotalPage(page.getTotalPage());
      super.setTotalSize(page.getTotalSize());
    }
    if (statsMap.size() > 0) {
      for (List<UserMallRankStats> list : statsMap.values()) {
        Collections.sort(
            list,
            new Comparator<UserMallRankStats>() {

              @Override
              public int compare(UserMallRankStats o1, UserMallRankStats o2) {
                // TODO Auto-generated method stub
                if (o1.getRank().intValue() > o2.getRank().intValue()) {
                  return 1;
                } else {
                  return -1;
                }
              }
            });
      }
    }
    // 排序
    if (statsMap.size() > 0) {
      mappingList = new ArrayList<Map.Entry<String, List<UserMallRankStats>>>(statsMap.entrySet());
      Collections.sort(
          mappingList,
          new Comparator<Map.Entry<String, List<UserMallRankStats>>>() {
            public int compare(
                Map.Entry<String, List<UserMallRankStats>> mapping1,
                Map.Entry<String, List<UserMallRankStats>> mapping2) {
              return mapping2.getKey().compareTo(mapping1.getKey());
            }
          });
    }
    return SUCCESS;
  }