Prechádzať zdrojové kódy

添加代理初始化游戏费率

kk 3 mesiacov pred
rodič
commit
1e9ed5aef5

+ 18 - 14
game-business/src/main/java/com/game/business/controller/AppUserAgentController.java

@@ -120,19 +120,26 @@ public class AppUserAgentController extends BaseController
             for (int i = 0; i < gameList.size(); i++) {
                 AppGame appGame = gameList.get(i);
 
+                AppGameCommission appGameCommission = new AppGameCommission();
+                appGameCommission.setUserId(appUserAgent.getUserId());
+                appGameCommission.setPid(appUserAgent.getPid());
+                appGameCommission.setGameId(appGame.getId());
+                appGameCommission.setGameRate(0L);
+
+                if(appGameCommissionService.save(appGameCommission)){
+                    AppGameCommissionVO appGameCommissionVO = new AppGameCommissionVO();
+                    appGameCommissionVO.setId(appGameCommission.getId());
+                    appGameCommissionVO.setPid(dbPuserAgent.getUserId());
+                    appGameCommissionVO.setUserId(appUser.getUserid());
+                    appGameCommissionVO.setGameRate(0L);
 
-                AppGameCommissionVO appGameCommissionVO = new AppGameCommissionVO();
-                appGameCommissionVO.setPid(dbPuserAgent.getUserId());
-                appGameCommissionVO.setUserId(appUser.getUserid());
-                appGameCommissionVO.setGameRate(0L);
-
-                appGameCommissionVO.setGameId(appGame.getId());
-                appGameCommissionVO.setGameName(appGame.getName());
-                appGameCommissionVO.setLogoUrl(appGame.getLogoUrl());
-                appGameCommissionVO.setGamePath(appGame.getGamePath());
-
+                    appGameCommissionVO.setGameId(appGame.getId());
+                    appGameCommissionVO.setGameName(appGame.getName());
+                    appGameCommissionVO.setLogoUrl(appGame.getLogoUrl());
+                    appGameCommissionVO.setGamePath(appGame.getGamePath());
 
-                gameCommissionVOList.add(appGameCommissionVO);
+                    gameCommissionVOList.add(appGameCommissionVO);
+                }
             }
         }
 
@@ -171,9 +178,6 @@ public class AppUserAgentController extends BaseController
             List<AppGameCommission> commissionList = appUserAgent.getCommissions();
             for(AppGameCommission commission : commissionList){
                 if(commission.getId() == null){
-/*                    if(commission.getPid() == null){
-                        commission.setPid(appUserAgent.getPid());
-                    }*/
                     if(commission.getGameId() == null){
                         continue;
                     }