|
@@ -64,6 +64,15 @@ public class AppAgentController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private IShopSubOrderService shopSubOrderService;
|
|
private IShopSubOrderService shopSubOrderService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IAppGameBettingService appGameBettingService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IAppUsersChargeService appUsersChargeService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IAppUsersCashrecordService appUsersCashrecordService;
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 首页
|
|
* 首页
|
|
@@ -344,6 +353,98 @@ public class AppAgentController extends BaseController {
|
|
List<AppGameCommission> gameCommissionList = appGameCommissionService.getByIds(Arrays.asList(userId));
|
|
List<AppGameCommission> gameCommissionList = appGameCommissionService.getByIds(Arrays.asList(userId));
|
|
appUserDetailVo.setGameCommissionList(gameCommissionList);
|
|
appUserDetailVo.setGameCommissionList(gameCommissionList);
|
|
|
|
|
|
|
|
+ Date nowDate = new Date();
|
|
|
|
+ int curDay = Integer.parseInt(DateUtil.format(nowDate,"dd"));
|
|
|
|
+
|
|
|
|
+ Date beginDate = null;
|
|
|
|
+ Date endDate = null;
|
|
|
|
+ if(curDay <= 15){
|
|
|
|
+ beginDate = DateUtil.beginOfMonth(nowDate);
|
|
|
|
+ endDate = DateUtil.parse(DateUtil.format(nowDate,"yyyy-MM-".concat("15").concat(" 23:59:59")),"yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ }else{
|
|
|
|
+ beginDate = DateUtil.parse(DateUtil.format(nowDate,"yyyy-MM-".concat("15").concat(" 00:00:00")),"yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ endDate = DateUtil.endOfMonth(nowDate);
|
|
|
|
+ }
|
|
|
|
+ //游戏流水
|
|
|
|
+ List<AppGameBetting> gameBettingList = appGameBettingService.selectListByDate(userId,
|
|
|
|
+ DateUtil.format(beginDate,"yyyy-MM-dd").concat(" 00:00:00"),
|
|
|
|
+ DateUtil.format(endDate,"yyyy-MM-dd").concat(" 23:59:59"),
|
|
|
|
+ null,null,null,null);
|
|
|
|
+ //当日游戏投注
|
|
|
|
+ appUserDetailVo.setTodayBetting(gameBettingList.stream().filter(e->{
|
|
|
|
+ return DateUtil.format(e.getCreateTime(),"yyyy-MM-dd").equals(DateUtil.format(nowDate,"yyyy-MM-dd")) &&
|
|
|
|
+ e.getBettingType().intValue() == 0;
|
|
|
|
+ }).mapToDouble(AppGameBetting::getBettingAmount).sum());
|
|
|
|
+ appUserDetailVo.setTodayCoinBetting(gameBettingList.stream().filter(e->{
|
|
|
|
+ return DateUtil.format(e.getCreateTime(),"yyyy-MM-dd").equals(DateUtil.format(nowDate,"yyyy-MM-dd")) &&
|
|
|
|
+ e.getBettingType().intValue() ==1;
|
|
|
|
+ }).mapToDouble(AppGameBetting::getBettingAmount).sum());
|
|
|
|
+
|
|
|
|
+ //本周游戏投注
|
|
|
|
+ appUserDetailVo.setWeekBetting(gameBettingList.stream().filter(e->e.getBettingType().intValue() == 0)
|
|
|
|
+ .mapToDouble(AppGameBetting::getBettingAmount).sum());
|
|
|
|
+ appUserDetailVo.setWeekCoinBetting(gameBettingList.stream().filter(e->e.getBettingType().intValue() == 1)
|
|
|
|
+ .mapToDouble(AppGameBetting::getBettingAmount).sum());
|
|
|
|
+
|
|
|
|
+ //当日游戏赢
|
|
|
|
+ appUserDetailVo.setTodayWin(gameBettingList.stream().filter(e->{
|
|
|
|
+ return DateUtil.format(e.getCreateTime(),"yyyy-MM-dd").equals(DateUtil.format(nowDate,"yyyy-MM-dd")) &&
|
|
|
|
+ e.getIsWinning().intValue() == 1 && e.getBettingType().intValue() == 0;
|
|
|
|
+ }).mapToDouble(e->{return (e.getBettingMultiple() * e.getBettingAmount()) - e.getBettingAmount();}).sum());
|
|
|
|
+ appUserDetailVo.setTodayCoinWin(gameBettingList.stream().filter(e->{
|
|
|
|
+ return DateUtil.format(e.getCreateTime(),"yyyy-MM-dd").equals(DateUtil.format(nowDate,"yyyy-MM-dd")) &&
|
|
|
|
+ e.getIsWinning().intValue() == 1 && e.getBettingType().intValue() == 1;
|
|
|
|
+ }).mapToDouble(e->{return (e.getBettingMultiple() * e.getBettingAmount()) - e.getBettingAmount();}).sum());
|
|
|
|
+
|
|
|
|
+ //本周游戏赢
|
|
|
|
+ appUserDetailVo.setWeekWin(gameBettingList.stream().filter(e->{
|
|
|
|
+ return e.getIsWinning().intValue() == 1 && e.getBettingType().intValue() == 0;
|
|
|
|
+ }).mapToDouble(e->{return (e.getBettingMultiple() * e.getBettingAmount()) - e.getBettingAmount();}).sum());
|
|
|
|
+ appUserDetailVo.setWeekCoinWin(gameBettingList.stream().filter(e->{
|
|
|
|
+ return e.getIsWinning().intValue() == 1 && e.getBettingType().intValue() == 1;
|
|
|
|
+ }).mapToDouble(e->{return (e.getBettingMultiple() * e.getBettingAmount()) - e.getBettingAmount();}).sum());
|
|
|
|
+
|
|
|
|
+ //当日游戏输
|
|
|
|
+ appUserDetailVo.setTodayLose(gameBettingList.stream().filter(e->{
|
|
|
|
+ return DateUtil.format(e.getCreateTime(),"yyyy-MM-dd").equals(DateUtil.format(nowDate,"yyyy-MM-dd")) &&
|
|
|
|
+ e.getIsWinning().intValue() == 2 && e.getBettingType().intValue() == 0;
|
|
|
|
+ }).mapToDouble(e->{return e.getBettingAmount();}).sum());
|
|
|
|
+ appUserDetailVo.setTodayCoinLose(gameBettingList.stream().filter(e->{
|
|
|
|
+ return DateUtil.format(e.getCreateTime(),"yyyy-MM-dd").equals(DateUtil.format(nowDate,"yyyy-MM-dd")) &&
|
|
|
|
+ e.getIsWinning().intValue() == 2 && e.getBettingType().intValue() == 1;
|
|
|
|
+ }).mapToDouble(e->{return e.getBettingAmount();}).sum());
|
|
|
|
+
|
|
|
|
+ //本周游戏输
|
|
|
|
+ appUserDetailVo.setWeekLose(gameBettingList.stream().filter(e->{
|
|
|
|
+ return e.getIsWinning().intValue() == 2 && e.getBettingType().intValue() == 0;
|
|
|
|
+ }).mapToDouble(e->{return e.getBettingAmount();}).sum());
|
|
|
|
+ appUserDetailVo.setWeekCoinLose(gameBettingList.stream().filter(e->{
|
|
|
|
+ return e.getIsWinning().intValue() == 2 && e.getBettingType().intValue() == 1;
|
|
|
|
+ }).mapToDouble(e->{return e.getBettingAmount();}).sum());
|
|
|
|
+
|
|
|
|
+ List<AppUsersCharge> appUsersChargeList = appUsersChargeService.getChargeList(userId,
|
|
|
|
+ DateUtil.format(beginDate,"yyyy-MM-dd").concat(" 00:00:00"),
|
|
|
|
+ DateUtil.format(endDate,"yyyy-MM-dd").concat(" 23:59:59"));
|
|
|
|
+ //当日充值
|
|
|
|
+ appUserDetailVo.setTodayCharge(appUsersChargeList.stream().filter(e->{
|
|
|
|
+ return DateUtil.format(e.getAddtime(),"yyyy-MM-dd").equals(DateUtil.format(nowDate,"yyyy-MM-dd"));
|
|
|
|
+ }).mapToDouble(e->{return e.getCoin().doubleValue();}).sum());
|
|
|
|
+
|
|
|
|
+ //本周充值
|
|
|
|
+ appUserDetailVo.setWeekCharge(appUsersChargeList.stream().mapToDouble(e->{return e.getCoin().doubleValue();}).sum());
|
|
|
|
+
|
|
|
|
+ //提现
|
|
|
|
+ List<AppUsersCashrecord> appUsersCashrecords = appUsersCashrecordService.getUserCashList(userId,
|
|
|
|
+ DateUtil.format(beginDate,"yyyy-MM-dd").concat(" 00:00:00"),
|
|
|
|
+ DateUtil.format(endDate,"yyyy-MM-dd").concat(" 23:59:59"));
|
|
|
|
+ //当日提现
|
|
|
|
+ appUserDetailVo.setTodayWithdraw(appUsersCashrecords.stream().filter(e->{
|
|
|
|
+ return DateUtil.format(e.getAddtime(),"yyyy-MM-dd").equals(DateUtil.format(nowDate,"yyyy-MM-dd"));
|
|
|
|
+ }).mapToDouble(e->{return e.getVotes().doubleValue();}).sum());
|
|
|
|
+
|
|
|
|
+ //本周提现
|
|
|
|
+ appUserDetailVo.setWeekWithdraw(appUsersCashrecords.stream().mapToDouble(e->{return e.getVotes().doubleValue();}).sum());
|
|
|
|
+
|
|
/* AppUser queryIpUser = new AppUser();
|
|
/* AppUser queryIpUser = new AppUser();
|
|
queryIpUser.setIpaddr(appUser.getIpaddr());
|
|
queryIpUser.setIpaddr(appUser.getIpaddr());
|
|
List<AppUser> ipUserList = appUserService.selectAppUserList(queryIpUser);
|
|
List<AppUser> ipUserList = appUserService.selectAppUserList(queryIpUser);
|