Преглед изворни кода

feat : 玩家游戏列表接口, 玩家角色列表接口, 代码提交

bilingfeng пре 2 година
родитељ
комит
d13585d089
18 измењених фајлова са 1264 додато и 126 уклоњено
  1. 24 17
      game-module/game-manage/src/main/java/com/zanxiang/manage/controller/UserController.java
  2. 149 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/GameDTO.java
  3. 89 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/UserExtDTO.java
  4. 117 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/params/GameUserListParam.java
  5. 5 1
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/params/GameUserRoleListParam.java
  6. 149 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameUserListVO.java
  7. 162 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameUserRoleListVO.java
  8. 0 99
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/UserGameRoleListVO.java
  9. 30 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameService.java
  10. 21 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameUserRoleService.java
  11. 21 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameUserService.java
  12. 64 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameServiceImpl.java
  13. 168 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameUserRoleServiceImpl.java
  14. 123 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameUserServiceImpl.java
  15. 60 3
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserExtServiceImpl.java
  16. 37 3
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserServiceImpl.java
  17. 28 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/UserExtService.java
  18. 17 3
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/UserService.java

+ 24 - 17
game-module/game-manage/src/main/java/com/zanxiang/manage/controller/UserController.java

@@ -6,11 +6,12 @@ import com.zanxiang.common.enums.AuthPlatform;
 import com.zanxiang.common.enums.OsEnum;
 import com.zanxiang.common.enums.VipLevelEnum;
 import com.zanxiang.common.utils.bean.BeanUtils;
+import com.zanxiang.manage.domain.params.GameUserListParam;
+import com.zanxiang.manage.domain.params.GameUserRoleListParam;
 import com.zanxiang.manage.domain.params.UserNameAuthListParam;
-import com.zanxiang.manage.domain.vo.AuthPlatformVO;
-import com.zanxiang.manage.domain.vo.SystemTypeVO;
-import com.zanxiang.manage.domain.vo.UserNameAuthVO;
-import com.zanxiang.manage.domain.vo.VipLevelVo;
+import com.zanxiang.manage.domain.vo.*;
+import com.zanxiang.manage.service.GameUserRoleService;
+import com.zanxiang.manage.service.GameUserService;
 import com.zanxiang.manage.service.UserExtService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -38,6 +39,12 @@ public class UserController {
     @Autowired
     private UserExtService userExtService;
 
+    @Autowired
+    private GameUserRoleService gameUserRoleService;
+
+    @Autowired
+    private GameUserService gameUserService;
+
 //    @ApiOperation(value = "玩家列表")
 //    @PostMapping(value = "/list")
 //    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = IpBanVO.class)})
@@ -59,20 +66,20 @@ public class UserController {
 //        return null;
 //    }
 //
-//    @ApiOperation(value = "玩家游戏列表")
-//    @PostMapping(value = "/game/list")
-//    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = Boolean.class)})
-//    public ResultVo<Boolean> gameList(@Validated @RequestBody IpBanAddParam param) {
-//        return null;
-//    }
 
-//
-//    @ApiOperation(value = "玩家角色列表")
-//    @PostMapping(value = "/role/list")
-//    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = Boolean.class)})
-//    public ResultVo<Boolean> roleList(@Validated @RequestBody IpBanUpdateParam param) {
-//        return null;
-//    }
+    @ApiOperation(value = "玩家游戏列表")
+    @PostMapping(value = "/game/list")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameUserListVO.class)})
+    public ResultVo<IPage<GameUserListVO>> gameUserList(@Validated @RequestBody GameUserListParam param) {
+        return ResultVo.ok(gameUserService.gameUserList(param));
+    }
+
+    @ApiOperation(value = "玩家角色列表")
+    @PostMapping(value = "/role/list")
+    @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")

+ 149 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/GameDTO.java

@@ -0,0 +1,149 @@
+package com.zanxiang.manage.domain.dto;
+
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-01
+ * @description : 游戏信息
+ */
+@Data
+public class GameDTO {
+
+    /**
+     * 游戏ID
+     */
+    private Long id;
+
+    /**
+     * CP ID
+     */
+    private Long cpId;
+
+    /**
+     * 游戏名称
+     */
+    private String name;
+
+    /**
+     * appkey
+     */
+    private String appKey;
+
+    /**
+     * 游戏标签
+     */
+    private Long tags;
+
+    /**
+     * 游戏类型
+     */
+    private Long category;
+
+    /**
+     * 游戏类别
+     */
+    private Integer classify;
+
+    /**
+     * 网页游戏图标,200*200
+     */
+    private String icon;
+
+    /**
+     * CP回调路径
+     */
+    private String cpPaybackUrl;
+
+    /**
+     * 从属游戏
+     */
+    private Long parentId;
+
+    /**
+     * 包名
+     */
+    private String packageName;
+
+    /**
+     * 上线状态1 接入中, 2 可上线, 3 已下线
+     */
+    private Boolean status;
+
+    /**
+     * 1在线游戏 2 单机
+     */
+    private Boolean isOnline;
+
+    /**
+     * 1 不是SDK游戏  2 是SDK游戏
+     */
+    private Boolean isSdk;
+
+    /**
+     * 游戏宣传语
+     */
+    private String publicity;
+
+    /**
+     * 语言
+     */
+    private String language;
+
+    /**
+     * 游戏描述
+     */
+    private String description;
+
+    /**
+     * 游戏宣传图 JSON格式
+     */
+    private String image;
+
+    /**
+     * 苹果应用ID
+     */
+    private String appleId;
+
+    /**
+     * 是否需要强制实名认证,1为 关闭实名认证,2为 强制实名认证  3  开启实名认证
+     */
+    private Byte isAuth;
+
+    /**
+     * 扩展 JSON格式
+     */
+    private String extInfo;
+
+    /**
+     * 上线时间
+     */
+    private LocalDateTime onlineTime;
+
+    /**
+     * 1 删除  0 正常
+     */
+    private Integer isDelete;
+
+    /**
+     * 删除时间
+     */
+    private LocalDateTime deleteTime;
+
+    /**
+     * 渠道
+     */
+    private Long channel;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+}

+ 89 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/UserExtDTO.java

@@ -0,0 +1,89 @@
+package com.zanxiang.manage.domain.dto;
+
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-01
+ * @description : 玩家拓展信息
+ */
+@Data
+public class UserExtDTO {
+
+    /**
+     * user_id
+     */
+    private Long userId;
+
+    /**
+     * 注册IP
+     */
+    private String regIp;
+
+    /**
+     * 注册手机号
+     */
+    private String regMobile;
+
+    /**
+     * 注册邮箱
+     */
+    private String regEmail;
+
+    /**
+     * 真实姓名
+     */
+    private String realName;
+
+    /**
+     * 是否实名认证
+     */
+    private Boolean isAuth;
+
+    /**
+     * 身份证类型 1、身份证
+     */
+    private Integer identifyType;
+
+    /**
+     * 证件号码
+     */
+    private String idCard;
+
+    /**
+     * 实名认证平台, 1 国家网络防沉迷
+     */
+    private Integer authPlatform;
+
+    /**
+     * 实名认证时间
+     */
+    private LocalDateTime authTime;
+
+    /**
+     * 中宣部PI
+     */
+    private String zxbPi;
+
+    /**
+     * 上次登录时间
+     */
+    private LocalDateTime lastLoginTime;
+
+    /**
+     * 上次登录ip
+     */
+    private String lastLoginIp;
+
+    /**
+     * 注册时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更改时间
+     */
+    private LocalDateTime updateTime;
+}

+ 117 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/params/GameUserListParam.java

@@ -0,0 +1,117 @@
+package com.zanxiang.manage.domain.params;
+
+import com.zanxiang.common.base.BasePage;
+import com.zanxiang.mybatis.entity.GameUser;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.time.LocalDate;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-04
+ * @description : 玩家游戏列表参数
+ */
+@ApiModel
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class GameUserListParam extends BasePage<GameUser> {
+
+    /**
+     * 玩家id
+     */
+    @ApiModelProperty(notes = "玩家id")
+    private Long userId;
+
+    /**
+     * 玩家账号
+     */
+    @ApiModelProperty(notes = "玩家账号")
+    private String userName;
+
+    /**
+     * 玩家昵称
+     */
+    @ApiModelProperty(notes = "玩家昵称")
+    private String nickname;
+
+    /**
+     * cp名称对应的id
+     */
+    @ApiModelProperty(notes = "cp名称对应的id")
+    private Long cpId;
+
+    /**
+     * 游戏名称对应的id
+     */
+    @ApiModelProperty(notes = "游戏名称对应的id")
+    private Long gameId;
+
+    /**
+     * 游戏应用类型对应的id
+     */
+    @ApiModelProperty(notes = "游戏应用类型对应的id")
+    private Long gameCategoryId;
+
+    /**
+     * 注册渠道对应的id
+     */
+    @ApiModelProperty(notes = "注册渠道对应的id")
+    private Long channelId;
+
+    /**
+     * 归因推广账号
+     */
+    @ApiModelProperty(notes = "归因推广账号")
+    private Long accountId;
+
+    /**
+     * 归因投放人员
+     */
+    @ApiModelProperty(notes = "归因投放人员")
+    private Long pitcherId;
+
+    /**
+     * 最近充值开始时间(开始玩开始时间请使用beginDate参数)
+     */
+    @ApiModelProperty(notes = "最近充值开始时间(开始玩开始时间请使用beginDate参数)")
+    private LocalDate rechargeBeginDate;
+
+    /**
+     * 最近充值结束时间(开始玩结束时间请使用endDate参数)
+     */
+    @ApiModelProperty(notes = "最近充值结束时间(开始玩结束时间请使用endDate参数)")
+    private LocalDate rechargeEndDate;
+
+    /**
+     * 客服id
+     */
+    @ApiModelProperty(notes = "客服id")
+    private Long customerId;
+
+    /**
+     * 归因广告id
+     */
+    @ApiModelProperty(notes = "归因广告id")
+    private String adId;
+
+    /**
+     * 是否GS
+     */
+    @ApiModelProperty(notes = "是否GS")
+    private Boolean isGs;
+
+    /**
+     * 是否充值
+     */
+    @ApiModelProperty(notes = "是否充值, true : 是, false : 否, 全部 : null或者不传")
+    private Boolean isRecharge;
+
+    /**
+     * 角色vip
+     */
+    @ApiModelProperty(notes = "角色vip, 全部 : null或者不传")
+    private Integer vipLevel;
+}

+ 5 - 1
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/params/UserGameRoleListParam.java → game-module/game-manage/src/main/java/com/zanxiang/manage/domain/params/GameUserRoleListParam.java

@@ -1,8 +1,11 @@
 package com.zanxiang.manage.domain.params;
 
+import com.zanxiang.common.base.BasePage;
+import com.zanxiang.mybatis.entity.GameUserRole;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import lombok.EqualsAndHashCode;
 
 import java.time.LocalDate;
 
@@ -13,7 +16,8 @@ import java.time.LocalDate;
  */
 @ApiModel
 @Data
-public class UserGameRoleListParam {
+@EqualsAndHashCode(callSuper = true)
+public class GameUserRoleListParam extends BasePage<GameUserRole> {
 
     /**
      * 玩家id

+ 149 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameUserListVO.java

@@ -0,0 +1,149 @@
+package com.zanxiang.manage.domain.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-04
+ * @description : 玩家游戏列表
+ */
+@Data
+public class GameUserListVO {
+
+    /**
+     * 主键id
+     */
+    @ApiModelProperty(notes = "主键id")
+    private Long id;
+
+    /**
+     * 玩家id
+     */
+    @ApiModelProperty(notes = "玩家id")
+    private Long userId;
+
+    /**
+     * 玩家账号
+     */
+    @ApiModelProperty(notes = "玩家账号")
+    private String username;
+
+    /**
+     * 玩家昵称
+     */
+    @ApiModelProperty(notes = "玩家昵称")
+    private String nickname;
+
+    /**
+     * 注册渠道id
+     */
+    @ApiModelProperty(notes = "注册渠道id")
+    private Long channelId;
+
+    /**
+     * cp名称
+     */
+    @ApiModelProperty(notes = "cp名称")
+    private Long cpId;
+
+    /**
+     * 游戏id
+     */
+    @ApiModelProperty(notes = "游戏id")
+    private Long gameId;
+
+    /**
+     * 游戏应用类型id
+     */
+    @ApiModelProperty(notes = "游戏应用类型id")
+    private Long gameCategoryId;
+
+    /**
+     * 归因投放人员
+     */
+    @ApiModelProperty(notes = "归因投放人员")
+    private Long pitcherId;
+
+    /**
+     * 归因推广账号
+     */
+    @ApiModelProperty(notes = "归因推广账号")
+    private Long accountId;
+
+    /**
+     * 归因媒体id
+     */
+    @ApiModelProperty(notes = "归因媒体id")
+    private Long mediaId;
+
+    /**
+     * 归因广告id
+     */
+    @ApiModelProperty(notes = "归因广告id")
+    private Long adId;
+
+    /**
+     * 充值金额
+     */
+    @ApiModelProperty(notes = "充值金额")
+    private BigDecimal rechargeMoney;
+
+    /**
+     * 平台币余额
+     */
+    @ApiModelProperty(notes = "平台币余额")
+    private BigDecimal platformCoin;
+
+    /**
+     * 充值次数
+     */
+    @ApiModelProperty(notes = "充值次数")
+    private Integer rechargeCount;
+
+    /**
+     * 创角色数
+     */
+    @ApiModelProperty(notes = "创角色数")
+    private Integer roleCount;
+
+    /**
+     * 客服id
+     */
+    @ApiModelProperty(notes = "客服id")
+    private Long customerId;
+
+    /**
+     * 是否GS
+     */
+    @ApiModelProperty(notes = "是否GS")
+    private Boolean isGs;
+
+    /**
+     * 玩家vip(所有角色中的最高vip等级)
+     */
+    @ApiModelProperty(notes = "角色vip")
+    private Integer roleVipMax;
+
+    /**
+     * 开始玩时间(游戏玩家创建时间)
+     */
+    @ApiModelProperty(notes = "开始玩时间(游戏玩家创建时间)")
+    private LocalDateTime createTime;
+
+    /**
+     * 最后玩时间(最后登录时间)
+     */
+    @ApiModelProperty(notes = "最后玩时间(最后登录时间)")
+    private LocalDateTime updateTime;
+
+    /**
+     * 最近充值时间
+     */
+    @ApiModelProperty(notes = "最近充值时间")
+    private LocalDateTime lastRechargeTime;
+
+}

+ 162 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameUserRoleListVO.java

@@ -0,0 +1,162 @@
+package com.zanxiang.manage.domain.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-06-30
+ * @description : 玩家角色列表
+ */
+@ApiModel
+@Data
+public class GameUserRoleListVO {
+
+    /**
+     * 主键id
+     */
+    @ApiModelProperty(notes = "主键id")
+    private Long id;
+
+    /**
+     * 玩家id
+     */
+    @ApiModelProperty(notes = "玩家id")
+    private Long userId;
+
+    /**
+     * 玩家账号
+     */
+    @ApiModelProperty(notes = "玩家账号")
+    private String username;
+
+    /**
+     * 玩家昵称
+     */
+    @ApiModelProperty(notes = "玩家昵称")
+    private String nickname;
+
+    /**
+     * 注册IP
+     */
+    @ApiModelProperty(notes = "注册IP")
+    private String regIp;
+
+    /**
+     * 玩家注册时间
+     */
+    @ApiModelProperty(notes = "玩家注册时间")
+    private LocalDateTime regTime;
+
+    /**
+     * 注册渠道id
+     */
+    @ApiModelProperty(notes = "注册渠道id")
+    private Long channelId;
+
+    /**
+     * cp名称
+     */
+    @ApiModelProperty(notes = "cp名称")
+    private Long cpId;
+
+    /**
+     * 游戏id
+     */
+    @ApiModelProperty(notes = "游戏id")
+    private Long gameId;
+
+    /**
+     * 游戏应用类型id
+     */
+    @ApiModelProperty(notes = "游戏应用类型id")
+    private Long gameCategoryId;
+
+    /**
+     * 游戏区服
+     */
+    @ApiModelProperty(notes = "游戏区服")
+    private String serverName;
+
+    /**
+     * 游戏角色
+     */
+    @ApiModelProperty(notes = "游戏角色")
+    private String roleName;
+
+    /**
+     * 游戏角色id
+     */
+    @ApiModelProperty(notes = "游戏角色id")
+    private String roleId;
+
+    /**
+     * 角色等级
+     */
+    @ApiModelProperty(notes = "角色等级")
+    private Long roleLevel;
+
+    /**
+     * 游戏战力
+     */
+    @ApiModelProperty(notes = "游戏战力")
+    private Long rolePower;
+
+    /**
+     * 角色vip
+     */
+    @ApiModelProperty(notes = "角色vip")
+    private Long roleVipLevel;
+
+    /**
+     * 操作系统
+     */
+    @ApiModelProperty(notes = "操作系统")
+    private String os;
+
+    /**
+     * 充值金额
+     */
+    @ApiModelProperty(notes = "充值金额")
+    private BigDecimal rechargeMoney;
+
+    /**
+     * 平台币余额
+     */
+    @ApiModelProperty(notes = "平台币余额")
+    private BigDecimal platformCoin;
+
+    /**
+     * 充值次数
+     */
+    @ApiModelProperty(notes = "充值次数")
+    private Integer rechargeCount;
+
+    /**
+     * 角色创建时间
+     */
+    @ApiModelProperty(notes = "角色创建时间")
+    private LocalDateTime createTime;
+
+    /**
+     * 最近登录时间
+     */
+    @ApiModelProperty(notes = "最近登录时间")
+    private LocalDateTime lastLoginTime;
+
+    /**
+     * 游戏角色更新时间
+     */
+    @ApiModelProperty(notes = "游戏角色更新时间")
+    private LocalDateTime updateTime;
+
+    /**
+     * 最近充值时间
+     */
+    @ApiModelProperty(notes = "最近充值时间")
+    private LocalDateTime lastRechargeTime;
+}

+ 0 - 99
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/UserGameRoleListVO.java

@@ -1,99 +0,0 @@
-package com.zanxiang.manage.domain.vo;
-
-import io.swagger.annotations.ApiModelProperty;
-
-import java.math.BigDecimal;
-import java.time.LocalDateTime;
-
-/**
- * @author : lingfeng
- * @time : 2022-06-30
- * @description : 玩家角色列表
- */
-public class UserGameRoleListVO {
-
-    /**
-     * 主键id
-     */
-    private Long id;
-
-    /**
-     * 玩家id
-     */
-    @ApiModelProperty(notes = "玩家id")
-    private Long userId;
-
-    /**
-     * 玩家账号
-     */
-    @ApiModelProperty(notes = "玩家账号")
-    private String username;
-
-    /**
-     * 玩家昵称
-     */
-    @ApiModelProperty(notes = "玩家昵称")
-    private String nickname;
-
-    /**
-     * 注册IP
-     */
-    private String regIp;
-
-    /**
-     * 玩家注册时间
-     */
-    private LocalDateTime regTime;
-
-    /**
-     * 注册渠道
-     */
-    private String channelSign;
-
-    /**
-     * cp名称
-     */
-    private String cpName;
-
-    /**
-     * 游戏名称
-     */
-    private String gameName;
-
-    /**
-     * 游戏应用类型
-     */
-    private String gameCategoryName;
-
-    /**
-     * 游戏区服
-     */
-    private String serverName;
-
-    /**
-     * 游戏角色
-     */
-    private String roleName;
-
-    /**
-     * 游戏角色id
-     */
-    private String roleId;
-
-    /**
-     * 游戏战力
-     */
-    private Long rolePower;
-
-    /**
-     * 角色vip
-     */
-    private Long vipLevel;
-
-    /**
-     * 操作系统
-     */
-    private String os;
-
-//    private BigDecimal
-}

+ 30 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameService.java

@@ -1,10 +1,12 @@
 package com.zanxiang.manage.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zanxiang.manage.domain.dto.GameDTO;
 import com.zanxiang.manage.domain.vo.GameChoiceVO;
 import com.zanxiang.mybatis.entity.Game;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author : lingfeng
@@ -19,4 +21,32 @@ public interface GameService extends IService<Game> {
      * @return : 返回所有游戏信息
      */
     List<GameChoiceVO> choiceList();
+
+    /**
+     * 根据id查询游戏信息
+     *
+     * @param id : 游戏id
+     * @return : 返回游戏信息
+     */
+    GameDTO getById(Long id);
+
+    /**
+     * 游戏相关条件查询游戏信息
+     *
+     * @param cpId           : cp唯一键
+     * @param gameId         : 游戏id
+     * @param gameCategoryId : 分类id
+     * @return : 返回游戏信息列表
+     */
+    Map<Long, GameDTO> gameCondition(Long cpId, Long gameId, Long gameCategoryId);
+
+    /**
+     * 游戏查询条件
+     *
+     * @param cpId           : cp唯一键
+     * @param gameId         : 游戏id
+     * @param gameCategoryId : 分类id
+     * @return : 返回游戏信息列表, null 标识未匹配到游戏, 空表示没有条件
+     */
+    List<GameDTO> getGameList(Long cpId, Long gameId, Long gameCategoryId);
 }

+ 21 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameUserRoleService.java

@@ -0,0 +1,21 @@
+package com.zanxiang.manage.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.zanxiang.manage.domain.params.GameUserRoleListParam;
+import com.zanxiang.manage.domain.vo.GameUserRoleListVO;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-01
+ * @description : 玩家角色
+ */
+public interface GameUserRoleService {
+
+    /**
+     * 查询玩家角色列表
+     *
+     * @param param : 角色列表查询参数
+     * @return : 玩家角色单页信息
+     */
+    IPage<GameUserRoleListVO> list(GameUserRoleListParam param);
+}

+ 21 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameUserService.java

@@ -0,0 +1,21 @@
+package com.zanxiang.manage.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.zanxiang.manage.domain.params.GameUserListParam;
+import com.zanxiang.manage.domain.vo.GameUserListVO;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-04
+ * @description : 玩家游戏
+ */
+public interface GameUserService {
+
+    /**
+     * 查询玩家游戏列表
+     *
+     * @param param : 玩家游戏列表参数
+     * @return : 返回单页数据
+     */
+    IPage<GameUserListVO> gameUserList(GameUserListParam param);
+}

+ 64 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameServiceImpl.java

@@ -1,8 +1,10 @@
 package com.zanxiang.manage.service.Impl;
 
+import com.alibaba.nacos.common.utils.CollectionUtils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.common.utils.bean.BeanUtils;
+import com.zanxiang.manage.domain.dto.GameDTO;
 import com.zanxiang.manage.domain.vo.GameChoiceVO;
 import com.zanxiang.manage.service.GameService;
 import com.zanxiang.mybatis.entity.Game;
@@ -10,7 +12,11 @@ import com.zanxiang.mybatis.mapper.GameMapper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
+import java.util.Collections;
 import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 /**
  * @author : lingfeng
@@ -31,4 +37,62 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements Ga
         List<Game> gameList = super.list(new LambdaQueryWrapper<Game>().select(Game::getId, Game::getName));
         return BeanUtils.copyList(gameList, GameChoiceVO.class);
     }
+
+    /**
+     * 根据id查询游戏信息
+     *
+     * @param id : 游戏id
+     * @return : 返回游戏信息
+     */
+    @Override
+    public GameDTO getById(Long id) {
+        if (id == null) {
+            return null;
+        }
+        return BeanUtils.copy(super.getById(id), GameDTO.class);
+    }
+
+    /**
+     * 游戏相关条件查询游戏信息
+     *
+     * @param cpId           : cp唯一键
+     * @param gameId         : 游戏id
+     * @param gameCategoryId : 分类id
+     * @return : 返回游戏信息列表
+     */
+    @Override
+    public Map<Long, GameDTO> gameCondition(Long cpId, Long gameId, Long gameCategoryId) {
+        //游戏条件判断
+        if (cpId == null && gameId == null && gameCategoryId == null) {
+            return null;
+        }
+        List<GameDTO> gameList = this.getGameList(cpId, gameId, gameCategoryId);
+        if (CollectionUtils.isEmpty(gameList)) {
+            return Collections.emptyMap();
+        }
+        return gameList.stream().collect(Collectors.toMap(GameDTO::getId, Function.identity()));
+    }
+
+    /**
+     * 游戏查询条件
+     *
+     * @param cpId           : cp唯一键
+     * @param gameId         : 游戏id
+     * @param gameCategoryId : 分类id
+     * @return : 返回游戏信息列表, null 标识未匹配到游戏, 空表示没有条件
+     */
+    @Override
+    public List<GameDTO> getGameList(Long cpId, Long gameId, Long gameCategoryId) {
+        if (cpId == null && gameId == null && gameCategoryId == null) {
+            return Collections.emptyList();
+        }
+        List<Game> gameList = super.list(new LambdaQueryWrapper<Game>()
+                .eq(cpId != null, Game::getCpId, cpId)
+                .eq(gameId != null, Game::getId, gameId)
+                .eq(gameCategoryId != null, Game::getCategory, gameCategoryId)
+                .select(Game::getId, Game::getCpId, Game::getName)
+        );
+        return BeanUtils.copyList(gameList, GameDTO.class);
+    }
+
 }

+ 168 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameUserRoleServiceImpl.java

@@ -0,0 +1,168 @@
+package com.zanxiang.manage.service.Impl;
+
+import com.alibaba.nacos.common.utils.CollectionUtils;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+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.GameDTO;
+import com.zanxiang.manage.domain.dto.UserDTO;
+import com.zanxiang.manage.domain.dto.UserExtDTO;
+import com.zanxiang.manage.domain.params.GameUserRoleListParam;
+import com.zanxiang.manage.domain.vo.GameUserRoleListVO;
+import com.zanxiang.manage.service.GameService;
+import com.zanxiang.manage.service.GameUserRoleService;
+import com.zanxiang.manage.service.UserExtService;
+import com.zanxiang.manage.service.UserService;
+import com.zanxiang.mybatis.entity.GameUserRole;
+import com.zanxiang.mybatis.mapper.GameUserRoleMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.logging.log4j.util.Strings;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-01
+ * @description : 玩家角色
+ */
+@Slf4j
+@Service
+public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, GameUserRole> implements GameUserRoleService {
+
+    @Autowired
+    private UserService userService;
+
+    @Autowired
+    private UserExtService userExtService;
+
+    @Autowired
+    private GameService gameService;
+
+    /**
+     * 查询玩家角色列表
+     *
+     * @param param : 角色列表查询参数
+     * @return : 玩家角色单页信息
+     */
+    @Override
+    public IPage<GameUserRoleListVO> list(GameUserRoleListParam param) {
+        //玩家条件处理
+        Map<Long, UserDTO> userMap = userService.userCondition(param.getUserId(), param.getChannelId(), param.getUserName(), param.getNickname());
+        //根据条件, 匹配不到玩家
+        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<>();
+        }
+        //游戏条件处理
+        Map<Long, GameDTO> gameMap = gameService.gameCondition(param.getCpId(), param.getGameId(), param.getGameCategoryId());
+        //根据条件, 匹配不到游戏
+        if (gameMap != null && gameMap.isEmpty()) {
+            return new Page<>();
+        }
+        //执行查询
+        return page(param.toPage(), new QueryWrapper<GameUserRole>().lambda()
+                .in(CollectionUtils.isNotEmpty(userIdSet), GameUserRole::getUserId, userIdSet)
+                .eq(Strings.isNotBlank(param.getServerName()), GameUserRole::getServerName, param.getServerName())
+                .eq(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)
+                .eq(param.getVipLevel() != null && param.getVipLevel() <= 10, GameUserRole::getRoleVipLevel, param.getVipLevel())
+                .gt(param.getVipLevel() != null && param.getVipLevel() > 10, GameUserRole::getRoleVipLevel, param.getVipLevel())
+                .ge(param.getBeginDate() != null, GameUserRole::getCreateTime, param.getBeginDate() == null ? null : LocalDateTime.of(param.getBeginDate(), LocalTime.MIN))
+                .le(param.getEndDate() != null, GameUserRole::getCreateTime, param.getEndDate() == null ? null : LocalDateTime.of(param.getEndDate(), LocalTime.MAX))
+                .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));
+    }
+
+    /**
+     * 玩家角色信息对象转换
+     *
+     * @param gameUserRole : 玩家角色信息
+     * @return : 玩家角色信息展示对象
+     */
+    private GameUserRoleListVO toVo(GameUserRole gameUserRole, Map<Long, UserDTO> userMap, Map<Long, UserExtDTO> userExtMap, Map<Long, GameDTO> gameMap) {
+        GameUserRoleListVO gameUserRoleListVO = BeanUtils.copy(gameUserRole, GameUserRoleListVO.class);
+        if (Objects.isNull(gameUserRoleListVO)) {
+            return null;
+        }
+        UserDTO userDTO = StringUtils.isEmpty(userMap) ? null : userMap.get(gameUserRoleListVO.getUserId());
+        if (userDTO == null) {
+            userDTO = userService.getById(gameUserRoleListVO.getUserId());
+        }
+        if (userDTO != null) {
+            gameUserRoleListVO.setUsername(userDTO.getUsername());
+            gameUserRoleListVO.setNickname(userDTO.getNickname());
+            gameUserRoleListVO.setChannelId(userDTO.getChannel());
+        }
+        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());
+        }
+        GameDTO gameDTO = StringUtils.isEmpty(gameMap) ? null : gameMap.get(gameUserRoleListVO.getGameId());
+        if (gameDTO == null) {
+            gameDTO = gameService.getById(gameUserRoleListVO.getGameId());
+        }
+        if (gameDTO != null) {
+            gameUserRoleListVO.setCpId(gameDTO.getCpId());
+            gameUserRoleListVO.setGameCategoryId(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;
+    }
+}

+ 123 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameUserServiceImpl.java

@@ -0,0 +1,123 @@
+package com.zanxiang.manage.service.Impl;
+
+import com.alibaba.nacos.common.utils.CollectionUtils;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+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.GameDTO;
+import com.zanxiang.manage.domain.dto.UserDTO;
+import com.zanxiang.manage.domain.params.GameUserListParam;
+import com.zanxiang.manage.domain.vo.GameUserListVO;
+import com.zanxiang.manage.service.GameService;
+import com.zanxiang.manage.service.GameUserService;
+import com.zanxiang.manage.service.UserService;
+import com.zanxiang.mybatis.entity.GameUser;
+import com.zanxiang.mybatis.mapper.GameUserMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-04
+ * @description : 玩家游戏
+ */
+@Slf4j
+@Service
+public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> implements GameUserService {
+
+    @Autowired
+    private UserService userService;
+
+    @Autowired
+    private GameService gameService;
+
+    /**
+     * 查询玩家游戏列表
+     *
+     * @param param : 玩家游戏列表参数
+     * @return : 返回单页数据
+     */
+    @Override
+    public IPage<GameUserListVO> gameUserList(GameUserListParam param) {
+        //玩家条件处理
+        Map<Long, UserDTO> userMap = userService.userCondition(param.getUserId(), param.getChannelId(), param.getUserName(), param.getNickname());
+        //根据条件, 匹配不到玩家
+        if (userMap != null && userMap.isEmpty()) {
+            return new Page<>();
+        }
+        //玩家信息和拓展信息合并
+        Set<Long> userIdSet = new HashSet<>();
+        if (userMap != null) {
+            userIdSet = userMap.keySet();
+        }
+        //游戏条件处理
+        Map<Long, GameDTO> gameMap = gameService.gameCondition(param.getCpId(), param.getGameId(), param.getGameCategoryId());
+        //根据条件, 匹配不到游戏
+        if (gameMap != null && gameMap.isEmpty()) {
+            return new Page<>();
+        }
+        //执行查询
+        return page(param.toPage(), new QueryWrapper<GameUser>().lambda()
+                .in(CollectionUtils.isNotEmpty(userIdSet), GameUser::getUserId, userIdSet)
+                .in(gameMap != null, GameUser::getGameId, gameMap != null ? gameMap.keySet() : null)
+                // todo : 归因推广账号
+                // todo : 归因投放人员
+                .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))
+                .le(param.getRechargeEndDate() != null, GameUser::getLastRechargeTime, param.getRechargeEndDate() == null ? null : LocalDateTime.of(param.getRechargeEndDate(), LocalTime.MAX))
+                .eq(param.getCustomerId() != null, GameUser::getCustomerId, param.getCustomerId())
+                // todo : 归因广告
+                .eq(param.getIsGs() != null, GameUser::getIsGs, param.getIsGs())
+                .gt(Objects.equals(param.getIsRecharge(), Boolean.TRUE), GameUser::getRechargeCount, 0)
+                .eq(Objects.equals(param.getIsRecharge(), Boolean.FALSE), GameUser::getRechargeCount, 0)
+                .eq(param.getVipLevel() != null && param.getVipLevel() <= 10, GameUser::getRoleVipMax, param.getVipLevel())
+                .gt(param.getVipLevel() != null && param.getVipLevel() > 10, GameUser::getRoleVipMax, param.getVipLevel())
+                .orderByDesc(GameUser::getCreateTime)
+        ).convert(u -> this.toVo(u, userMap, gameMap));
+    }
+
+    /**
+     * 游戏玩家信息转换对象
+     *
+     * @param gameUser : 游戏玩家信息
+     * @param userMap  : 用户信息
+     * @param gameMap  : 游戏信息
+     * @return : 返回游戏玩家信息
+     */
+    private GameUserListVO toVo(GameUser gameUser, Map<Long, UserDTO> userMap, Map<Long, GameDTO> gameMap) {
+        GameUserListVO gameUserListVO = BeanUtils.copy(gameUser, GameUserListVO.class);
+        if (Objects.isNull(gameUserListVO)) {
+            return null;
+        }
+        UserDTO userDTO = StringUtils.isEmpty(userMap) ? null : userMap.get(gameUserListVO.getUserId());
+        if (userDTO == null) {
+            userDTO = userService.getById(gameUserListVO.getUserId());
+        }
+        if (userDTO != null) {
+            gameUserListVO.setNickname(userDTO.getNickname());
+            gameUserListVO.setUsername(userDTO.getUsername());
+            gameUserListVO.setChannelId(userDTO.getChannel());
+        }
+        GameDTO gameDTO = StringUtils.isEmpty(gameMap) ? null : gameMap.get(gameUserListVO.getGameId());
+        if (gameDTO == null) {
+            gameDTO = gameService.getById(gameUserListVO.getGameId());
+        }
+        if (gameDTO != null) {
+            gameUserListVO.setGameCategoryId(gameDTO.getCategory());
+            gameUserListVO.setCpId(gameDTO.getCpId());
+        }
+        return gameUserListVO;
+    }
+}

+ 60 - 3
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserExtServiceImpl.java

@@ -1,11 +1,14 @@
 package com.zanxiang.manage.service.Impl;
 
 import com.alibaba.nacos.common.utils.CollectionUtils;
+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.extension.service.impl.ServiceImpl;
+import com.zanxiang.common.utils.StringUtils;
 import com.zanxiang.common.utils.bean.BeanUtils;
 import com.zanxiang.manage.domain.dto.UserDTO;
+import com.zanxiang.manage.domain.dto.UserExtDTO;
 import com.zanxiang.manage.domain.params.UserNameAuthListParam;
 import com.zanxiang.manage.domain.vo.UserNameAuthVO;
 import com.zanxiang.manage.service.UserExtService;
@@ -19,6 +22,7 @@ import org.springframework.stereotype.Service;
 
 import java.time.LocalDateTime;
 import java.time.LocalTime;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -37,6 +41,56 @@ public class UserExtServiceImpl extends ServiceImpl<UserExtMapper, UserExt> impl
     @Autowired
     private UserService userService;
 
+    /**
+     * 注册ip相关条件查询用户拓展信息
+     *
+     * @param regIp : 参数
+     * @return : 玩家信息
+     */
+    @Override
+    public Map<Long, UserExtDTO> regIpCondition(String regIp) {
+        if (Strings.isBlank(regIp)) {
+            return null;
+        }
+        //玩家注册ip条件处理
+        List<UserExtDTO> userExtList = this.getByRegIp(regIp);
+        if (CollectionUtils.isEmpty(userExtList)) {
+            return Collections.emptyMap();
+        }
+        return userExtList.stream().collect(Collectors.toMap(UserExtDTO::getUserId, Function.identity()));
+    }
+
+    /**
+     * 根据玩家注册ip查询
+     *
+     * @param regIp : 玩家注册ip
+     * @return : 返回玩家信息列表
+     */
+    @Override
+    public List<UserExtDTO> getByRegIp(String regIp) {
+        if (Strings.isBlank(regIp)) {
+            return Collections.emptyList();
+        }
+        List<UserExt> userExtList = super.list(new LambdaQueryWrapper<UserExt>()
+                .eq(UserExt::getRegIp, regIp)
+                .select(UserExt::getUserId, UserExt::getRegIp));
+        return BeanUtils.copyList(userExtList, UserExtDTO.class);
+    }
+
+    /**
+     * 根据玩家id查询
+     *
+     * @param userId : 玩家id
+     * @return : 返回玩家信息
+     */
+    @Override
+    public UserExtDTO getById(Long userId) {
+        if (userId == null) {
+            return null;
+        }
+        return BeanUtils.copy(super.getById(userId), UserExtDTO.class);
+    }
+
     /**
      * 获取玩家实名认证列表
      *
@@ -45,17 +99,19 @@ public class UserExtServiceImpl extends ServiceImpl<UserExtMapper, UserExt> impl
      */
     @Override
     public IPage<UserNameAuthVO> authList(UserNameAuthListParam param) {
+        Long userId = param.getUserId();
         String userName = param.getUserName();
         String nickname = param.getNickname();
         //玩家账号和玩家昵称涉及的玩家条件
-        List<UserDTO> userDTOList = userService.getLikeUserNameOrNickName(userName, nickname);
+        List<UserDTO> userDTOList = userService.getUserList(userId, null, userName, nickname);
         //玩家信息map
         Map<Long, UserDTO> map = userDTOList.stream().collect(Collectors.toMap(UserDTO::getId, Function.identity()));
         //玩家id列表
         List<Long> userIdList = userDTOList.stream().map(UserDTO::getId).collect(Collectors.toList());
+        //查询返回
         return page(param.toPage(), new QueryWrapper<UserExt>().lambda()
                 .eq(UserExt::getIsAuth, Boolean.TRUE)
-                .eq(param.getUserId() != null, UserExt::getUserId, param.getUserId())
+                .eq(userId != null, UserExt::getUserId, userId)
                 .in(CollectionUtils.isNotEmpty(userIdList), UserExt::getUserId, userIdList)
                 .ge(param.getBeginDate() != null, UserExt::getCreateTime, param.getBeginDate() == null ? null : LocalDateTime.of(param.getBeginDate(), LocalTime.MIN))
                 .le(param.getEndDate() != null, UserExt::getCreateTime, param.getEndDate() == null ? null : LocalDateTime.of(param.getEndDate(), LocalTime.MAX))
@@ -78,7 +134,7 @@ public class UserExtServiceImpl extends ServiceImpl<UserExtMapper, UserExt> impl
         if (Objects.isNull(userNameAuthVO)) {
             return null;
         }
-        UserDTO userDTO = map.get(userNameAuthVO.getUserId());
+        UserDTO userDTO = StringUtils.isEmpty(map) ? null : map.get(userNameAuthVO.getUserId());
         if (userDTO == null) {
             userDTO = userService.getById(userNameAuthVO.getUserId());
         }
@@ -89,4 +145,5 @@ public class UserExtServiceImpl extends ServiceImpl<UserExtMapper, UserExt> impl
         return userNameAuthVO;
     }
 
+
 }

+ 37 - 3
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserServiceImpl.java

@@ -14,6 +14,9 @@ import org.springframework.stereotype.Service;
 
 import java.util.Collections;
 import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 /**
  * @author : lingfeng
@@ -24,16 +27,47 @@ import java.util.List;
 @Service
 public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
 
+    /**
+     * 玩家相关条件查询用户信息
+     *
+     * @param userId    : 用户id
+     * @param channelId : 渠道id
+     * @param userName  : 用户名称
+     * @param nickname  : 用户昵称
+     * @return : 返回用户信息map
+     */
+    @Override
+    public Map<Long, UserDTO> userCondition(Long userId, Long channelId, String userName, String nickname) {
+        //用户信息条件处理
+        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 userName : 玩家账号
-     * @param nickname : 玩家昵称
+     * @param userId    : 用户id
+     * @param channelId : 渠道id
+     * @param userName  : 玩家账号
+     * @param nickname  : 玩家昵称
      * @return : 返回玩家信息
      */
     @Override
-    public List<UserDTO> getLikeUserNameOrNickName(String userName, String nickname) {
+    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)
                 .like(Strings.isNotBlank(userName), User::getUsername, userName)
                 .like(Strings.isNotBlank(nickname), User::getNickname, nickname)
                 .select(User::getId, User::getUsername, User::getNickname));

+ 28 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/UserExtService.java

@@ -2,10 +2,14 @@ package com.zanxiang.manage.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zanxiang.manage.domain.dto.UserExtDTO;
 import com.zanxiang.manage.domain.params.UserNameAuthListParam;
 import com.zanxiang.manage.domain.vo.UserNameAuthVO;
 import com.zanxiang.mybatis.entity.UserExt;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * @author : lingfeng
  * @time : 2022-06-29
@@ -13,6 +17,30 @@ import com.zanxiang.mybatis.entity.UserExt;
  */
 public interface UserExtService extends IService<UserExt> {
 
+    /**
+     * 注册ip相关条件查询用户拓展信息
+     *
+     * @param regIp : 参数
+     * @return : 玩家信息
+     */
+    Map<Long, UserExtDTO> regIpCondition(String regIp);
+
+    /**
+     * 根据玩家注册ip查询
+     *
+     * @param regIp : 玩家注册ip
+     * @return : 返回玩家信息列表
+     */
+    List<UserExtDTO> getByRegIp(String regIp);
+
+    /**
+     * 根据玩家id查询
+     *
+     * @param userId : 玩家id
+     * @return : 返回玩家信息
+     */
+    UserExtDTO getById(Long userId);
+
     /**
      * 获取玩家实名认证列表
      *

+ 17 - 3
game-module/game-manage/src/main/java/com/zanxiang/manage/service/UserService.java

@@ -5,6 +5,7 @@ import com.zanxiang.manage.domain.dto.UserDTO;
 import com.zanxiang.mybatis.entity.User;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author : lingfeng
@@ -13,14 +14,27 @@ import java.util.List;
  */
 public interface UserService extends IService<User> {
 
+    /**
+     * 玩家相关条件查询用户信息
+     *
+     * @param userId    : 用户id
+     * @param channelId : 渠道id
+     * @param userName  : 用户名称
+     * @param nickname  : 用户昵称
+     * @return : 返回用户信息map
+     */
+    Map<Long, UserDTO> userCondition(Long userId, Long channelId, String userName, String nickname);
+
     /**
      * 根据玩家账号或者昵称模糊查询玩家列表
      *
-     * @param userName : 玩家账号
-     * @param nickname : 玩家昵称
+     * @param userId    : 用户id
+     * @param channelId : 渠道id
+     * @param userName  : 玩家账号
+     * @param nickname  : 玩家昵称
      * @return : 返回玩家信息
      */
-    List<UserDTO> getLikeUserNameOrNickName(String userName, String nickname);
+    List<UserDTO> getUserList(Long userId, Long channelId, String userName, String nickname);
 
     /**
      * 根据用户id查询信息