Bläddra i källkod

Merge remote-tracking branch 'origin/dev-lingfeng' into dev0.0.1

bilingfeng 2 år sedan
förälder
incheckning
c3a6b354a0
44 ändrade filer med 1986 tillägg och 208 borttagningar
  1. 16 10
      game-module/game-common/pom.xml
  2. 2 2
      game-module/game-common/src/main/java/com/zanxiang/common/utils/DateUtils.java
  3. 1 1
      game-module/game-common/src/main/java/com/zanxiang/common/utils/ExceptionUtil.java
  4. 16 0
      game-module/game-common/src/main/java/com/zanxiang/common/utils/IpUtils.java
  5. 21 1
      game-module/game-common/src/main/java/com/zanxiang/common/utils/StringUtils.java
  6. 0 5
      game-module/game-manage/pom.xml
  7. 36 26
      game-module/game-manage/src/main/java/com/zanxiang/manage/controller/UserController.java
  8. 64 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/ChannelDTO.java
  9. 149 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/GameDTO.java
  10. 109 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/UserExtDTO.java
  11. 117 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/params/GameUserListParam.java
  12. 5 1
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/params/GameUserRoleListParam.java
  13. 149 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameUserListVO.java
  14. 162 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameUserRoleListVO.java
  15. 100 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameUserVO.java
  16. 0 99
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/UserGameRoleListVO.java
  17. 138 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/UserVO.java
  18. 9 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/ChannelService.java
  19. 30 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameService.java
  20. 21 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameUserRoleService.java
  21. 30 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameUserService.java
  22. 13 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/ChannelServiceImpl.java
  23. 64 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameServiceImpl.java
  24. 168 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameUserRoleServiceImpl.java
  25. 137 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameUserServiceImpl.java
  26. 9 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserAddressServiceImpl.java
  27. 61 4
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserExtServiceImpl.java
  28. 107 5
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserServiceImpl.java
  29. 28 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/UserExtService.java
  30. 23 3
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/UserService.java
  31. 16 16
      game-module/game-manage/src/main/resources/bootstrap.yml
  32. 2 2
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/Game.java
  33. 37 2
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/GameUser.java
  34. 22 5
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/GameUserRole.java
  35. 5 0
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/User.java
  36. 71 0
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/UserAddress.java
  37. 22 2
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/UserExt.java
  38. 12 0
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/mapper/UserAddressMapper.java
  39. 4 0
      game-module/game-mybatis/src/main/resources/mapper/UserAddressMapper.xml
  40. 2 10
      game-module/game-sdk/src/main/java/com/zanxiang/sdk/common/util/RegisterUtil.java
  41. 3 2
      game-module/game-sdk/src/main/java/com/zanxiang/sdk/controller/PayController.java
  42. 0 1
      game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/Impl/RegisterLoginServiceImpl.java
  43. 4 10
      game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/Impl/UserTokenServiceImpl.java
  44. 1 1
      game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/Impl/WordCheckServiceImpl.java

+ 16 - 10
game-module/game-common/pom.xml

@@ -16,16 +16,16 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
-        <!-- nacos配置中心 -->
-        <dependency>
-            <groupId>com.alibaba.cloud</groupId>
-            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
-        </dependency>
-        <!-- nacos注册中心 -->
-        <dependency>
-            <groupId>com.alibaba.cloud</groupId>
-            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
-        </dependency>
+<!--        &lt;!&ndash; nacos配置中心 &ndash;&gt;-->
+<!--        <dependency>-->
+<!--            <groupId>com.alibaba.cloud</groupId>-->
+<!--            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>-->
+<!--        </dependency>-->
+<!--        &lt;!&ndash; nacos注册中心 &ndash;&gt;-->
+<!--        <dependency>-->
+<!--            <groupId>com.alibaba.cloud</groupId>-->
+<!--            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
+<!--        </dependency>-->
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-test</artifactId>
@@ -65,6 +65,12 @@
             <artifactId>springfox-swagger-ui</artifactId>
             <version>${swagger2.ui.version}</version>
         </dependency>
+
+        <dependency>
+            <groupId>com.zanxiangnet.module</groupId>
+            <artifactId>zx-util</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
     </dependencies>
 
 </project>

+ 2 - 2
game-module/game-common/src/main/java/com/zanxiang/common/utils/DateUtils.java

@@ -1,6 +1,6 @@
 package com.zanxiang.common.utils;
 
-import org.apache.commons.lang.time.DateFormatUtils;
+import org.apache.commons.lang3.time.DateFormatUtils;
 
 import java.lang.management.ManagementFactory;
 import java.text.DateFormat;
@@ -20,7 +20,7 @@ import java.util.Locale;
  *
  * @author ruoyi
  */
-public class DateUtils extends org.apache.commons.lang.time.DateUtils {
+public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
     public static String YYYY_MM_DD = "yyyy-MM-dd";
 
     public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";

+ 1 - 1
game-module/game-common/src/main/java/com/zanxiang/common/utils/ExceptionUtil.java

@@ -1,6 +1,6 @@
 package com.zanxiang.common.utils;
 
-import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
 
 import java.io.PrintWriter;
 import java.io.StringWriter;

+ 16 - 0
game-module/game-common/src/main/java/com/zanxiang/common/utils/IpUtils.java

@@ -36,4 +36,20 @@ public class IpUtils {
         }
         return ipAddress;
     }
+
+    public static String getHostIp() {
+        try {
+            return InetAddress.getLocalHost().getHostAddress();
+        } catch (UnknownHostException e) {
+        }
+        return "127.0.0.1";
+    }
+
+    public static String getHostName() {
+        try {
+            return InetAddress.getLocalHost().getHostName();
+        } catch (UnknownHostException e) {
+        }
+        return "未知";
+    }
 }

+ 21 - 1
game-module/game-common/src/main/java/com/zanxiang/common/utils/StringUtils.java

@@ -1,5 +1,6 @@
 package com.zanxiang.common.utils;
 
+import com.baomidou.mybatisplus.core.toolkit.ArrayUtils;
 import com.zanxiang.common.text.StrFormatter;
 
 import java.util.Collection;
@@ -10,7 +11,8 @@ import java.util.Map;
  *
  * @author ruoyi
  */
-public class StringUtils extends org.apache.commons.lang.StringUtils {
+public class StringUtils extends org.apache.commons.lang3.StringUtils {
+
     /**
      * 空字符串
      */
@@ -363,4 +365,22 @@ public class StringUtils extends org.apache.commons.lang.StringUtils {
     public static <T> T cast(Object obj) {
         return (T) obj;
     }
+
+    /**
+     * 判断数组里的字符串是否存在空值
+     *
+     * @param css : 需要判断的参数
+     * @return : 返回判断结果
+     */
+    public static boolean isAnyEmpty(final String... css) {
+        if (ArrayUtils.isEmpty(css)) {
+            return false;
+        }
+        for (final String cs : css) {
+            if (isEmpty(cs)) {
+                return true;
+            }
+        }
+        return false;
+    }
 }

+ 0 - 5
game-module/game-manage/pom.xml

@@ -16,11 +16,6 @@
             <groupId>com.zanxiang.game</groupId>
             <version>0.0.1-SNAPSHOT</version>
         </dependency>
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>fastjson</artifactId>
-            <version>${alibaba.fastjson.version}</version>
-        </dependency>
         <dependency>
             <groupId>com.zanxiang.game</groupId>
             <artifactId>game-common-redis</artifactId>

+ 36 - 26
game-module/game-manage/src/main/java/com/zanxiang/manage/controller/UserController.java

@@ -6,12 +6,14 @@ 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 com.zanxiang.manage.service.UserService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiResponse;
@@ -38,41 +40,49 @@ public class UserController {
     @Autowired
     private UserExtService userExtService;
 
+    @Autowired
+    private GameUserRoleService gameUserRoleService;
+
+    @Autowired
+    private GameUserService gameUserService;
+
+    @Autowired
+    private UserService userService;
+
 //    @ApiOperation(value = "玩家列表")
 //    @PostMapping(value = "/list")
 //    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = IpBanVO.class)})
 //    public ResultVo<IPage<IpBanVO>> list(@Validated @RequestBody IpBanListParam param) {
 //        return null;
 //    }
-//
-//    @ApiOperation(value = "玩家详细信息")
-//    @PostMapping(value = "/info")
-//    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = IpBanVO.class)})
-//    public ResultVo<IPage<IpBanVO>> info(@Validated @RequestBody IpBanListParam param) {
-//        return null;
-//    }
-//
+
 //    @ApiOperation(value = "玩家详细信息")
 //    @PostMapping(value = "/update")
 //    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = IpBanVO.class)})
 //    public ResultVo<IPage<IpBanVO>> update(@Validated @RequestBody IpBanListParam param) {
 //        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 = "玩家详细信息")
+    @GetMapping(value = "/info")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = UserVO.class)})
+    public ResultVo<UserVO> getUserInfo(@RequestParam Long id) {
+        return ResultVo.ok(userService.getUserInfo(id));
+    }
+
+    @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")

+ 64 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/ChannelDTO.java

@@ -0,0 +1,64 @@
+package com.zanxiang.manage.domain.dto;
+
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-05
+ * @description : 渠道信息
+ */
+@Data
+public class ChannelDTO {
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 平台名称
+     */
+    private String channelName;
+
+    /**
+     * 公司名称
+     */
+    private String companyName;
+
+    /**
+     * 联系人
+     */
+    private String linkMan;
+
+    /**
+     * 手机号
+     */
+    private String mobile;
+
+    /**
+     * 职位
+     */
+    private String position;
+
+    /**
+     * 1 删除  0 正常
+     */
+    private Integer isDelete;
+
+    /**
+     * 删除时间
+     */
+    private LocalDateTime deleteTime;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+}

+ 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;
+}

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

@@ -0,0 +1,109 @@
+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;
+
+    /**
+     * 注册游戏id
+     */
+    private Long regGameId;
+
+    /**
+     * 注册来源
+     */
+    private String regFrom;
+
+    /**
+     * 是否实名认证
+     */
+    private Boolean isAuth;
+
+    /**
+     * 身份证类型 1、身份证
+     */
+    private Integer identifyType;
+
+    /**
+     * 证件号码
+     */
+    private String idCard;
+
+    /**
+     * 真实姓名
+     */
+    private String realName;
+
+    /**
+     * 生日
+     */
+    private String birthday;
+
+    /**
+     * 性别, 0 : 未知, 1 : 男, 2 : 女
+     */
+    private Integer sex;
+
+    /**
+     * 实名认证平台, 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;
+}

+ 100 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameUserVO.java

@@ -0,0 +1,100 @@
+package com.zanxiang.manage.domain.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-05
+ * @description : 游戏玩家信息
+ */
+@Data
+public class GameUserVO {
+
+    /**
+     * 主键id
+     */
+    private Long id;
+
+    /**
+     * 用户 id
+     */
+    private Long userId;
+
+    /**
+     * 导量的渠道ID
+     */
+    private Long guidedAgentId;
+
+    /**
+     * 游戏ID
+     */
+    private Long gameId;
+
+    /**
+     * 昵称
+     */
+    private String nickname;
+
+    /**
+     * 最近默认 2 默认 1 不默认
+     */
+    private Boolean isDefault;
+
+    /**
+     * 状态 2正常 1锁定
+     */
+    private Boolean status;
+
+    /**
+     * 充值次数
+     */
+    private Integer rechargeCount;
+
+    /**
+     * 充值金额
+     */
+    private BigDecimal rechargeMoney;
+
+    /**
+     * 最近充值时间
+     */
+    private LocalDateTime lastRechargeTime;
+
+    /**
+     * 平台币余额
+     */
+    private BigDecimal platformCoin;
+
+    /**
+     * 是否GS
+     */
+    private Boolean isGs;
+
+    /**
+     * 客服id
+     */
+    private Long customerId;
+
+    /**
+     * 创角数
+     */
+    private Integer roleCount;
+
+    /**
+     * 拥有角色最高vip等级
+     */
+    private Integer roleVipMax;
+
+    /**
+     * 开始玩时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 最后玩时间
+     */
+    private LocalDateTime updateTime;
+}

+ 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
-}

+ 138 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/UserVO.java

@@ -0,0 +1,138 @@
+package com.zanxiang.manage.domain.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-04
+ * @description : 用户详细信息
+ */
+@ApiModel
+@Data
+public class UserVO {
+
+    /**
+     * 玩家id
+     */
+    @ApiModelProperty(notes = "玩家id")
+    private Long id;
+
+    /**
+     * 用户名
+     */
+    @ApiModelProperty(notes = "用户名")
+    private String username;
+
+    /**
+     * 密码
+     */
+    @ApiModelProperty(notes = "密码")
+    private String password;
+
+    /**
+     * 最高vip
+     */
+    @ApiModelProperty(notes = "最高vip")
+    private Integer vipMax;
+
+    /**
+     * 昵称
+     */
+    @ApiModelProperty(notes = "昵称")
+    private String nickname;
+
+    /**
+     * 真实姓名
+     */
+    @ApiModelProperty(notes = "真实姓名")
+    private String realName;
+
+    /**
+     * 生日
+     */
+    @ApiModelProperty(notes = "生日")
+    private String birthday;
+
+    /**
+     * 性别
+     */
+    @ApiModelProperty(notes = "性别")
+    private Integer sex;
+
+    /**
+     * 证件号码
+     */
+    @ApiModelProperty(notes = "证件号码")
+    private String idCard;
+
+    /**
+     * 注册手机号
+     */
+    @ApiModelProperty(notes = "注册手机号")
+    private String regMobile;
+
+    /**
+     * 注册邮箱
+     */
+    @ApiModelProperty(notes = "注册邮箱")
+    private String regEmail;
+
+    /**
+     * 绑定支付宝
+     */
+    @ApiModelProperty(notes = "绑定支付宝")
+    private String aliPay;
+
+    /**
+     * 地址
+     */
+    @ApiModelProperty(notes = "地址")
+    private String address;
+
+    /**
+     * 注册来源
+     */
+    @ApiModelProperty(notes = "注册来源")
+    private String regFrom;
+
+    /**
+     * 渠道
+     */
+    @ApiModelProperty(notes = "渠道")
+    private String channelName;
+
+    /**
+     * 注册游戏
+     */
+    @ApiModelProperty(notes = "注册游戏")
+    private String regGame;
+
+    /**
+     * -1 为冻结状态, 1 为试玩状态 2为正常状态
+     */
+    @ApiModelProperty(notes = "状态 , -1 为冻结, 1 为试玩 2为正常")
+    private Integer status;
+
+    /**
+     * 设备id
+     */
+    @ApiModelProperty(notes = "设备码")
+    private String deviceId;
+
+    /**
+     * 注册IP
+     */
+    @ApiModelProperty(notes = "注册IP")
+    private String regIp;
+
+    /**
+     * 注册时间
+     */
+    @ApiModelProperty(notes = "注册时间")
+    private LocalDateTime createTime;
+
+}

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

@@ -1,6 +1,7 @@
 package com.zanxiang.manage.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zanxiang.manage.domain.dto.ChannelDTO;
 import com.zanxiang.manage.domain.vo.ChannelChoiceVO;
 import com.zanxiang.mybatis.entity.Channel;
 
@@ -19,4 +20,12 @@ public interface ChannelService extends IService<Channel> {
      * @return : 返回所有cp信息
      */
     List<ChannelChoiceVO> choiceList();
+
+    /**
+     * 根据主键id查询
+     *
+     * @param id : 主键id
+     * @return : 返回渠道信息
+     */
+    ChannelDTO getById(Long id);
 }

+ 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);
+}

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

@@ -0,0 +1,30 @@
+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;
+import com.zanxiang.manage.domain.vo.GameUserVO;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-04
+ * @description : 玩家游戏
+ */
+public interface GameUserService {
+
+    /**
+     * 查询玩家游戏列表
+     *
+     * @param param : 玩家游戏列表参数
+     * @return : 返回单页数据
+     */
+    IPage<GameUserListVO> gameUserList(GameUserListParam param);
+
+    /**
+     * 获取指定用户对应vip等级最高的用户信息
+     *
+     * @param userId : 用户信息
+     * @return : 返回玩家信息
+     */
+    GameUserVO getMaxVipGameUser(Long userId);
+}

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

@@ -1,6 +1,8 @@
 package com.zanxiang.manage.service.Impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zanxiang.common.utils.bean.BeanUtils;
+import com.zanxiang.manage.domain.dto.ChannelDTO;
 import com.zanxiang.manage.domain.vo.ChannelChoiceVO;
 import com.zanxiang.manage.service.ChannelService;
 import com.zanxiang.mybatis.entity.Channel;
@@ -35,4 +37,15 @@ public class ChannelServiceImpl extends ServiceImpl<ChannelMapper, Channel> impl
                 .channelSign("SZQhuoreshouyouxinzhanbaoJL(szq-奇迹战神-火热手游新战报-激励-巨网)").build();
         return Arrays.asList(choice1, choice2);
     }
+
+    /**
+     * 根据主键id查询
+     *
+     * @param id : 主键id
+     * @return : 返回渠道信息
+     */
+    @Override
+    public ChannelDTO getById(Long id) {
+        return BeanUtils.copy(super.getById(id), ChannelDTO.class);
+    }
 }

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

@@ -3,14 +3,20 @@ package com.zanxiang.manage.service.Impl;
 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;
 import com.zanxiang.mybatis.mapper.GameMapper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
+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.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.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;
+    }
+}

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

@@ -0,0 +1,137 @@
+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.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.domain.vo.GameUserVO;
+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.*;
+
+/**
+ * @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;
+    }
+
+    /**
+     * 获取指定用户对应vip等级最高的用户信息
+     *
+     * @param userId : 用户信息
+     * @return : 返回玩家信息
+     */
+    @Override
+    public GameUserVO getMaxVipGameUser(Long userId) {
+        List<GameUser> gameUserList = super.list(new LambdaQueryWrapper<GameUser>()
+                .eq(GameUser::getUserId, userId)
+                .select(GameUser::getUserId, GameUser::getRoleVipMax)
+                .orderByDesc(GameUser::getRoleVipMax));
+        return BeanUtils.copy(gameUserList.get(0), GameUserVO.class);
+    }
+}

+ 9 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserAddressServiceImpl.java

@@ -0,0 +1,9 @@
+package com.zanxiang.manage.service.Impl;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-05
+ * @description : 用户地址
+ */
+public class UserAddressServiceImpl {
+}

+ 61 - 4
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.core.toolkit.CollectionUtils;
 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;
     }
 
+
 }

+ 107 - 5
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserServiceImpl.java

@@ -1,19 +1,29 @@
 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.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zanxiang.common.exception.BaseException;
 import com.zanxiang.common.utils.bean.BeanUtils;
+import com.zanxiang.manage.domain.dto.ChannelDTO;
+import com.zanxiang.manage.domain.dto.GameDTO;
 import com.zanxiang.manage.domain.dto.UserDTO;
-import com.zanxiang.manage.service.UserService;
+import com.zanxiang.manage.domain.dto.UserExtDTO;
+import com.zanxiang.manage.domain.vo.GameUserVO;
+import com.zanxiang.manage.domain.vo.UserVO;
+import com.zanxiang.manage.service.*;
 import com.zanxiang.mybatis.entity.User;
 import com.zanxiang.mybatis.mapper.UserMapper;
 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.util.Collections;
 import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 /**
  * @author : lingfeng
@@ -24,16 +34,108 @@ import java.util.List;
 @Service
 public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
 
+    @Autowired
+    private UserExtService userExtService;
+
+    @Autowired
+    private GameService gameService;
+
+    @Autowired
+    private ChannelService channelService;
+
+    @Autowired
+    private GameUserService gameUserService;
+
+    /**
+     * 查询玩家详细信息
+     *
+     * @param userId : 用户id
+     * @return : 返回用户信息
+     */
+    @Override
+    public UserVO getUserInfo(Long userId) {
+        //查询用户信息
+        User user = super.getById(userId);
+        if (user == null) {
+            throw new BaseException("用户信息不存在!");
+        }
+        //查询用户拓展信息
+        UserExtDTO userExtDTO = userExtService.getById(userId);
+        if (userExtDTO == null) {
+            throw new BaseException("用户拓展信息不存在!");
+        }
+        UserVO userVO = BeanUtils.copy(user, UserVO.class);
+        //拓展信息补充
+        userVO.setRealName(userExtDTO.getRealName());
+        userVO.setBirthday(userExtDTO.getBirthday());
+        userVO.setSex(userExtDTO.getSex());
+        userVO.setIdCard(userExtDTO.getIdCard());
+        userVO.setRegMobile(userExtDTO.getRegMobile());
+        userVO.setRegEmail(userExtDTO.getRegEmail());
+        userVO.setRegFrom(userExtDTO.getRegFrom());
+        userVO.setRegIp(userExtDTO.getRegIp());
+        //注册游戏
+        GameDTO gameDTO = gameService.getById(userExtDTO.getRegGameId());
+        if (gameDTO != null) {
+            userVO.setRegGame(gameDTO.getName());
+        }
+        //渠道
+        ChannelDTO channelDTO = channelService.getById(user.getAgentId());
+        if (channelDTO != null) {
+            userVO.setChannelName(channelDTO.getChannelName());
+        }
+        //vip等级
+        GameUserVO maxVipGameUser = gameUserService.getMaxVipGameUser(userId);
+        if (maxVipGameUser != null){
+            userVO.setVipMax(maxVipGameUser.getRoleVipMax());
+        }
+        //地址
+        userVO.setAddress("贝达梦工厂E座二楼趣程科技");
+        return userVO;
+    }
+
+
+    /**
+     * 玩家相关条件查询用户信息
+     *
+     * @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);
+
     /**
      * 获取玩家实名认证列表
      *

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

@@ -2,9 +2,11 @@ package com.zanxiang.manage.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.zanxiang.manage.domain.dto.UserDTO;
+import com.zanxiang.manage.domain.vo.UserVO;
 import com.zanxiang.mybatis.entity.User;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author : lingfeng
@@ -13,14 +15,32 @@ import java.util.List;
  */
 public interface UserService extends IService<User> {
 
+    /**
+     * 查询玩家详细信息
+     */
+    UserVO getUserInfo(Long userId);
+
+    /**
+     * 玩家相关条件查询用户信息
+     *
+     * @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查询信息

+ 16 - 16
game-module/game-manage/src/main/resources/bootstrap.yml

@@ -12,22 +12,22 @@ spring:
     # 环境配置
     active: dev
   cloud:
-    nacos:
-      discovery:
-        namespace: DEV_game
-        # 服务注册地址
-        server-addr: 118.178.187.109:8848
-      config:
-        namespace: DEV_game
-        # 配置中心地址
-        server-addr: 118.178.187.109:8848
-        # 配置文件格式
-        file-extension: yml
-        # 配置文件分组
-        group: GAME
-        # 共享配置
-        shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
-        max-retry: 10
+#    nacos:
+#      discovery:
+#        namespace: DEV_game
+#        # 服务注册地址
+#        server-addr: 118.178.187.109:8848
+#      config:
+#        namespace: DEV_game
+#        # 配置中心地址
+#        server-addr: 118.178.187.109:8848
+#        # 配置文件格式
+#        file-extension: yml
+#        # 配置文件分组
+#        group: GAME
+#        # 共享配置
+#        shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
+#        max-retry: 10
 
   #数据库配置
   datasource:

+ 2 - 2
game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/Game.java

@@ -45,12 +45,12 @@ public class Game {
     /**
      * 游戏标签
      */
-    private String tags;
+    private Long tags;
 
     /**
      * 游戏类型
      */
-    private String category;
+    private Long category;
 
     /**
      * 游戏类别

+ 37 - 2
game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/GameUser.java

@@ -58,9 +58,44 @@ public class GameUser {
     private Boolean status;
 
     /**
-     * 累计充值
+     * 充值次数
      */
-    private BigDecimal sumMoney;
+    private Integer rechargeCount;
+
+    /**
+     * 充值金额
+     */
+    private BigDecimal rechargeMoney;
+
+    /**
+     * 最近充值时间
+     */
+    private LocalDateTime lastRechargeTime;
+
+    /**
+     * 平台币余额
+     */
+    private BigDecimal platformCoin;
+
+    /**
+     * 是否GS
+     */
+    private Boolean isGs;
+
+    /**
+     * 客服id
+     */
+    private Long customerId;
+
+    /**
+     * 创角数
+     */
+    private Integer roleCount;
+
+    /**
+     * 拥有角色最高vip等级
+     */
+    private Integer roleVipMax;
 
     /**
      * 开始玩时间

+ 22 - 5
game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/GameUserRole.java

@@ -3,8 +3,10 @@ package com.zanxiang.mybatis.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.*;
 
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
 /**
@@ -69,17 +71,32 @@ public class GameUserRole {
     /**
      * 角色VIP
      */
-    private Long roleVip;
+    private Long roleVipLevel;
 
     /**
-     * 金钱
+     * 玩家角色战力
      */
-    private Double money;
+    private Long rolePower;
 
     /**
-     * 玩家角色战力
+     * 平台币余额
+     */
+    private BigDecimal platformCoin;
+
+    /**
+     * 充值金额
+     */
+    private BigDecimal rechargeMoney;
+
+    /**
+     * 充值次数
+     */
+    private Integer rechargeCount;
+
+    /**
+     * 最近充值时间
      */
-    private Long combatNum;
+    private LocalDateTime lastRechargeTime;
 
     /**
      * 扩展信息

+ 5 - 0
game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/User.java

@@ -56,6 +56,11 @@ public class User {
      */
     private String mobile;
 
+    /**
+     * 绑定支付宝账号
+     */
+    private String aliPay;
+
     /**
      * 设备来源 mobile,android,iphone,ipad,web,pc,mac,wxapp
      */

+ 71 - 0
game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/UserAddress.java

@@ -0,0 +1,71 @@
+package com.zanxiang.mybatis.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-05
+ * @description : 用户收货地址
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@ToString
+@Builder
+@TableName("h_user_address")
+public class UserAddress {
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 用户id
+     */
+    private Long userId;
+
+    /**
+     * 手机号
+     */
+    private String mobile;
+
+    /**
+     * 邮箱
+     */
+    private String email;
+
+    /**
+     * 是否默认
+     */
+    private Boolean isDefault;
+
+    /**
+     * 收货地址
+     */
+    private String address;
+
+    /**
+     * 1:删除,0: 正常
+     */
+    @TableLogic
+    private Integer isDelete;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+}

+ 22 - 2
game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/UserExt.java

@@ -41,9 +41,14 @@ public class UserExt {
     private String regEmail;
 
     /**
-     * 真实姓名
+     * 注册游戏id
      */
-    private String realName;
+    private Long regGameId;
+
+    /**
+     * 注册来源
+     */
+    private String regFrom;
 
     /**
      * 是否实名认证
@@ -60,6 +65,21 @@ public class UserExt {
      */
     private String idCard;
 
+    /**
+     * 真实姓名
+     */
+    private String realName;
+
+    /**
+     * 生日
+     */
+    private String birthday;
+
+    /**
+     * 性别, 0 : 未知, 1 : 男, 2 : 女
+     */
+    private Integer sex;
+
     /**
      * 实名认证平台, 1 国家网络防沉迷
      */

+ 12 - 0
game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/mapper/UserAddressMapper.java

@@ -0,0 +1,12 @@
+package com.zanxiang.mybatis.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zanxiang.mybatis.entity.UserAddress;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-05
+ * @description : ${description}
+ */
+public interface UserAddressMapper extends BaseMapper<UserAddress> {
+}

+ 4 - 0
game-module/game-mybatis/src/main/resources/mapper/UserAddressMapper.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zanxiang.mybatis.mapper.UserAddressMapper">
+</mapper>

+ 2 - 10
game-module/game-sdk/src/main/java/com/zanxiang/sdk/common/util/RegisterUtil.java

@@ -1,12 +1,8 @@
 package com.zanxiang.sdk.common.util;
 
-import com.alibaba.nacos.common.utils.MD5Utils;
 import com.zanxiang.common.enums.HttpStatusEnum;
-import com.zanxiang.common.exception.BaseException;
 import org.apache.logging.log4j.util.Strings;
 
-import java.security.NoSuchAlgorithmException;
-
 /**
  * @author : lingfeng
  * @time : 2022-06-22
@@ -122,11 +118,7 @@ public class RegisterUtil {
      */
     public static String cmfPassword(String password) {
         String passwordSalt = password + CMF_PASSWORD_SALT;
-        try {
-            return "###" + MD5Utils.md5Hex(MD5Utils.md5Hex(passwordSalt.getBytes()).getBytes());
-        } catch (NoSuchAlgorithmException e) {
-            e.printStackTrace();
-            throw new BaseException("密码加密异常");
-        }
+        String charsetName = "UTF-8";
+        return "###" + MD5Util.MD5Encode(MD5Util.MD5Encode(passwordSalt, charsetName), charsetName);
     }
 }

+ 3 - 2
game-module/game-sdk/src/main/java/com/zanxiang/sdk/controller/PayController.java

@@ -1,9 +1,9 @@
 package com.zanxiang.sdk.controller;
 
-import com.alibaba.nacos.common.utils.IPUtil;
 import com.zanxiang.common.domain.ResultMap;
 import com.zanxiang.common.enums.HttpStatusEnum;
 import com.zanxiang.common.enums.PayWayEnum;
+import com.zanxiang.common.utils.IpUtils;
 import com.zanxiang.common.utils.StringUtils;
 import com.zanxiang.sdk.common.annotation.ValidLogin;
 import com.zanxiang.sdk.domain.bo.PlatformOrderBO;
@@ -71,7 +71,8 @@ public class PayController {
         bo.setGameId(product.getGameId());
         bo.setUserId(userId);
         bo.setPayDevice(userData.getDeviceType());
-        bo.setSpbillCreateIp(IPUtil.localHostIP());
+        //todo : 工具类做了修改
+        bo.setSpbillCreateIp(IpUtils.getHostIp());
         bo.setOutTradeNo(product.getOrderId());
         bo.setPayWay(product.getPayWay());
         return payService.payCreate(bo);

+ 0 - 1
game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/Impl/RegisterLoginServiceImpl.java

@@ -268,7 +268,6 @@ public class RegisterLoginServiceImpl implements RegisterLoginService {
         //创建用户信息
         User user = User.builder()
                 .username(mobile)
-                .regMobile(mobile)
                 .mobile(mobile)
                 .password(RegisterUtil.cmfPassword(password))
                 .deviceId(registerMobileParam.getDeviceId())

+ 4 - 10
game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/Impl/UserTokenServiceImpl.java

@@ -1,26 +1,24 @@
 package com.zanxiang.sdk.service.Impl;
 
-import com.alibaba.nacos.common.utils.CollectionUtils;
-import com.alibaba.nacos.common.utils.MD5Utils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.common.enums.ExpireTimeEnum;
 import com.zanxiang.common.enums.HttpStatusEnum;
-import com.zanxiang.common.exception.BaseException;
 import com.zanxiang.common.text.UUID;
 import com.zanxiang.common.utils.DateUtils;
 import com.zanxiang.common.utils.bean.BeanUtils;
 import com.zanxiang.mybatis.entity.UserToken;
 import com.zanxiang.mybatis.mapper.UserTokenMapper;
 import com.zanxiang.sdk.common.constant.RedisKeyConstant;
+import com.zanxiang.sdk.common.util.MD5Util;
 import com.zanxiang.sdk.common.util.RedisUtil;
 import com.zanxiang.sdk.domain.dto.UserTokenDTO;
 import com.zanxiang.sdk.service.UserTokenService;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.security.NoSuchAlgorithmException;
 import java.time.LocalDateTime;
 import java.util.List;
 import java.util.Objects;
@@ -192,13 +190,9 @@ public class UserTokenServiceImpl extends ServiceImpl<UserTokenMapper, UserToken
     private String createToken(Long userId, Integer deviceType) {
         //生成随机数
         String random = userId + deviceType + UUID.randomUUID().toString() + System.currentTimeMillis();
+        String charsetName = "UTF-8";
         //创建token
-        try {
-            return MD5Utils.md5Hex(MD5Utils.md5Hex(random.getBytes()).getBytes());
-        } catch (NoSuchAlgorithmException e) {
-            e.printStackTrace();
-            throw new BaseException("生成token异常");
-        }
+        return MD5Util.MD5Encode(MD5Util.MD5Encode(random, charsetName), charsetName);
     }
 
     /**

+ 1 - 1
game-module/game-sdk/src/main/java/com/zanxiang/sdk/service/Impl/WordCheckServiceImpl.java

@@ -1,7 +1,7 @@
 package com.zanxiang.sdk.service.Impl;
 
-import com.alibaba.nacos.common.utils.CollectionUtils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.mybatis.entity.WordCheck;
 import com.zanxiang.mybatis.mapper.WordCheckMapper;