Ver código fonte

fix : 区服指派接口调试修改

bilingfeng 1 ano atrás
pai
commit
6a554ec1dc

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

@@ -23,7 +23,7 @@ public class ManageApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功 <区服指派测试 ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 <区服指派接口调试修改 ( ´・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 11 - 15
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameServerServiceImpl.java

@@ -26,7 +26,6 @@ import com.zanxiang.game.module.mybatis.entity.GameServer;
 import com.zanxiang.game.module.mybatis.entity.GameServerAssignLog;
 import com.zanxiang.game.module.mybatis.entity.GameSupper;
 import com.zanxiang.game.module.mybatis.mapper.GameServerMapper;
-import com.zanxiang.module.util.JsonUtil;
 import com.zanxiang.module.util.bean.BeanUtil;
 import com.zanxiang.module.util.excel.ExcelUtil;
 import com.zanxiang.module.util.exception.BaseException;
@@ -82,6 +81,9 @@ public class GameServerServiceImpl extends ServiceImpl<GameServerMapper, GameSer
     }
 
     private void gameServerAssign(GameServerAssignParam param, GameServer gameServer) {
+        if (Objects.equals(gameServer.getIsSourceServer(), Boolean.FALSE)) {
+            return;
+        }
         //老的指派人员id
         String oldUserIds = null;
         if (Objects.equals(param.getAssignType(), GameServerAssignEnum.GAME_SERVER_ASSIGN_GS)) {
@@ -308,6 +310,14 @@ public class GameServerServiceImpl extends ServiceImpl<GameServerMapper, GameSer
         gameServerListVO.setGameName(gameSupper == null ? null : gameSupper.getName());
         //原始区服, 直接返回
         if (Objects.equals(gameServer.getIsSourceServer(), Boolean.TRUE)) {
+            //指派客服
+            if (Strings.isNotBlank(gameServer.getCustomerIds())) {
+                gameServerListVO.setCustomerList(this.getUserBeanList(gameServer.getCustomerIds()));
+            }
+            //指派GS
+            if (Strings.isNotBlank(gameServer.getGsIds())) {
+                gameServerListVO.setGsList(this.getUserBeanList(gameServer.getGsIds()));
+            }
             return gameServerListVO;
         }
         //合服
@@ -343,14 +353,6 @@ public class GameServerServiceImpl extends ServiceImpl<GameServerMapper, GameSer
         if (sourceServerIdArray != null) {
             gameServerListVO.setSourceServerList(this.getSourceServerList(sourceServerIdArray, gameServerMap));
         }
-        //指派客服
-        if (Strings.isNotBlank(gameServer.getCustomerIds())) {
-            gameServerListVO.setCustomerList(this.getUserBeanList(gameServer.getCustomerIds()));
-        }
-        //指派GS
-        if (Strings.isNotBlank(gameServer.getGsIds())) {
-            gameServerListVO.setGsList(this.getUserBeanList(gameServer.getGsIds()));
-        }
         return gameServerListVO;
     }
 
@@ -388,20 +390,14 @@ public class GameServerServiceImpl extends ServiceImpl<GameServerMapper, GameSer
     }
 
     private List<GameServerListVO.UserBean> getUserBeanList(String userIds) {
-        log.error("区服 userIds : {}", userIds);
         List<GameServerListVO.UserBean> userList = new ArrayList<>();
         List<Long> userIdList = Arrays.stream(userIds.split(","))
                 .map(Long::valueOf).collect(Collectors.toList());
-
-        log.error("区服 userIdList : {}", userIdList);
-
         Map<Long, String> userNameMap = sysUserRpc.getUserNameByIds(userIdList).getData();
         userIdList.forEach(userId -> userList.add(GameServerListVO.UserBean.builder()
                 .userId(userId)
                 .userName(userNameMap.get(userId))
                 .build()));
-
-        log.error("区服 userList : {}", JsonUtil.toString(userList));
         return userList;
     }