kk пре 3 месеци
родитељ
комит
31b62e4816

+ 8 - 10
game-business/src/main/java/com/game/business/task/AppAgentGameBettingTask.java

@@ -47,8 +47,10 @@ public class AppAgentGameBettingTask {
     @Async("asyncExecutor")
     public void agentGameBettingTask(AppGameBetting appGameBetting) {
 
+        List<AppUserGameRecordCount> recordCountList = new ArrayList<>();
+
         // 主播分佣
-        liveCommissionHandler(appGameBetting);
+        liveCommissionHandler(appGameBetting, recordCountList);
 
         AppUserAgent userIdObject = new AppUserAgent();
         userIdObject.setUserId(appGameBetting.getUserId());
@@ -63,7 +65,6 @@ public class AppAgentGameBettingTask {
 
         getGameRate(appGameBetting.getGameId(), userAgent.getPid(), userAgent.getUserId(), gameRateList);
         if(gameRateList.isEmpty()){
-            List<AppUserGameRecordCount>  recordCountList = new ArrayList<>();
             AppUserGameRecordCount recordCount = new AppUserGameRecordCount();
             recordCount.setGameId(appGameBetting.getGameId());
             recordCount.setUserId(appGameBetting.getUserId());
@@ -71,11 +72,11 @@ public class AppAgentGameBettingTask {
             recordCount.setCommission(0.00);
             recordCount.setGameRate(0.00);
             recordCountList.add(recordCount);
-            appUserCountService.staticsUserBetting(appGameBetting,recordCountList);
+            appUserCountService.staticsUserBetting(appGameBetting, recordCountList);
             return;
         }
 
-        List<AppUserGameRecordCount>  recordCountList = commissionHandler(gameRateList, appGameBetting);
+        commissionHandler(gameRateList, appGameBetting, recordCountList);
 
         //统计游戏下注、返佣情况
         appUserCountService.staticsUserBetting(appGameBetting,recordCountList);
@@ -116,9 +117,7 @@ public class AppAgentGameBettingTask {
     }
 
     @Transactional
-    public List<AppUserGameRecordCount> commissionHandler(List<AppGameCommission> gameRateList, AppGameBetting appGameBetting){
-
-        List<AppUserGameRecordCount> recordCountList = new ArrayList<>();
+    public void commissionHandler(List<AppGameCommission> gameRateList, AppGameBetting appGameBetting, List<AppUserGameRecordCount> recordCountList){
 
         // 升序排序
         Collections.sort(gameRateList, Comparator.comparing(AppGameCommission::getGameRate));
@@ -248,12 +247,10 @@ public class AppAgentGameBettingTask {
             finTranRecord.setOrderId(appGameBetting.getId());
             finTranRecordService.insertFinTranRecord(finTranRecord);
         }
-
-        return recordCountList;
     }
 
     @Transactional
-    public void liveCommissionHandler(AppGameBetting appGameBetting){
+    public void liveCommissionHandler(AppGameBetting appGameBetting, List<AppUserGameRecordCount> recordCountList){
 
         if(appGameBetting.getIsLive() == 0){
             return;
@@ -293,6 +290,7 @@ public class AppAgentGameBettingTask {
         appUserGameRecordCount.setCommission(gameRateAmount);
 
         appUserGameRecordCountService.save(appUserGameRecordCount);
+        recordCountList.add(appUserGameRecordCount);
 
         FinTranRecord finTranRecord = new FinTranRecord();
 

+ 1 - 1
game-business/src/main/java/com/game/business/util/Common.java

@@ -16,7 +16,7 @@ public class Common {
     public static final String WS_GAME_ONE_URL = "ws://47.115.49.14:8000/ws";
     public static final String WS_GAME_ONE_REMARK_URL = "ws://47.238.102.31:8000/ws";
     public static final String WS_GAME_TWO_URL = "ws://47.115.54.173:8000/ws";
-    public static final String WS_GAME_TWO_REMARK_URL = "ws://47.238.153.129:8000/ws";
+    public static final String WS_GAME_TWO_REMARK_URL = "ws://47.115.54.173:8000/ws";
 
 
     public static Map<String, Session> sessionMap = new HashMap<>();