Browse Source

feat : 玩家接口完成代码提交

bilingfeng 2 years ago
parent
commit
03c5ac28f9
24 changed files with 551 additions and 59 deletions
  1. 2 2
      game-module/game-common/src/main/java/com/zanxiang/common/enums/GameCategoryEnum.java
  2. 11 3
      game-module/game-manage/src/main/java/com/zanxiang/manage/controller/GameController.java
  3. 6 6
      game-module/game-manage/src/main/java/com/zanxiang/manage/controller/UserController.java
  4. 0 5
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/UserDTO.java
  5. 71 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/params/GameListParam.java
  6. 99 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameListVO.java
  7. 25 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GamePayWayVO.java
  8. 31 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameStrategyVO.java
  9. 5 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/UserListVO.java
  10. 9 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameCategoryService.java
  11. 12 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/GamePayWayService.java
  12. 11 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameService.java
  13. 6 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameStrategyService.java
  14. 16 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameCategoryServiceImpl.java
  15. 12 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GamePayWayServiceImpl.java
  16. 69 4
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameServiceImpl.java
  17. 14 7
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameStrategyServiceImpl.java
  18. 1 1
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameUserRoleServiceImpl.java
  19. 1 1
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameUserServiceImpl.java
  20. 25 20
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserExtServiceImpl.java
  21. 89 8
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserServiceImpl.java
  22. 10 1
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/UserExtService.java
  23. 21 1
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/Game.java
  24. 5 0
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/User.java

+ 2 - 2
game-module/game-common/src/main/java/com/zanxiang/common/enums/GameCategoryEnum.java

@@ -13,12 +13,12 @@ import lombok.Getter;
 public enum GameCategoryEnum {
 
     /**
-     * 苹果正版sdk
+     * 游戏类型(微信小游戏/抖音小游戏/h5/app等)
      */
     GAME_TYPE(1, "游戏类型(微信小游戏/抖音小游戏/h5/app等)"),
 
     /**
-     * 苹果免越狱sdk
+     * 游戏分类(策略游戏/卡牌游戏/)
      */
     GAME_LABEL(2, "游戏分类(策略游戏/卡牌游戏/)");
 

+ 11 - 3
game-module/game-manage/src/main/java/com/zanxiang/manage/controller/GameController.java

@@ -1,7 +1,10 @@
 package com.zanxiang.manage.controller;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.zanxiang.common.domain.ResultVo;
+import com.zanxiang.manage.domain.params.GameListParam;
 import com.zanxiang.manage.domain.vo.GameChoiceVO;
+import com.zanxiang.manage.domain.vo.GameListVO;
 import com.zanxiang.manage.service.GameService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -9,9 +12,7 @@ import io.swagger.annotations.ApiResponse;
 import io.swagger.annotations.ApiResponses;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
@@ -29,6 +30,13 @@ public class GameController {
     @Autowired
     private GameService gameService;
 
+    @ApiOperation(value = "游戏列表查询")
+    @PostMapping(value = "/list")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameListVO.class)})
+    public ResultVo<IPage<GameListVO>> gameList(@RequestBody GameListParam param) {
+        return new ResultVo<>(gameService.gameList(param));
+    }
+
     @ApiOperation(value = "游戏选择列表查询")
     @GetMapping(value = "/choice/list")
     @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameChoiceVO.class, responseContainer = "list")})

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

@@ -53,12 +53,12 @@ public class UserController {
     @Autowired
     private OrderService orderService;
 
-//    @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 = "/list")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = UserListVO.class)})
+    public ResultVo<IPage<UserListVO>> list(@Validated @RequestBody UserListParam param) {
+        return ResultVo.ok(userService.list(param));
+    }
 
     @ApiOperation(value = "玩家信息编辑")
     @PostMapping(value = "/update")

+ 0 - 5
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/UserDTO.java

@@ -82,11 +82,6 @@ public class UserDTO {
      */
     private String avatar;
 
-    /**
-     * 渠道
-     */
-    private Long channel;
-
     /**
      * 注册时间
      */

+ 71 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/params/GameListParam.java

@@ -0,0 +1,71 @@
+package com.zanxiang.manage.domain.params;
+
+import com.zanxiang.common.base.BasePage;
+import com.zanxiang.mybatis.entity.Game;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-06
+ * @description : 游戏列表查询参数
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class GameListParam extends BasePage<Game> {
+
+    /**
+     * cp名称对应的id
+     */
+    @ApiModelProperty(notes = "cp名称对应的id")
+    private Long cpId;
+
+    /**
+     * 游戏名称对应的id
+     */
+    @ApiModelProperty(notes = "游戏名称对应的id")
+    private Long gameId;
+
+    /**
+     * 是否父游戏
+     */
+    @ApiModelProperty(notes = "是否父游戏")
+    private Boolean isParentGame;
+
+    /**
+     * 游戏应用类型对应的id
+     */
+    @ApiModelProperty(notes = "游戏应用类型对应的id")
+    private Long gameCategoryId;
+
+    /**
+     * 关联h5游戏id
+     */
+    @ApiModelProperty(notes = "关联h5游戏id")
+    private Long h5GameId;
+
+    /**
+     * 关联导量游戏id
+     */
+    @ApiModelProperty(notes = "关联导量游戏id")
+    private Long guideGameId;
+
+    /**
+     * 游戏分类id
+     */
+    @ApiModelProperty(notes = "游戏分类id")
+    private Long gameClassifyId;
+
+    /**
+     * 是否父标签
+     */
+    @ApiModelProperty(notes = "是否父标签")
+    private Boolean isParentClassify;
+
+    /**
+     * 上线状态1 接入中, 2 可上线, 3 已下线
+     */
+    @ApiModelProperty(notes = "上线状态1 接入中, 2 可上线, 3 已下线")
+    private Integer status;
+}

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

@@ -0,0 +1,99 @@
+package com.zanxiang.manage.domain.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-06
+ * @description : 游戏列表展示
+ */
+@Data
+public class GameListVO {
+
+    /**
+     * 游戏ID
+     */
+    @ApiModelProperty(notes = "游戏ID")
+    private Long id;
+
+    /**
+     * 游戏名称
+     */
+    @ApiModelProperty(notes = "游戏名称")
+    private String name;
+
+    /**
+     * 游戏类型id
+     */
+    @ApiModelProperty(notes = "游戏类型id")
+    private Long category;
+
+    /**
+     * CPID
+     */
+    @ApiModelProperty(notes = "CPID")
+    private Long cpId;
+
+    /**
+     * 分成比例
+     */
+    @ApiModelProperty(notes = "分成比例")
+    private Double shareScale;
+
+    /**
+     * 游戏类别
+     */
+    @ApiModelProperty(notes = "游戏类别id")
+    private Integer classify;
+
+    /**
+     * 是否父游戏
+     */
+    @ApiModelProperty(notes = "是否主游戏")
+    private Boolean isParentGame;
+
+    /**
+     * 主游戏id
+     */
+    @ApiModelProperty(notes = "主游戏id")
+    private Long parentId;
+
+    /**
+     * 关联h5游戏id
+     */
+    @ApiModelProperty(notes = "关联h5游戏id")
+    private Long h5GameId;
+
+    /**
+     * 关联导量游戏id
+     */
+    @ApiModelProperty(notes = "关联导量游戏id")
+    private Long guideGameId;
+
+    /**
+     * 支付方式列表
+     */
+    @ApiModelProperty(notes = "支付方式列表")
+    private List<GamePayWayVO> gamePayWayVOList;
+
+    /**
+     * 游戏订单起量切换以及规则配置
+     */
+    @ApiModelProperty(notes = "游戏订单起量切换以及规则配置")
+    private List<GameStrategyVO> gameStrategyVOList;
+
+    /**
+     * CP回调地址
+     */
+    @ApiModelProperty(notes = "CP回调地址")
+    private String cpPaybackUrl;
+
+    /**
+     * 游戏地址
+     */
+    @ApiModelProperty(notes = "游戏地址")
+    private String gameUrl;
+}

+ 25 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GamePayWayVO.java

@@ -0,0 +1,25 @@
+package com.zanxiang.manage.domain.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-06
+ * @description : 游戏支付方式
+ */
+@Data
+public class GamePayWayVO {
+
+    /**
+     * 主键id
+     */
+    @ApiModelProperty(notes = "支付方式id")
+    private String id;
+
+    /**
+     * 支付方式自定义别名(为空时则展示支付方式+游戏名称)
+     */
+    @ApiModelProperty(notes = "支付方式名称")
+    private String payWayName;
+}

+ 31 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameStrategyVO.java

@@ -0,0 +1,31 @@
+package com.zanxiang.manage.domain.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-07-06
+ * @description : 游起起量规则配置
+ */
+@Data
+public class GameStrategyVO {
+
+    /**
+     * 配置id
+     */
+    @ApiModelProperty(notes = "配置id")
+    private Long id;
+
+    /**
+     * 策略名称
+     */
+    @ApiModelProperty(notes = "订单起量切换规则")
+    private String name;
+
+    /**
+     * 状态 0正常 1不可用
+     */
+    @ApiModelProperty(notes = "状态 , 0 : 开启, 1 : 关闭")
+    private Integer status;
+}

+ 5 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/UserListVO.java

@@ -176,5 +176,10 @@ public class UserListVO {
     @ApiModelProperty(notes = "玩家状态, -1 为冻结状态, 1 为试玩状态 2为正常状态")
     private Integer status;
 
+    /**
+     * 证件号码
+     */
+    @ApiModelProperty(notes = "证件号码")
+    private String idCard;
 
 }

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

@@ -17,6 +17,15 @@ import java.util.List;
  */
 public interface GameCategoryService extends IService<GameCategory> {
 
+    /**
+     * 根据主键id查询分类以及子分类
+     *
+     * @param id   : 主键id
+     * @param type : 类型
+     * @return : 返回游戏分类信息
+     */
+    List<GameCategoryVO> listById(Long id, Integer type);
+
     /**
      * 根据主键id查询
      *

+ 12 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/GamePayWayService.java

@@ -5,8 +5,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.zanxiang.manage.domain.params.GamePayWayListParam;
 import com.zanxiang.manage.domain.params.GamePayWayParam;
 import com.zanxiang.manage.domain.vo.GamePayWayListVO;
+import com.zanxiang.manage.domain.vo.GamePayWayVO;
 import com.zanxiang.mybatis.entity.GamePayWay;
 
+import java.util.List;
+
 /**
  * 游戏支付配置表 服务类接口
  *
@@ -14,6 +17,15 @@ import com.zanxiang.mybatis.entity.GamePayWay;
  * @date 2022-06-30 14:22
  */
 public interface GamePayWayService extends IService<GamePayWay> {
+
+    /**
+     * 根据游戏id查询
+     *
+     * @param gameId
+     * @return
+     */
+    List<GamePayWayVO> getByGameId(Long gameId);
+
     /**
      * 游戏配置更新/保存/删除
      *

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

@@ -1,8 +1,11 @@
 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.GameDTO;
+import com.zanxiang.manage.domain.params.GameListParam;
 import com.zanxiang.manage.domain.vo.GameChoiceVO;
+import com.zanxiang.manage.domain.vo.GameListVO;
 import com.zanxiang.mybatis.entity.Game;
 
 import java.util.List;
@@ -15,6 +18,14 @@ import java.util.Map;
  */
 public interface GameService extends IService<Game> {
 
+    /**
+     * 查询游戏列表
+     *
+     * @param param : 游戏列表查询参数
+     * @return : 返回单页游戏游戏列表数据
+     */
+    IPage<GameListVO> gameList(GameListParam param);
+
     /**
      * 游戏选择列表查询
      *

+ 6 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameStrategyService.java

@@ -5,8 +5,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.zanxiang.manage.domain.params.GameStrategyListParam;
 import com.zanxiang.manage.domain.params.GameStrategyParam;
 import com.zanxiang.manage.domain.vo.GameStrategyListVO;
+import com.zanxiang.manage.domain.vo.GameStrategyVO;
 import com.zanxiang.mybatis.entity.GameStrategy;
 
+import java.util.List;
+
 /**
  * 游戏策略 服务类接口
  *
@@ -14,6 +17,9 @@ import com.zanxiang.mybatis.entity.GameStrategy;
  * @date 2022-07-01 11:38
  */
 public interface GameStrategyService extends IService<GameStrategy> {
+
+    List<GameStrategyVO> getByGameId(Long gameId);
+
     Boolean saveOrUpdate(GameStrategyParam bo);
 
     IPage<GameStrategyListVO> list(GameStrategyListParam bo);

+ 16 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameCategoryServiceImpl.java

@@ -31,6 +31,22 @@ import java.util.Objects;
 @Service
 public class GameCategoryServiceImpl extends ServiceImpl<GameCategoryMapper, GameCategory> implements GameCategoryService {
 
+    /**
+     * 根据主键id查询分类以及子分类
+     *
+     * @param id   : 主键id
+     * @param type : 类型
+     * @return : 返回游戏分类信息
+     */
+    @Override
+    public List<GameCategoryVO> listById(Long id, Integer type) {
+        List<GameCategory> gameCategoryList = super.list(new LambdaQueryWrapper<GameCategory>()
+                .eq(GameCategory::getType, type)
+                .and(q -> q.eq(GameCategory::getId, id)
+                        .or().eq(GameCategory::getParentId, id)));
+        return BeanUtils.copyList(gameCategoryList, GameCategoryVO.class);
+    }
+
     /**
      * 根据主键id查询
      *

+ 12 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GamePayWayServiceImpl.java

@@ -1,5 +1,6 @@
 package com.zanxiang.manage.service.Impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -10,12 +11,15 @@ import com.zanxiang.manage.domain.mapper.GamePayWayListMapper;
 import com.zanxiang.manage.domain.params.GamePayWayListParam;
 import com.zanxiang.manage.domain.params.GamePayWayParam;
 import com.zanxiang.manage.domain.vo.GamePayWayListVO;
+import com.zanxiang.manage.domain.vo.GamePayWayVO;
 import com.zanxiang.manage.service.GamePayWayService;
 import com.zanxiang.mybatis.entity.GamePayWay;
 import com.zanxiang.mybatis.mapper.GamePayWayMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * 游戏支付配置表 服务实现类
  *
@@ -28,6 +32,14 @@ public class GamePayWayServiceImpl extends ServiceImpl<GamePayWayMapper, GamePay
     @Autowired
     private GamePayWayListMapper gamePayWayListMapper;
 
+    @Override
+    public List<GamePayWayVO> getByGameId(Long gameId) {
+        List<GamePayWay> gamePayWayList = super.list(new LambdaQueryWrapper<GamePayWay>()
+                .eq(GamePayWay::getGameId, gameId)
+                .select(GamePayWay::getId, GamePayWay::getPayWayName));
+        return BeanUtils.copyList(gamePayWayList, GamePayWayVO.class);
+    }
+
     @Override
     public Boolean saveOrUpdate(GamePayWayParam bo) {
         if (bo.getIsDelete() != null && bo.getIsDelete() == DeleteEnum.YES.getCode()) {

+ 69 - 4
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameServiceImpl.java

@@ -1,20 +1,26 @@
 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.extension.service.impl.ServiceImpl;
+import com.zanxiang.common.enums.GameCategoryEnum;
 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.domain.params.GameListParam;
+import com.zanxiang.manage.domain.vo.*;
+import com.zanxiang.manage.service.GameCategoryService;
+import com.zanxiang.manage.service.GamePayWayService;
 import com.zanxiang.manage.service.GameService;
+import com.zanxiang.manage.service.GameStrategyService;
 import com.zanxiang.mybatis.entity.Game;
 import com.zanxiang.mybatis.mapper.GameMapper;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 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.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
@@ -27,6 +33,65 @@ import java.util.stream.Collectors;
 @Service
 public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements GameService {
 
+    @Autowired
+    private GamePayWayService gamePayWayService;
+
+    @Autowired
+    private GameStrategyService gameStrategyService;
+
+    @Autowired
+    private GameCategoryService gameCategoryService;
+
+    /**
+     * 查询游戏列表
+     *
+     * @param param : 游戏列表查询参数
+     * @return : 返回单页游戏游戏列表数据
+     */
+    @Override
+    public IPage<GameListVO> gameList(GameListParam param) {
+        //查询游戏类别
+        List<GameCategoryVO> gameCategoryVOList = new ArrayList<>();
+        if (Objects.equals(param.getIsParentClassify(), Boolean.TRUE)) {
+            gameCategoryVOList = gameCategoryService.listById(param.getGameClassifyId(), GameCategoryEnum.GAME_LABEL.getCategoryType());
+        }
+        //执行查询
+        return page(param.toPage(), new QueryWrapper<Game>().lambda()
+                .eq(param.getCpId() != null, Game::getCpId, param.getCpId())
+                .eq(param.getGameId() != null && !Objects.equals(param.getIsParentGame(), Boolean.TRUE), Game::getId, param.getGameId())
+                .and(param.getGameId() != null && Objects.equals(param.getIsParentGame(), Boolean.TRUE),
+                        qw -> qw.eq(Game::getId, param.getGameId()).or().eq(Game::getParentId, param.getGameId()))
+                .eq(param.getGameCategoryId() != null, Game::getCategory, param.getGameCategoryId())
+                .eq(param.getH5GameId() != null, Game::getH5GameId, param.getH5GameId())
+                .eq(param.getGuideGameId() != null, Game::getGuideGameId, param.getGuideGameId())
+                .eq(param.getGameClassifyId() != null && !Objects.equals(param.getIsParentClassify(), Boolean.TRUE), Game::getClassify, param.getGameClassifyId())
+                .in(param.getGameClassifyId() != null && !gameCategoryVOList.isEmpty(), Game::getClassify, param.getGameClassifyId())
+                .eq(param.getStatus() != null, Game::getStatus, param.getStatus())
+                .orderByDesc(Game::getCreateTime)
+        ).convert(this::toVo);
+    }
+
+    /**
+     * 游戏对象信息转换
+     *
+     * @param game : 游戏信息
+     * @return : 返回展示对象
+     */
+    private GameListVO toVo(Game game) {
+        if (Objects.isNull(game)) {
+            return null;
+        }
+        GameListVO gameListVO = BeanUtils.copy(game, GameListVO.class);
+        gameListVO.setIsParentGame(Objects.equals(game.getParentId(), 0L));
+        //查询支付方式列表
+        List<GamePayWayVO> gamePayWayVOList = gamePayWayService.getByGameId(game.getId());
+        gameListVO.setGamePayWayVOList(gamePayWayVOList);
+        //查询规则配置列表
+        List<GameStrategyVO> gameStrategyVOList = gameStrategyService.getByGameId(game.getId());
+        gameListVO.setGameStrategyVOList(gameStrategyVOList);
+        return gameListVO;
+    }
+
     /**
      * 游戏选择列表查询
      *

+ 14 - 7
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameStrategyServiceImpl.java

@@ -1,5 +1,6 @@
 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;
@@ -14,7 +15,11 @@ import com.zanxiang.manage.domain.mapper.GameStrategyListMapper;
 import com.zanxiang.manage.domain.params.GameStrategyListParam;
 import com.zanxiang.manage.domain.params.GameStrategyParam;
 import com.zanxiang.manage.domain.vo.GameStrategyListVO;
-import com.zanxiang.manage.service.*;
+import com.zanxiang.manage.domain.vo.GameStrategyVO;
+import com.zanxiang.manage.service.GamePayWayService;
+import com.zanxiang.manage.service.GameStrategyService;
+import com.zanxiang.manage.service.PayBoxService;
+import com.zanxiang.manage.service.PayMerchantService;
 import com.zanxiang.mybatis.entity.GamePayWay;
 import com.zanxiang.mybatis.entity.GameStrategy;
 import com.zanxiang.mybatis.entity.PayMerchant;
@@ -37,12 +42,6 @@ import java.util.stream.Collectors;
 @Service
 public class GameStrategyServiceImpl extends ServiceImpl<GameStrategyMapper, GameStrategy> implements GameStrategyService {
 
-    @Autowired
-    private GameService gameService;
-
-    @Autowired
-    private GameCategoryService gameCategoryService;
-
     @Autowired
     private GamePayWayService gamePayWayService;
 
@@ -55,6 +54,14 @@ public class GameStrategyServiceImpl extends ServiceImpl<GameStrategyMapper, Gam
     @Autowired
     private PayBoxService payBoxService;
 
+    @Override
+    public List<GameStrategyVO> getByGameId(Long gameId) {
+        List<GameStrategy> gameStrategyList = super.list(new LambdaQueryWrapper<GameStrategy>()
+                .eq(GameStrategy::getGameId, gameId)
+                .select(GameStrategy::getId, GameStrategy::getName, GameStrategy::getStatus));
+        return BeanUtils.copyList(gameStrategyList, GameStrategyVO.class);
+    }
+
     @Override
     public Boolean saveOrUpdate(GameStrategyParam bo) {
         if (bo.getIsDelete() != null && bo.getIsDelete() == DeleteEnum.YES.getCode()) {

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

@@ -173,7 +173,7 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
         if (userDTO != null) {
             gameUserRoleListVO.setUsername(userDTO.getUsername());
             gameUserRoleListVO.setNickname(userDTO.getNickname());
-            gameUserRoleListVO.setChannelId(userDTO.getChannel());
+            gameUserRoleListVO.setChannelId(userDTO.getAgentId());
         }
         UserExtDTO userExtDTO = StringUtils.isEmpty(userExtMap) ? null : userExtMap.get(gameUserRoleListVO.getUserId());
         if (userExtDTO == null) {

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

@@ -107,7 +107,7 @@ public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> i
         if (userDTO != null) {
             gameUserListVO.setNickname(userDTO.getNickname());
             gameUserListVO.setUsername(userDTO.getUsername());
-            gameUserListVO.setChannelId(userDTO.getChannel());
+            gameUserListVO.setChannelId(userDTO.getAgentId());
         }
         GameDTO gameDTO = StringUtils.isEmpty(gameMap) ? null : gameMap.get(gameUserListVO.getGameId());
         if (gameDTO == null) {

+ 25 - 20
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserExtServiceImpl.java

@@ -43,44 +43,49 @@ public class UserExtServiceImpl extends ServiceImpl<UserExtMapper, UserExt> impl
 
     /**
      * 多条件查询用户拓展信息
-     */
-    private List<UserExtDTO> getUserExtList(String realName, String regIp, Boolean isAuth) {
-        return null;
-    }
-
-    /**
-     * 注册ip相关条件查询用户拓展信息
      *
-     * @param regIp : 参数
-     * @return : 玩家信息
+     * @param realName : 真实姓名
+     * @param regIp    : 注册ip
+     * @param isAuth   : 是否实名
+     * @return : 返回用户拓展信息列表
      */
     @Override
-    public Map<Long, UserExtDTO> regIpCondition(String regIp) {
-        if (Strings.isBlank(regIp)) {
+    public Map<Long, UserExtDTO> getUserExtList(String realName, String regIp, Boolean isAuth) {
+        if (Strings.isBlank(realName) && Strings.isBlank(regIp) && isAuth == null) {
             return null;
         }
-        //玩家注册ip条件处理
-        List<UserExtDTO> userExtList = this.getByRegIp(regIp);
+        List<UserExt> userExtList = super.list(new LambdaQueryWrapper<UserExt>()
+                .eq(Strings.isNotBlank(realName), UserExt::getRealName, realName)
+                .eq(Strings.isNotBlank(regIp), UserExt::getRegIp, regIp)
+                .eq(isAuth != null, UserExt::getIsAuth, isAuth)
+                .select(UserExt::getUserId, UserExt::getRealName, UserExt::getRegIp, UserExt::getIsAuth, UserExt::getIdCard));
         if (CollectionUtils.isEmpty(userExtList)) {
             return Collections.emptyMap();
         }
-        return userExtList.stream().collect(Collectors.toMap(UserExtDTO::getUserId, Function.identity()));
+        return BeanUtils.copyList(userExtList, UserExtDTO.class).stream()
+                .collect(Collectors.toMap(UserExtDTO::getUserId, Function.identity()));
     }
 
     /**
-     * 根据玩家注册ip查询
+     * 注册ip相关条件查询用户拓展信息
      *
-     * @param regIp : 玩家注册ip
-     * @return : 返回玩家信息列表
+     * @param regIp : 参数
+     * @return : 玩家信息
      */
-    private List<UserExtDTO> getByRegIp(String regIp) {
+    @Override
+    public Map<Long, UserExtDTO> regIpCondition(String regIp) {
         if (Strings.isBlank(regIp)) {
-            return Collections.emptyList();
+            return null;
         }
+        //玩家注册ip条件处理
         List<UserExt> userExtList = super.list(new LambdaQueryWrapper<UserExt>()
                 .eq(UserExt::getRegIp, regIp)
                 .select(UserExt::getUserId, UserExt::getRegIp));
-        return BeanUtils.copyList(userExtList, UserExtDTO.class);
+        if (CollectionUtils.isEmpty(userExtList)) {
+            return Collections.emptyMap();
+        }
+        return BeanUtils.copyList(userExtList, UserExtDTO.class).stream()
+                .collect(Collectors.toMap(UserExtDTO::getUserId, Function.identity()));
     }
 
     /**

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

@@ -1,12 +1,15 @@
 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.conditions.update.LambdaUpdateWrapper;
 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.exception.BaseException;
 import com.zanxiang.common.utils.MD5Util;
+import com.zanxiang.common.utils.StringUtils;
 import com.zanxiang.common.utils.bean.BeanUtils;
 import com.zanxiang.manage.domain.dto.ChannelDTO;
 import com.zanxiang.manage.domain.dto.GameDTO;
@@ -28,9 +31,11 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.time.LocalDateTime;
+import java.time.LocalTime;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
@@ -63,7 +68,83 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
      */
     @Override
     public IPage<UserListVO> list(UserListParam param) {
-        return null;
+        //游戏条件处理
+        Map<Long, GameDTO> gameMap = gameService.gameCondition(param.getCpId(), param.getGameId(), param.getGameCategoryId());
+        //根据条件, 匹配不到游戏
+        if (gameMap != null && gameMap.isEmpty()) {
+            return new Page<>();
+        }
+        //玩家拓展信息条件
+        Map<Long, UserExtDTO> userExtMap = userExtService.getUserExtList(param.getRealName(), param.getRegIp(), param.getIsAuth());
+        if (userExtMap != null && userExtMap.isEmpty()) {
+            return new Page<>();
+        }
+        //判断指定的玩家id是否在用户列表中
+        if (param.getUserId() != null && userExtMap != null && !userExtMap.keySet().contains(param.getUserId())) {
+            return new Page<>();
+        }
+        //执行查询
+        return page(param.toPage(), new QueryWrapper<User>().lambda()
+                .eq(param.getUserId() != null, User::getId, param.getUserId())
+                .like(Strings.isNotBlank(param.getUserName()), User::getUsername, param.getUserName())
+                .like(Strings.isNotBlank(param.getNickname()), User::getNickname, param.getNickname())
+                .eq(Strings.isNotBlank(param.getMobile()), User::getMobile, param.getMobile())
+                .in(userExtMap != null, User::getId, userExtMap != null ? userExtMap.keySet() : null)
+                .isNotNull(Objects.equals(param.getIsBindMobile(), Boolean.TRUE), User::getMobile)
+                .isNull(Objects.equals(param.getIsBindMobile(), Boolean.FALSE), User::getMobile)
+                .in(gameMap != null, User::getGameId, gameMap != null ? gameMap.keySet() : null)
+                .ge(param.getBeginDate() != null, User::getCreateTime, param.getBeginDate() == null ? null : LocalDateTime.of(param.getBeginDate(), LocalTime.MIN))
+                .le(param.getEndDate() != null, User::getCreateTime, param.getEndDate() == null ? null : LocalDateTime.of(param.getEndDate(), LocalTime.MAX))
+                .ge(param.getRechargeBeginDate() != null, User::getLastRechargeTime, param.getRechargeBeginDate() == null ? null : LocalDateTime.of(param.getRechargeBeginDate(), LocalTime.MIN))
+                .le(param.getRechargeEndDate() != null, User::getLastRechargeTime, param.getRechargeEndDate() == null ? null : LocalDateTime.of(param.getRechargeEndDate(), LocalTime.MAX))
+                .gt(Objects.equals(param.getIsRecharge(), Boolean.TRUE), User::getRechargeCount, 0)
+                .eq(Objects.equals(param.getIsRecharge(), Boolean.FALSE), User::getRechargeCount, 0)
+                .eq(param.getVipLevel() != null && param.getVipLevel() <= 10, User::getVipMax, param.getVipLevel())
+                .gt(param.getVipLevel() != null && param.getVipLevel() > 10, User::getVipMax, param.getVipLevel())
+                .eq(param.getStatus() != null, User::getStatus, param.getStatus())
+                .eq(param.getChannelId() != null, User::getAgentId, param.getChannelId())
+                // todo : 归因推广账号
+                // todo : 归因投放人员
+                .eq(param.getCustomerId() != null, User::getCustomerId, param.getCustomerId())
+                // todo : 归因广告
+                .eq(param.getIsGs() != null, User::getIsGs, param.getIsGs())
+                // todo : 是否切量
+                .orderByDesc(User::getCreateTime)
+        ).convert(u -> this.toVo(u, userExtMap, gameMap));
+    }
+
+    /**
+     * 游戏玩家信息转换对象
+     *
+     * @param user       : 用户信息
+     * @param userExtMap : 用户拓展信息
+     * @param gameMap    : 游戏列表
+     * @return : 返回用户信息
+     */
+    private UserListVO toVo(User user, Map<Long, UserExtDTO> userExtMap, Map<Long, GameDTO> gameMap) {
+        UserListVO userListVO = BeanUtils.copy(user, UserListVO.class);
+        if (Objects.isNull(userListVO)) {
+            return null;
+        }
+        UserExtDTO userExtDTO = StringUtils.isEmpty(userExtMap) ? null : userExtMap.get(userListVO.getId());
+        if (userExtDTO == null) {
+            userExtDTO = userExtService.getById(userListVO.getId());
+        }
+        if (userExtDTO != null) {
+            userListVO.setRealName(userExtDTO.getRealName());
+            userListVO.setRegIp(userExtDTO.getRegIp());
+            userListVO.setIdCard(userExtDTO.getIdCard());
+        }
+        GameDTO gameDTO = StringUtils.isEmpty(gameMap) ? null : gameMap.get(userListVO.getGameId());
+        if (gameDTO == null) {
+            gameDTO = gameService.getById(userListVO.getGameId());
+        }
+        if (gameDTO != null) {
+            userListVO.setGameCategoryId(gameDTO.getCategory());
+            userListVO.setCpId(gameDTO.getCpId());
+        }
+        userListVO.setChannelId(user.getAgentId());
+        return userListVO;
     }
 
     /**
@@ -84,13 +165,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 .set(Strings.isNotBlank(param.getPassword()), User::getPassword, this.cmfPassword(param.getPassword()))
                 .set(Strings.isNotBlank(param.getMobile()) || Strings.isNotBlank(param.getAliPay())
                         || Strings.isNotBlank(param.getPassword()), User::getUpdateTime, LocalDateTime.now()));
-        //用户拓展信息更新
-        userExtService.update(new LambdaUpdateWrapper<UserExt>()
-                .eq(UserExt::getUserId, param.getUserId())
-                .set(Strings.isNotBlank(param.getRealName()), UserExt::getRealName, param.getRealName())
-                .set(Strings.isNotBlank(param.getIdCard()), UserExt::getIdCard, param.getIdCard())
-                .set(Strings.isNotBlank(param.getRealName()) || Strings.isNotBlank(param.getIdCard()), UserExt::getUpdateTime, LocalDateTime.now())
-        );
+//        //用户拓展信息更新
+//        userExtService.update(new LambdaUpdateWrapper<UserExt>()
+//                .eq(UserExt::getUserId, param.getUserId())
+//                .set(Strings.isNotBlank(param.getRealName()), UserExt::getRealName, param.getRealName())
+//                .set(Strings.isNotBlank(param.getIdCard()), UserExt::getIdCard, param.getIdCard())
+//                .set(Strings.isNotBlank(param.getRealName()) || Strings.isNotBlank(param.getIdCard()), UserExt::getUpdateTime, LocalDateTime.now())
+//        );
         return Boolean.TRUE;
     }
 

+ 10 - 1
game-module/game-manage/src/main/java/com/zanxiang/manage/service/UserExtService.java

@@ -7,7 +7,6 @@ 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;
 
 /**
@@ -17,6 +16,16 @@ import java.util.Map;
  */
 public interface UserExtService extends IService<UserExt> {
 
+    /**
+     * 多条件查询用户拓展信息
+     *
+     * @param realName : 真实姓名
+     * @param regIp    : 注册ip
+     * @param isAuth   : 是否实名
+     * @return : 返回用户拓展信息列表
+     */
+    Map<Long, UserExtDTO> getUserExtList(String realName, String regIp, Boolean isAuth);
+
     /**
      * 注册ip相关条件查询用户拓展信息
      *

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

@@ -80,7 +80,7 @@ public class Game {
     /**
      * 上线状态1 接入中, 2 可上线, 3 已下线
      */
-    private Boolean status;
+    private Integer status;
 
     /**
      * 1在线游戏 2 单机
@@ -148,6 +148,26 @@ public class Game {
      */
     private Long channel;
 
+    /**
+     * 分成比例
+     */
+    private Double shareScale;
+
+    /**
+     * 关联H5游戏id
+     */
+    private Long h5GameId;
+
+    /**
+     * 导量游戏id
+     */
+    private Long guideGameId;
+
+    /**
+     * 游戏地址
+     */
+    private String gameUrl;
+
     /**
      * 创建时间
      */

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

@@ -32,6 +32,11 @@ public class User {
      */
     private Long agentId;
 
+    /**
+     * 注册游戏id
+     */
+    private Long gameId;
+
     /**
      * 用户名
      */