Browse Source

盈亏减去中奖本金

dos 3 months ago
parent
commit
ab5fa2b278

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

@@ -155,7 +155,11 @@ public class AppAgentController extends BaseController {
         //团队直播消费
         vo.setTeamLive(BigDecimal.valueOf(appUserCountList.stream().mapToDouble(e->e.getLiveUseAmount()).sum()).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue());
         //团队投注赢
-        vo.setTeamWin(BigDecimal.valueOf(appUserCountList.stream().mapToDouble(e->e.getGameWinAmount()).sum()).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue());
+        vo.setTeamWin(BigDecimal.valueOf(appUserCountList.stream().mapToDouble(
+                e->{
+                    return e.getGameWinAmount() - (e.getGameBetting() - e.getGameLoseAmount());
+                }
+        ).sum()).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue());
         //团队投注输
         vo.setTeamLose(BigDecimal.valueOf(appUserCountList.stream().mapToDouble(e->e.getGameLoseAmount()).sum()).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue());
         //活跃人数

+ 1 - 1
game-business/src/main/java/com/game/business/domain/AppUserAgent.java

@@ -119,7 +119,7 @@ private static final long serialVersionUID=1L;
 
     private static double deal(List<AppUserCount> appUserCountList,Long userId){
        return appUserCountList.stream().filter(e->e.getUserId().equals(userId)).mapToDouble(e->{
-            return e.getGameLoseAmount() - e.getGameWinAmount() - e.getGameCommission() - e.getRechargeGive();
+            return e.getGameLoseAmount() - (e.getGameWinAmount() - (e.getGameBetting() - e.getGameLoseAmount())) - e.getGameCommission() - e.getRechargeGive();
         }).sum();
     }
 

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

@@ -236,7 +236,8 @@ public class AppUserAgentServiceImpl extends ServiceImpl<AppUserAgentMapper, App
                         e.setGameCommission(BigDecimal.valueOf(appUserCountList.stream().mapToDouble(AppUserCount::getGameCommission).sum()).setScale(2, RoundingMode.HALF_UP).doubleValue());
                         //盈亏
                         e.setGameAmount(BigDecimal.valueOf(appUserCountList.stream().mapToDouble(userCount->{
-                            return (userCount.getGameWinAmount() - userCount.getGameLoseAmount()) + userCount.getGameCommission() + userCount.getRechargeGive();
+                            return ((userCount.getGameWinAmount() - (userCount.getGameBetting() - userCount.getGameLoseAmount()))
+                                    - userCount.getGameLoseAmount()) + userCount.getGameCommission() + userCount.getRechargeGive();
                         }).sum()).setScale(2, RoundingMode.HALF_UP).doubleValue());
                         //充值金额(由于统计的金额是扣除了手续费并且加上赠送金额的值 故这么计算出原始充值金额)
                         e.setRechargeAmount(BigDecimal.valueOf(appUserCountList.stream().mapToDouble(userCount->{

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

@@ -377,7 +377,9 @@ public class AppUserCountTask {
                     //游戏输钱
                     double loseAmount = appUserCountList.stream().mapToDouble(e -> e.getGameLoseAmount()).sum();
                     //游戏赢钱
-                    double winAmount = appUserCountList.stream().mapToDouble(e -> e.getGameWinAmount()).sum();
+                    double winAmount = appUserCountList.stream().mapToDouble(e -> {
+                        return e.getGameWinAmount() - (e.getGameBetting() - e.getGameLoseAmount()); //实际赢钱 = 赢 - 中奖本金
+                    }).sum();
                     //提现手续费
                     double withdrawalCommission = appUserCountList.stream().mapToDouble(e -> e.getWithdrawalCommission()).sum();
                     //游戏佣金