dos před 4 měsíci
rodič
revize
93f4cde856

+ 1 - 1
game-business/src/main/java/com/game/business/controller/AppUserCountDividendController.java

@@ -59,7 +59,7 @@ public class AppUserCountDividendController extends BaseController
     /**
      * 发放分红
      */
-    @GetMapping("/send")
+    @PostMapping("/send")
     @ApiOperation(value = "发放分红", notes = "发放分红")
     public HttpRet<Boolean> send(AppUserDividendSendDto dto)
     {

+ 5 - 0
game-business/src/main/java/com/game/business/domain/AppUserCount.java

@@ -45,6 +45,11 @@ public class AppUserCount {
     @ApiModelProperty(value = "充值手续费")
     private double rechargeCommission;
 
+    @Excel(name = "充值赠送(余额)")
+    @TableField(value = "recharge_give")
+    @ApiModelProperty(value = "充值赠送(余额)")
+    private double rechargeGive;
+
     @Excel(name = "提现金额")
     @TableField(value = "withdrawal_amount")
     @ApiModelProperty(value = "提现金额")

+ 14 - 4
game-business/src/main/java/com/game/business/task/AppUserCountTask.java

@@ -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"));