瀏覽代碼

feat : 玩家列表修改

bilingfeng 2 年之前
父節點
當前提交
a178280bee

+ 2 - 2
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/params/UserListParam.java

@@ -125,13 +125,13 @@ public class UserListParam extends BasePage<User> {
      * 归因推广账号
      */
     @ApiModelProperty(notes = "归因推广账号")
-    private Long accountId;
+    private String accountId;
 
     /**
      * 归因投放人员
      */
     @ApiModelProperty(notes = "归因投放人员")
-    private Long pitcherId;
+    private String pitcherId;
 
     /**
      * 客服id

+ 34 - 16
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/UserListVO.java

@@ -54,13 +54,13 @@ public class UserListVO {
      * 注册渠道id
      */
     @ApiModelProperty(notes = "注册渠道id")
-    private Long channelId;
+    private Long agentId;
 
     /**
      * 注册渠道名称
      */
-    @ApiModelProperty(notes = "注册渠道id")
-    private String channelName;
+    @ApiModelProperty(notes = "注册渠道名称")
+    private String channel;
 
     /**
      * cpId
@@ -96,19 +96,31 @@ public class UserListVO {
      * 游戏应用类型名称
      */
     @ApiModelProperty(notes = "游戏应用类型名称")
-    private Long gameCategoryName;
+    private String gameCategoryName;
+
+    /**
+     * 归因投放人员id
+     */
+    @ApiModelProperty(notes = "归因投放人员id")
+    private String pitcherId;
 
     /**
-     * 归因投放人员
+     * 归因投放人员名字
      */
-    @ApiModelProperty(notes = "归因投放人员")
-    private Long pitcherId;
+    @ApiModelProperty(notes = "归因投放人员名字")
+    private String pitcherName;
+
+    /**
+     * 归因推广账号id
+     */
+    @ApiModelProperty(notes = "归因推广账号id")
+    private Long accountId;
 
     /**
      * 归因推广账号
      */
     @ApiModelProperty(notes = "归因推广账号")
-    private Long accountId;
+    private String accountName;
 
     /**
      * 归因媒体id
@@ -116,17 +128,29 @@ public class UserListVO {
     @ApiModelProperty(notes = "归因媒体id")
     private Long mediaId;
 
+    /**
+     * 归因媒体名称
+     */
+    @ApiModelProperty(notes = "归因媒体名称")
+    private String mediaName;
+
     /**
      * 归因广告id
      */
     @ApiModelProperty(notes = "归因广告id")
-    private Long adId;
+    private String adId;
 
     /**
      * 真实姓名
      */
     @ApiModelProperty(notes = "真实姓名")
-    private String realName;
+    private String cardName;
+
+    /**
+     * 证件号码
+     */
+    @ApiModelProperty(notes = "证件号码")
+    private String cardId;
 
     /**
      * 绑定手机号码
@@ -200,10 +224,4 @@ public class UserListVO {
     @ApiModelProperty(notes = "玩家状态, -1 为冻结状态, 1 为试玩状态 2为正常状态")
     private Integer status;
 
-    /**
-     * 证件号码
-     */
-    @ApiModelProperty(notes = "证件号码")
-    private String idCard;
-
 }

+ 77 - 35
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserServiceImpl.java

@@ -12,10 +12,7 @@ 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;
-import com.zanxiang.manage.domain.dto.UserDTO;
-import com.zanxiang.manage.domain.dto.UserExtDTO;
+import com.zanxiang.manage.domain.dto.*;
 import com.zanxiang.manage.domain.params.UserListParam;
 import com.zanxiang.manage.domain.params.UserUpdateParam;
 import com.zanxiang.manage.domain.vo.GameUserVO;
@@ -33,10 +30,7 @@ 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.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
@@ -61,6 +55,21 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     @Autowired
     private GameUserService gameUserService;
 
+    @Autowired
+    private PromoChannelService promoChannelService;
+
+    @Autowired
+    private UserService userService;
+
+    @Autowired
+    private CpService cpService;
+
+    @Autowired
+    private GameCategoryService gameCategoryService;
+
+    @Autowired
+    private PromoAccountService promoAccountService;
+
     /**
      * 玩家列表查询
      *
@@ -69,28 +78,43 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
      */
     @Override
     public IPage<UserListVO> list(UserListParam param) {
+        //渠道列表
+        List<Long> agentIdList;
+        if (param.getChannelId() == null) {
+            agentIdList = promoChannelService.listByAccountOrPitcherId(param.getAccountId(), param.getPitcherId());
+        } else {
+            agentIdList = Collections.singletonList(param.getChannelId());
+        }
+        //根据条件, 匹配渠道
+        if (agentIdList != null && agentIdList.isEmpty()) {
+            return new Page<>();
+        }
         //游戏条件处理
         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())) {
+        //玩家条件处理
+        Map<Long, UserDTO> userMap = userService.userCondition(param.getUserId(), agentIdList, param.getUserName(),
+                param.getNickname(), param.getRegIp(), param.getAdId());
+        //根据条件, 匹配不到玩家
+        if (userMap != null && userMap.isEmpty()) {
             return new Page<>();
         }
+        //相关用户id
+        Set<Long> userIdSet = userMap == null ? null : userMap.keySet();
+        Map<Long, CpDTO> cpMap = cpService.cpMap();
+        Map<Long, PromoChannelDTO> channelMap = promoChannelService.promoChannelMap();
+        Map<Long, GameCategoryDTO> gameCategoryMap = gameCategoryService.gameCategoryMap();
+        Map<Long, PromoAccountDTO> promoAccountMap = promoAccountService.promoAccountMap();
         //执行查询
         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)
+                .in(CollectionUtils.isNotEmpty(userIdSet), User::getId, userIdSet)
                 .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)
@@ -104,47 +128,65 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 .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));
+        ).convert(u -> this.toVo(u, userMap, gameMap, promoAccountMap, channelMap, cpMap, gameCategoryMap));
     }
 
+
     /**
-     * 游戏玩家信息转换对象
+     * 给签证官
      *
-     * @param user       : 用户信息
-     * @param userExtMap : 用户拓展信息
-     * @param gameMap    : 游戏列表
-     * @return : 返回用户信息
+     * @param user            用户
+     * @param userMap         用户映射
+     * @param gameMap         游戏地图
+     * @param promoAccountMap 推广账户映射
+     * @param channelMap      通道映射
+     * @param cpMap           cp地图
+     * @param gameCategoryMap 游戏类别映射
+     * @return {@link UserListVO}
      */
-    private UserListVO toVo(User user, Map<Long, UserExtDTO> userExtMap, Map<Long, GameDTO> gameMap) {
+    private UserListVO toVo(User user, Map<Long, UserDTO> userMap, Map<Long, GameDTO> gameMap, Map<Long, PromoAccountDTO> promoAccountMap,
+                            Map<Long, PromoChannelDTO> channelMap, Map<Long, CpDTO> cpMap, Map<Long, GameCategoryDTO> gameCategoryMap) {
         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());
+        UserDTO userDTO = StringUtils.isEmpty(userMap) ? null : userMap.get(userListVO.getId());
+        if (userDTO == null) {
+            userDTO = this.getById(userListVO.getId());
         }
-        if (userExtDTO != null) {
-            userListVO.setRealName(userExtDTO.getRealName());
-            userListVO.setRegIp(userExtDTO.getRegIp());
-            userListVO.setIdCard(userExtDTO.getIdCard());
+        if (userDTO != null) {
+            userListVO.setUsername(userDTO.getUsername());
+            userListVO.setNickname(userDTO.getNickname());
+            userListVO.setAgentId(userDTO.getAgentId());
+            userListVO.setChannel(channelMap.get(userDTO.getAgentId()) == null ? null : channelMap.get(userDTO.getAgentId()).getChannel());
+            userListVO.setAdId(userDTO.getAdId());
         }
         GameDTO gameDTO = StringUtils.isEmpty(gameMap) ? null : gameMap.get(userListVO.getGameId());
         if (gameDTO == null) {
             gameDTO = gameService.getById(userListVO.getGameId());
         }
         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.setCpId(gameDTO.getCpId());
+            userListVO.setCpName(cpMap.get(gameDTO.getCpId()) == null ? null : cpMap.get(gameDTO.getCpId()).getCpName());
+        }
+        PromoChannelDTO promoChannelDTO = channelMap.get(userListVO.getAgentId());
+        if (promoChannelDTO != null) {
+            PromoAccountDTO promoAccountDTO = promoAccountMap.get(promoChannelDTO.getAccountId());
+            if (promoAccountDTO != null) {
+                userListVO.setAccountId(promoAccountDTO.getId());
+                userListVO.setAccountName(promoAccountDTO.getName());
+                userListVO.setPitcherId(promoAccountDTO.getPitcherId());
+                userListVO.setPitcherName(promoAccountDTO.getPitcherName());
+                userListVO.setMediaId(promoAccountDTO.getMediaId());
+                userListVO.setMediaName(promoAccountDTO.getMediaName());
+            }
         }
-        userListVO.setChannelId(user.getAgentId());
         return userListVO;
     }
 

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

@@ -74,7 +74,7 @@ public class User {
     private Integer deviceType;
 
     /**
-     * 用户状态, -1 : 为冻结状态, 0 : 为正常状态
+     * 状态, 0 正常 1 封禁
      */
     private Integer status;