Browse Source

fix : bug调试修改1

bilingfeng 1 year ago
parent
commit
151e616b4a

+ 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服务启动成功 <bug调试修改> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 <bug调试修改1> ( ´・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 0 - 4
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameServiceImpl.java

@@ -249,10 +249,6 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
 
     @Override
     public Map<Long, GameDTO> gameCondition(List<Long> gameIdList, Long cpId, Long gameId, Long gameCategoryId) {
-        //游戏条件判断
-        if (cpId == null && gameId == null && gameCategoryId == null) {
-            return null;
-        }
         List<GameDTO> gameList = super.list(new LambdaQueryWrapper<Game>()
                 .eq(cpId != null, Game::getCpId, cpId)
                 .in(CollectionUtils.isNotEmpty(gameIdList), Game::getId, gameIdList)

+ 6 - 8
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserRoleServiceImpl.java

@@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 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;
 import com.zanxiang.game.module.manage.pojo.dto.*;
@@ -121,14 +120,14 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
         //游戏条件处理
         Map<Long, GameDTO> gameMap = gameService.gameCondition(gameTuple.getT2(), param.getCpId(), param.getGameId(), param.getGameCategoryId());
         //根据条件, 匹配不到游戏
-        if (gameMap != null && gameMap.isEmpty()) {
+        if (CollectionUtils.isEmpty(gameMap)) {
             return new Page<>();
         }
         //渠道获取
         Tuple2<List<Long>, List<AgentDTO>> tuple2 = agentService.getUserAgent(param.getAccountId(), param.getPitcherId(), param.getChannelId());
         List<Long> agentIdList = tuple2.getT1();
         List<AgentDTO> agentDTOList = tuple2.getT2();
-        if (Objects.equals(gameTuple.getT1(), GameAuthEnum.PITCHER.getValue()) && CollectionUtils.isEmpty(agentIdList)) {
+        if (CollectionUtils.isEmpty(agentIdList)) {
             return new Page<>();
         }
         //玩家条件处理
@@ -146,10 +145,10 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
         Map<Long, AgentDTO> agentMap = agentDTOList.stream().collect(Collectors.toMap(AgentDTO::getId, Function.identity()));
         //执行查询
         return page(param.toPage(), new QueryWrapper<GameUserRole>().lambda()
+                .in(GameUserRole::getGameId, gameMap.keySet())
                 .in(CollectionUtils.isNotEmpty(userIdSet), GameUserRole::getUserId, userIdSet)
                 .in(CollectionUtils.isNotEmpty(serverIdList), GameUserRole::getServerId, serverIdList)
                 .like(Strings.isNotBlank(param.getRoleName()), GameUserRole::getRoleName, param.getRoleName())
-                .in(gameMap != null, GameUserRole::getGameId, gameMap != null ? gameMap.keySet() : null)
                 .eq(Strings.isNotBlank(param.getOs()), GameUserRole::getOs, param.getOs())
                 .gt(Objects.equals(param.getIsRecharge(), Boolean.TRUE), GameUserRole::getRechargeCount, 0)
                 .eq(Objects.equals(param.getIsRecharge(), Boolean.FALSE), GameUserRole::getRechargeCount, 0)
@@ -230,15 +229,14 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
         }
         //游戏条件处理
         Map<Long, GameDTO> gameMap = gameService.gameCondition(gameTuple.getT2(), param.getCpId(), param.getGameId(), param.getGameCategoryId());
-        //根据条件, 匹配不到游戏
-        if (gameMap != null && gameMap.isEmpty()) {
+        if (CollectionUtils.isEmpty(gameMap)) {
             return;
         }
         //渠道获取
         Tuple2<List<Long>, List<AgentDTO>> tuple2 = agentService.getUserAgent(param.getAccountId(), param.getPitcherId(), param.getChannelId());
         List<Long> agentIdList = tuple2.getT1();
         List<AgentDTO> agentDTOList = tuple2.getT2();
-        if (Objects.equals(gameTuple.getT1(), GameAuthEnum.PITCHER.getValue()) && CollectionUtils.isEmpty(agentIdList)) {
+        if (CollectionUtils.isEmpty(agentIdList)) {
             return;
         }
         //玩家条件处理
@@ -258,9 +256,9 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
         WebExcelUtil.httpExport(response, "玩家角色", GameUserRoleExcelVO.class, ((pageNumber, pageSize) -> {
             //查询订单
             return page(new Page<>(pageNumber, pageSize), new QueryWrapper<GameUserRole>().lambda()
+                    .in(GameUserRole::getGameId, gameMap.keySet())
                     .in(CollectionUtils.isNotEmpty(userIdSet), GameUserRole::getUserId, userIdSet)
                     .in(CollectionUtils.isNotEmpty(serverIdList), GameUserRole::getServerId, serverIdList)
-                    .in(gameMap != null, GameUserRole::getGameId, gameMap != null ? gameMap.keySet() : null)
                     .like(Strings.isNotBlank(param.getRoleName()), GameUserRole::getRoleName, param.getRoleName())
                     .eq(Objects.equals(param.getIsRecharge(), Boolean.FALSE), GameUserRole::getRechargeCount, 0)
                     .eq(Strings.isNotBlank(param.getOs()), GameUserRole::getOs, param.getOs())

+ 3 - 4
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserServiceImpl.java

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-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;
 import com.zanxiang.game.module.manage.pojo.dto.AgentDTO;
@@ -72,14 +71,14 @@ public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> i
         //游戏条件处理
         Map<Long, GameDTO> gameMap = gameService.gameCondition(gameTuple.getT2(), param.getCpId(), param.getGameId(), param.getGameCategoryId());
         //根据条件, 匹配不到游戏
-        if (gameMap != null && gameMap.isEmpty()) {
+        if (CollectionUtils.isEmpty(gameMap)) {
             return new Page<>();
         }
         //渠道获取
         Tuple2<List<Long>, List<AgentDTO>> tuple2 = agentService.getUserAgent(param.getAccountId(), param.getPitcherId(), param.getChannelId());
         List<Long> agentIdList = tuple2.getT1();
         List<AgentDTO> agentDTOList = tuple2.getT2();
-        if (Objects.equals(gameTuple.getT1(), GameAuthEnum.PITCHER.getValue()) && CollectionUtils.isEmpty(agentIdList)) {
+        if (CollectionUtils.isEmpty(agentIdList)) {
             return new Page<>();
         }
         //玩家条件处理
@@ -95,8 +94,8 @@ public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> i
         Map<Long, AgentDTO> agentMap = agentDTOList.stream().collect(Collectors.toMap(AgentDTO::getId, Function.identity()));
         //执行查询
         return page(param.toPage(), new QueryWrapper<GameUser>().lambda()
+                .in(GameUser::getGameId, gameMap.keySet())
                 .in(CollectionUtils.isNotEmpty(userIdSet), GameUser::getUserId, userIdSet)
-                .in(gameMap != null, GameUser::getGameId, gameMap != null ? gameMap.keySet() : null)
                 .ge(param.getBeginDate() != null, GameUser::getCreateTime, param.getBeginDate() == null ? null : LocalDateTime.of(param.getBeginDate(), LocalTime.MIN))
                 .le(param.getEndDate() != null, GameUser::getCreateTime, param.getEndDate() == null ? null : LocalDateTime.of(param.getEndDate(), LocalTime.MAX))
                 .ge(param.getRechargeBeginDate() != null, GameUser::getLastRechargeTime, param.getRechargeBeginDate() == null ? null : LocalDateTime.of(param.getRechargeBeginDate(), LocalTime.MIN))

+ 3 - 14
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserServiceImpl.java

@@ -10,8 +10,6 @@ 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;
 import com.zanxiang.game.module.manage.pojo.dto.AgentDTO;
@@ -30,7 +28,6 @@ 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;
@@ -192,29 +189,22 @@ 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()) {
+        if (CollectionUtils.isEmpty(gameMap)) {
             return new Page<>();
         }
         //渠道获取
         Tuple2<List<Long>, List<AgentDTO>> tuple2 = agentService.getUserAgent(param.getAccountId(), param.getPitcherId(), param.getChannelId());
         List<Long> agentIdList = tuple2.getT1();
         List<AgentDTO> agentDTOList = tuple2.getT2();
-        if (Objects.equals(gameTuple.getT1(), GameAuthEnum.PITCHER.getValue()) && CollectionUtils.isEmpty(agentIdList)) {
+        if (CollectionUtils.isEmpty(agentIdList)) {
             return new Page<>();
         }
         Map<Long, CpDTO> cpMap = cpService.cpMap();
         //执行查询
         return page(param.toPage(), new QueryWrapper<User>().lambda()
+                .in(User::getGameId, gameMap.keySet())
                 .eq(param.getUserId() != null, User::getId, param.getUserId())
                 .like(Strings.isNotBlank(param.getUserName()), User::getUsername, param.getUserName())
                 .like(Strings.isNotBlank(param.getNickname()), User::getNickname, param.getNickname())
@@ -224,7 +214,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
                 .ne(Objects.equals(param.getIsAuth(), Boolean.TRUE), User::getAuthentication, 0)
                 .isNotNull(Objects.equals(param.getIsBindMobile(), Boolean.TRUE), User::getMobile)
                 .isNull(Objects.equals(param.getIsBindMobile(), Boolean.FALSE), User::getMobile)
-                .in(CollectionUtils.isNotEmpty(gameMap), User::getGameId, CollectionUtils.isEmpty(gameMap) ? null : gameMap.keySet())
                 .ge(param.getBeginDate() != null, User::getCreateTime, param.getBeginDate() == null ? null : LocalDateTime.of(param.getBeginDate(), LocalTime.MIN))
                 .le(param.getEndDate() != null, User::getCreateTime, param.getEndDate() == null ? null : LocalDateTime.of(param.getEndDate(), LocalTime.MAX))
                 .ge(param.getRechargeBeginDate() != null, User::getLastRechargeTime, param.getRechargeBeginDate() == null ? null : LocalDateTime.of(param.getRechargeBeginDate(), LocalTime.MIN))