|
@@ -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) {
|
|
|
+
|
|
|
Date curDate = DateUtils.getNowDate();
|
|
|
String dateTime = DateUtils.parseDateToStr("yyyy-MM-dd", curDate);
|
|
|
|
|
@@ -233,36 +233,37 @@ public class AppUserCountServiceImpl extends ServiceImpl<AppUserCountMapper, App
|
|
|
userIds = userIds.stream().distinct().collect(Collectors.toList());*/
|
|
|
|
|
|
|
|
|
- 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());
|
|
|
+
|
|
|
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) {
|
|
|
+
|
|
|
|
|
|
- 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()));
|
|
|
}).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
|