Ver código fonte

fix : sdk游戏后台管理

bilingfeng 1 ano atrás
pai
commit
1246b7fb5a
14 arquivos alterados com 20 adições e 395 exclusões
  1. 0 54
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/GameAppletController.java
  2. 0 47
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/GamePictureController.java
  3. 0 24
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IGameAppletService.java
  4. 0 30
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IGamePictureService.java
  5. 2 2
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/AgentServiceImpl.java
  6. 0 53
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameAppletServiceImpl.java
  7. 0 137
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GamePictureServiceImpl.java
  8. 2 0
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameServiceImpl.java
  9. 2 2
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserRoleServiceImpl.java
  10. 2 2
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserServiceImpl.java
  11. 2 2
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/OrderServiceImpl.java
  12. 2 2
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserCardServiceImpl.java
  13. 6 9
      game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserServiceImpl.java
  14. 2 31
      game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/GameExtServiceImpl.java

+ 0 - 54
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/GameAppletController.java

@@ -1,54 +0,0 @@
-package com.zanxiang.game.module.manage.controller;
-
-import com.zanxiang.erp.security.annotation.PreAuthorize;
-import com.zanxiang.game.module.manage.pojo.params.GameAccountUpdateParam;
-import com.zanxiang.game.module.manage.pojo.vo.GameAccountVO;
-import com.zanxiang.game.module.manage.service.IGameAppletService;
-import com.zanxiang.module.util.pojo.ResultVO;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * @author : lingfeng
- * @time : 2022-07-08
- * @description : 微信小游戏(小程序)
- */
-@Api(tags = {"微信小游戏(小程序)"})
-@RestController
-@RequestMapping("/game/applet")
-@Slf4j
-public class GameAppletController {
-
-    @Autowired
-    private IGameAppletService gameAppletService;
-
-    @ApiOperation(value = "获取账号信息配置")
-    @GetMapping(value = "/info")
-    @PreAuthorize(permissionKey = "sdk:gameApplet:info")
-    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameAccountVO.class)})
-    public ResultVO<GameAccountVO> getGameAccount(@RequestParam Long id) {
-        return ResultVO.ok(gameAppletService.getGameAccount(id));
-    }
-
-    @ApiOperation(value = "账号信息配置添加或者更新")
-    @PostMapping(value = "/add/or/update")
-    @PreAuthorize(permissionKey = "sdk:gameApplet:addOrUpdate")
-    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = Boolean.class)})
-    public ResultVO<Boolean> gameAccountAddOrUpdate(@Validated @RequestBody GameAccountUpdateParam param) {
-        return ResultVO.ok(gameAppletService.gameAccountAddOrUpdate(param));
-    }
-
-    @ApiOperation(value = "获取小游戏二维码")
-    @GetMapping(value = "/qr/code")
-    @PreAuthorize(permissionKey = "sdk:gameApplet:qrCode")
-    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = String.class)})
-    public ResultVO<String> getQrCodByGameId(@RequestParam Long gameId) {
-        return ResultVO.ok(gameAppletService.getQrCodByGameId(gameId));
-    }
-}

+ 0 - 47
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/GamePictureController.java

@@ -1,47 +0,0 @@
-package com.zanxiang.game.module.manage.controller;
-
-import com.zanxiang.erp.security.annotation.PreAuthorize;
-import com.zanxiang.game.module.manage.pojo.params.GamePictureParam;
-import com.zanxiang.game.module.manage.pojo.vo.GamePictureVO;
-import com.zanxiang.game.module.manage.service.IGamePictureService;
-import com.zanxiang.module.util.pojo.ResultVO;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * @author : lingfeng
- * @time : 2022-07-12
- * @description : 游戏图片
- */
-@Api(tags = {"游戏图片管理接口"})
-@RestController
-@RequestMapping("/game/picture")
-@Slf4j
-public class GamePictureController {
-
-    @Autowired
-    private IGamePictureService gamePictureService;
-
-    @ApiOperation(value = "获取游戏图片配置")
-    @GetMapping(value = "/info")
-    @PreAuthorize(permissionKey = "sdk:gamePicture:info")
-    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GamePictureVO.class)})
-    public ResultVO<GamePictureVO> getByGameId(@RequestParam Long id) {
-        return ResultVO.ok(gamePictureService.getByGameId(id));
-    }
-
-    @ApiOperation(value = "游戏图片配置添加或者更新")
-    @PostMapping(value = "/add/or/update")
-    @PreAuthorize(permissionKey = "sdk:gamePicture:addOrUpdate")
-    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = Boolean.class)})
-    public ResultVO<Boolean> addOrUpdate(@Validated @RequestBody GamePictureParam param) {
-        return ResultVO.ok(gamePictureService.addOrUpdate(param));
-    }
-
-}

+ 0 - 24
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IGameAppletService.java

@@ -21,30 +21,6 @@ public interface IGameAppletService extends IService<GameApplet> {
      */
     GameAppletDTO getByGameId(Long gameId);
 
-    /**
-     * 获取账号信息配置
-     *
-     * @param id : 游戏id
-     * @return {@link GameAccountVO}
-     */
-    GameAccountVO getGameAccount(Long id);
-
-    /**
-     * 获取账号信息配置
-     *
-     * @param param : 更新参数
-     * @return {@link Boolean}
-     */
-    Boolean gameAccountAddOrUpdate(GameAccountUpdateParam param);
-
-    /**
-     * 获取游戏小程序二维码
-     *
-     * @param gameId : 游戏id
-     * @return {@link String}
-     */
-    String getQrCodByGameId(Long gameId);
-
     /**
      * 获取小游戏二维码
      *

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

@@ -1,30 +0,0 @@
-package com.zanxiang.game.module.manage.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.zanxiang.game.module.manage.pojo.params.GamePictureParam;
-import com.zanxiang.game.module.manage.pojo.vo.GamePictureVO;
-import com.zanxiang.game.module.mybatis.entity.GamePicture;
-
-/**
- * @author : lingfeng
- * @time : 2022-07-12
- * @description : 游戏图片
- */
-public interface IGamePictureService extends IService<GamePicture> {
-
-    /**
-     * 根据游戏id查询
-     *
-     * @param gameId : 游戏id
-     * @return 返回游戏图片信息
-     */
-    GamePictureVO getByGameId(Long gameId);
-
-    /**
-     * 游戏图片添加或更新
-     *
-     * @param param : 游戏图片参数
-     * @return {@link Boolean}
-     */
-    Boolean addOrUpdate(GamePictureParam param);
-}

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

@@ -184,7 +184,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
     public List<AgentDTO> listUserAgent(String account, String pitcherId, Long agentId) {
         List<Agent> agentList;
         //超管权限
-        if (SecurityUtil.isAdmin()) {
+        if (SecurityUtil.isManager()) {
             agentList = super.list(new LambdaQueryWrapper<Agent>()
                     .eq(Strings.isNotBlank(account), Agent::getAccountId, account)
                     .eq(Strings.isNotBlank(pitcherId), Agent::getCreateBy, pitcherId)
@@ -211,7 +211,7 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
     @Override
     public List<AgentAccountChoiceVO> agentAccountChoiceList() {
         return super.list(new LambdaQueryWrapper<Agent>()
-                .eq(!SecurityUtil.isAdmin(), Agent::getCreateBy, SecurityUtil.getUserId())
+                .eq(!SecurityUtil.isManager(), Agent::getCreateBy, SecurityUtil.getUserId())
         ).stream().map(agent -> BeanUtil.copy(agent, AgentAccountChoiceVO.class)).collect(Collectors.toList());
     }
 }

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

@@ -5,11 +5,7 @@ import cn.hutool.json.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.game.module.manage.pojo.dto.GameAppletDTO;
-import com.zanxiang.game.module.manage.pojo.dto.GameDTO;
-import com.zanxiang.game.module.manage.pojo.params.GameAccountUpdateParam;
-import com.zanxiang.game.module.manage.pojo.vo.GameAccountVO;
 import com.zanxiang.game.module.manage.service.IGameAppletService;
-import com.zanxiang.game.module.manage.service.IGameService;
 import com.zanxiang.game.module.mybatis.entity.GameApplet;
 import com.zanxiang.game.module.mybatis.mapper.GameAppletMapper;
 import com.zanxiang.module.oss.service.IOssService;
@@ -26,7 +22,6 @@ import java.io.BufferedInputStream;
 import java.io.PrintWriter;
 import java.net.HttpURLConnection;
 import java.net.URL;
-import java.time.LocalDateTime;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
@@ -40,9 +35,6 @@ import java.util.UUID;
 @Service
 public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApplet> implements IGameAppletService {
 
-    @Autowired
-    private IGameService gameService;
-
     @Autowired
     private IOssService ossService;
 
@@ -56,51 +48,6 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
         return BeanUtil.copy(gameApplet, GameAppletDTO.class);
     }
 
-    @Override
-    public GameAccountVO getGameAccount(Long id) {
-        GameApplet gameApplet = super.getOne(new LambdaQueryWrapper<GameApplet>()
-                .eq(GameApplet::getGameId, id));
-        if (gameApplet == null) {
-            GameAccountVO vo = new GameAccountVO();
-            vo.setGameId(id);
-            return vo;
-        }
-        return BeanUtil.copy(gameApplet, GameAccountVO.class);
-    }
-
-    @Override
-    public Boolean gameAccountAddOrUpdate(GameAccountUpdateParam param) {
-        GameApplet gameApplet;
-        if (param.getId() == null) {
-            gameApplet = new GameApplet();
-            gameApplet.setCreateTime(LocalDateTime.now());
-            gameApplet.setGameId(param.getGameId());
-        } else {
-            gameApplet = super.getById(param.getId());
-        }
-        gameApplet.setAppId(param.getAppId());
-        gameApplet.setGhId(param.getGhId());
-        gameApplet.setAccount(param.getAccount());
-        gameApplet.setPassword(param.getPassword());
-        gameApplet.setCompany(param.getCompany());
-        gameApplet.setAppSecret(param.getAppSecret());
-        gameApplet.setUpdateTime(LocalDateTime.now());
-        return super.saveOrUpdate(gameApplet);
-    }
-
-    @Override
-    public String getQrCodByGameId(Long gameId) {
-        GameDTO gameDTO = gameService.getById(gameId);
-        if (gameDTO == null) {
-            throw new BaseException("游戏不存在");
-        }
-        GameApplet gameApplet = super.getOne(new LambdaQueryWrapper<GameApplet>().eq(GameApplet::getGameId, gameId));
-        if (gameApplet == null || Strings.isBlank(gameApplet.getAppId()) || Strings.isBlank(gameApplet.getAppSecret())) {
-            throw new BaseException("该游戏未设置小程序信息");
-        }
-        return this.getQrCode(gameApplet.getAppId(), gameApplet.getAppSecret(), gameDTO.getName());
-    }
-
     /**
      * 获取游戏小程序二维码
      *

+ 0 - 137
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GamePictureServiceImpl.java

@@ -1,137 +0,0 @@
-package com.zanxiang.game.module.manage.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
-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.params.GamePictureParam;
-import com.zanxiang.game.module.manage.pojo.vo.GamePictureVO;
-import com.zanxiang.game.module.manage.service.IGameCategoryService;
-import com.zanxiang.game.module.manage.service.IGamePictureService;
-import com.zanxiang.game.module.manage.service.IGameService;
-import com.zanxiang.game.module.mybatis.entity.Game;
-import com.zanxiang.game.module.mybatis.entity.GamePicture;
-import com.zanxiang.game.module.mybatis.mapper.GamePictureMapper;
-import com.zanxiang.module.util.bean.BeanUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.time.LocalDateTime;
-import java.util.Objects;
-
-/**
- * @author : lingfeng
- * @time : 2022-07-12
- * @description : 游戏图片
- */
-@Slf4j
-@Service
-public class GamePictureServiceImpl extends ServiceImpl<GamePictureMapper, GamePicture> implements IGamePictureService {
-
-    @Autowired
-    private IGameService gameService;
-
-    @Autowired
-    private IGameCategoryService gameCategoryService;
-
-    @Override
-    public GamePictureVO getByGameId(Long gameId) {
-        GamePicture gamePicture = super.getOne(new LambdaQueryWrapper<GamePicture>().eq(GamePicture::getGameId, gameId));
-        if (gamePicture == null) {
-            gamePicture = GamePicture.builder().gameId(gameId).build();
-        }
-        GamePictureVO gamePictureVO = BeanUtil.copy(gamePicture, GamePictureVO.class);
-        GameDTO gameDTO = gameService.getById(gameId);
-        gamePictureVO.setNeedAuth(gameDTO.getNeedAuth());
-        gamePictureVO.setDownloadCount(gameDTO.getDownloadCount());
-        return gamePictureVO;
-    }
-
-    @Override
-    public Boolean addOrUpdate(GamePictureParam param) {
-        GameDTO gameDTO = gameService.getById(param.getGameId());
-        GameCategoryDTO gameCategoryDTO = gameCategoryService.getById(gameDTO.getCategory());
-        //微信小游戏更新
-        if (Objects.equals(gameCategoryDTO.getKey(), GameCategoryEnum.CATEGORY_WX_APPLET.getKey())) {
-            return this.appletGameAddOrUpdate(param);
-        }
-        //h5游戏更新
-        if (Objects.equals(gameCategoryDTO.getKey(), GameCategoryEnum.CATEGORY_DY_APPLET.getKey())) {
-            return this.h5GameAddOrUpdate(param);
-        }
-        return Boolean.FALSE;
-    }
-
-    @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
-    public Boolean h5GameAddOrUpdate(GamePictureParam param) {
-        Long gameId = param.getGameId();
-        GamePicture gamePicture = super.getOne(new LambdaQueryWrapper<GamePicture>().eq(GamePicture::getGameId, gameId));
-        if (gamePicture == null) {
-            gamePicture = GamePicture.builder()
-                    .gameId(gameId)
-                    .avatarImg(param.getAvatarImg())
-//                    .gamePictureImg(param.getGamePictureImg())
-//                    .loginBackGroundImg(param.getLoginBackGroundImg())
-                    .createTime(LocalDateTime.now())
-                    .updateTime(LocalDateTime.now())
-                    .build();
-        } else {
-            gamePicture.setAvatarImg(param.getAvatarImg());
-//            gamePicture.setGamePictureImg(param.getGamePictureImg());
-//            gamePicture.setLoginBackGroundImg(param.getLoginBackGroundImg());
-            gamePicture.setUpdateTime(LocalDateTime.now());
-        }
-        //游戏图片信息更新
-        super.saveOrUpdate(gamePicture);
-        //游戏信息更新
-        if (param.getNeedAuth() != null || param.getDownloadCount() != null) {
-            gameService.update(new LambdaUpdateWrapper<Game>()
-                    .set(Game::getUpdateTime, LocalDateTime.now())
-                    .eq(Game::getId, gameId));
-        }
-        return Boolean.TRUE;
-    }
-
-    private Boolean appletGameAddOrUpdate(GamePictureParam param) {
-        Long gameId = param.getGameId();
-        GamePicture gamePicture = super.getOne(new LambdaQueryWrapper<GamePicture>().eq(GamePicture::getGameId, gameId));
-        if (gamePicture == null) {
-            gamePicture = GamePicture.builder()
-                    .gameId(gameId)
-                    .avatarImg(param.getAvatarImg())
-                    .appletImg(param.getAppletImg())
-//                    .cardTitle(param.getCardTitle())
-//                    .cardUrl(param.getCardUrl())
-//                    .cardImg(param.getCardImg())
-//                    .isOpenInlet(param.getIsOpenInlet())
-//                    .inletImg(param.getInletImg())
-//                    .findImg(param.getFindImg())
-//                    .recommendImg(param.getRecommendImg())
-//                    .tryPayImg(param.getTryPayImg())
-//                    .shareImgName(param.getShareImgName())
-//                    .shareImg(param.getShareImg())
-                    .createTime(LocalDateTime.now())
-                    .updateTime(LocalDateTime.now())
-                    .build();
-        } else {
-            gamePicture.setAvatarImg(param.getAvatarImg());
-            gamePicture.setAppletImg(param.getAppletImg());
-//            gamePicture.setCardTitle(param.getCardTitle());
-//            gamePicture.setCardUrl(param.getCardUrl());
-//            gamePicture.setCardImg(param.getCardImg());
-//            gamePicture.setIsOpenInlet(param.getIsOpenInlet());
-//            gamePicture.setInletImg(param.getInletImg());
-//            gamePicture.setFindImg(param.getFindImg());
-//            gamePicture.setRecommendImg(param.getRecommendImg());
-//            gamePicture.setTryPayImg(param.getTryPayImg());
-//            gamePicture.setShareImgName(param.getShareImgName());
-            gamePicture.setShareImg(param.getShareImg());
-            gamePicture.setUpdateTime(LocalDateTime.now());
-        }
-        return super.saveOrUpdate(gamePicture);
-    }
-}

+ 2 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameServiceImpl.java

@@ -27,6 +27,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.apache.logging.log4j.util.Strings;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
 import java.time.LocalDateTime;
@@ -53,6 +54,7 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
     private ICpService cpService;
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public Boolean gameAddOrUpdate(GameAddParam param) {
         //游戏分类处理
         String gameTags = this.getGameTags(param.getClassifyList());

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

@@ -107,13 +107,13 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
         //渠道列表
         List<AgentDTO> agentDTOList = agentService.listUserAgent(null, null, param.getChannelId());
         //根据条件, 匹配渠道
-        if (CollectionUtils.isEmpty(agentDTOList) && !SecurityUtil.isAdmin()) {
+        if (CollectionUtils.isEmpty(agentDTOList) && !SecurityUtil.isManager()) {
             return new Page<>();
         }
         //渠道id
         List<Long> agentIdList = agentDTOList.stream().map(AgentDTO::getId).collect(Collectors.toList());
         //管理员可见自然量数据
-        if (SecurityUtil.isAdmin()) {
+        if (SecurityUtil.isManager()) {
             agentIdList.add(Agent.DEFAULT_AGENT);
         }
         //玩家条件处理

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

@@ -62,13 +62,13 @@ public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> i
         //渠道列表
         List<AgentDTO> agentDTOList = agentService.listUserAgent(param.getAccountId(), param.getPitcherId(), param.getChannelId());
         //根据条件, 匹配渠道
-        if (CollectionUtils.isEmpty(agentDTOList) && !SecurityUtil.isAdmin()) {
+        if (CollectionUtils.isEmpty(agentDTOList) && !SecurityUtil.isManager()) {
             return new Page<>();
         }
         //渠道id
         List<Long> agentIdList = agentDTOList.stream().map(AgentDTO::getId).collect(Collectors.toList());
         //管理员可见自然量数据
-        if (SecurityUtil.isAdmin()) {
+        if (SecurityUtil.isManager()) {
             agentIdList.add(0L);
         }
         //玩家条件处理

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

@@ -101,13 +101,13 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         //渠道列表
         List<AgentDTO> agentDTOList = agentService.listUserAgent(param.getAccountId(), param.getPitcherId(), param.getChannelId());
         //根据条件, 匹配渠道
-        if (CollectionUtils.isEmpty(agentDTOList) && !SecurityUtil.isAdmin()) {
+        if (CollectionUtils.isEmpty(agentDTOList) && !SecurityUtil.isManager()) {
             return new OrderListVO(param.toPage().getSize());
         }
         //渠道id列表
         List<Long> agentIds = agentDTOList.stream().map(AgentDTO::getId).collect(Collectors.toList());
         //管理员可见自然量数据
-        if (SecurityUtil.isAdmin()) {
+        if (SecurityUtil.isManager()) {
             agentIds.add(0L);
         }
         //查询用户id和名字条件

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

@@ -50,13 +50,13 @@ public class UserCardServiceImpl extends ServiceImpl<UserCardMapper, UserCard> i
         //渠道列表
         List<AgentDTO> agentDTOList = agentService.listUserAgent(null, null, null);
         //根据条件, 匹配渠道
-        if (CollectionUtils.isEmpty(agentDTOList) && !SecurityUtil.isAdmin()) {
+        if (CollectionUtils.isEmpty(agentDTOList) && !SecurityUtil.isManager()) {
             return new Page<>();
         }
         //渠道id
         List<Long> agentIdList = agentDTOList.stream().map(AgentDTO::getId).collect(Collectors.toList());
         //管理员可见自然量数据
-        if (SecurityUtil.isAdmin()) {
+        if (SecurityUtil.isManager()) {
             agentIdList.add(0L);
         }
         //玩家条件处理

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

@@ -71,13 +71,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         //渠道列表
         List<AgentDTO> agentDTOList = agentService.listUserAgent(param.getAccountId(), param.getPitcherId(), param.getChannelId());
         //根据条件, 匹配渠道
-        if (CollectionUtils.isEmpty(agentDTOList) && !SecurityUtil.isAdmin()) {
+        if (CollectionUtils.isEmpty(agentDTOList) && !SecurityUtil.isManager()) {
             return new Page<>();
         }
         //渠道id列表
         List<Long> agentIdList = agentDTOList.stream().map(AgentDTO::getId).collect(Collectors.toList());
         //管理员可见自然量数据
-        if (SecurityUtil.isAdmin()) {
+        if (SecurityUtil.isManager()) {
             agentIdList.add(0L);
         }
         Map<Long, CpDTO> cpMap = cpService.cpMap();
@@ -168,14 +168,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         }
         //查询用户拓展信息
         UserCardVO userCardVO = userCardService.getByUserId(userId);
-        if (userCardVO == null) {
-            throw new BaseException("用户实名信息不存在!");
-        }
         //拓展信息补充
-        userVO.setRealName(userCardVO.getCardName());
-        userVO.setBirthday(userCardVO.getBirthday());
-        userVO.setSex(userCardVO.getSex());
-        userVO.setIdCard(userCardVO.getCardId());
+        userVO.setRealName(userCardVO == null ? null : userCardVO.getCardName());
+        userVO.setBirthday(userCardVO == null ? null : userCardVO.getBirthday());
+        userVO.setSex(userCardVO == null ? null : userCardVO.getSex());
+        userVO.setIdCard(userCardVO == null ? null : userCardVO.getCardId());
         userVO.setRegMobile(user.getShowPhoneNum());
         userVO.setMobile(user.getShowPhoneNum());
         userVO.setRegEmail(user.getEmail());

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

@@ -4,12 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.game.module.mybatis.entity.GameExt;
 import com.zanxiang.game.module.mybatis.mapper.GameExtMapper;
-import com.zanxiang.game.module.sdk.constant.RedisKeyConstant;
-import com.zanxiang.game.module.sdk.enums.ExpireTimeEnum;
 import com.zanxiang.game.module.sdk.service.IGameExtService;
-import com.zanxiang.game.module.sdk.util.RedisUtil;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 /**
@@ -21,38 +17,13 @@ import org.springframework.stereotype.Service;
 @Service
 public class GameExtServiceImpl extends ServiceImpl<GameExtMapper, GameExt> implements IGameExtService {
 
-    @Autowired
-    private RedisUtil<GameExt> redisUtil;
-
     @Override
     public GameExt getByGameId(Long gameId) {
-        //查询缓存
-        GameExt gameExt = redisUtil.getCache(this.getGameKey(String.valueOf(gameId)));
-        if (gameExt != null) {
-            return gameExt;
-        }
-        gameExt = this.getOne(new LambdaQueryWrapper<GameExt>().eq(GameExt::getGameId, gameId));
-        if (gameExt != null) {
-            redisUtil.setCache(this.getGameKey(String.valueOf(gameId)), gameExt, ExpireTimeEnum.ONE_DAY.getTime());
-        }
-        return gameExt;
+        return this.getOne(new LambdaQueryWrapper<GameExt>().eq(GameExt::getGameId, gameId));
     }
 
     @Override
     public GameExt getByGameAppId(String appId) {
-        //查询缓存
-        GameExt gameExt = redisUtil.getCache(this.getGameKey(appId));
-        if (gameExt != null) {
-            return gameExt;
-        }
-        gameExt = this.getOne(new LambdaQueryWrapper<GameExt>().eq(GameExt::getAppId, appId));
-        if (gameExt != null) {
-            redisUtil.setCache(this.getGameKey(appId), gameExt, ExpireTimeEnum.ONE_DAY.getTime());
-        }
-        return gameExt;
-    }
-
-    private String getGameKey(String key) {
-        return RedisKeyConstant.GAME_SECRET_KEY + "_" + key;
+        return this.getOne(new LambdaQueryWrapper<GameExt>().eq(GameExt::getAppId, appId));
     }
 }