|
@@ -224,8 +224,8 @@ public class AppUserCountServiceImpl extends ServiceImpl<AppUserCountMapper, App
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void staticsUserBetting(AppGameBetting appGameBetting,List<AppGameCommission> gameRateList) {
|
|
|
- synchronized (CacheConstants.USER_GAME_RECORD_COUNT.concat(String.valueOf(appGameBetting.getGameId())).concat(appGameBetting.getGameDate())) {
|
|
|
+ public void staticsUserBetting(AppGameBetting appGameBetting,List<AppUserGameRecordCount> recordCountList) {
|
|
|
+// synchronized (CacheConstants.USER_GAME_RECORD_COUNT.concat(String.valueOf(appGameBetting.getGameId())).concat(appGameBetting.getGameDate())) {
|
|
|
Date curDate = DateUtils.getNowDate();
|
|
|
String dateTime = DateUtils.parseDateToStr("yyyy-MM-dd", curDate);
|
|
|
/*List<Long> userIds = gameRateList.stream().map(AppGameCommission::getUserId).collect(Collectors.toList());
|
|
@@ -233,36 +233,37 @@ public class AppUserCountServiceImpl extends ServiceImpl<AppUserCountMapper, App
|
|
|
userIds = userIds.stream().distinct().collect(Collectors.toList());*/
|
|
|
// List<AppUserGameRecordCount> gameRecordCountList = appUserGameRecordCountService.selectByDate(null, null, null,appGameBetting.getGameId(),appGameBetting.getGameDate());
|
|
|
|
|
|
- if (null != gameRateList && gameRateList.size() > 0) {
|
|
|
+ if (null != recordCountList && recordCountList.size() > 0) {
|
|
|
|
|
|
String finalDateTime = dateTime;
|
|
|
Date finalCurDate = curDate;
|
|
|
List<Long> userIds = new ArrayList<>();
|
|
|
- gameRateList.forEach(gameRate -> {
|
|
|
+ recordCountList.forEach(gameRate -> {
|
|
|
Long userId = gameRate.getUserId();
|
|
|
- //用户最后一次更新时间
|
|
|
+ /*//用户最后一次更新时间
|
|
|
Date updateTime = this.selectGameLastDate(userId);
|
|
|
if (!DateUtil.format(updateTime, "yyyy-MM-dd").equals(DateUtil.format(finalCurDate, "yyyy-MM-dd"))) {
|
|
|
//跨天直接从当日零点开始统计
|
|
|
updateTime = DateUtil.beginOfDay(finalCurDate);
|
|
|
- }
|
|
|
+ }*/
|
|
|
//查询用户返佣
|
|
|
- List<AppUserGameRecordCount> gameRecordCountList = appUserGameRecordCountService.selectByDate(userId, DateUtil.format(updateTime, "yyyy-MM-dd HH:mm:ss"), DateUtil.format(finalCurDate, "yyyy-MM-dd HH:mm:ss"), gameRate.getGameId(), appGameBetting.getGameDate());
|
|
|
+// List<AppUserGameRecordCount> gameRecordCountList = appUserGameRecordCountService.selectByDate(userId, DateUtil.format(updateTime, "yyyy-MM-dd HH:mm:ss"), DateUtil.format(finalCurDate, "yyyy-MM-dd HH:mm:ss"), gameRate.getGameId(), appGameBetting.getGameDate());
|
|
|
userIds.add(userId);
|
|
|
AppUserCount appUserCount = new AppUserCount();
|
|
|
appUserCount.setUserId(userId);
|
|
|
appUserCount.setStrDate(finalDateTime);
|
|
|
- appUserCount.setAgentUserId(gameRateList.stream().filter(e -> e.getUserId().equals(userId)).map(AppGameCommission::getPid).collect(Collectors.toList()).get(0));
|
|
|
+ appUserCount.setAgentUserId(gameRate.getPid());
|
|
|
appUserCount.setUpdateTime(finalCurDate);
|
|
|
appUserCount.setGameCountTime(finalCurDate);
|
|
|
- if (null != gameRecordCountList && gameRecordCountList.size() > 0) {
|
|
|
+// if (null != gameRecordCountList && gameRecordCountList.size() > 0) {
|
|
|
//游戏佣金
|
|
|
- Map<String, Double> map = redisCache.getCacheMap(CacheConstants.USER_GAME_RECORD_COUNT.concat(String.valueOf(userId)));
|
|
|
+ /*Map<String, Double> map = redisCache.getCacheMap(CacheConstants.USER_GAME_RECORD_COUNT.concat(String.valueOf(userId)));
|
|
|
appUserCount.setGameCommission(gameRecordCountList.stream().filter(e -> {
|
|
|
return null == map || null == map.get(String.valueOf(e.getId())); //过滤已统计过的id
|
|
|
}).mapToDouble(e -> e.getCommission()).sum());
|
|
|
- setGameCache(gameRecordCountList);
|
|
|
- }
|
|
|
+ setGameCache(gameRecordCountList);*/
|
|
|
+ appUserCount.setGameCommission(gameRate.getCommission());
|
|
|
+// }
|
|
|
//游戏下注金额 更新当前下注用户 (非金币)
|
|
|
if (userId.equals(appGameBetting.getUserId()) && appGameBetting.getBettingType().intValue() == 0) {
|
|
|
appUserCount.setGameBetting(appGameBetting.getBettingAmount());
|
|
@@ -272,7 +273,7 @@ public class AppUserCountServiceImpl extends ServiceImpl<AppUserCountMapper, App
|
|
|
//更新周盈亏数据
|
|
|
appUserCountDividendService.reloadCache(null, userIds);
|
|
|
}
|
|
|
- }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
@Override
|