Kaynağa Gözat

fix : bug调试修改

bilingfeng 1 yıl önce
ebeveyn
işleme
07913eb286

+ 1 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/ManageApplication.java

@@ -21,7 +21,7 @@ public class ManageApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功 <玩家角色列表下载修改> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 <bug调试修改> ( ´・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 17 - 10
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/AgentServiceImpl.java

@@ -229,6 +229,11 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
         //判断运营
         GameAuthRole gameAuthRole = gameAuthRoleService.getOne(new LambdaQueryWrapper<GameAuthRole>()
                 .eq(GameAuthRole::getUserId, SecurityUtil.getUserId()));
+        //分配的游戏不存在
+        Tuple2<String, List<Long>> gameTuple = gameAuthService.getUserGameList(null);
+        if (CollectionUtils.isEmpty(gameTuple.getT2())) {
+            return Tuples.of(Collections.emptyList(), Collections.emptyList());
+        }
         //自然量查询
         if (Objects.equals(agentId, Agent.DEFAULT_AGENT)) {
             //超管, 运营, 组长可以查询自然量
@@ -240,7 +245,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
             return Tuples.of(Collections.emptyList(), Collections.emptyList());
         }
         //渠道列表
-        List<Agent> agentList = new ArrayList<>();
+        List<Agent> agentList;
         //是否需要自然量
         boolean defaultAgent = true;
         //超管权限, 返回所有渠道
@@ -251,26 +256,28 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
                     .eq(agentId != null, Agent::getId, agentId));
         } else if (Objects.equals(gameAuthRole.getAuthType(), GameAuthEnum.OPERATE.getValue())) {
             //运营权限, 获取拥有的游戏的所有渠道
-            Tuple2<String, List<Long>> tuple2 = gameAuthService.getUserGameList(null);
-            if (CollectionUtils.isNotEmpty(tuple2.getT2())) {
-                agentList = super.list(new LambdaQueryWrapper<Agent>()
-                        .in(Agent::getGameId, tuple2.getT2())
-                        .eq(Strings.isNotBlank(account), Agent::getAccountId, account)
-                        .eq(Strings.isNotBlank(pitcherId), Agent::getCreateBy, pitcherId)
-                        .eq(agentId != null, Agent::getId, agentId));
-            }
+            agentList = super.list(new LambdaQueryWrapper<Agent>()
+                    .in(Agent::getGameId, gameTuple.getT2())
+                    .eq(Strings.isNotBlank(account), Agent::getAccountId, account)
+                    .eq(Strings.isNotBlank(pitcherId), Agent::getCreateBy, pitcherId)
+                    .eq(agentId != null, Agent::getId, agentId));
         } else if (sysGameUserGroupRpcVO != null) {
             //组长权限, 获取组员id, 查询组内所有渠道
             Collection<Long> memberUserIdList = sysGameUserGroupRpc.memberUserIds(SecurityUtil.getCompanyId(),
                     SecurityUtil.getUserId()).getData();
+            if (CollectionUtils.isEmpty(memberUserIdList)){
+                return Tuples.of(Collections.emptyList(), Collections.emptyList());
+            }
             agentList = super.list(new LambdaQueryWrapper<Agent>()
+                    .in(Agent::getGameId, gameTuple.getT2())
                     .eq(Strings.isNotBlank(account), Agent::getAccountId, account)
                     .eq(Strings.isNotBlank(pitcherId), Agent::getCreateBy, pitcherId)
-                    .in(Strings.isBlank(pitcherId), Agent::getCreateBy, memberUserIdList)
+                    .in(Agent::getCreateBy, memberUserIdList)
                     .eq(agentId != null, Agent::getId, agentId));
         } else {
             //组员, 只允许查看自己的数据
             agentList = super.list(new LambdaQueryWrapper<Agent>()
+                    .in(Agent::getGameId, gameTuple.getT2())
                     .eq(Strings.isNotBlank(account), Agent::getAccountId, account)
                     .eq(Agent::getCreateBy, SecurityUtil.getUserId())
                     .eq(agentId != null, Agent::getId, agentId));

+ 9 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserServiceImpl.java

@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.corp.base.CorpServer;
 import com.zanxiang.corp.base.pojo.dto.CorpExternalUserDTO;
 import com.zanxiang.corp.base.rpc.ICorpExternalUserServiceRpc;
+import com.zanxiang.erp.security.util.SecurityUtil;
 import com.zanxiang.game.module.base.pojo.enums.GameAuthEnum;
 import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
 import com.zanxiang.game.module.base.util.DateUtils;
@@ -29,6 +30,7 @@ import com.zanxiang.game.module.mybatis.entity.GameUser;
 import com.zanxiang.game.module.mybatis.entity.GameUserRole;
 import com.zanxiang.game.module.mybatis.entity.User;
 import com.zanxiang.game.module.mybatis.mapper.UserMapper;
+import com.zanxiang.module.util.JsonUtil;
 import com.zanxiang.module.util.bean.BeanUtil;
 import com.zanxiang.module.util.encryption.Md5Util;
 import com.zanxiang.module.util.exception.BaseException;
@@ -190,8 +192,15 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         if (CollectionUtils.isEmpty(gameTuple.getT2())) {
             return new Page<>();
         }
+
+        log.error("查询玩家, 游戏授权列表 userId : {}, gameTuple : {}", SecurityUtil.getUserId(), JsonUtil.toString(gameTuple));
+
+
         //游戏条件处理
         Map<Long, GameDTO> gameMap = gameService.gameCondition(gameTuple.getT2(), param.getCpId(), param.getGameId(), param.getGameCategoryId());
+
+        log.error("查询玩家, 游戏授权列表 userId : {}, gameMap : {}", SecurityUtil.getUserId(), JsonUtil.toString(gameMap));
+
         //根据条件, 匹配不到游戏
         if (gameMap != null && gameMap.isEmpty()) {
             return new Page<>();