|
@@ -61,31 +61,33 @@ public class AppAgentController extends BaseController {
|
|
|
Date endDate = DateUtil.endOfMonth(nowDate);
|
|
|
List<AppUserCount> appUserCountList = appUserCountService.getAppUserCount(userId,DateUtil.format(beginDate,formatP),DateUtil.format(endDate,formatP));
|
|
|
|
|
|
- if(null != appUserCountList && appUserCountList.size() > 0){
|
|
|
- //佣金
|
|
|
- vo.setMyCommission(appUserCountList.stream().mapToDouble(e->e.getLiveCommission() + e.getGameCommission()).sum());
|
|
|
- //团队人数
|
|
|
- vo.setTeamUser(appUserAgentService.countAgent(userId,null,null));
|
|
|
- //团队充值
|
|
|
- vo.setTeamRecharge(appUserCountList.stream().mapToDouble(e->e.getRechargeAmount()).sum());
|
|
|
- //团队投注
|
|
|
- vo.setTeamBetting(appUserAgentService.sumBetting(DateUtil.format(beginDate,"yyyy-MM-dd").concat(" 00:00:00")
|
|
|
- ,DateUtil.format(endDate,"yyyy-MM-dd").concat(" 23:59:59"),userId));
|
|
|
- //团队直播消费
|
|
|
- vo.setTeamLive(appUserCountList.stream().mapToDouble(e->e.getLiveUseAmount()).sum());
|
|
|
- //团队投注赢
|
|
|
- vo.setTeamWin(appUserCountList.stream().mapToDouble(e->e.getGameWinAmount()).sum());
|
|
|
- //团队投注输
|
|
|
- vo.setTeamLose(appUserCountList.stream().mapToDouble(e->e.getGameLoseAmount()).sum());
|
|
|
- //活跃人数
|
|
|
- vo.setActiveUser(appUserCountList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(()-> new TreeSet<>(Comparator.comparing(f->f.getUserId()))), ArrayList::new)).size());
|
|
|
- //昨日新增
|
|
|
- Date yesterDay = DateUtil.offsetDay(DateUtil.date(),-1);
|
|
|
- vo.setYesterdayUser(appUserAgentService.countAgent(userId,DateUtil.format(yesterDay,"yyyy-MM-dd").concat(" 00:00:00")
|
|
|
- ,DateUtil.format(yesterDay,"yyyy-MM-dd").concat(" 23:59:59")));
|
|
|
- vo.setMonthUser(appUserAgentService.countAgent(userId,DateUtil.format(beginDate,"yyyy-MM-dd").concat(" 00:00:00")
|
|
|
- ,DateUtil.format(endDate,"yyyy-MM-dd").concat(" 23:59:59")));
|
|
|
+ if(null != appUserCountList){
|
|
|
+ appUserCountList = new ArrayList<>();
|
|
|
}
|
|
|
+ //佣金
|
|
|
+ vo.setMyCommission(appUserCountList.stream().mapToDouble(e->e.getLiveCommission() + e.getGameCommission()).sum());
|
|
|
+ //团队人数
|
|
|
+ vo.setTeamUser(appUserAgentService.countAgent(userId,null,null));
|
|
|
+ //团队充值
|
|
|
+ vo.setTeamRecharge(appUserCountList.stream().mapToDouble(e->e.getRechargeAmount()).sum());
|
|
|
+ //团队投注
|
|
|
+ vo.setTeamBetting(appUserAgentService.sumBetting(DateUtil.format(beginDate,"yyyy-MM-dd").concat(" 00:00:00")
|
|
|
+ ,DateUtil.format(endDate,"yyyy-MM-dd").concat(" 23:59:59"),userId));
|
|
|
+ //团队直播消费
|
|
|
+ vo.setTeamLive(appUserCountList.stream().mapToDouble(e->e.getLiveUseAmount()).sum());
|
|
|
+ //团队投注赢
|
|
|
+ vo.setTeamWin(appUserCountList.stream().mapToDouble(e->e.getGameWinAmount()).sum());
|
|
|
+ //团队投注输
|
|
|
+ vo.setTeamLose(appUserCountList.stream().mapToDouble(e->e.getGameLoseAmount()).sum());
|
|
|
+ //活跃人数
|
|
|
+ vo.setActiveUser(appUserCountList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(()-> new TreeSet<>(Comparator.comparing(f->f.getUserId()))), ArrayList::new)).size());
|
|
|
+ //昨日新增
|
|
|
+ Date yesterDay = DateUtil.offsetDay(DateUtil.date(),-1);
|
|
|
+ vo.setYesterdayUser(appUserAgentService.countAgent(userId,DateUtil.format(yesterDay,"yyyy-MM-dd").concat(" 00:00:00")
|
|
|
+ ,DateUtil.format(yesterDay,"yyyy-MM-dd").concat(" 23:59:59")));
|
|
|
+ vo.setMonthUser(appUserAgentService.countAgent(userId,DateUtil.format(beginDate,"yyyy-MM-dd").concat(" 00:00:00")
|
|
|
+ ,DateUtil.format(endDate,"yyyy-MM-dd").concat(" 23:59:59")));
|
|
|
+
|
|
|
return HttpRet.success(MessageUtils.message("11022"),vo);
|
|
|
}
|
|
|
|