瀏覽代碼

Merge remote-tracking branch 'origin/package' into package

lth 1 年之前
父節點
當前提交
47d82f015c
共有 16 個文件被更改,包括 81 次插入282 次删除
  1. 15 4
      game-module/game-module-base/src/main/java/com/zanxiang/game/module/base/pojo/enums/GameCategoryEnum.java
  2. 4 4
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/ChoiceController.java
  3. 0 12
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameCategoryChoiceVO.java
  4. 0 39
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IGameCategoryService.java
  5. 3 3
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameAppletServiceImpl.java
  6. 0 59
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameCategoryServiceImpl.java
  7. 12 13
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GamePayStrategyServiceImpl.java
  8. 8 15
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GamePayWayServiceImpl.java
  9. 5 12
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserRoleServiceImpl.java
  10. 9 9
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserServiceImpl.java
  11. 13 21
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/OrderServiceImpl.java
  12. 2 10
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserLoginLogServiceImpl.java
  13. 8 9
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserServiceImpl.java
  14. 0 58
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameCategory.java
  15. 0 12
      game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/mapper/GameCategoryMapper.java
  16. 2 2
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/CallBackServiceImpl.java

+ 15 - 4
game-module/game-module-base/src/main/java/com/zanxiang/game/module/base/pojo/enums/GameCategoryEnum.java

@@ -37,12 +37,12 @@ public enum GameCategoryEnum {
     /**
      * 应用id
      */
-    private Long category;
+    private Long id;
 
     /**
      * 游戏分类key
      */
-    private String key;
+    private String categoryKey;
 
     /**
      * 描述
@@ -56,9 +56,20 @@ public enum GameCategoryEnum {
      * @return {@link String}
      */
     public static String getNameByCategory(Long category) {
+        GameCategoryEnum gameCategory = GameCategoryEnum.getGameCategory(category);
+        return gameCategory == null ? null : gameCategory.getName();
+    }
+
+    /**
+     * 获取游戏分类
+     *
+     * @param category 类别
+     * @return {@link String}
+     */
+    public static GameCategoryEnum getGameCategory(Long category) {
         for (GameCategoryEnum gameCategoryEnum : GameCategoryEnum.values()) {
-            if (Objects.equals(gameCategoryEnum.getCategory(), category)) {
-                return gameCategoryEnum.getName();
+            if (Objects.equals(gameCategoryEnum.getId(), category)) {
+                return gameCategoryEnum;
             }
         }
         return null;

+ 4 - 4
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/ChoiceController.java

@@ -1,6 +1,7 @@
 package com.zanxiang.game.module.manage.controller;
 
 import com.zanxiang.erp.security.annotation.PreAuthorize;
+import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
 import com.zanxiang.game.module.base.pojo.enums.OsEnum;
 import com.zanxiang.game.module.base.pojo.enums.PayApplicationTypeEnum;
 import com.zanxiang.game.module.manage.enums.GameStrategyTypeEnum;
@@ -40,9 +41,6 @@ public class ChoiceController {
     @Autowired
     private IGameService gameService;
 
-    @Autowired
-    private IGameCategoryService gameCategoryService;
-
     @Autowired
     private IPayWayService payWayService;
 
@@ -105,7 +103,9 @@ public class ChoiceController {
     @PreAuthorize(permissionKey = "sdk:gameCategoryChoice:list")
     @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameCategoryChoiceVO.class, responseContainer = "list")})
     public ResultVO<List<GameCategoryChoiceVO>> gameCategoryChoiceList() {
-        return ResultVO.ok(gameCategoryService.gameCategoryChoiceList());
+        return ResultVO.ok(Arrays.stream(GameCategoryEnum.values())
+                .map(gameCategoryEnum -> BeanUtil.copy(gameCategoryEnum, GameCategoryChoiceVO.class))
+                .collect(Collectors.toList()));
     }
 
     @ApiOperation(value = "游戏分类标签选择列表")

+ 0 - 12
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameCategoryChoiceVO.java

@@ -22,16 +22,4 @@ public class GameCategoryChoiceVO {
      */
     @ApiModelProperty(notes = "名称")
     private String name;
-
-    /**
-     * 是否父标签
-     */
-    @ApiModelProperty(notes = "是否父标签")
-    private Boolean isParent;
-
-    /**
-     * 父分类id
-     */
-    @ApiModelProperty(notes = "父分类id")
-    private Long parentId;
 }

+ 0 - 39
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IGameCategoryService.java

@@ -1,39 +0,0 @@
-package com.zanxiang.game.module.manage.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.zanxiang.game.module.manage.pojo.dto.GameCategoryDTO;
-import com.zanxiang.game.module.manage.pojo.vo.GameCategoryChoiceVO;
-import com.zanxiang.game.module.mybatis.entity.GameCategory;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author : lingfeng
- * @time : 2022-06-23
- * @description : 游戏分类标签管理
- */
-public interface IGameCategoryService extends IService<GameCategory> {
-
-    /**
-     * 根据主键id查询
-     *
-     * @param id : 主键id
-     * @return {@link GameCategoryDTO}
-     */
-    GameCategoryDTO getById(Long id);
-
-    /**
-     * 查询所有应用类型列表
-     *
-     * @return {@link List}<{@link GameCategoryChoiceVO}>
-     */
-    List<GameCategoryChoiceVO> gameCategoryChoiceList();
-
-    /**
-     * 查询游戏分类和标签
-     *
-     * @return {@link Map}<{@link Long}, {@link GameCategoryDTO}>
-     */
-    Map<Long, GameCategoryDTO> gameCategoryMap();
-}

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

@@ -61,11 +61,11 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
                     .appId(gameAppletConfigDTO.getAppId())
                     .build();
             //小游戏需要创建数据源
-            if (Objects.equals(GameCategoryEnum.CATEGORY_WX_APPLET.getCategory(), game.getCategory())) {
+            if (Objects.equals(GameCategoryEnum.CATEGORY_WX_APPLET.getId(), game.getCategory())) {
 //                userActionSetRpc.create(actionSetRpcDTO);
             }
             //H5游戏要判断是否主游戏, 主游戏才投, 需要创建公众号数据源
-            if (game.getParentId() == null && Objects.equals(GameCategoryEnum.CATEGORY_H5.getCategory(), game.getCategory())) {
+            if (game.getParentId() == null && Objects.equals(GameCategoryEnum.CATEGORY_H5.getId(), game.getCategory())) {
 //                userActionSetRpc.create(actionSetRpcDTO);
             }
             gameApplet = GameApplet.builder()
@@ -100,7 +100,7 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
             gameApplet.setManager(gameAppletConfigDTO.getManager());
             gameApplet.setUpdateTime(LocalDateTime.now());
         }
-       return super.saveOrUpdate(gameApplet);
+        return super.saveOrUpdate(gameApplet);
     }
 
     @Override

+ 0 - 59
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameCategoryServiceImpl.java

@@ -1,59 +0,0 @@
-package com.zanxiang.game.module.manage.service.impl;
-
-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.game.module.manage.pojo.dto.GameCategoryDTO;
-import com.zanxiang.game.module.manage.pojo.vo.GameCategoryChoiceVO;
-import com.zanxiang.game.module.manage.service.IGameCategoryService;
-import com.zanxiang.game.module.mybatis.entity.GameCategory;
-import com.zanxiang.game.module.mybatis.mapper.GameCategoryMapper;
-import com.zanxiang.module.util.bean.BeanUtil;
-import com.zanxiang.module.util.exception.BaseException;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-/**
- * @author : lingfeng
- * @time : 2022-06-23
- * @description : 游戏应用类型
- */
-@Slf4j
-@Service
-public class GameCategoryServiceImpl extends ServiceImpl<GameCategoryMapper, GameCategory> implements IGameCategoryService {
-
-    @Override
-    public GameCategoryDTO getById(Long id) {
-        GameCategory gameCategory = super.getById(id);
-        if (gameCategory == null) {
-            throw new BaseException("参数错误, 游戏应用类型不存在");
-        }
-        return BeanUtil.copy(gameCategory, GameCategoryDTO.class);
-    }
-
-    @Override
-    public List<GameCategoryChoiceVO> gameCategoryChoiceList() {
-        return super.list().stream()
-                .map(gameCategory -> BeanUtil.copy(gameCategory, GameCategoryChoiceVO.class))
-                .collect(Collectors.toList());
-    }
-
-    @Override
-    public Map<Long, GameCategoryDTO> gameCategoryMap() {
-        List<GameCategory> gameCategoryList = list(new LambdaQueryWrapper<GameCategory>()
-                .select(GameCategory::getId, GameCategory::getName));
-        if (CollectionUtils.isEmpty(gameCategoryList)) {
-            return Collections.emptyMap();
-        }
-        return gameCategoryList.stream()
-                .map(gameCategory -> BeanUtil.copy(gameCategory, GameCategoryDTO.class))
-                .collect(Collectors.toMap(GameCategoryDTO::getId, Function.identity()));
-    }
-
-}

+ 12 - 13
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GamePayStrategyServiceImpl.java

@@ -5,15 +5,18 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.game.module.base.pojo.enums.DeleteEnum;
+import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
 import com.zanxiang.game.module.base.pojo.enums.StatusEnum;
 import com.zanxiang.game.module.manage.enums.GameStrategyTypeEnum;
-import com.zanxiang.game.module.manage.pojo.dto.GameCategoryDTO;
 import com.zanxiang.game.module.manage.pojo.dto.GameDTO;
 import com.zanxiang.game.module.manage.pojo.dto.PayMerchantDTO;
 import com.zanxiang.game.module.manage.pojo.params.GamePayStrategyAddUpdateParam;
 import com.zanxiang.game.module.manage.pojo.params.GamePayStrategyListParam;
 import com.zanxiang.game.module.manage.pojo.vo.GamePayStrategyListVO;
-import com.zanxiang.game.module.manage.service.*;
+import com.zanxiang.game.module.manage.service.IGamePayStrategyService;
+import com.zanxiang.game.module.manage.service.IGamePayWayService;
+import com.zanxiang.game.module.manage.service.IGameService;
+import com.zanxiang.game.module.manage.service.IPayMerchantService;
 import com.zanxiang.game.module.mybatis.entity.GamePayStrategy;
 import com.zanxiang.game.module.mybatis.mapper.GameStrategyMapper;
 import com.zanxiang.module.util.bean.BeanUtil;
@@ -37,9 +40,6 @@ import java.util.Set;
 @Service
 public class GamePayStrategyServiceImpl extends ServiceImpl<GameStrategyMapper, GamePayStrategy> implements IGamePayStrategyService {
 
-    @Autowired
-    private IGameCategoryService gameCategoryService;
-
     @Autowired
     private IGameService gameService;
 
@@ -98,7 +98,6 @@ public class GamePayStrategyServiceImpl extends ServiceImpl<GameStrategyMapper,
 
     @Override
     public IPage<GamePayStrategyListVO> pageList(GamePayStrategyListParam param) {
-        Map<Long, GameCategoryDTO> gameCategoryMap = gameCategoryService.gameCategoryMap();
         Map<Long, GameDTO> gameMap = gameService.gameMap();
         Map<String, PayMerchantDTO> payMerchantMap = payMerchantService.payMerchantMap();
         return super.page(param.toPage(), new LambdaQueryWrapper<GamePayStrategy>()
@@ -107,11 +106,11 @@ public class GamePayStrategyServiceImpl extends ServiceImpl<GameStrategyMapper,
                 .eq(param.getGameId() != null, GamePayStrategy::getGameId, param.getGameId())
                 .eq(param.getStatus() != null, GamePayStrategy::getStatus, param.getStatus())
                 .orderByDesc(GamePayStrategy::getCreateTime))
-                .convert(gamePayStrategy -> this.toVO(gameMap, gameCategoryMap, gamePayStrategy, payMerchantMap));
+                .convert(gamePayStrategy -> this.toVO(gameMap, gamePayStrategy, payMerchantMap));
     }
 
-    private GamePayStrategyListVO toVO(Map<Long, GameDTO> gameMap, Map<Long, GameCategoryDTO> gameCategoryMap,
-                                       GamePayStrategy gamePayStrategy, Map<String, PayMerchantDTO> payMerchantMap) {
+    private GamePayStrategyListVO toVO(Map<Long, GameDTO> gameMap, GamePayStrategy gamePayStrategy,
+                                       Map<String, PayMerchantDTO> payMerchantMap) {
         GamePayStrategyListVO gamePayStrategyListVO = BeanUtil.copy(gamePayStrategy, GamePayStrategyListVO.class);
         if (gamePayStrategyListVO == null) {
             return null;
@@ -119,11 +118,11 @@ public class GamePayStrategyServiceImpl extends ServiceImpl<GameStrategyMapper,
         gamePayStrategyListVO.setTypeName(GameStrategyTypeEnum.getNameByType(gamePayStrategyListVO.getType()));
         GameDTO gameDTO = gameMap.get(gamePayStrategyListVO.getGameId());
         if (gameDTO != null) {
-            GameCategoryDTO gameCategoryDTO = gameCategoryMap.get(gameDTO.getCategory());
             gamePayStrategyListVO.setGameName(gameDTO.getName());
-            if (gameCategoryDTO != null) {
-                gamePayStrategyListVO.setGameCategory(gameCategoryDTO.getName());
-                gamePayStrategyListVO.setGameCategoryId(gameCategoryDTO.getId());
+            GameCategoryEnum gameCategoryEnum = GameCategoryEnum.getGameCategory(gameDTO.getCategory());
+            if (gameCategoryEnum != null) {
+                gamePayStrategyListVO.setGameCategory(gameCategoryEnum.getName());
+                gamePayStrategyListVO.setGameCategoryId(gameCategoryEnum.getId());
             }
         }
         Set<String> gameMerchantNoSet = gamePayWayService.getGameMerchantNo(gamePayStrategyListVO.getGameId());

+ 8 - 15
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GamePayWayServiceImpl.java

@@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.zanxiang.game.module.base.pojo.enums.DeleteEnum;
-import com.zanxiang.game.module.base.pojo.enums.PayDeviceEnum;
-import com.zanxiang.game.module.base.pojo.enums.PayWayEnum;
-import com.zanxiang.game.module.base.pojo.enums.StatusEnum;
+import com.zanxiang.game.module.base.pojo.enums.*;
 import com.zanxiang.game.module.manage.pojo.dto.*;
 import com.zanxiang.game.module.manage.pojo.params.GamePayWayAddUpdateParam;
 import com.zanxiang.game.module.manage.pojo.params.GamePayWayListParam;
@@ -45,9 +42,6 @@ public class GamePayWayServiceImpl extends ServiceImpl<GamePayWayMapper, GamePay
     @Autowired
     private IGameAppletService gameAppletService;
 
-    @Autowired
-    private IGameCategoryService gameCategoryService;
-
     @Autowired
     private IGameService gameService;
 
@@ -149,7 +143,6 @@ public class GamePayWayServiceImpl extends ServiceImpl<GamePayWayMapper, GamePay
 
     @Override
     public IPage<GamePayWayListVO> pageList(GamePayWayListParam param) {
-        Map<Long, GameCategoryDTO> gameCategoryMap = gameCategoryService.gameCategoryMap();
         Map<Long, GameDTO> gameMap = gameService.gameMap();
         Map<Long, PayDeviceDTO> payDeviceMap = payDeviceService.payDeviceMap();
         Map<Long, PayWayDTO> payWayMap = payWayService.payWayMap();
@@ -159,11 +152,11 @@ public class GamePayWayServiceImpl extends ServiceImpl<GamePayWayMapper, GamePay
                 .eq(param.getPayWayId() != null, GamePayWay::getPayWayId, param.getPayWayId())
                 .eq(param.getStatus() != null, GamePayWay::getStatus, param.getStatus())
                 .orderByDesc(GamePayWay::getCreateTime))
-                .convert(gamePayWay -> this.toVO(gameMap, gameCategoryMap, gamePayWay, payMerchantMap, payWayMap, payDeviceMap));
+                .convert(gamePayWay -> this.toVO(gameMap, gamePayWay, payMerchantMap, payWayMap, payDeviceMap));
     }
 
-    private GamePayWayListVO toVO(Map<Long, GameDTO> gameMap, Map<Long, GameCategoryDTO> gameCategoryMap, GamePayWay gamePayWay,
-                                  Map<String, PayMerchantDTO> payMerchantMap, Map<Long, PayWayDTO> payWayMap, Map<Long, PayDeviceDTO> payDeviceMap) {
+    private GamePayWayListVO toVO(Map<Long, GameDTO> gameMap, GamePayWay gamePayWay, Map<String, PayMerchantDTO> payMerchantMap,
+                                  Map<Long, PayWayDTO> payWayMap, Map<Long, PayDeviceDTO> payDeviceMap) {
         GamePayWayListVO gamePayWayListVO = BeanUtil.copy(gamePayWay, GamePayWayListVO.class);
         if (gamePayWayListVO == null) {
             return null;
@@ -172,10 +165,10 @@ public class GamePayWayServiceImpl extends ServiceImpl<GamePayWayMapper, GamePay
         GameDTO gameDTO = gameMap.get(gamePayWayListVO.getGameId());
         if (gameDTO != null) {
             gamePayWayListVO.setGameName(gameDTO.getName());
-            GameCategoryDTO gameCategoryDTO = gameCategoryMap.get(gameDTO.getCategory());
-            if (gameCategoryDTO != null) {
-                gamePayWayListVO.setGameCategoryId(gameCategoryDTO.getId());
-                gamePayWayListVO.setGameCategory(gameCategoryDTO.getName());
+            GameCategoryEnum gameCategoryEnum = GameCategoryEnum.getGameCategory(gameDTO.getCategory());
+            if (gameCategoryEnum != null) {
+                gamePayWayListVO.setGameCategoryId(gameCategoryEnum.getId());
+                gamePayWayListVO.setGameCategory(gameCategoryEnum.getName());
             }
         }
         //支付方式和类型

+ 5 - 12
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserRoleServiceImpl.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.erp.security.util.SecurityUtil;
+import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
 import com.zanxiang.game.module.manage.pojo.dto.*;
 import com.zanxiang.game.module.manage.pojo.params.GameUserRoleListParam;
 import com.zanxiang.game.module.manage.pojo.vo.GameUserRoleListVO;
@@ -46,9 +47,6 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
     @Autowired
     private IGameUserService gameUserService;
 
-    @Autowired
-    private IGameCategoryService gameCategoryService;
-
     @Autowired
     private ICpService cpService;
 
@@ -77,11 +75,7 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
             GameDTO gameDTO = gameService.getById(role.getGameId());
             if (gameDTO != null) {
                 gameUserRoleVO.setGameName(gameDTO.getName());
-                //设置游戏列表
-                GameCategoryDTO gameCategoryDTO = gameCategoryService.getById(gameDTO.getCategory());
-                if (gameCategoryDTO != null) {
-                    gameUserRoleVO.setGameCategoryName(gameCategoryDTO.getName());
-                }
+                gameUserRoleVO.setGameCategoryName(GameCategoryEnum.getNameByCategory(gameDTO.getCategory()));
             }
             //玩家游戏信息
             GameUserVO gameUserVO = gameUserService.getById(role.getGameUserId());
@@ -126,7 +120,6 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
         //相关用户id
         Set<Long> userIdSet = userMap == null ? null : userMap.keySet();
         Map<Long, CpDTO> cpMap = cpService.cpMap();
-        Map<Long, GameCategoryDTO> gameCategoryMap = gameCategoryService.gameCategoryMap();
         Map<Long, AgentDTO> agentMap = agentDTOList.stream().collect(Collectors.toMap(AgentDTO::getId, Function.identity()));
         //执行查询
         return page(param.toPage(), new QueryWrapper<GameUserRole>().lambda()
@@ -144,11 +137,11 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
                 .ge(param.getRechargeBeginDate() != null, GameUserRole::getLastRechargeTime, param.getRechargeBeginDate() == null ? null : LocalDateTime.of(param.getRechargeBeginDate(), LocalTime.MIN))
                 .le(param.getRechargeEndDate() != null, GameUserRole::getLastRechargeTime, param.getRechargeEndDate() == null ? null : LocalDateTime.of(param.getRechargeEndDate(), LocalTime.MAX))
                 .orderByDesc(GameUserRole::getCreateTime)
-        ).convert(u -> this.toVo(u, userMap, gameMap, cpMap, gameCategoryMap, agentMap));
+        ).convert(u -> this.toVo(u, userMap, gameMap, cpMap, agentMap));
     }
 
     private GameUserRoleListVO toVo(GameUserRole gameUserRole, Map<Long, UserDTO> userMap, Map<Long, GameDTO> gameMap,
-                                    Map<Long, CpDTO> cpMap, Map<Long, GameCategoryDTO> categoryMap, Map<Long, AgentDTO> agentMap) {
+                                    Map<Long, CpDTO> cpMap, Map<Long, AgentDTO> agentMap) {
         GameUserRoleListVO gameUserRoleListVO = BeanUtil.copy(gameUserRole, GameUserRoleListVO.class);
         if (Objects.isNull(gameUserRoleListVO)) {
             return null;
@@ -175,7 +168,7 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
             gameUserRoleListVO.setCpId(gameDTO.getCpId());
             gameUserRoleListVO.setCpName(cpMap.get(gameDTO.getCpId()) == null ? null : cpMap.get(gameDTO.getCpId()).getCpName());
             gameUserRoleListVO.setGameCategoryId(gameDTO.getCategory());
-            gameUserRoleListVO.setGameCategoryName(categoryMap.get(gameDTO.getCategory()) == null ? null : categoryMap.get(gameDTO.getCategory()).getName());
+            gameUserRoleListVO.setGameCategoryName(GameCategoryEnum.getNameByCategory(gameDTO.getCategory()));
         }
         return gameUserRoleListVO;
     }

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

@@ -6,7 +6,11 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.erp.security.util.SecurityUtil;
-import com.zanxiang.game.module.manage.pojo.dto.*;
+import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
+import com.zanxiang.game.module.manage.pojo.dto.AgentDTO;
+import com.zanxiang.game.module.manage.pojo.dto.CpDTO;
+import com.zanxiang.game.module.manage.pojo.dto.GameDTO;
+import com.zanxiang.game.module.manage.pojo.dto.UserDTO;
 import com.zanxiang.game.module.manage.pojo.params.GameUserListParam;
 import com.zanxiang.game.module.manage.pojo.vo.GameUserListVO;
 import com.zanxiang.game.module.manage.pojo.vo.GameUserVO;
@@ -42,9 +46,6 @@ public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> i
     @Autowired
     private IGameService gameService;
 
-    @Autowired
-    private IGameCategoryService gameCategoryService;
-
     @Autowired
     private ICpService cpService;
 
@@ -81,7 +82,6 @@ public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> i
         //相关用户id
         Map<Long, CpDTO> cpMap = cpService.cpMap();
         Set<Long> userIdSet = userMap == null ? null : userMap.keySet();
-        Map<Long, GameCategoryDTO> gameCategoryMap = gameCategoryService.gameCategoryMap();
         Map<Long, AgentDTO> agentMap = agentDTOList.stream().collect(Collectors.toMap(AgentDTO::getId, Function.identity()));
         //执行查询
         return page(param.toPage(), new QueryWrapper<GameUser>().lambda()
@@ -94,11 +94,11 @@ public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> i
                 .gt(Objects.equals(param.getIsRecharge(), Boolean.TRUE), GameUser::getRechargeCount, 0)
                 .eq(Objects.equals(param.getIsRecharge(), Boolean.FALSE), GameUser::getRechargeCount, 0)
                 .orderByDesc(GameUser::getCreateTime)
-        ).convert(u -> this.toVo(u, userMap, gameMap, agentMap, cpMap, gameCategoryMap));
+        ).convert(u -> this.toVo(u, userMap, gameMap, agentMap, cpMap));
     }
 
-    private GameUserListVO toVo(GameUser gameUser, Map<Long, UserDTO> userMap, Map<Long, GameDTO> gameMap, Map<Long, AgentDTO> agentMap,
-                                Map<Long, CpDTO> cpMap, Map<Long, GameCategoryDTO> gameCategoryMap) {
+    private GameUserListVO toVo(GameUser gameUser, Map<Long, UserDTO> userMap, Map<Long, GameDTO> gameMap,
+                                Map<Long, AgentDTO> agentMap, Map<Long, CpDTO> cpMap) {
         GameUserListVO gameUserListVO = BeanUtil.copy(gameUser, GameUserListVO.class);
         if (Objects.isNull(gameUserListVO)) {
             return null;
@@ -130,7 +130,7 @@ public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> i
             gameUserListVO.setGameName(gameDTO.getName());
             gameUserListVO.setGameCategoryId(gameDTO.getCategory());
             gameUserListVO.setCpName(cpMap.get(gameDTO.getCpId()) == null ? null : cpMap.get(gameDTO.getCpId()).getCpName());
-            gameUserListVO.setGameCategoryName(gameCategoryMap.get(gameDTO.getCategory()) == null ? null : gameCategoryMap.get(gameDTO.getCategory()).getName());
+            gameUserListVO.setGameCategoryName(GameCategoryEnum.getNameByCategory(gameDTO.getCategory()));
         }
         return gameUserListVO;
     }

+ 13 - 21
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/OrderServiceImpl.java

@@ -6,6 +6,7 @@ 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.erp.security.util.SecurityUtil;
+import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
 import com.zanxiang.game.module.manage.pojo.dto.*;
 import com.zanxiang.game.module.manage.pojo.params.OrderParam;
 import com.zanxiang.game.module.manage.pojo.params.UserOrderListParam;
@@ -44,9 +45,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
     @Autowired
     private IGameService gameService;
 
-    @Autowired
-    private IGameCategoryService gameCategoryService;
-
     @Autowired
     private ICpService cpService;
 
@@ -88,10 +86,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             return orderListVO;
         }
         //设置游戏列表
-        GameCategoryDTO gameCategoryDTO = gameCategoryService.getById(gameDTO.getCategory());
-        if (gameCategoryDTO != null) {
-            orderListVO.setGameCategoryName(gameCategoryDTO.getName());
-        }
+        orderListVO.setGameCategoryName(GameCategoryEnum.getNameByCategory(gameDTO.getCategory()));
         orderListVO.setGameName(gameDTO.getName());
         return orderListVO;
     }
@@ -145,14 +140,12 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         Map<Long, GameDTO> gameMap = gameService.gameMap(orderListVOList.stream()
                 .map(orderVO -> Arrays.asList(orderVO.getGameId(), orderVO.getRegGameId()))
                 .flatMap(List::stream).collect(Collectors.toSet()));
-        //游戏分类信息
-        Map<Long, GameCategoryDTO> gameCategoryMap = gameCategoryService.gameCategoryMap();
         //支付渠道列表
         Map<Long, PayWayDTO> payWayMap = payWayService.payWayMap();
         //支付方式列表
         Map<Long, PayDeviceDTO> payDeviceMap = payDeviceService.payDeviceMap();
         //字段信息补充更新
-        orderListVOList.forEach(vo -> this.update(vo, userMap, gameMap, gameCategoryMap, cpMap,
+        orderListVOList.forEach(vo -> this.update(vo, userMap, gameMap, cpMap,
                 payWayMap, payDeviceMap, agentMap));
         //设置返回
         OrderListVO orderListVO = new OrderListVO();
@@ -165,9 +158,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         return orderListVO;
     }
 
-    private void update(OrderVO orderVO, Map<Long, UserDTO> userMap, Map<Long, GameDTO> gameMap,
-                        Map<Long, GameCategoryDTO> gameCategoryMap, Map<Long, CpDTO> cpMap, Map<Long, PayWayDTO> payWayMap,
-                        Map<Long, PayDeviceDTO> payDeviceMap, Map<Long, AgentDTO> agentMap) {
+    private void update(OrderVO orderVO, Map<Long, UserDTO> userMap, Map<Long, GameDTO> gameMap, Map<Long, CpDTO> cpMap,
+                        Map<Long, PayWayDTO> payWayMap, Map<Long, PayDeviceDTO> payDeviceMap, Map<Long, AgentDTO> agentMap) {
         orderVO.setDateTime(orderVO.getCreateTime().toLocalDate());
         //用户信息补充
         UserDTO userDTO = userMap.get(orderVO.getUserId());
@@ -192,10 +184,10 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         if (regGameDTO != null) {
             orderVO.setRegGameName(regGameDTO.getName());
             //注册游戏应用类型
-            GameCategoryDTO gameCategoryDTO = gameCategoryMap.get(regGameDTO.getCategory());
-            if (gameCategoryDTO != null) {
-                orderVO.setRegGameCategoryId(gameCategoryDTO.getId());
-                orderVO.setRegGameCategoryName(gameCategoryDTO.getName());
+            GameCategoryEnum gameCategoryEnum = GameCategoryEnum.getGameCategory(regGameDTO.getCategory());
+            if (gameCategoryEnum != null) {
+                orderVO.setRegGameCategoryId(gameCategoryEnum.getId());
+                orderVO.setRegGameCategoryName(gameCategoryEnum.getName());
             }
         }
         //CP
@@ -208,10 +200,10 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         if (gameDTO != null) {
             orderVO.setGameName(gameDTO.getName());
             //注册游戏应用类型
-            GameCategoryDTO gameCategoryDTO = gameCategoryMap.get(gameDTO.getCategory());
-            if (gameCategoryDTO != null) {
-                orderVO.setGameCategory(gameCategoryDTO.getName());
-                orderVO.setGameCategoryId(gameCategoryDTO.getId());
+            GameCategoryEnum gameCategoryEnum = GameCategoryEnum.getGameCategory(gameDTO.getCategory());
+            if (gameCategoryEnum != null) {
+                orderVO.setGameCategory(gameCategoryEnum.getName());
+                orderVO.setGameCategoryId(gameCategoryEnum.getId());
             }
         }
         //支付渠道

+ 2 - 10
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserLoginLogServiceImpl.java

@@ -3,12 +3,11 @@ package com.zanxiang.game.module.manage.service.impl;
 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.game.module.manage.pojo.dto.GameCategoryDTO;
+import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
 import com.zanxiang.game.module.manage.pojo.dto.GameDTO;
 import com.zanxiang.game.module.manage.pojo.dto.GameUserRoleDTO;
 import com.zanxiang.game.module.manage.pojo.params.UserLoginLogParam;
 import com.zanxiang.game.module.manage.pojo.vo.UserRoleLoginVO;
-import com.zanxiang.game.module.manage.service.IGameCategoryService;
 import com.zanxiang.game.module.manage.service.IGameService;
 import com.zanxiang.game.module.manage.service.IGameUserRoleService;
 import com.zanxiang.game.module.manage.service.IUserLoginLogService;
@@ -34,9 +33,6 @@ public class UserLoginLogServiceImpl extends ServiceImpl<UserLoginLogMapper, Use
     @Autowired
     private IGameService gameService;
 
-    @Autowired
-    private IGameCategoryService gameCategoryService;
-
     @Override
     public IPage<UserRoleLoginVO> loginList(UserLoginLogParam param) {
         //执行查询
@@ -61,11 +57,7 @@ public class UserLoginLogServiceImpl extends ServiceImpl<UserLoginLogMapper, Use
         //设置游戏名称
         GameDTO gameDTO = gameService.getById(userLoginLog.getGameId());
         if (gameDTO != null) {
-            //设置游戏列表
-            GameCategoryDTO gameCategoryDTO = gameCategoryService.getById(gameDTO.getCategory());
-            if (gameCategoryDTO != null) {
-                roleLoginVO.setGameCategoryName(gameCategoryDTO.getName());
-            }
+            roleLoginVO.setGameCategoryName(GameCategoryEnum.getNameByCategory(gameDTO.getCategory()));
             roleLoginVO.setGameName(gameDTO.getName());
         }
         return roleLoginVO;

+ 8 - 9
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserServiceImpl.java

@@ -8,7 +8,11 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.erp.security.util.SecurityUtil;
-import com.zanxiang.game.module.manage.pojo.dto.*;
+import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
+import com.zanxiang.game.module.manage.pojo.dto.AgentDTO;
+import com.zanxiang.game.module.manage.pojo.dto.CpDTO;
+import com.zanxiang.game.module.manage.pojo.dto.GameDTO;
+import com.zanxiang.game.module.manage.pojo.dto.UserDTO;
 import com.zanxiang.game.module.manage.pojo.params.UserListParam;
 import com.zanxiang.game.module.manage.pojo.params.UserUpdateParam;
 import com.zanxiang.game.module.manage.pojo.vo.UserCardVO;
@@ -51,9 +55,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
     @Autowired
     private ICpService cpService;
 
-    @Autowired
-    private IGameCategoryService gameCategoryService;
-
     @Autowired
     private IUserCardService userCardService;
 
@@ -81,7 +82,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
             agentIdList.add(0L);
         }
         Map<Long, CpDTO> cpMap = cpService.cpMap();
-        Map<Long, GameCategoryDTO> gameCategoryMap = gameCategoryService.gameCategoryMap();
         Map<Long, AgentDTO> agentMap = agentDTOList.stream().collect(Collectors.toMap(AgentDTO::getId, Function.identity()));
         //执行查询
         return page(param.toPage(), new QueryWrapper<User>().lambda()
@@ -104,11 +104,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
                 .eq(param.getStatus() != null, User::getStatus, param.getStatus())
                 .in(CollectionUtils.isNotEmpty(agentIdList), User::getAgentId, agentIdList)
                 .orderByDesc(User::getCreateTime)
-        ).convert(u -> this.toVo(u, gameMap, cpMap, gameCategoryMap, agentMap));
+        ).convert(u -> this.toVo(u, gameMap, cpMap, agentMap));
     }
 
-    private UserListVO toVo(User user, Map<Long, GameDTO> gameMap, Map<Long, CpDTO> cpMap, Map<Long, GameCategoryDTO> gameCategoryMap,
-                            Map<Long, AgentDTO> agentMap) {
+    private UserListVO toVo(User user, Map<Long, GameDTO> gameMap, Map<Long, CpDTO> cpMap, Map<Long, AgentDTO> agentMap) {
         UserListVO userListVO = BeanUtil.copy(user, UserListVO.class);
         if (Objects.isNull(userListVO)) {
             return null;
@@ -130,7 +129,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         if (gameDTO != null) {
             userListVO.setGameName(gameDTO.getName());
             userListVO.setGameCategoryId(gameDTO.getCategory());
-            userListVO.setGameCategoryName(gameCategoryMap.get(gameDTO.getCategory()) == null ? null : gameCategoryMap.get(gameDTO.getCategory()).getName());
+            userListVO.setGameCategoryName(GameCategoryEnum.getNameByCategory(gameDTO.getCategory()));
             userListVO.setCpId(gameDTO.getCpId());
             userListVO.setCpName(cpMap.get(gameDTO.getCpId()) == null ? null : cpMap.get(gameDTO.getCpId()).getCpName());
         }

+ 0 - 58
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameCategory.java

@@ -1,58 +0,0 @@
-package com.zanxiang.game.module.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.io.Serializable;
-import java.time.LocalDateTime;
-
-/**
- * @author : lingfeng
- * @time : 2022-06-06
- * @description : 游戏来源表
- */
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@ToString
-@Builder
-@TableName("t_game_category")
-public class GameCategory implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 游戏分类ID
-     */
-    @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    /**
-     * 游戏分类key
-     */
-    private String categoryKey;
-
-    /**
-     * 标签名称
-     */
-    private String name;
-
-    /**
-     * 1 删除  0 正常
-     */
-    @TableLogic
-    private Integer isDelete;
-
-    /**
-     * 创建时间
-     */
-    private LocalDateTime createTime;
-
-    /**
-     * 更新时间
-     */
-    private LocalDateTime updateTime;
-}

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

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

+ 2 - 2
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/CallBackServiceImpl.java

@@ -85,7 +85,7 @@ public class CallBackServiceImpl implements ICallBackService {
             if (CollectionUtils.isNotEmpty(urlParamMap) && Objects.equals(agent.getAccountType(), Agent.ACCOUNT_TYPE_BYTE)) {
                 Game game = gameService.getById(user.getGameId());
                 //判断是微信小游戏
-                if (Objects.equals(game.getCategory(), GameCategoryEnum.CATEGORY_WX_APPLET.getCategory())) {
+                if (Objects.equals(game.getCategory(), GameCategoryEnum.CATEGORY_WX_APPLET.getId())) {
                     UserActiveReportRpcDTO activeReportRpcDTO = this.transform(user, agent, gameApplet, urlParamMap);
                     wechatMiniGameDataReportRpc.userActiveReport(activeReportRpcDTO);
                 }
@@ -122,7 +122,7 @@ public class CallBackServiceImpl implements ICallBackService {
             if (Objects.equals(agent.getAccountType(), Agent.ACCOUNT_TYPE_BYTE)) {
                 //判断游戏类型
                 Game game = gameService.getById(platformOrderDTO.getGameId());
-                if (Objects.equals(game.getCategory(), GameCategoryEnum.CATEGORY_WX_APPLET.getCategory())) {
+                if (Objects.equals(game.getCategory(), GameCategoryEnum.CATEGORY_WX_APPLET.getId())) {
                     OrderReportRpcDTO orderReportRpcDTO = this.transform(platformOrderDTO, user.getOpenId(), agent, gameApplet);
                     wechatMiniGameDataReportRpc.orderReport(orderReportRpcDTO);
                 }