|
@@ -1,6 +1,7 @@
|
|
|
package com.game.business.task;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.game.business.domain.*;
|
|
|
import com.game.business.service.*;
|
|
@@ -90,6 +91,12 @@ public class AppUserCountTask {
|
|
|
appUserCount.setWithdrawalAmount(appUsersCashrecords.stream().filter(e -> e.getUid().equals(appUser.getUserid())).mapToDouble(e -> e.getMoney().doubleValue()).sum());
|
|
|
//充值服务费/手续费
|
|
|
appUserCount.setRechargeCommission(appUsersChargeList.stream().filter(e -> e.getUid().equals(appUser.getUserid())).mapToDouble(e -> e.getPlatformService()).sum());
|
|
|
+ //充值赠送余额
|
|
|
+ appUserCount.setRechargeGive(finTranRecordList.stream().filter(e -> {
|
|
|
+ return e.getUid().equals(appUser.getUserid()) &&
|
|
|
+ e.getTranType1().intValue() == FinTranType1.U_Income_Coin_Balance.getType() &&
|
|
|
+ e.getTranType3().intValue() == FinTranType3.CHARGE_IN_REWARD.getType();
|
|
|
+ }).mapToDouble(e->e.getCoinChange()).sum());
|
|
|
//提现服务费/手续费
|
|
|
appUserCount.setWithdrawalCommission(appUsersCashrecords.stream().filter(e -> e.getUid().equals(appUser.getUserid())).mapToDouble(e -> e.getService().doubleValue()).sum());
|
|
|
//直播消费金额
|
|
@@ -111,7 +118,7 @@ public class AppUserCountTask {
|
|
|
e.getBettingAmount()
|
|
|
).sum());
|
|
|
//游戏赢
|
|
|
- appUserCount.setGameLoseAmount(gameBettingList.stream().filter(
|
|
|
+ appUserCount.setGameWinAmount(gameBettingList.stream().filter(
|
|
|
e -> e.getUserId().equals(appUser.getUserid()) && e.getIsWinning().intValue() == 1
|
|
|
).mapToDouble(e ->
|
|
|
e.getBettingAmount() * e.getBettingMultiple()
|
|
@@ -193,9 +200,12 @@ public class AppUserCountTask {
|
|
|
double gameCommission = appUserCountList.stream().mapToDouble(e -> e.getGameCommission()).sum();
|
|
|
//直播佣金
|
|
|
double liveCommission = appUserCountList.stream().mapToDouble(e -> e.getLiveCommission()).sum();
|
|
|
+ //充值赠送
|
|
|
+ double rechargeGive = appUserCountList.stream().mapToDouble(e -> e.getRechargeGive()).sum();
|
|
|
|
|
|
- //计算分红金额
|
|
|
- double money = (loseAmount - winAmount) - withdrawalCommission - gameCommission - liveCommission;
|
|
|
+ //计算分红金额 (输-赢)
|
|
|
+// double money = (loseAmount - winAmount) - withdrawalCommission - gameCommission - liveCommission;
|
|
|
+ double money = (loseAmount - winAmount) - gameCommission - rechargeGive;
|
|
|
if (money > 0) {
|
|
|
//金额大于0 满足分红
|
|
|
|
|
@@ -211,7 +221,7 @@ public class AppUserCountTask {
|
|
|
return;
|
|
|
}
|
|
|
double rate = userAgent.getDividendGuaranteeRate();
|
|
|
- double dividends = money * rate;
|
|
|
+ double dividends = money * rate/100;
|
|
|
AppUserCountDividend appUserCountDividend = new AppUserCountDividend();
|
|
|
appUserCountDividend.setUserId(userAgent.getUserId());
|
|
|
appUserCountDividend.setDateNo(DateUtil.format(endTime, "yyyy-MM-dd"));
|