ソースを参照

feat : 后台bug调试修改

bilingfeng 2 年 前
コミット
8885f6ea19
22 ファイル変更412 行追加69 行削除
  1. 57 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/CpDTO.java
  2. 52 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/GameCategoryDTO.java
  3. 72 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/PromoAccountDTO.java
  4. 1 1
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/PromoChannelDTO.java
  5. 5 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/UserDTO.java
  6. 2 2
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/params/GameUserListParam.java
  7. 3 3
      game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameUserListVO.java
  8. 2 1
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/CpService.java
  9. 4 3
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameCategoryService.java
  10. 6 3
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/CpServiceImpl.java
  11. 7 4
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameCategoryServiceImpl.java
  12. 14 13
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameUserRoleServiceImpl.java
  13. 42 20
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameUserServiceImpl.java
  14. 40 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/PromoAccountServiceImpl.java
  15. 41 2
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/PromoChannelServiceImpl.java
  16. 13 9
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserServiceImpl.java
  17. 18 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/PromoAccountService.java
  18. 18 0
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/PromoChannelService.java
  19. 8 6
      game-module/game-manage/src/main/java/com/zanxiang/manage/service/UserService.java
  20. 1 1
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/PromoAccount.java
  21. 1 1
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/PromoChannel.java
  22. 5 0
      game-module/game-mybatis/src/main/java/com/zanxiang/mybatis/entity/User.java

+ 57 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/CpDTO.java

@@ -0,0 +1,57 @@
+package com.zanxiang.manage.domain.dto;
+
+import lombok.Data;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-11-04
+ * @description : cp信息
+ */
+@Data
+public class CpDTO {
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * cp名称
+     */
+    private String cpName;
+
+    /**
+     * 公司名称
+     */
+    private String companyName;
+
+    /**
+     * 联系人
+     */
+    private String linkMan;
+
+    /**
+     * 手机号
+     */
+    private String mobile;
+
+    /**
+     * 对接状态
+     */
+    private String status;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 渠道
+     */
+    private Long channel;
+
+    /**
+     * 1 删除  0 正常
+     */
+    private Integer isDelete;
+}

+ 52 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/GameCategoryDTO.java

@@ -0,0 +1,52 @@
+package com.zanxiang.manage.domain.dto;
+
+import lombok.Data;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-11-04
+ * @description : 游戏分类
+ */
+@Data
+public class GameCategoryDTO {
+
+    /**
+     * 游戏分类ID
+     */
+    private Long id;
+
+    /**
+     * 分类类型 1、游戏类型(微信小游戏/抖音小游戏/h5/app等) 2、游戏分类(策略游戏/卡牌游戏/)
+     */
+    private Integer type;
+
+    /**
+     * 标签名称
+     */
+    private String name;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 父分类id(顶层游戏分类为0)
+     */
+    private Long parentId;
+
+    /**
+     * 操作者id
+     */
+    private Long operatorId;
+
+    /**
+     * 操作者名字
+     */
+    private String operatorName;
+
+    /**
+     * 1 删除  0 正常
+     */
+    private Integer isDelete;
+}

+ 72 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/PromoAccountDTO.java

@@ -0,0 +1,72 @@
+package com.zanxiang.manage.domain.dto;
+
+import lombok.Data;
+
+/**
+ * @author : lingfeng
+ * @time : 2022-11-04
+ * @description : 推广账号
+ */
+@Data
+public class PromoAccountDTO {
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 推广账号id
+     */
+    private String account;
+
+    /**
+     * 推广账号名称
+     */
+    private String name;
+
+    /**
+     * 投手项目组
+     */
+    private String pitcherGroupId;
+
+    /**
+     * 投手项目组名称
+     */
+    private String pitcherGroupName;
+
+    /**
+     * 投手id
+     */
+    private String pitcherId;
+
+    /**
+     * 投手名称
+     */
+    private String pitcherName;
+
+    /**
+     * 推广媒体id
+     */
+    private Long mediaId;
+
+    /**
+     * 推广媒体名称
+     */
+    private String mediaName;
+
+    /**
+     * 推广账号类型
+     */
+    private String accountType;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 状态, 0 : 可用, 1: 禁用
+     */
+    private Integer status;
+}

+ 1 - 1
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/dto/PromoChannelDTO.java

@@ -18,7 +18,7 @@ public class PromoChannelDTO {
     /**
      * 推广账号主键id
      */
-    private String accountId;
+    private Long accountId;
 
     /**
      * 推广媒体id

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

@@ -152,4 +152,9 @@ public class UserDTO {
      * 用户注册ip
      */
     private String ip;
+
+    /**
+     * 广告id
+     */
+    private String adId;
 }

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

@@ -65,13 +65,13 @@ public class GameUserListParam extends BasePage<GameUser> {
      * 归因推广账号
      */
     @ApiModelProperty(notes = "归因推广账号")
-    private Long accountId;
+    private String accountId;
 
     /**
      * 归因投放人员
      */
     @ApiModelProperty(notes = "归因投放人员")
-    private Long pitcherId;
+    private String pitcherId;
 
     /**
      * 最近充值开始时间(开始玩开始时间请使用beginDate参数)

+ 3 - 3
game-module/game-manage/src/main/java/com/zanxiang/manage/domain/vo/GameUserListVO.java

@@ -90,7 +90,7 @@ public class GameUserListVO {
      * 归因投放人员id
      */
     @ApiModelProperty(notes = "归因投放人员id")
-    private Long pitcherId;
+    private String pitcherId;
 
     /**
      * 归因投放人员名字
@@ -99,9 +99,9 @@ public class GameUserListVO {
     private String pitcherName;
 
     /**
-     * 归因推广账号
+     * 归因推广账号id
      */
-    @ApiModelProperty(notes = "归因推广账号")
+    @ApiModelProperty(notes = "归因推广账号id")
     private Long accountId;
 
     /**

+ 2 - 1
game-module/game-manage/src/main/java/com/zanxiang/manage/service/CpService.java

@@ -2,6 +2,7 @@ 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.CpDTO;
 import com.zanxiang.manage.domain.params.CpAddUpdateParam;
 import com.zanxiang.manage.domain.params.CpListParam;
 import com.zanxiang.manage.domain.vo.CpChoiceVO;
@@ -46,7 +47,7 @@ public interface CpService extends IService<Cp> {
      *
      * @return : 返回所有cp信息
      */
-    Map<Long, String> choiceMap();
+    Map<Long, CpDTO> cpMap();
 
     /**
      * 删除cp信息

+ 4 - 3
game-module/game-manage/src/main/java/com/zanxiang/manage/service/GameCategoryService.java

@@ -2,6 +2,7 @@ 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.GameCategoryDTO;
 import com.zanxiang.manage.domain.params.GameCategoryAddUpdateParam;
 import com.zanxiang.manage.domain.params.GameCategoryListParam;
 import com.zanxiang.manage.domain.vo.GameCategoryParentVO;
@@ -44,11 +45,11 @@ public interface GameCategoryService extends IService<GameCategory> {
     List<GameCategoryParentVO> getGameCategoryParent(Integer type);
 
     /**
-     * 查询所有标签
+     * 查询游戏分类和标签
      *
-     * @return : 返回所有游戏标签
+     * @return : 返回所有游戏分类和标签
      */
-    Map<Long, String> choiceMap();
+    Map<Long, GameCategoryDTO> gameCategoryMap();
 
     /**
      * 查询游戏标签列表

+ 6 - 3
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/CpServiceImpl.java

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.common.exception.BaseException;
 import com.zanxiang.common.utils.StringUtils;
 import com.zanxiang.common.utils.bean.BeanUtils;
+import com.zanxiang.manage.domain.dto.CpDTO;
 import com.zanxiang.manage.domain.params.CpAddUpdateParam;
 import com.zanxiang.manage.domain.params.CpListParam;
 import com.zanxiang.manage.domain.vo.CpChoiceVO;
@@ -23,6 +24,7 @@ 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;
 
 /**
@@ -116,17 +118,18 @@ public class CpServiceImpl extends ServiceImpl<CpMapper, Cp> implements CpServic
     }
 
     /**
-     * 查询cp选择列表
+     * cp信息
      *
      * @return : 返回所有cp信息
      */
     @Override
-    public Map<Long, String> choiceMap() {
+    public Map<Long, CpDTO> cpMap() {
         List<Cp> cpList = super.list(new LambdaQueryWrapper<Cp>().select(Cp::getId, Cp::getCpName));
         if (CollectionUtils.isEmpty(cpList)) {
             return Collections.emptyMap();
         }
-        return cpList.stream().collect(Collectors.toMap(Cp::getId, Cp::getCpName));
+        List<CpDTO> cpDTOList = BeanUtils.copyList(cpList, CpDTO.class);
+        return cpDTOList.stream().collect(Collectors.toMap(CpDTO::getId, Function.identity()));
     }
 
     /**

+ 7 - 4
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/GameCategoryServiceImpl.java

@@ -10,6 +10,7 @@ import com.zanxiang.common.enums.GameCategoryEnum;
 import com.zanxiang.common.exception.BaseException;
 import com.zanxiang.common.utils.StringUtils;
 import com.zanxiang.common.utils.bean.BeanUtils;
+import com.zanxiang.manage.domain.dto.GameCategoryDTO;
 import com.zanxiang.manage.domain.params.GameCategoryAddUpdateParam;
 import com.zanxiang.manage.domain.params.GameCategoryListParam;
 import com.zanxiang.manage.domain.vo.GameCategoryParentVO;
@@ -23,6 +24,7 @@ import org.springframework.stereotype.Service;
 
 import java.time.LocalDateTime;
 import java.util.*;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 /**
@@ -75,18 +77,19 @@ public class GameCategoryServiceImpl extends ServiceImpl<GameCategoryMapper, Gam
     }
 
     /**
-     * 查询所有标签
+     * 查询游戏分类和标签
      *
-     * @return : 返回所有游戏标签
+     * @return : 返回所有游戏分类和标签
      */
     @Override
-    public Map<Long, String> choiceMap() {
+    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().collect(Collectors.toMap(GameCategory::getId, GameCategory::getName));
+        List<GameCategoryDTO> gameCategoryDTOList = BeanUtils.copyList(gameCategoryList, GameCategoryDTO.class);
+        return gameCategoryDTOList.stream().collect(Collectors.toMap(GameCategoryDTO::getId, Function.identity()));
     }
 
     /**

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

@@ -8,10 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.common.utils.StringUtils;
 import com.zanxiang.common.utils.bean.BeanUtils;
-import com.zanxiang.manage.domain.dto.ChannelDTO;
-import com.zanxiang.manage.domain.dto.GameDTO;
-import com.zanxiang.manage.domain.dto.GameUserRoleDTO;
-import com.zanxiang.manage.domain.dto.UserDTO;
+import com.zanxiang.manage.domain.dto.*;
 import com.zanxiang.manage.domain.params.GameUserRoleListParam;
 import com.zanxiang.manage.domain.vo.GameCategoryVO;
 import com.zanxiang.manage.domain.vo.GameUserRoleListVO;
@@ -56,6 +53,9 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
     @Autowired
     private CpService cpService;
 
+    @Autowired
+    private PromoChannelService promoChannelService;
+
     /**
      * 根据角色id查询
      *
@@ -116,7 +116,8 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
     @Override
     public IPage<GameUserRoleListVO> list(GameUserRoleListParam param) {
         //玩家条件处理
-        Map<Long, UserDTO> userMap = userService.userCondition(param.getUserId(), param.getChannelId(), param.getUserName(), param.getNickname(), param.getRegIp());
+        Map<Long, UserDTO> userMap = userService.userCondition(param.getUserId(), param.getChannelId() == null ? null : Collections.singletonList(param.getChannelId()),
+                param.getUserName(), param.getNickname(), param.getRegIp(), null);
         //根据条件, 匹配不到玩家
         if (userMap != null && userMap.isEmpty()) {
             return new Page<>();
@@ -129,9 +130,9 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
         if (gameMap != null && gameMap.isEmpty()) {
             return new Page<>();
         }
-        Map<Long, String> channelMap = channelService.choiceMap();
-        Map<Long, String> cpMap = cpService.choiceMap();
-        Map<Long, String> categoryMap = gameCategoryService.choiceMap();
+        Map<Long, PromoChannelDTO> channelMap = promoChannelService.promoChannelMap();
+        Map<Long, CpDTO> cpMap = cpService.cpMap();
+        Map<Long, GameCategoryDTO> gameCategoryMap = gameCategoryService.gameCategoryMap();
         //执行查询
         return page(param.toPage(), new QueryWrapper<GameUserRole>().lambda()
                 .in(CollectionUtils.isNotEmpty(userIdSet), GameUserRole::getUserId, userIdSet)
@@ -148,7 +149,7 @@ 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, channelMap, cpMap, categoryMap));
+        ).convert(u -> this.toVo(u, userMap, gameMap, channelMap, cpMap, gameCategoryMap));
     }
 
     /**
@@ -158,7 +159,7 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
      * @return : 玩家角色信息展示对象
      */
     private GameUserRoleListVO toVo(GameUserRole gameUserRole, Map<Long, UserDTO> userMap, Map<Long, GameDTO> gameMap,
-                                    Map<Long, String> channelMap, Map<Long, String> cpMap, Map<Long, String> categoryMap) {
+                                    Map<Long, PromoChannelDTO> channelMap, Map<Long, CpDTO> cpMap, Map<Long, GameCategoryDTO> categoryMap) {
         GameUserRoleListVO gameUserRoleListVO = BeanUtils.copy(gameUserRole, GameUserRoleListVO.class);
         if (Objects.isNull(gameUserRoleListVO)) {
             return null;
@@ -171,7 +172,7 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
             gameUserRoleListVO.setUsername(userDTO.getUsername());
             gameUserRoleListVO.setNickname(userDTO.getNickname());
             gameUserRoleListVO.setAgentId(userDTO.getAgentId());
-            gameUserRoleListVO.setChannel(channelMap.get(userDTO.getAgentId()));
+            gameUserRoleListVO.setChannel(channelMap.get(userDTO.getAgentId()) == null ? null : channelMap.get(userDTO.getAgentId()).getChannel());
             gameUserRoleListVO.setRegIp(userDTO.getIp());
             gameUserRoleListVO.setRegTime(userDTO.getCreateTime());
         }
@@ -182,9 +183,9 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
         if (gameDTO != null) {
             gameUserRoleListVO.setGameName(gameDTO.getName());
             gameUserRoleListVO.setCpId(gameDTO.getCpId());
-            gameUserRoleListVO.setCpName(cpMap.get(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()));
+            gameUserRoleListVO.setGameCategoryName(categoryMap.get(gameDTO.getCategory()) == null ? null : categoryMap.get(gameDTO.getCategory()).getName());
         }
         return gameUserRoleListVO;
     }

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

@@ -8,8 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zanxiang.common.utils.StringUtils;
 import com.zanxiang.common.utils.bean.BeanUtils;
-import com.zanxiang.manage.domain.dto.GameDTO;
-import com.zanxiang.manage.domain.dto.UserDTO;
+import com.zanxiang.manage.domain.dto.*;
 import com.zanxiang.manage.domain.params.GameUserListParam;
 import com.zanxiang.manage.domain.vo.GameUserListVO;
 import com.zanxiang.manage.domain.vo.GameUserVO;
@@ -22,10 +21,7 @@ import org.springframework.stereotype.Service;
 
 import java.time.LocalDateTime;
 import java.time.LocalTime;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
+import java.util.*;
 
 /**
  * @author : lingfeng
@@ -46,11 +42,14 @@ public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> i
     private GameCategoryService gameCategoryService;
 
     @Autowired
-    private ChannelService channelService;
+    private PromoChannelService promoChannelService;
 
     @Autowired
     private CpService cpService;
 
+    @Autowired
+    private PromoAccountService promoAccountService;
+
     /**
      * 查询玩家游戏列表
      *
@@ -65,36 +64,46 @@ public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> i
         if (gameMap != null && gameMap.isEmpty()) {
             return new Page<>();
         }
+        //渠道列表
+        List<Long> agentIdList;
+        if (param.getChannelId() != null) {
+            agentIdList = Collections.singletonList(param.getChannelId());
+        } else {
+            agentIdList = promoChannelService.listByAccountOrPitcherId(param.getAccountId(), param.getPitcherId());
+        }
+        //根据条件, 匹配渠道
+        if (agentIdList != null && agentIdList.isEmpty()) {
+            return new Page<>();
+        }
         //玩家条件处理
-        Map<Long, UserDTO> userMap = userService.userCondition(param.getUserId(), param.getChannelId(), param.getUserName(), param.getNickname(), null);
+        Map<Long, UserDTO> userMap = userService.userCondition(param.getUserId(), agentIdList, param.getUserName(),
+                param.getNickname(), null, param.getAdId());
         //根据条件, 匹配不到玩家
         if (userMap != null && userMap.isEmpty()) {
             return new Page<>();
         }
         //相关用户id
         Set<Long> userIdSet = userMap == null ? null : userMap.keySet();
-        Map<Long, String> channelMap = channelService.choiceMap();
-        Map<Long, String> cpMap = cpService.choiceMap();
-        Map<Long, String> categoryMap = gameCategoryService.choiceMap();
+        Map<Long, PromoChannelDTO> channelMap = promoChannelService.promoChannelMap();
+        Map<Long, CpDTO> cpMap = cpService.cpMap();
+        Map<Long, GameCategoryDTO> gameCategoryMap = gameCategoryService.gameCategoryMap();
+        Map<Long, PromoAccountDTO> promoAccountMap = promoAccountService.promoAccountMap();
         //执行查询
         return page(param.toPage(), new QueryWrapper<GameUser>().lambda()
                 .in(CollectionUtils.isNotEmpty(userIdSet), GameUser::getUserId, userIdSet)
                 .in(gameMap != null, GameUser::getGameId, gameMap != null ? gameMap.keySet() : null)
-                // todo : 归因推广账号
-                // todo : 归因投放人员
                 .ge(param.getBeginDate() != null, GameUser::getCreateTime, param.getBeginDate() == null ? null : LocalDateTime.of(param.getBeginDate(), LocalTime.MIN))
                 .le(param.getEndDate() != null, GameUser::getCreateTime, param.getEndDate() == null ? null : LocalDateTime.of(param.getEndDate(), LocalTime.MAX))
                 .ge(param.getRechargeBeginDate() != null, GameUser::getLastRechargeTime, param.getRechargeBeginDate() == null ? null : LocalDateTime.of(param.getRechargeBeginDate(), LocalTime.MIN))
                 .le(param.getRechargeEndDate() != null, GameUser::getLastRechargeTime, param.getRechargeEndDate() == null ? null : LocalDateTime.of(param.getRechargeEndDate(), LocalTime.MAX))
                 .eq(param.getCustomerId() != null, GameUser::getCustomerId, param.getCustomerId())
-                // todo : 归因广告
                 .eq(param.getIsGs() != null, GameUser::getIsGs, param.getIsGs())
                 .gt(Objects.equals(param.getIsRecharge(), Boolean.TRUE), GameUser::getRechargeCount, 0)
                 .eq(Objects.equals(param.getIsRecharge(), Boolean.FALSE), GameUser::getRechargeCount, 0)
                 .eq(param.getVipLevel() != null && param.getVipLevel() <= 10, GameUser::getRoleVipMax, param.getVipLevel())
                 .gt(param.getVipLevel() != null && param.getVipLevel() > 10, GameUser::getRoleVipMax, param.getVipLevel())
                 .orderByDesc(GameUser::getCreateTime)
-        ).convert(u -> this.toVo(u, userMap, gameMap, channelMap, cpMap, categoryMap));
+        ).convert(u -> this.toVo(u, userMap, gameMap, promoAccountMap, channelMap, cpMap, gameCategoryMap));
     }
 
     /**
@@ -105,8 +114,8 @@ public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> i
      * @param gameMap  : 游戏信息
      * @return : 返回游戏玩家信息
      */
-    private GameUserListVO toVo(GameUser gameUser, Map<Long, UserDTO> userMap, Map<Long, GameDTO> gameMap,
-                                Map<Long, String> channelMap, Map<Long, String> cpMap, Map<Long, String> categoryMap) {
+    private GameUserListVO toVo(GameUser gameUser, Map<Long, UserDTO> userMap, Map<Long, GameDTO> gameMap, Map<Long, PromoAccountDTO> promoAccountMap,
+                                Map<Long, PromoChannelDTO> channelMap, Map<Long, CpDTO> cpMap, Map<Long, GameCategoryDTO> gameCategoryMap) {
         GameUserListVO gameUserListVO = BeanUtils.copy(gameUser, GameUserListVO.class);
         if (Objects.isNull(gameUserListVO)) {
             return null;
@@ -119,7 +128,8 @@ public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> i
             gameUserListVO.setNickname(userDTO.getNickname());
             gameUserListVO.setUsername(userDTO.getUsername());
             gameUserListVO.setAgentId(userDTO.getAgentId());
-            gameUserListVO.setChannel(channelMap.get(userDTO.getAgentId()));
+            gameUserListVO.setChannel(channelMap.get(userDTO.getAgentId()) == null ? null : channelMap.get(userDTO.getAgentId()).getChannel());
+            gameUserListVO.setAdId(userDTO.getAdId());
         }
         GameDTO gameDTO = StringUtils.isEmpty(gameMap) ? null : gameMap.get(gameUserListVO.getGameId());
         if (gameDTO == null) {
@@ -127,9 +137,21 @@ public class GameUserServiceImpl extends ServiceImpl<GameUserMapper, GameUser> i
         }
         if (gameDTO != null) {
             gameUserListVO.setCpId(gameDTO.getCpId());
-            gameUserListVO.setCpName(cpMap.get(gameDTO.getCpId()));
             gameUserListVO.setGameCategoryId(gameDTO.getCategory());
-            gameUserListVO.setGameCategoryName(categoryMap.get(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());
+        }
+        PromoChannelDTO promoChannelDTO = channelMap.get(gameUserListVO.getAgentId());
+        if (promoChannelDTO != null) {
+            PromoAccountDTO promoAccountDTO = promoAccountMap.get(promoChannelDTO.getAccountId());
+            if (promoAccountDTO != null) {
+                gameUserListVO.setPitcherId(promoAccountDTO.getPitcherId());
+                gameUserListVO.setPitcherName(promoAccountDTO.getPitcherName());
+                gameUserListVO.setAccountId(promoAccountDTO.getId());
+                gameUserListVO.setAccountName(promoAccountDTO.getName());
+                gameUserListVO.setMediaId(promoAccountDTO.getMediaId());
+                gameUserListVO.setMediaName(promoAccountDTO.getMediaName());
+            }
         }
         return gameUserListVO;
     }

+ 40 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/PromoAccountServiceImpl.java

@@ -1,17 +1,24 @@
 package com.zanxiang.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.common.utils.bean.BeanUtils;
+import com.zanxiang.manage.domain.dto.PromoAccountDTO;
 import com.zanxiang.manage.domain.vo.PromoAccountChoiceVO;
 import com.zanxiang.manage.domain.vo.PromoPitcherChoiceVO;
 import com.zanxiang.manage.service.PromoAccountService;
 import com.zanxiang.mybatis.entity.PromoAccount;
 import com.zanxiang.mybatis.mapper.PromoAccountMapper;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.logging.log4j.util.Strings;
 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
@@ -45,4 +52,37 @@ public class PromoAccountServiceImpl extends ServiceImpl<PromoAccountMapper, Pro
                 select(PromoAccount::getPitcherId, PromoAccount::getPitcherName));
         return BeanUtils.copyList(promoAccountList, PromoPitcherChoiceVO.class);
     }
+
+    /**
+     * 注册渠道信息
+     *
+     * @return : 返回所有渠道信息
+     */
+    @Override
+    public Map<Long, PromoAccountDTO> promoAccountMap() {
+        List<PromoAccount> promoChannelList = super.list();
+        if (CollectionUtils.isEmpty(promoChannelList)) {
+            return Collections.emptyMap();
+        }
+        List<PromoAccountDTO> promoAccountDTOList = BeanUtils.copyList(promoChannelList, PromoAccountDTO.class);
+        return promoAccountDTOList.stream().collect(Collectors.toMap(PromoAccountDTO::getId, Function.identity()));
+    }
+
+    /**
+     * 通过帐户或投手id列表
+     *
+     * @param account   账户
+     * @param pitcherId 投手id
+     * @return {@link List}<{@link Long}>
+     */
+    @Override
+    public List<Long> listByAccountOrPitcherId(String account, String pitcherId) {
+        List<PromoAccount> promoAccountList = super.list(new LambdaQueryWrapper<PromoAccount>()
+                .eq(Strings.isNotBlank(account), PromoAccount::getAccount, account)
+                .eq(Strings.isNotBlank(pitcherId), PromoAccount::getPitcherId, pitcherId));
+        if (CollectionUtils.isEmpty(promoAccountList)) {
+            return Collections.emptyList();
+        }
+        return promoAccountList.stream().map(PromoAccount::getId).collect(Collectors.toList());
+    }
 }

+ 41 - 2
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/PromoChannelServiceImpl.java

@@ -1,18 +1,25 @@
 package com.zanxiang.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.common.utils.bean.BeanUtils;
 import com.zanxiang.manage.domain.dto.PromoChannelDTO;
 import com.zanxiang.manage.domain.vo.PromoChannelChoiceVO;
+import com.zanxiang.manage.service.PromoAccountService;
 import com.zanxiang.manage.service.PromoChannelService;
 import com.zanxiang.mybatis.entity.PromoChannel;
 import com.zanxiang.mybatis.mapper.PromoChannelMapper;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.logging.log4j.util.Strings;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 /**
  * @author : lingfeng
@@ -23,6 +30,9 @@ import java.util.Map;
 @Service
 public class PromoChannelServiceImpl extends ServiceImpl<PromoChannelMapper, PromoChannel> implements PromoChannelService {
 
+    @Autowired
+    private PromoAccountService promoAccountService;
+
     /**
      * 注册渠道选择列表查询
      *
@@ -40,9 +50,38 @@ public class PromoChannelServiceImpl extends ServiceImpl<PromoChannelMapper, Pro
      *
      * @return : 返回所有渠道信息
      */
+    @Override
     public Map<Long, PromoChannelDTO> promoChannelMap() {
         List<PromoChannel> promoChannelList = super.list(new LambdaQueryWrapper<PromoChannel>().
-                select(PromoChannel::getId, PromoChannel::getChannel));
-        return null;
+                select(PromoChannel::getId, PromoChannel::getChannel, PromoChannel::getAccountId));
+        if (CollectionUtils.isEmpty(promoChannelList)) {
+            return Collections.emptyMap();
+        }
+        List<PromoChannelDTO> promoChannelDTOList = BeanUtils.copyList(promoChannelList, PromoChannelDTO.class);
+        return promoChannelDTOList.stream().collect(Collectors.toMap(PromoChannelDTO::getId, Function.identity()));
+    }
+
+    /**
+     * 通过帐户或投手id列表
+     *
+     * @param account   账户
+     * @param pitcherId 投手id
+     * @return {@link List}<{@link Long}>
+     */
+    @Override
+    public List<Long> listByAccountOrPitcherId(String account, String pitcherId) {
+        if (Strings.isBlank(account) && Strings.isBlank(pitcherId)) {
+            return null;
+        }
+        List<Long> accountIdList = promoAccountService.listByAccountOrPitcherId(account, pitcherId);
+        if (CollectionUtils.isEmpty(accountIdList)) {
+            return Collections.emptyList();
+        }
+        List<PromoChannel> promoChannelList = super.list(new LambdaQueryWrapper<PromoChannel>()
+                .in(PromoChannel::getAccountId, accountIdList));
+        if (CollectionUtils.isEmpty(promoChannelList)) {
+            return Collections.emptyList();
+        }
+        return promoChannelList.stream().map(PromoChannel::getId).collect(Collectors.toList());
     }
 }

+ 13 - 9
game-module/game-manage/src/main/java/com/zanxiang/manage/service/Impl/UserServiceImpl.java

@@ -242,27 +242,31 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     /**
      * 玩家相关条件查询用户信息
      *
-     * @param userId    : 用户id
-     * @param channelId : 渠道id
-     * @param userName  : 用户名称
-     * @param nickname  : 用户昵称
-     * @param regIp     : 用户注册ip
+     * @param userId      : 用户id
+     * @param agentIdList : 渠道id列表
+     * @param userName    : 用户名称
+     * @param nickname    : 用户昵称
+     * @param regIp       : 用户注册ip
+     * @param adId        : 广告id
      * @return : 返回用户信息map
      */
     @Override
-    public Map<Long, UserDTO> userCondition(Long userId, Long channelId, String userName, String nickname, String regIp) {
+    public Map<Long, UserDTO> userCondition(Long userId, List<Long> agentIdList, String userName, String nickname,
+                                            String regIp, String adId) {
         //用户信息条件处理
-        if (userId == null && channelId == null && Strings.isBlank(userName) && Strings.isBlank(nickname) && Strings.isBlank(regIp)) {
+        if (userId == null && CollectionUtils.isEmpty(agentIdList) && Strings.isBlank(userName)
+                && Strings.isBlank(nickname) && Strings.isBlank(regIp) && Strings.isBlank(adId)) {
             return null;
         }
         //查询
         List<User> userList = super.list(new LambdaQueryWrapper<User>()
                 .eq(userId != null, User::getId, userId)
-                .eq(channelId != null, User::getAgentId, channelId)
+                .eq(Strings.isNotBlank(adId), User::getAdId, adId)
+                .in(CollectionUtils.isEmpty(agentIdList), User::getAgentId, agentIdList)
                 .eq(Strings.isNotBlank(regIp), User::getIp, regIp)
                 .like(Strings.isNotBlank(userName), User::getUsername, userName)
                 .like(Strings.isNotBlank(nickname), User::getNickname, nickname)
-                .select(User::getId, User::getUsername, User::getNickname, User::getIp, User::getCreateTime, User::getAgentId));
+                .select(User::getId, User::getUsername, User::getNickname, User::getIp, User::getCreateTime, User::getAgentId, User::getAdId));
         if (CollectionUtils.isEmpty(userList)) {
             return Collections.emptyMap();
         }

+ 18 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/PromoAccountService.java

@@ -1,11 +1,13 @@
 package com.zanxiang.manage.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zanxiang.manage.domain.dto.PromoAccountDTO;
 import com.zanxiang.manage.domain.vo.PromoAccountChoiceVO;
 import com.zanxiang.manage.domain.vo.PromoPitcherChoiceVO;
 import com.zanxiang.mybatis.entity.PromoAccount;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author : lingfeng
@@ -27,4 +29,20 @@ public interface PromoAccountService extends IService<PromoAccount> {
      * @return : 返回所有投手信息
      */
     List<PromoPitcherChoiceVO> promoPitcherChoiceList();
+
+    /**
+     * 通过帐户或投手id列表
+     *
+     * @param account   账户
+     * @param pitcherId 投手id
+     * @return {@link List}<{@link Long}>
+     */
+    List<Long> listByAccountOrPitcherId(String account, String pitcherId);
+
+    /**
+     * 注册渠道信息
+     *
+     * @return : 返回所有渠道信息
+     */
+    Map<Long, PromoAccountDTO> promoAccountMap();
 }

+ 18 - 0
game-module/game-manage/src/main/java/com/zanxiang/manage/service/PromoChannelService.java

@@ -1,10 +1,12 @@
 package com.zanxiang.manage.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zanxiang.manage.domain.dto.PromoChannelDTO;
 import com.zanxiang.manage.domain.vo.PromoChannelChoiceVO;
 import com.zanxiang.mybatis.entity.PromoChannel;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author : lingfeng
@@ -19,4 +21,20 @@ public interface PromoChannelService extends IService<PromoChannel> {
      * @return : 返回所有注册渠道信息
      */
     List<PromoChannelChoiceVO> promoChannelChoiceList();
+
+    /**
+     * 注册渠道信息
+     *
+     * @return : 返回所有渠道信息
+     */
+    Map<Long, PromoChannelDTO> promoChannelMap();
+
+    /**
+     * 通过帐户或投手id列表
+     *
+     * @param account   账户
+     * @param pitcherId 投手id
+     * @return {@link List}<{@link Long}>
+     */
+    List<Long> listByAccountOrPitcherId(String account, String pitcherId);
 }

+ 8 - 6
game-module/game-manage/src/main/java/com/zanxiang/manage/service/UserService.java

@@ -9,6 +9,7 @@ import com.zanxiang.manage.domain.vo.UserListVO;
 import com.zanxiang.manage.domain.vo.UserVO;
 import com.zanxiang.mybatis.entity.User;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -45,14 +46,15 @@ public interface UserService extends IService<User> {
     /**
      * 玩家相关条件查询用户信息
      *
-     * @param userId    : 用户id
-     * @param channelId : 渠道id
-     * @param userName  : 用户名称
-     * @param nickname  : 用户昵称
-     * @param regIp     : 用户注册ip
+     * @param userId      : 用户id
+     * @param agentIdList : 渠道id列表
+     * @param userName    : 用户名称
+     * @param nickname    : 用户昵称
+     * @param regIp       : 用户注册ip
+     * @param adId        : 广告id
      * @return : 返回用户信息map
      */
-    Map<Long, UserDTO> userCondition(Long userId, Long channelId, String userName, String nickname, String regIp);
+    Map<Long, UserDTO> userCondition(Long userId, List<Long> agentIdList, String userName, String nickname, String regIp, String adId);
 
     /**
      * 根据用户id查询信息

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

@@ -28,7 +28,7 @@ public class PromoAccount {
     private Long id;
 
     /**
-     * 推广账号
+     * 推广账号id
      */
     private String account;
 

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

@@ -30,7 +30,7 @@ public class PromoChannel {
     /**
      * 推广账号主键id
      */
-    private String accountId;
+    private Long accountId;
 
     /**
      * 推广媒体id

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

@@ -163,6 +163,11 @@ public class User {
      */
     private String ip;
 
+    /**
+     * 归因广告id
+     */
+    private String adId;
+
     /**
      * 获取用户显示手机号
      *