Browse Source

修复bug

gogs 2 months ago
parent
commit
24d30a3e25

+ 1 - 1
game-business/src/main/java/com/game/business/service/impl/AppUserAgentServiceImpl.java

@@ -262,7 +262,7 @@ public class AppUserAgentServiceImpl extends ServiceImpl<AppUserAgentMapper, App
                             //游戏返点
                             e.setGameCommission(BigDecimal.valueOf(appUserCountList.stream().mapToDouble(j->
                                 {
-                                    return j.getGameCommission() - j.getLiveBettingCommission();
+                                    return j.getGameCommission() - j.getLiveBettingCommission() + j.getRechargeCommission() + j.getWithdrawalCommission();
                                 }
                             ).sum()).setScale(2, RoundingMode.HALF_UP).doubleValue());
                             //直播间下注返点

+ 6 - 1
game-business/src/main/java/com/game/business/task/AppUserCountTask.java

@@ -592,6 +592,9 @@ public class AppUserCountTask {
      * */
     @DSTransactional
     public void updateWithdrawAble(Long userId){
+        if(userId.longValue() == -1){
+            userId = null;
+        }
         //查询所有未满足提现的充值、转账
         String chargeType3 = FinTranType3.ON_LINE_CHARGE.getType() + "," + FinTranType3.CHARGE_IN.getType()+ "," + FinTranType3.CHARGE_IN_Back.getType()
                 + "," + FinTranType3.TRANSFER_TO_TEAM_DiamondCoin.getType();
@@ -610,7 +613,9 @@ public class AppUserCountTask {
                     }
                     //查询用户这段时间流水记录
                     List<FinTranRecord> curTranList = finTranRecordService.selectUserTran(null, null, uid, beginDate, endDate, null);
-                    withdrawAble += curTranList.stream().mapToDouble(FinTranRecord::getDiamondCoinChange).sum();
+                    withdrawAble += curTranList.stream().filter(
+                            e->FinTranType3.CASH_DIAMOND_INCOME.getType() != e.getTranType3().intValue()
+                    ).mapToDouble(FinTranRecord::getDiamondCoinChange).sum();
 
                 }
                 AppUser updateUser = new AppUser();

+ 3 - 0
game-business/src/main/java/com/game/business/vo/AppAgentTeamVo.java

@@ -52,6 +52,9 @@ public class AppAgentTeamVo {
     @ApiModelProperty(value = "充值手续费")
     private double rechargeCommission;
 
+    @ApiModelProperty(value = "提现手续费")
+    private double withdrawalCommission;
+
     @ApiModelProperty(value = "充值赠送金额")
     private double rechargeGive;
 

+ 2 - 1
game-business/src/main/resources/mapper/business/AppUserAgentMapper.xml

@@ -190,12 +190,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             a.pid as pid,
             IFNULL((LENGTH(a.subset) - LENGTH(REPLACE(a.subset, ',', ''))) + 1,0) as teamNum,
             IFNULL(sum(b.game_betting),0) as bettingAmount,
-            IFNULL(sum(b.game_commission - b.live_betting_commission),0) as gameCommission,
+            IFNULL(sum(b.game_commission - b.live_betting_commission + b.recharge_commission + b.withdrawal_commission),0) as gameCommission,
             IFNULL(sum(b.live_betting_commission),0) as liveBettingCommission,
             IFNULL(sum(b.live_commission),0) as liveCommission,
             IFNULL(sum((b.game_win_amount - (b.game_betting - b.game_lose_amount)) - b.game_lose_amount + b.game_commission + b.recharge_give + b.recharge_commission +  b.withdrawal_commission),0) as gameAmount,
             IFNULL(sum(b.recharge_amount),0) as rechargeAmount,
             IFNULL(sum(b.recharge_commission),0) as rechargeCommission,
+            IFNULL(sum(b.withdrawal_commission),0) as withdrawalCommission,
             IFNULL(sum(b.recharge_give),0) as rechargeGive,
             a.live_rate as liveRate,
             a.dividend_guarantee_rate as dividendGuaranteeRate