Преглед на файлове

feat : 玩家角色列表逻辑修改

bilingfeng преди 2 години
родител
ревизия
5a7fd12be4
променени са 16 файла, в които са добавени 251 реда и са изтрити 178 реда
  1. 0 33
      game-module/game-manage/src/main/java/com/zanxiang/manage/controller/TestController.java
  2. 1 1
      game-module/game-manage/src/main/java/com/zanxiang/manage/controller/UserBanController.java
  3. 0 19
      game-module/game-manage/src/main/java/com/zanxiang/manage/controller/UserController.java
  4. 50 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/controller/UserRoleController.java
  5. 81 20
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/UserDTO.java
  6. 26 2
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameUserRoleListVO.java
  7. 8 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/ChannelService.java
  8. 8 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/CpService.java
  9. 2 1
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameCategoryService.java
  10. 15 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/ChannelServiceImpl.java
  11. 18 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/CpServiceImpl.java
  12. 7 5
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameCategoryServiceImpl.java
  13. 1 2
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameServiceImpl.java
  14. 24 56
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameUserRoleServiceImpl.java
  15. 8 26
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserServiceImpl.java
  16. 2 13
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/UserService.java

+ 0 - 33
game-module/game-manage/src/main/java/com/zanxiang/manage/controller/TestController.java

@@ -1,33 +0,0 @@
-package com.zanxiang.manage.controller;
-
-import com.zanxiang.mybatis.entity.Order;
-import com.zanxiang.mybatis.mapper.OrderMapper;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import org.apache.tomcat.jni.Time;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-
-@Api(tags = {"示例接口"})
-@RestController
-@RequestMapping("/game/test/")
-public class TestController {
-
-    @Autowired
-    private OrderMapper orderMapper;
-
-    @ApiOperation(value = "根据id获取")
-    @GetMapping("/index")
-    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功")})
-
-    public String index() {
-
-
-        return "game-manage service" + new Time();
-    }
-}

+ 1 - 1
game-module/game-manage/src/main/java/com/zanxiang/manage/controller/BanController.java → game-module/game-manage/src/main/java/com/zanxiang/manage/controller/UserBanController.java

@@ -29,7 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
 @RestController
 @RequestMapping("/ban")
 @Slf4j
-public class BanController {
+public class UserBanController {
 
     @Autowired
     private IpBanService ipBanService;

+ 0 - 19
game-module/game-manage/src/main/java/com/zanxiang/manage/controller/UserController.java

@@ -32,9 +32,6 @@ import java.util.List;
 @Slf4j
 public class UserController {
 
-    @Autowired
-    private GameUserRoleService gameUserRoleService;
-
     @Autowired
     private GameUserService gameUserService;
 
@@ -74,14 +71,6 @@ public class UserController {
         return ResultVO.ok(userService.getUserInfo(id));
     }
 
-    @ApiOperation(value = "玩家游戏角色列表")
-    @GetMapping(value = "/game/role/list")
-    @PreAuthorize(permissionKey = "sdk:user:gameRoleList")
-    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameUserRoleVO.class, responseContainer = "list")})
-    public ResultVO<List<GameUserRoleVO>> roleList(@RequestParam Long userId) {
-        return ResultVO.ok(gameUserRoleService.roleList(userId));
-    }
-
     @ApiOperation(value = "玩家登录记录列表")
     @PostMapping(value = "/login/list")
     @PreAuthorize(permissionKey = "sdk:user:loginList")
@@ -114,14 +103,6 @@ public class UserController {
         return ResultVO.ok(gameUserService.gameUserList(param));
     }
 
-    @ApiOperation(value = "玩家角色列表")
-    @PostMapping(value = "/role/list")
-    @PreAuthorize(permissionKey = "sdk:user:roleList")
-    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameUserRoleListVO.class)})
-    public ResultVO<IPage<GameUserRoleListVO>> roleList(@Validated @RequestBody GameUserRoleListParam param) {
-        return ResultVO.ok(gameUserRoleService.list(param));
-    }
-
     @ApiOperation(value = "vip等级选择列表选择列表")
     @GetMapping(value = "/vip/level/choice/list")
     @PreAuthorize(permissionKey = "sdk:userVipChoice:list")

+ 50 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/controller/UserRoleController.java

@@ -0,0 +1,50 @@
+package com.zanxiang.manage.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.zanxiang.common.domain.ResultVO;
+import com.zanxiang.erp.security.annotation.PreAuthorize;
+import com.zanxiang.manage.domain.params.GameUserRoleListParam;
+import com.zanxiang.manage.domain.vo.GameUserRoleListVO;
+import com.zanxiang.manage.domain.vo.GameUserRoleVO;
+import com.zanxiang.manage.service.GameUserRoleService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-11-03
+ * @description : 玩家角色
+ */
+@Api(tags = {"玩家角色"})
+@RestController
+@RequestMapping("/user")
+@Slf4j
+public class UserRoleController {
+
+    @Autowired
+    private GameUserRoleService gameUserRoleService;
+
+    @ApiOperation(value = "用户游戏角色")
+    @GetMapping(value = "/game/role/list")
+    @PreAuthorize(permissionKey = "sdk:user:gameRoleList")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameUserRoleVO.class, responseContainer = "list")})
+    public ResultVO<List<GameUserRoleVO>> roleList(@RequestParam Long userId) {
+        return ResultVO.ok(gameUserRoleService.roleList(userId));
+    }
+
+    @ApiOperation(value = "玩家游戏角色列表")
+    @PostMapping(value = "/role/list")
+    @PreAuthorize(permissionKey = "sdk:user:roleList")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameUserRoleListVO.class)})
+    public ResultVO<IPage<GameUserRoleListVO>> roleList(@Validated @RequestBody GameUserRoleListParam param) {
+        return ResultVO.ok(gameUserRoleService.list(param));
+    }
+}

+ 81 - 20
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/UserDTO.java

@@ -2,6 +2,7 @@ package com.zanxiang.manage.domain.dto;
 
 import lombok.Data;
 
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
 /**
@@ -22,6 +23,11 @@ public class UserDTO {
      */
     private Long agentId;
 
+    /**
+     * 注册游戏id
+     */
+    private Long gameId;
+
     /**
      * 用户名
      */
@@ -32,16 +38,6 @@ public class UserDTO {
      */
     private String nickname;
 
-    /**
-     * 注册手机号
-     */
-    private String regMobile;
-
-    /**
-     * 注册邮箱
-     */
-    private String regEmail;
-
     /**
      * 密码
      */
@@ -58,22 +54,17 @@ public class UserDTO {
     private String mobile;
 
     /**
-     * 设备来源 mobile,android,iphone,ipad,web,pc,mac,wxapp
+     * 绑定支付宝账号
      */
-    private String fromDevice;
+    private String aliPay;
 
     /**
-     * 设备ID android 为imei ios 为idfa
+     * 客户端类型, 1 : 安卓app
      */
-    private String deviceId;
+    private Integer deviceType;
 
     /**
-     * 设备类型
-     */
-    private String deviceType;
-
-    /**
-     * -1 为冻结状态, 1 为试玩状态 2为正常状态
+     * 用户状态, -1 : 为冻结状态, 0 : 为正常状态
      */
     private Integer status;
 
@@ -82,6 +73,51 @@ public class UserDTO {
      */
     private String avatar;
 
+    /**
+     * 充值次数
+     */
+    private Integer rechargeCount;
+
+    /**
+     * 充值金额
+     */
+    private BigDecimal rechargeMoney;
+
+    /**
+     * 最近充值时间
+     */
+    private LocalDateTime lastRechargeTime;
+
+    /**
+     * 平台币余额
+     */
+    private BigDecimal platformCoin;
+
+    /**
+     * 创角数
+     */
+    private Integer roleCount;
+
+    /**
+     * 是否GS
+     */
+    private Boolean isGs;
+
+    /**
+     * 客服id
+     */
+    private Long customerId;
+
+    /**
+     * 拥有角色最高vip等级
+     */
+    private Integer vipMax;
+
+    /**
+     * 是否实名认证,0未实名认证,1成年人,2未成年人
+     */
+    private Integer authentication;
+
     /**
      * 注册时间
      */
@@ -91,4 +127,29 @@ public class UserDTO {
      * 更改时间
      */
     private LocalDateTime updateTime;
+
+    /**
+     * 客户端操作系统, android, ios, windows, mac
+     */
+    private String deviceSystem;
+
+    /**
+     * 用户设备mac地址
+     */
+    private String mac;
+
+    /**
+     * 设备唯一编号IMEI
+     */
+    private String imei;
+
+    /**
+     * 安卓id, (仅安卓设备才有值)
+     */
+    private String androidId;
+
+    /**
+     * 用户注册ip
+     */
+    private String ip;
 }

+ 26 - 2
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameUserRoleListVO.java

@@ -56,13 +56,25 @@ public class GameUserRoleListVO {
      * 注册渠道id
      */
     @ApiModelProperty(notes = "注册渠道id")
-    private Long channelId;
+    private Long agentId;
+
+    /**
+     * 注册渠道名称
+     */
+    @ApiModelProperty(notes = "注册渠道名称")
+    private String channel;
+
+    /**
+     * cp标识id
+     */
+    @ApiModelProperty(notes = "cp标识id")
+    private Long cpId;
 
     /**
      * cp名称
      */
     @ApiModelProperty(notes = "cp名称")
-    private Long cpId;
+    private String cpName;
 
     /**
      * 游戏id
@@ -70,12 +82,24 @@ public class GameUserRoleListVO {
     @ApiModelProperty(notes = "游戏id")
     private Long gameId;
 
+    /**
+     * 游戏名称
+     */
+    @ApiModelProperty(notes = "游戏名称")
+    private String gameName;
+
     /**
      * 游戏应用类型id
      */
     @ApiModelProperty(notes = "游戏应用类型id")
     private Long gameCategoryId;
 
+    /**
+     * 游戏应用类型名称
+     */
+    @ApiModelProperty(notes = "游戏应用类型名称")
+    private String gameCategoryName;
+
     /**
      * 游戏区服
      */

+ 8 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/ChannelService.java

@@ -6,6 +6,7 @@ import com.zanxiang.manage.domain.vo.ChannelChoiceVO;
 import com.zanxiang.mybatis.entity.Channel;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author : lingfeng
@@ -21,6 +22,13 @@ public interface ChannelService extends IService<Channel> {
      */
     List<ChannelChoiceVO> choiceList();
 
+    /**
+     * 查询渠道选择列表
+     *
+     * @return : 返回所有cp信息
+     */
+    Map<Long, String> choiceMap();
+
     /**
      * 根据主键id查询
      *

+ 8 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/CpService.java

@@ -9,6 +9,7 @@ import com.zanxiang.manage.domain.vo.CpVO;
 import com.zanxiang.mybatis.entity.Cp;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author : lingfeng
@@ -40,6 +41,13 @@ public interface CpService extends IService<Cp> {
      */
     List<CpChoiceVO> choiceList();
 
+    /**
+     * 查询cp选择列表
+     *
+     * @return : 返回所有cp信息
+     */
+    Map<Long, String> choiceMap();
+
     /**
      * 删除cp信息
      *

+ 2 - 1
game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameCategoryService.java

@@ -9,6 +9,7 @@ import com.zanxiang.manage.domain.vo.GameCategoryVO;
 import com.zanxiang.mybatis.entity.GameCategory;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author : lingfeng
@@ -47,7 +48,7 @@ public interface GameCategoryService extends IService<GameCategory> {
      *
      * @return : 返回所有父游戏标签
      */
-    List<GameCategoryParentVO> choiceList();
+    Map<Long, String> choiceMap();
 
     /**
      * 查询游戏标签列表

+ 15 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/ChannelServiceImpl.java

@@ -11,7 +11,9 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author : lingfeng
@@ -38,6 +40,19 @@ public class ChannelServiceImpl extends ServiceImpl<ChannelMapper, Channel> impl
         return Arrays.asList(choice1, choice2);
     }
 
+    /**
+     * 查询渠道选择列表
+     *
+     * @return : 返回所有cp信息
+     */
+    @Override
+    public Map<Long, String> choiceMap() {
+        Map<Long, String> map = new HashMap<>(2);
+        map.put(1L, "szqremenshouyoubabangtuijianpyq|邵邵-烈火骑士-热门手游霸榜推荐-朋友圈");
+        map.put(2L, "SZQhuoreshouyouxinzhanbaoJL(szq-奇迹战神-火热手游新战报-激励-巨网)");
+        return map;
+    }
+
     /**
      * 根据主键id查询
      *

+ 18 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/CpServiceImpl.java

@@ -3,6 +3,7 @@ package com.zanxiang.manage.service.Impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.common.exception.BaseException;
 import com.zanxiang.common.utils.StringUtils;
@@ -18,8 +19,11 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
 import java.time.LocalDateTime;
+import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 import java.util.Objects;
+import java.util.stream.Collectors;
 
 /**
  * @author : lingfeng
@@ -111,6 +115,20 @@ public class CpServiceImpl extends ServiceImpl<CpMapper, Cp> implements CpServic
         return BeanUtils.copyList(cpList, CpChoiceVO.class);
     }
 
+    /**
+     * 查询cp选择列表
+     *
+     * @return : 返回所有cp信息
+     */
+    @Override
+    public Map<Long, String> choiceMap() {
+        List<Cp> cpList = super.list(new LambdaQueryWrapper<Cp>().select(Cp::getId, Cp::getCpName));
+        if (CollectionUtils.isEmpty(cpList)) {
+            return Collections.emptyMap();
+        }
+        return cpList.stream().collect(Collectors.toMap(Cp::getId, Cp::getCpName));
+    }
+
     /**
      * 删除cp信息
      *

+ 7 - 5
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameCategoryServiceImpl.java

@@ -3,6 +3,7 @@ package com.zanxiang.manage.service.Impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 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.common.enums.GameCategoryEnum;
@@ -21,9 +22,7 @@ import org.apache.logging.log4j.util.Strings;
 import org.springframework.stereotype.Service;
 
 import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -81,10 +80,13 @@ public class GameCategoryServiceImpl extends ServiceImpl<GameCategoryMapper, Gam
      * @return : 返回所有父游戏标签
      */
     @Override
-    public List<GameCategoryParentVO> choiceList() {
+    public Map<Long, String> choiceMap() {
         List<GameCategory> gameCategoryList = list(new LambdaQueryWrapper<GameCategory>()
                 .select(GameCategory::getId, GameCategory::getName));
-        return BeanUtils.copyList(gameCategoryList, GameCategoryParentVO.class);
+        if (CollectionUtils.isEmpty(gameCategoryList)) {
+            return Collections.emptyMap();
+        }
+        return gameCategoryList.stream().collect(Collectors.toMap(GameCategory::getId, GameCategory::getName));
     }
 
     /**

+ 1 - 2
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameServiceImpl.java

@@ -378,8 +378,7 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements Ga
         Map<Long, String> cpMap = cpService.choiceList().stream()
                 .collect(Collectors.toMap(CpChoiceVO::getId, CpChoiceVO::getCpName));
         //游戏分类列表
-        Map<Long, String> gameCategoryMap = gameCategoryService.choiceList().stream()
-                .collect(Collectors.toMap(GameCategoryParentVO::getId, GameCategoryParentVO::getName));
+        Map<Long, String> gameCategoryMap = gameCategoryService.choiceMap();
         //查询游戏
         Map<Long, String> gameMap = this.choiceList().stream()
                 .collect(Collectors.toMap(GameChoiceVO::getId, GameChoiceVO::getName));

+ 24 - 56
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameUserRoleServiceImpl.java

@@ -8,7 +8,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.common.utils.StringUtils;
 import com.zanxiang.common.utils.bean.BeanUtils;
-import com.zanxiang.manage.domain.dto.*;
+import com.zanxiang.manage.domain.dto.ChannelDTO;
+import com.zanxiang.manage.domain.dto.GameDTO;
+import com.zanxiang.manage.domain.dto.GameUserRoleDTO;
+import com.zanxiang.manage.domain.dto.UserDTO;
 import com.zanxiang.manage.domain.params.GameUserRoleListParam;
 import com.zanxiang.manage.domain.vo.GameCategoryVO;
 import com.zanxiang.manage.domain.vo.GameUserRoleListVO;
@@ -38,9 +41,6 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
     @Autowired
     private UserService userService;
 
-    @Autowired
-    private UserExtService userExtService;
-
     @Autowired
     private GameService gameService;
 
@@ -53,6 +53,9 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
     @Autowired
     private ChannelService channelService;
 
+    @Autowired
+    private CpService cpService;
+
     /**
      * 根据角色id查询
      *
@@ -113,29 +116,23 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
     @Override
     public IPage<GameUserRoleListVO> list(GameUserRoleListParam param) {
         //玩家条件处理
-        Map<Long, UserDTO> userMap = userService.userCondition(param.getUserId(), param.getChannelId(), param.getUserName(), param.getNickname());
+        Map<Long, UserDTO> userMap = userService.userCondition(param.getUserId(), param.getChannelId(), param.getUserName(), param.getNickname(), param.getRegIp());
         //根据条件, 匹配不到玩家
         if (userMap != null && userMap.isEmpty()) {
             return new Page<>();
         }
-        //玩家注册ip条件处理
-        Map<Long, UserExtDTO> userExtMap = userExtService.regIpCondition(param.getRegIp());
-        //根据ip, 匹配不到玩家
-        if (userExtMap != null && userExtMap.isEmpty()) {
-            return new Page<>();
-        }
-        //玩家信息和拓展信息合并
-        Set<Long> userIdSet = this.getUserId(userMap, userExtMap);
-        //用户信息取交集不存在玩家信息
-        if (userIdSet != null && userIdSet.isEmpty()) {
-            return new Page<>();
-        }
+        //相关用户id
+        Set<Long> userIdSet = userMap == null ? null : userMap.keySet();
         //游戏条件处理
         Map<Long, GameDTO> gameMap = gameService.gameCondition(param.getCpId(), param.getGameId(), param.getGameCategoryId());
         //根据条件, 匹配不到游戏
         if (gameMap != null && gameMap.isEmpty()) {
             return new Page<>();
         }
+        //注册渠道
+        Map<Long, String> channelMap = channelService.choiceMap();
+        Map<Long, String> cpMap = cpService.choiceMap();
+        Map<Long, String> categoryMap = gameCategoryService.choiceMap();
         //执行查询
         return page(param.toPage(), new QueryWrapper<GameUserRole>().lambda()
                 .in(CollectionUtils.isNotEmpty(userIdSet), GameUserRole::getUserId, userIdSet)
@@ -152,7 +149,7 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
                 .ge(param.getRechargeBeginDate() != null, GameUserRole::getLastRechargeTime, param.getRechargeBeginDate() == null ? null : LocalDateTime.of(param.getRechargeBeginDate(), LocalTime.MIN))
                 .le(param.getRechargeEndDate() != null, GameUserRole::getLastRechargeTime, param.getRechargeEndDate() == null ? null : LocalDateTime.of(param.getRechargeEndDate(), LocalTime.MAX))
                 .orderByDesc(GameUserRole::getCreateTime)
-        ).convert(u -> this.toVo(u, userMap, userExtMap, gameMap));
+        ).convert(u -> this.toVo(u, userMap, gameMap, channelMap, cpMap, categoryMap));
     }
 
     /**
@@ -161,7 +158,8 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
      * @param gameUserRole : 玩家角色信息
      * @return : 玩家角色信息展示对象
      */
-    private GameUserRoleListVO toVo(GameUserRole gameUserRole, Map<Long, UserDTO> userMap, Map<Long, UserExtDTO> userExtMap, Map<Long, GameDTO> gameMap) {
+    private GameUserRoleListVO toVo(GameUserRole gameUserRole, Map<Long, UserDTO> userMap, Map<Long, GameDTO> gameMap,
+                                    Map<Long, String> channelMap, Map<Long, String> cpMap, Map<Long, String> categoryMap) {
         GameUserRoleListVO gameUserRoleListVO = BeanUtils.copy(gameUserRole, GameUserRoleListVO.class);
         if (Objects.isNull(gameUserRoleListVO)) {
             return null;
@@ -173,52 +171,22 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
         if (userDTO != null) {
             gameUserRoleListVO.setUsername(userDTO.getUsername());
             gameUserRoleListVO.setNickname(userDTO.getNickname());
-            gameUserRoleListVO.setChannelId(userDTO.getAgentId());
-        }
-        UserExtDTO userExtDTO = StringUtils.isEmpty(userExtMap) ? null : userExtMap.get(gameUserRoleListVO.getUserId());
-        if (userExtDTO == null) {
-            userExtDTO = userExtService.getById(gameUserRoleListVO.getUserId());
-        }
-        if (userExtDTO != null) {
-            gameUserRoleListVO.setRegIp(userExtDTO.getRegIp());
-            gameUserRoleListVO.setRegTime(userExtDTO.getCreateTime());
+            gameUserRoleListVO.setAgentId(userDTO.getAgentId());
+            gameUserRoleListVO.setChannel(channelMap.get(userDTO.getAgentId()));
+            gameUserRoleListVO.setRegIp(userDTO.getIp());
+            gameUserRoleListVO.setRegTime(userDTO.getCreateTime());
         }
         GameDTO gameDTO = StringUtils.isEmpty(gameMap) ? null : gameMap.get(gameUserRoleListVO.getGameId());
         if (gameDTO == null) {
             gameDTO = gameService.getById(gameUserRoleListVO.getGameId());
         }
         if (gameDTO != null) {
+            gameUserRoleListVO.setGameName(gameDTO.getName());
             gameUserRoleListVO.setCpId(gameDTO.getCpId());
+            gameUserRoleListVO.setCpName(cpMap.get(gameDTO.getCpId()));
             gameUserRoleListVO.setGameCategoryId(gameDTO.getCategory());
+            gameUserRoleListVO.setGameCategoryName(categoryMap.get(gameDTO.getCategory()));
         }
         return gameUserRoleListVO;
     }
-
-    /**
-     * 获取查询相关的玩家用户id
-     *
-     * @param userMap    : 玩家信息
-     * @param userExtMap : 玩家拓展信息
-     * @return : 返回玩家id列表
-     */
-    private Set<Long> getUserId(Map<Long, UserDTO> userMap, Map<Long, UserExtDTO> userExtMap) {
-        if (userMap == null && userExtMap == null) {
-            return null;
-        }
-        if (userMap == null) {
-            return userExtMap.keySet();
-        }
-        if (userExtMap == null) {
-            return userMap.keySet();
-        }
-        //两者都不为空, 取交集
-        Set<Long> set = new HashSet<>();
-        Set<Long> userExtMapKeySet = userExtMap.keySet();
-        userMap.keySet().forEach(u -> {
-            if (userExtMapKeySet.contains(u)) {
-                set.add(u);
-            }
-        });
-        return set;
-    }
 }

+ 8 - 26
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserServiceImpl.java

@@ -246,47 +246,29 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
      * @param channelId : 渠道id
      * @param userName  : 用户名称
      * @param nickname  : 用户昵称
+     * @param regIp     : 用户注册ip
      * @return : 返回用户信息map
      */
     @Override
-    public Map<Long, UserDTO> userCondition(Long userId, Long channelId, String userName, String nickname) {
+    public Map<Long, UserDTO> userCondition(Long userId, Long channelId, String userName, String nickname, String regIp) {
         //用户信息条件处理
         if (userId == null && channelId == null && Strings.isBlank(userName) && Strings.isBlank(nickname)) {
             return null;
         }
-        //玩家账号和玩家昵称涉及的玩家条件
-        List<UserDTO> userList = this.getUserList(userId, channelId, userName, nickname);
-        if (CollectionUtils.isEmpty(userList)) {
-            return Collections.emptyMap();
-        }
-        return userList.stream().collect(Collectors.toMap(UserDTO::getId, Function.identity()));
-    }
-
-    /**
-     * 根据玩家账号或者昵称模糊查询玩家列表
-     *
-     * @param userId    : 用户id
-     * @param channelId : 渠道id
-     * @param userName  : 玩家账号
-     * @param nickname  : 玩家昵称
-     * @return : 返回玩家信息
-     */
-    @Override
-    public List<UserDTO> getUserList(Long userId, Long channelId, String userName, String nickname) {
-        if (userId == null && channelId != null && Strings.isBlank(userName) && Strings.isBlank(nickname)) {
-            return Collections.emptyList();
-        }
         //查询
         List<User> userList = super.list(new LambdaQueryWrapper<User>()
                 .eq(userId != null, User::getId, userId)
                 .eq(channelId != null, User::getAgentId, channelId)
+                .eq(Strings.isNotBlank(regIp), User::getIp, regIp)
                 .like(Strings.isNotBlank(userName), User::getUsername, userName)
                 .like(Strings.isNotBlank(nickname), User::getNickname, nickname)
-                .select(User::getId, User::getUsername, User::getNickname));
+                .select(User::getId, User::getUsername, User::getNickname, User::getIp));
         if (CollectionUtils.isEmpty(userList)) {
-            return Collections.emptyList();
+            return Collections.emptyMap();
         }
-        return BeanUtils.copyList(userList, UserDTO.class);
+        List<UserDTO> list = BeanUtils.copyList(userList, UserDTO.class);
+        //构造返回
+        return list.stream().collect(Collectors.toMap(UserDTO::getId, Function.identity()));
     }
 
     /**

+ 2 - 13
game-module/game-manage/src/main/java/com/zanxiang/manage/service/UserService.java

@@ -9,7 +9,6 @@ import com.zanxiang.manage.domain.vo.UserListVO;
 import com.zanxiang.manage.domain.vo.UserVO;
 import com.zanxiang.mybatis.entity.User;
 
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -50,20 +49,10 @@ public interface UserService extends IService<User> {
      * @param channelId : 渠道id
      * @param userName  : 用户名称
      * @param nickname  : 用户昵称
+     * @param regIp     : 用户注册ip
      * @return : 返回用户信息map
      */
-    Map<Long, UserDTO> userCondition(Long userId, Long channelId, String userName, String nickname);
-
-    /**
-     * 根据玩家账号或者昵称模糊查询玩家列表
-     *
-     * @param userId    : 用户id
-     * @param channelId : 渠道id
-     * @param userName  : 玩家账号
-     * @param nickname  : 玩家昵称
-     * @return : 返回玩家信息
-     */
-    List<UserDTO> getUserList(Long userId, Long channelId, String userName, String nickname);
+    Map<Long, UserDTO> userCondition(Long userId, Long channelId, String userName, String nickname, String regIp);
 
     /**
      * 根据用户id查询信息