Переглянути джерело

按游戏期号增量统计

dos 2 місяців тому
батько
коміт
b395a98789

+ 1 - 1
game-business/src/main/java/com/game/business/service/IAppGameBettingService.java

@@ -31,5 +31,5 @@ public interface IAppGameBettingService extends IService<AppGameBetting> {
     /**
      * 根据日期查询投注情况
      * */
-    List<AppGameBetting> selectListByDate( Long userId, String beginTime, String endTime,Long gameId);
+    List<AppGameBetting> selectListByDate( Long userId, String beginTime, String endTime,Long gameId,String gameDate);
 }

+ 1 - 1
game-business/src/main/java/com/game/business/service/IAppUserCountService.java

@@ -13,7 +13,7 @@ public interface IAppUserCountService extends IService<AppUserCount> {
 
     public void createAppUserCount(AppUserCount appUserCount);
 
-    public void staticsUserCount(Long gameId,String dateTime);
+    public void staticsUserCount(Long gameId,String dateTime,String gameDate);
 
     public Date selectLastUpdateDate();
 

+ 1 - 1
game-business/src/main/java/com/game/business/service/IAppUserGameRecordCountService.java

@@ -10,6 +10,6 @@ public interface IAppUserGameRecordCountService extends IService<AppUserGameReco
     /**
      * 根据日期查询用户当日统计情况
      * */
-    public List<AppUserGameRecordCount> selectByDate(Long userId, String startDate, String endDate);
+    public List<AppUserGameRecordCount> selectByDate(Long userId, String startDate, String endDate,Long gameId,String gameDate);
 
 }

+ 4 - 1
game-business/src/main/java/com/game/business/service/impl/AppGameBettingServiceImpl.java

@@ -96,7 +96,7 @@ public class AppGameBettingServiceImpl extends ServiceImpl<AppGameBettingMapper,
     }
 
     @Override
-    public List<AppGameBetting> selectListByDate(Long userId, String beginTime, String endTime,Long gameId) {
+    public List<AppGameBetting> selectListByDate(Long userId, String beginTime, String endTime,Long gameId,String gameDate) {
         LambdaQueryWrapper<AppGameBetting> queryWrapper = Wrappers.lambdaQuery();;
         queryWrapper.ne(AppGameBetting::getIsWinning,0);//查询已开奖
         queryWrapper.eq(AppGameBetting::getBettingType,0);
@@ -112,6 +112,9 @@ public class AppGameBettingServiceImpl extends ServiceImpl<AppGameBettingMapper,
         if(StringUtils.isNotBlank(endTime)){
             queryWrapper.le(AppGameBetting::getUpdateTime,endTime);
         }
+        if(StringUtils.isNotBlank(gameDate)){
+            queryWrapper.like(AppGameBetting::getGameDate,gameDate);
+        }
         return appGameBettingMapper.selectList(queryWrapper);
     }
 }

+ 5 - 5
game-business/src/main/java/com/game/business/service/impl/AppUserCountServiceImpl.java

@@ -114,7 +114,7 @@ public class AppUserCountServiceImpl extends ServiceImpl<AppUserCountMapper, App
     }
 
     @Override
-    public void staticsUserCount(Long gameId,String dateTime) {
+    public void staticsUserCount(Long gameId,String dateTime,String gameDate) {
         Date curDate = DateUtils.getNowDate();
         if (StringUtils.isNotBlank(dateTime)) {
             curDate = DateUtil.parse(dateTime, "yyyy-MM-dd");
@@ -122,17 +122,17 @@ public class AppUserCountServiceImpl extends ServiceImpl<AppUserCountMapper, App
             dateTime = DateUtils.parseDateToStr("yyyy-MM-dd", curDate);
         }
 
-        Date lastDate = this.selectLastUpdateDate();
+        /*Date lastDate = this.selectLastUpdateDate();
         String lastDateStr = DateUtil.format(lastDate,"yyyy-MM-dd HH:mm:ss");
         if(!dateTime.equals(DateUtil.format(lastDate,"yyyy-MM-dd"))){
             lastDateStr = DateUtil.format(curDate, "yyyy-MM-dd").concat(" 00:00:00");
         }
-        String endTimeStr = DateUtil.format(curDate,"yyyy-MM-dd HH:mm:ss");
+        String endTimeStr = DateUtil.format(curDate,"yyyy-MM-dd HH:mm:ss");*/
         AppUser queryUser = new AppUser();
         queryUser.setAgentFlag(1);
         List<AppUser> list = appUserService.selectAppUserList(queryUser);//查询所有代理用户
-        List<AppUserGameRecordCount> gameRecordCountList = appUserGameRecordCountService.selectByDate(null, lastDateStr, endTimeStr);
-        List<AppGameBetting> gameBettingList = appGameBettingService.selectListByDate(null, lastDateStr, endTimeStr,null);
+        List<AppUserGameRecordCount> gameRecordCountList = appUserGameRecordCountService.selectByDate(null, null, null,gameId,gameDate);
+        List<AppGameBetting> gameBettingList = appGameBettingService.selectListByDate(null, null, null,gameId,gameDate);
         if (null != list && list.size() > 0) {
             String finalDateTime = dateTime;
             Date finalCurDate = curDate;

+ 7 - 1
game-business/src/main/java/com/game/business/service/impl/AppUserGameRecordCountServiceImpl.java

@@ -21,7 +21,7 @@ public class AppUserGameRecordCountServiceImpl extends ServiceImpl<AppUserGameRe
     private AppUserGameRecordCountMapper appUserGameRecordCountMapper;
 
     @Override
-    public List<AppUserGameRecordCount> selectByDate(Long userId, String startDate, String endDate) {
+    public List<AppUserGameRecordCount> selectByDate(Long userId, String startDate, String endDate,Long gameId,String gameDate) {
         LambdaQueryWrapper<AppUserGameRecordCount> queryWrapper = new LambdaQueryWrapper<>();
         if(null != userId){
             queryWrapper.eq(AppUserGameRecordCount::getUserId, userId);
@@ -32,6 +32,12 @@ public class AppUserGameRecordCountServiceImpl extends ServiceImpl<AppUserGameRe
         if(StringUtils.isNotBlank(endDate)){
             queryWrapper.le(AppUserGameRecordCount::getCreateTime, endDate);
         }
+        if(null != gameId){
+            queryWrapper.eq(AppUserGameRecordCount::getGameId, gameId);
+        }
+        if(StringUtils.isNotBlank(gameDate)){
+            queryWrapper.like(AppUserGameRecordCount::getGameDate, gameDate);
+        }
         return appUserGameRecordCountMapper.selectList(queryWrapper);
     }
 

+ 1 - 1
game-business/src/main/java/com/game/business/task/AppGameBettingTask.java

@@ -233,7 +233,7 @@ public class AppGameBettingTask {
 
             this.gameBettingTask(appGameClassify.getId(), appGame.getId(), gameDate, gameLotterySucc);
 
-            appUserCountService.staticsUserCount(appGame.getId(),null);
+            appUserCountService.staticsUserCount(appGame.getId(),null,appGame.getGameDate());
         }
 
     }

+ 1 - 1
game-business/src/main/java/com/game/business/task/AppGameLotteryTask.java

@@ -45,7 +45,7 @@ public class AppGameLotteryTask {
 
         gameBettingTask(appGameLottery);
 
-        appUserCountService.staticsUserCount(appGameLottery.getGameId(),null);
+        appUserCountService.staticsUserCount(appGameLottery.getGameId(),null,appGameLottery.getGameDate());
     }
 
     private void updateItme(Long gameId, String gameLotterySucc){

+ 2 - 2
game-business/src/main/java/com/game/business/task/AppUserCountTask.java

@@ -75,8 +75,8 @@ public class AppUserCountTask {
             List<AppUsersCashrecord> appUsersCashrecords = appUsersCashrecordService.getUserCashList(null, dateTime.concat(" 00:00:00"), dateTime.concat(" 23:59:59"));
             List<FinTranRecord> finTranRecordList = finTranRecordService.getUserRecordList(null, dateTime.concat(" 00:00:00"), dateTime.concat(" 23:59:59"));
             List<AppUserLiveDividedRecord> liveDividedRecordList = appUserLiveDividedRecordService.selectByDate(null, dateTime.concat(" 00:00:00"), dateTime.concat(" 23:59:59"));
-            List<AppUserGameRecordCount> gameRecordCountList = appUserGameRecordCountService.selectByDate(null, dateTime.concat(" 00:00:00"), dateTime.concat(" 23:59:59"));
-            List<AppGameBetting> gameBettingList = appGameBettingService.selectListByDate(null, dateTime.concat(" 00:00:00"), dateTime.concat(" 23:59:59"),null);
+            List<AppUserGameRecordCount> gameRecordCountList = appUserGameRecordCountService.selectByDate(null, dateTime.concat(" 00:00:00"), dateTime.concat(" 23:59:59"),null,null);
+            List<AppGameBetting> gameBettingList = appGameBettingService.selectListByDate(null, dateTime.concat(" 00:00:00"), dateTime.concat(" 23:59:59"),null,null);
             if (null != list && list.size() > 0) {
                 List<AppUserCount> appUserCountList = new ArrayList<>();
                 String finalDateTime = dateTime;