Example #1
0
  @Override
  public String execute() {

    if (tagArr == null) {
      SystemMallService systemMallService =
          ServiceCacheFactory.getServiceCache().getService(SystemMallService.class);
      systemMallList = systemMallService.getSystemMallByMallId(mallId);
      return INPUT;
    } else {
      isUpdate = "T";

      SystemMallService systemMallService =
          ServiceCacheFactory.getServiceCache().getService(SystemMallService.class);
      SystemMall systemMall =
          new SystemMall(
              mallIdArr,
              tagArr,
              nameArr,
              descriptionArr,
              toolTypeArr,
              toolIdArr,
              toolNumArr,
              moneyTypeArr,
              amountArr,
              imgIdArr,
              dailyMaxNumArr,
              maxNumArr,
              needVipLevelArr,
              seeVipLevelArr);
      systemMallService.update(systemMall);
      systemMallList = systemMallService.getSystemMallList();
      return SUCCESS;
    }
  }
Example #2
0
  public String execute() {
    NoticeService noticeService =
        ServiceCacheFactory.getServiceCache().getService(NoticeService.class);
    GameWebServerService service =
        ServiceCacheFactory.getServiceCache().getService(GameWebServerService.class);

    Integer dbSourceId = 0;
    if (gameWebId1 != null && gameWebId1.length >= 1) {
      gameWebId = gameWebId1[0];
    }
    if (gameWebId != null && !gameWebId.equals("")) {
      dbSourceId = Integer.parseInt(gameWebId);
    }

    serverList = service.findAllServer(dbSourceId);
    if (isCommit.equals("F")) {
      return INPUT;
    }

    if (sid == null || sid.length == 0) {
      setErroDescrip("请选择服务器。");
      return INPUT;
    }

    // TODO serverId唯一
    List<Notice> noticeList = noticeService.getNoticeList(dbSourceId);
    for (String serverId : sid) {
      for (Notice n : noticeList) {
        if (n.getServerId().equals(serverId)) {
          setErroDescrip("存在相同的服务器ID:" + notice.getServerId());
          return INPUT;
        }
      }
    }

    // 添加
    Date date = new Date();
    Timestamp createdTime = new Timestamp(date.getTime());
    notice.setCreatedTime(createdTime);

    for (String serverId : sid) {
      notice.setServerId(serverId);
      noticeService.addNotice(notice, dbSourceId);
    }

    // 记录日志
    AdminChangeConstantLog adminChangeConstantLog = new AdminChangeConstantLog();
    adminChangeConstantLog.setSysNum(0);
    adminChangeConstantLog.setAdminName(super.getAdminUser().getAdminName());
    adminChangeConstantLog.setChangeTime(new Timestamp(System.currentTimeMillis()));
    adminChangeConstantLog.setConstantName("AddNotice");
    adminChangeConstantLog.setChangeType(1);
    adminChangeConstantLog.setChangeDetail("添加通知信息");
    AdminChangeConstantLogService adminChangeConstantLogService =
        ServiceCacheFactory.getServiceCache().getService(AdminChangeConstantLogService.class);
    adminChangeConstantLogService.saveOne(adminChangeConstantLog);
    return SUCCESS;
  }
Example #3
0
 /** 执行一个服务器的调度 */
 public void executeOneServer(Date date, Integer sysNum) {
   ServerTask task = new ServerTask(date, sysNum);
   ThreadPoolTaskExecutor executer =
       (ThreadPoolTaskExecutor)
           ServiceCacheFactory.getServiceCache().getBeanById("dayTaskExecutor");
   executer.execute(task);
 }
Example #4
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 #5
0
 @Override
 public void run() {
   LogSystem.info("服务器 " + sysNum + "的日统计线程开始-----------------------------------");
   CustomerContextHolder.setSystemNum(sysNum);
   InvocationCollector invocationCollector =
       (InvocationCollector)
           ServiceCacheFactory.getServiceCache().getBeanById("dayInvocationCollector");
   invocationCollector.invoke(date);
   LogSystem.info("服务器 " + sysNum + "的日统计线程结束-----------------------------------");
 }
Example #6
0
  public String execute() {
    if (isCommit.equals("F")) {
      return INPUT;
    }

    ActivityDrawLevelGoodsService service =
        ServiceCacheFactory.getServiceCache().getService(ActivityDrawLevelGoodsService.class);
    service.addDrawLevelGoods(activityDrawLevelGoods);

    return SUCCESS;
  }
Example #7
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 #8
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 #9
0
  @Override
  public String execute() {

    System30LoginRewardService service =
        ServiceCacheFactory.getServiceCache().getService(System30LoginRewardService.class);
    if (isCommit) {
      for (int i = 0; i < system30LoginRewardIdArr.length; i++) {
        System30LoginReward reward = new System30LoginReward();
        reward.setSystem30LoginRewardId(system30LoginRewardIdArr[i]);
        reward.setDay(dayArr[i]);
        reward.setToolIds(toolIdsArr[i]);
        reward.setToolDesc(toolDescArr[i]);
        service.update(reward);
      }
    }
    system30LoginRewardList = service.findAll();
    return SUCCESS;
  }
Example #10
0
 public String execute() {
   AdminPowerPhysicsService aps =
       ServiceCacheFactory.getServiceCache().getService(AdminPowerPhysicsService.class);
   aps.delPowerPhysicsService(id);
   return SUCCESS;
 }
Example #11
0
  public String execute() {
    UserRegLogService userRegLogService =
        ServiceCacheFactory.getServiceCache().getService(UserRegLogService.class);

    if (DTools.isEmpty(serverIds)) {
      return SUCCESS;
    }
    for (String serverId : serverIds.split(",")) {
      CustomerContextHolder.setSystemNum(Integer.valueOf(serverId.trim()));
      TGameServer gameServer =
          DataSourceManager.getInstatnce()
              .getGameServerMap()
              .get(CustomerContextHolder.getSystemNum());
      Date openDate = new Date(gameServer.getServerOpernTime().getTime());

      if (DateUtil.dayDiff(regStartDate, openDate) > 0) {
        super.setErroDescrip("\"" + gameServer.getServerAlias() + "\"在当前注册日期还没开服!");
        continue;
      }

      // 登录开始日期
      // super.getStartDate();
      // 登录结束日期
      // super.getEndDate();
      Map<String, Integer> tempMap =
          userRegLogService.findReLoginMap(
              regStartDate, regEndDate, super.getStartDate(), super.getEndDate());
      //		Calendar calendar = Calendar.getInstance();
      //		calendar.get(Calendar.DAY_OF_MONTH);

      // 再登录人数:在A时间段注册的人中 在B时间段登陆的人数
      Integer reLoginAmount = 0;

      // 在A时间段注册的人中 B时间段内,各个日期登陆的人数
      Map<String, Integer> dayAndAmountmap = new HashMap<String, Integer>();
      Iterator<Entry<String, Integer>> ite1 = tempMap.entrySet().iterator();
      while (ite1.hasNext()) {
        Entry<String, Integer> entry = ite1.next();

        Integer count = entry.getValue();
        reLoginAmount += count;

        String[] dayStrArr = entry.getKey().split(",");
        for (String dayStr : dayStrArr) {
          if (dayAndAmountmap.get(dayStr) == null) {
            dayAndAmountmap.put(dayStr, count);
          } else {
            dayAndAmountmap.put(dayStr, count + dayAndAmountmap.get(dayStr));
          }
        }
      }
      // 每天的再登录人数(总和): 在A时间段注册的人中  B时间段内,每天登陆的人数 的总和
      Integer allDayAmount = 0;
      Iterator<Entry<String, Integer>> ite2 = dayAndAmountmap.entrySet().iterator();
      while (ite2.hasNext()) {
        Entry<String, Integer> entry = ite2.next();
        allDayAmount += entry.getValue();
      }

      // A时间段注册的人数
      String[] dates = new String[2];
      Calendar c = Calendar.getInstance();
      c.setTimeInMillis(regStartDate.getTime());
      dates[0] =
          c.get(Calendar.YEAR)
              + "-"
              + (c.get(Calendar.MONTH) + 1)
              + "-"
              + c.get(Calendar.DATE)
              + " 00:00:00";
      c.setTimeInMillis(regEndDate.getTime());
      dates[1] =
          c.get(Calendar.YEAR)
              + "-"
              + (c.get(Calendar.MONTH) + 1)
              + "-"
              + c.get(Calendar.DATE)
              + " 23:59:59";
      int regAmount = userRegLogService.findRegUserNumInSomeTime(dates);

      // 当前服务器的统计数据
      Map<String, Integer> serverMap = new HashMap<String, Integer>();
      serverMap.put("regAmount", regAmount);
      serverMap.put("reLoginAmount", reLoginAmount);
      serverMap.put("allDayAmount", allDayAmount);

      map.put(gameServer.getServerAlias(), serverMap);
    }
    return SUCCESS;
  }
Example #12
0
  public String execute() {
    if (toolTypeArr == null) {
      isCommit = "F";
      return SUCCESS;
    }

    GiftbagDropToolService service =
        ServiceCacheFactory.getServiceCache().getService(GiftbagDropToolService.class);
    int dbSourceId = gameWebId + ServerConstant.GIFT_DBKEY_BEGIN_NUMBER;
    service.delGiftbagDropTool(dbSourceId, giftbagDropTool.getGiftbagId());

    for (int i = 0; i < toolTypeArr.length; i++) {
      boolean mark = false;
      if (toolTypeArr[i] != null && !toolTypeArr[i].equals("")) {
        try {
          int typeId = Integer.parseInt(toolTypeArr[i]);
          giftbagDropTool.setToolType(typeId);
          mark = true;
        } catch (NumberFormatException e) {
          mark = false;
        }
      }

      if (mark && toolIdArr[i] != null && !toolIdArr[i].equals("")) {
        try {
          int toolId = Integer.parseInt(toolIdArr[i]);
          giftbagDropTool.setToolId(toolId);
        } catch (NumberFormatException e) {
          mark = false;
        }
      } else {
        mark = false;
      }

      if (mark && nameArr[i] != null && !nameArr[i].equals("")) {
        giftbagDropTool.setName(nameArr[i]);
      } else {
        mark = false;
      }

      if (mark && toolNumArr[i] != null && !toolNumArr[i].equals("")) {
        try {
          int num = Integer.parseInt(toolNumArr[i]);
          giftbagDropTool.setToolNum(num);
          ;
        } catch (NumberFormatException e) {
          mark = false;
        }
      } else {
        mark = false;
      }

      if (mark && lowerNumArr[i] != null && !lowerNumArr[i].equals("")) {
        try {
          int lowerNum = Integer.parseInt(lowerNumArr[i]);
          giftbagDropTool.setLowerNum(lowerNum);
        } catch (NumberFormatException e) {
          mark = false;
        }
      } else {
        mark = false;
      }

      if (mark && upperNumArr[i] != null && !upperNumArr[i].equals("")) {
        try {
          int upperNum = Integer.parseInt(upperNumArr[i]);
          giftbagDropTool.setUpperNum(upperNum);
        } catch (NumberFormatException e) {
          mark = false;
        }
      } else {
        mark = false;
      }

      if (mark) {
        service.addGiftbagDropTool(giftbagDropTool, dbSourceId);
      }
    }

    return SUCCESS;
  }
  @Override
  public String execute() throws Exception {
    UserLoginLogService userLoginLogService =
        ServiceCacheFactory.getServiceCache().getService(UserLoginLogService.class);
    UserGoldLogService userGoldLogService =
        ServiceCacheFactory.getServiceCache().getService(UserGoldLogService.class);

    // {4,2} 等级为0-5区间时,活跃天数大于或等于4的为小户, 活跃天数大于或等于2小于4为中户,活跃天数小于2的为大户。

    List<Object> activeDaysList =
        userLoginLogService.findUserIdAndLevelIntervalIndexAndActiveDaysList();

    Map<String, Map<Integer, Integer>> userIdAndLevelIntervalIndexAndConsumeNumMap =
        userGoldLogService.findUserIdAndLevelIntervalIndexAndConsumeNumMap();

    Integer levelIntervalIndex;
    String userId;
    Integer activeDays;
    // 0小户 1中户 2大户
    Integer userConsumeType;
    String key;
    Integer consumeNum;
    if (activeDaysList != null && activeDaysList.size() > 0) {
      for (int i = 0; i < activeDaysList.size(); i++) {
        userId = ((Object[]) activeDaysList.get(i))[0].toString();
        levelIntervalIndex = Integer.valueOf(((Object[]) activeDaysList.get(i))[1].toString());
        activeDays = Integer.valueOf(((Object[]) activeDaysList.get(i))[2].toString());

        if (userIdAndLevelIntervalIndexAndConsumeNumMap.get(userId) != null
            && userIdAndLevelIntervalIndexAndConsumeNumMap.get(userId).get(levelIntervalIndex)
                != null) {
          consumeNum =
              userIdAndLevelIntervalIndexAndConsumeNumMap.get(userId).get(levelIntervalIndex);
        } else {
          consumeNum = 0;
        }

        if (activeDays >= activeDaysInterval[levelIntervalIndex][0]) {
          userConsumeType = 0;
        } else if (activeDays >= activeDaysInterval[levelIntervalIndex][1]) {
          userConsumeType = 1;
        } else {
          userConsumeType = 2;
        }
        key = levelIntervalIndex + "-" + userConsumeType;
        if (statsMap.get(key) != null) {
          statsMap.put(
              key,
              (Integer.valueOf(statsMap.get(key).split("-")[0]) + 1)
                  + "-"
                  + (Integer.valueOf(statsMap.get(key).split("-")[1]) + consumeNum));
        } else {
          statsMap.put(key, "1-" + consumeNum);
        }
        //				System.out.println(statsMap);
        //				System.out.println();
      }
    }

    return SUCCESS;
  }
Example #14
0
 public void executeDel() {
   SParamConfigService service =
       ServiceCacheFactory.getServiceCache().getService(SParamConfigService.class);
   service.delSParamConfig(spParamConfig.getConfigkey());
 }
  @Override
  public void execute(Date date) throws Exception {
    LogSystem.info("VIP 玩家元宝统计 Collector开始");
    UserGoldLogService userGoldLogService =
        ServiceCacheFactory.getServiceCache().getService(UserGoldLogService.class);
    UserService userService = ServiceCacheFactory.getServiceCache().getService(UserService.class);
    VipUserDiamondStatsService vipUserDiamondStatsService =
        ServiceCacheFactory.getServiceCache().getService(VipUserDiamondStatsService.class);

    String[] dates = DateUtil.getOneDayStrArr(SystemStatsDate.YESTERDAY);
    List<Object> tempList = userService.findVipUser();
    List<String> userList = new ArrayList<String>();
    for (int i = 0; i < tempList.size(); i++) {
      Object objArr = (Object) tempList.get(i);
      Character[] cc = (Character[]) objArr;
      StringBuilder sb = new StringBuilder();
      for (int j = 0; j < cc.length; j++) {
        Character c = cc[j];
        sb.append(c);
      }
      userList.add(sb.toString());
    }
    int actityCount = userService.findActityVipUser(dates, userList);
    Map<Integer, Integer> map1 =
        userGoldLogService.findEveryTypeAmountVIP(UserGoldLogCategory.RECEIVE, dates, userList);
    Map<Integer, Integer> map2 =
        userGoldLogService.findEveryTypeAmountVIP(UserGoldLogCategory.CONSUME, dates, userList);
    List<VipUserDiamondStats> resultList = new ArrayList<VipUserDiamondStats>();

    Iterator<Integer> key1 = map1.keySet().iterator();
    while (key1.hasNext()) {
      Integer k = key1.next();
      Integer value = map1.get(k);
      VipUserDiamondStats stats = new VipUserDiamondStats();
      stats.setSysNum(CustomerContextHolder.getSystemNum());
      stats.setDate(DateUtil.getSomeDaysDiffDate(SystemStatsDate.YESTERDAY));
      stats.setCount(tempList.size());
      stats.setType(k);
      stats.setCaterory(UserGoldLogCategory.RECEIVE);
      stats.setDiamond(value);
      stats.setActityCount(actityCount);

      resultList.add(stats);
    }
    Iterator<Integer> key2 = map2.keySet().iterator();
    while (key2.hasNext()) {
      Integer k = key2.next();
      Integer value = map2.get(k);
      VipUserDiamondStats stats = new VipUserDiamondStats();
      stats.setSysNum(CustomerContextHolder.getSystemNum());
      stats.setDate(DateUtil.getSomeDaysDiffDate(SystemStatsDate.YESTERDAY));
      stats.setCount(tempList.size());
      stats.setType(k);
      stats.setDiamond(value);
      stats.setCaterory(UserGoldLogCategory.CONSUME);
      stats.setActityCount(actityCount);

      resultList.add(stats);
    }
    vipUserDiamondStatsService.saveBatch(resultList);
    LogSystem.info("VIP 玩家元宝统计 Collector结束");
  }
Example #16
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;
  }