瀏覽代碼

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

lth 1 年之前
父節點
當前提交
b89c2ab00d

+ 1 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/ManageApplication.java

@@ -21,7 +21,7 @@ public class ManageApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功 <权限修改提交修改完成!!!!!> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 <玩家角色列表下载修改> ( ´・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

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

@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 
 /**
@@ -121,6 +122,14 @@ public class UserController {
         return ResultVO.ok(gameUserRoleService.list(param));
     }
 
+    @ApiOperation(value = "玩家游戏角色Excel下载")
+    @PostMapping(value = "/role/list/excel")
+    @PreAuthorize(permissionKey = "manage:user:roleListExcel")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功")})
+    public void getGameUserRoleExcel(@Validated @RequestBody GameUserRoleListParam param, HttpServletResponse response) {
+        gameUserRoleService.getGameUserRoleExcel(param, response);
+    }
+
     @ApiOperation(value = "玩家实名认证列表")
     @PostMapping(value = "/card/list")
     @PreAuthorize(permissionKey = "manage:userCard:list")

+ 18 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/UserListParam.java

@@ -174,4 +174,22 @@ public class UserListParam extends BaseListDTO<User> {
 
     @ApiModelProperty("充值到支付的间隔时间(分)")
     private Long regPayIntervalTimeMax;
+
+    /**
+     * 是否创角
+     */
+    @ApiModelProperty(notes = "是否创角")
+    private Boolean createRole;
+
+    /**
+     * 角色数量最小值
+     */
+    @ApiModelProperty(notes = "角色数量最小值")
+    private Integer roleCountMin;
+
+    /**
+     * 角色数量最大值
+     */
+    @ApiModelProperty(notes = "角色数量最大值")
+    private Integer roleCountMax;
 }

+ 184 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameUserRoleExcelVO.java

@@ -0,0 +1,184 @@
+package com.zanxiang.game.module.manage.pojo.vo;
+
+import com.zanxiang.module.util.excel.ExcelAnno;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-08-23
+ * @description : 玩家角色表格
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class GameUserRoleExcelVO {
+
+    /**
+     * 玩家id
+     */
+    @ExcelAnno(title = "玩家id")
+    private Long userId;
+
+    /**
+     * 玩家账号
+     */
+    @ExcelAnno(title = "玩家账号")
+    private String username;
+
+    /**
+     * 玩家昵称
+     */
+    @ExcelAnno(title = "玩家昵称")
+    private String nickname;
+
+    /**
+     * 注册IP
+     */
+    @ExcelAnno(title = "注册IP")
+    private String regIp;
+
+    /**
+     * 玩家注册时间
+     */
+    @ExcelAnno(title = "玩家注册时间")
+    private LocalDateTime regTime;
+
+    /**
+     * 注册渠道名称
+     */
+    @ExcelAnno(title = "注册渠道名称")
+    private String agentName;
+
+    /**
+     * cp名称
+     */
+    @ExcelAnno(title = "cp名称")
+    private String cpName;
+
+    /**
+     * 游戏名称
+     */
+    @ExcelAnno(title = "游戏名称")
+    private String gameName;
+
+    /**
+     * 游戏应用类型名称
+     */
+    @ExcelAnno(title = "游戏应用类型名称")
+    private String gameCategoryName;
+
+    /**
+     * 原始服务器名称
+     */
+    @ExcelAnno(title = "原始服务器名称")
+    private String sourceServerName;
+
+    /**
+     * 游戏区服
+     */
+    @ExcelAnno(title = "游戏区服")
+    private String serverName;
+
+    /**
+     * 游戏角色
+     */
+    @ExcelAnno(title = "游戏角色")
+    private String roleName;
+
+    /**
+     * 游戏角色id
+     */
+    @ExcelAnno(title = "游戏角色id")
+    private String roleId;
+
+    /**
+     * 角色等级
+     */
+    @ExcelAnno(title = "角色等级")
+    private Long roleLevel;
+
+    /**
+     * 游戏战力
+     */
+    @ExcelAnno(title = "游戏战力")
+    private Long rolePower;
+
+    /**
+     * 角色vip
+     */
+    @ExcelAnno(title = "角色vip")
+    private Long roleVipLevel;
+
+    /**
+     * 操作系统
+     */
+    @ExcelAnno(title = "操作系统")
+    private String os;
+
+    /**
+     * 充值金额
+     */
+    @ExcelAnno(title = "充值金额")
+    private BigDecimal rechargeMoney;
+
+    /**
+     * 充值次数
+     */
+    @ExcelAnno(title = "充值次数")
+    private Integer rechargeCount;
+
+    /**
+     * 角色创建时间
+     */
+    @ExcelAnno(title = "角色创建时间")
+    private LocalDateTime createTime;
+
+    /**
+     * 最近登录时间
+     */
+    @ExcelAnno(title = "最近登录时间")
+    private LocalDateTime lastLoginTime;
+
+    /**
+     * 游戏角色更新时间
+     */
+    @ExcelAnno(title = "游戏角色更新时间")
+    private LocalDateTime updateTime;
+
+    /**
+     * 最近充值时间
+     */
+    @ExcelAnno(title = "最近充值时间")
+    private LocalDateTime lastRechargeTime;
+
+    /**
+     * 归因投放人员名字
+     */
+    @ExcelAnno(title = "归因投放人员名字")
+    private String pitcherName;
+
+    /**
+     * 归因推广账号id
+     */
+    @ExcelAnno(title = "归因推广账号id")
+    private Long accountId;
+
+    /**
+     * 归因推广账号类型(1:腾讯、2:头条)
+     */
+    @ExcelAnno(title = "因推广账号类型(1:腾讯、2:头条)")
+    private Integer accountType;
+
+    /**
+     * 注册充值时间差
+     */
+    @ExcelAnno(title = "注册充值时间差")
+    private Long regPayTimeDiff;
+}

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

@@ -8,6 +8,7 @@ import com.zanxiang.game.module.manage.pojo.vo.GameUserRoleListVO;
 import com.zanxiang.game.module.manage.pojo.vo.GameUserRoleVO;
 import com.zanxiang.game.module.mybatis.entity.GameUserRole;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 
 /**
@@ -51,4 +52,12 @@ public interface IGameUserRoleService extends IService<GameUserRole> {
      * @return {@link IPage}<{@link GameUserRoleListVO}>
      */
     IPage<GameUserRoleListVO> list(GameUserRoleListParam param);
+
+    /**
+     * 游戏用户角色excel
+     *
+     * @param param    参数
+     * @param response 响应
+     */
+    void getGameUserRoleExcel(GameUserRoleListParam param, HttpServletResponse response);
 }

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

@@ -3,6 +3,8 @@ package com.zanxiang.game.module.manage.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+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.DeleteEnum;
@@ -10,6 +12,7 @@ import com.zanxiang.game.module.manage.pojo.dto.GameDTO;
 import com.zanxiang.game.module.manage.pojo.params.GameServerAddUpdateParam;
 import com.zanxiang.game.module.manage.pojo.params.GameServerListParam;
 import com.zanxiang.game.module.manage.pojo.vo.GameServerListVO;
+import com.zanxiang.game.module.manage.service.IGameAuthService;
 import com.zanxiang.game.module.manage.service.IGameServerService;
 import com.zanxiang.game.module.manage.service.IGameService;
 import com.zanxiang.game.module.mybatis.entity.GameServer;
@@ -21,6 +24,7 @@ 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 reactor.util.function.Tuple2;
 
 import java.time.LocalDateTime;
 import java.time.LocalTime;
@@ -41,6 +45,9 @@ public class GameServerServiceImpl extends ServiceImpl<GameServerMapper, GameSer
     @Autowired
     private IGameService gameService;
 
+    @Autowired
+    private IGameAuthService gameAuthService;
+
     @Override
     public List<String> listServerId(Long gameId, String serverName) {
         if (Strings.isBlank(serverName)) {
@@ -85,7 +92,18 @@ public class GameServerServiceImpl extends ServiceImpl<GameServerMapper, GameSer
 
     @Override
     public IPage<GameServerListVO> listOfPage(GameServerListParam param) {
+        //游戏获取
+        Tuple2<String, List<Long>> gameTuple = gameAuthService.getUserGameList(null);
+        List<Long> gameIdList = gameTuple.getT2();
+        if (CollectionUtils.isEmpty(gameIdList)) {
+            return new Page<>();
+        }
+        //不包含参数游戏
+        if (param.getGameId() != null && !gameIdList.contains(param.getGameId())) {
+            return new Page<>();
+        }
         return page(param.toPage(), new QueryWrapper<GameServer>().lambda()
+                .in(GameServer::getGameId, gameIdList)
                 .eq(param.getGameId() != null, GameServer::getGameId, param.getGameId())
                 .eq(param.getServerId() != null, GameServer::getServerId, param.getServerId())
                 .like(Strings.isNotBlank(param.getServerName()), GameServer::getServerName, param.getServerName())

+ 19 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameUserConfigServiceImpl.java

@@ -3,12 +3,15 @@ package com.zanxiang.game.module.manage.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+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.GameDTO;
 import com.zanxiang.game.module.manage.pojo.params.GameUserConfigAddUpdateParam;
 import com.zanxiang.game.module.manage.pojo.params.GameUserConfigListParam;
 import com.zanxiang.game.module.manage.pojo.vo.GameUserConfigListVO;
+import com.zanxiang.game.module.manage.service.IGameAuthService;
 import com.zanxiang.game.module.manage.service.IGameService;
 import com.zanxiang.game.module.manage.service.IGameUserConfigService;
 import com.zanxiang.game.module.mybatis.entity.GameUserConfig;
@@ -19,8 +22,10 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import reactor.util.function.Tuple2;
 
 import java.time.LocalDateTime;
+import java.util.List;
 import java.util.Objects;
 
 /**
@@ -35,6 +40,9 @@ public class GameUserConfigServiceImpl extends ServiceImpl<GameUserConfigMapper,
     @Autowired
     private IGameService gameService;
 
+    @Autowired
+    private IGameAuthService gameAuthService;
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean addOrUpdate(GameUserConfigAddUpdateParam param) {
@@ -63,7 +71,18 @@ public class GameUserConfigServiceImpl extends ServiceImpl<GameUserConfigMapper,
 
     @Override
     public IPage<GameUserConfigListVO> listOfPage(GameUserConfigListParam param) {
+        //游戏获取
+        Tuple2<String, List<Long>> gameTuple = gameAuthService.getUserGameList(null);
+        List<Long> gameIdList = gameTuple.getT2();
+        if (CollectionUtils.isEmpty(gameIdList)) {
+            return new Page<>();
+        }
+        //不包含参数游戏
+        if (param.getGameId() != null && !gameIdList.contains(param.getGameId())) {
+            return new Page<>();
+        }
         return page(param.toPage(), new QueryWrapper<GameUserConfig>().lambda()
+                .in(GameUserConfig::getGameId, gameIdList)
                 .eq(param.getGameId() != null, GameUserConfig::getGameId, param.getGameId())
                 .orderByDesc(GameUserConfig::getCreateTime)
         ).convert(this::toVo);

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

@@ -6,11 +6,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zanxiang.erp.security.util.SecurityUtil;
 import com.zanxiang.game.module.base.pojo.enums.GameAuthEnum;
 import com.zanxiang.game.module.base.pojo.enums.GameCategoryEnum;
 import com.zanxiang.game.module.base.util.DateUtils;
 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.GameUserRoleExcelVO;
 import com.zanxiang.game.module.manage.pojo.vo.GameUserRoleListVO;
 import com.zanxiang.game.module.manage.pojo.vo.GameUserRoleVO;
 import com.zanxiang.game.module.manage.service.*;
@@ -19,12 +21,16 @@ import com.zanxiang.game.module.mybatis.entity.GameServer;
 import com.zanxiang.game.module.mybatis.entity.GameUserRole;
 import com.zanxiang.game.module.mybatis.mapper.GameUserRoleMapper;
 import com.zanxiang.module.util.bean.BeanUtil;
+import com.zanxiang.module.util.excel.ExcelUtil;
+import com.zanxiang.module.util.exception.BaseException;
+import com.zanxiang.module.web.util.WebExcelUtil;
 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 reactor.util.function.Tuple2;
 
+import javax.servlet.http.HttpServletResponse;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
 import java.util.*;
@@ -211,4 +217,68 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
         }
         return gameUserRoleListVO;
     }
+
+    @Override
+    public void getGameUserRoleExcel(GameUserRoleListParam param, HttpServletResponse response) {
+        if (!SecurityUtil.isAdmin()) {
+            throw new BaseException("没有下载权限");
+        }
+        //游戏获取
+        Tuple2<String, List<Long>> gameTuple = gameAuthService.getUserGameList(param.getPitcherId());
+        if (CollectionUtils.isEmpty(gameTuple.getT2())) {
+            return;
+        }
+        //游戏条件处理
+        Map<Long, GameDTO> gameMap = gameService.gameCondition(gameTuple.getT2(), param.getCpId(), param.getGameId(), param.getGameCategoryId());
+        //根据条件, 匹配不到游戏
+        if (gameMap != null && gameMap.isEmpty()) {
+            return;
+        }
+        //渠道获取
+        Tuple2<List<Long>, List<AgentDTO>> tuple2 = agentService.getUserAgent(param.getAccountId(), param.getPitcherId(), param.getChannelId());
+        List<Long> agentIdList = tuple2.getT1();
+        List<AgentDTO> agentDTOList = tuple2.getT2();
+        if (Objects.equals(gameTuple.getT1(), GameAuthEnum.PITCHER.getValue()) && CollectionUtils.isEmpty(agentIdList)) {
+            return;
+        }
+        //玩家条件处理
+        Map<Long, UserDTO> userMap = userService.userCondition(param.getUserId(), agentIdList, param.getUserName(),
+                param.getNickname(), param.getRegIp(), param.getRegTimeBeginDate(), param.getRegTimeEndDate());
+        //根据条件, 匹配不到玩家
+        if (userMap != null && userMap.isEmpty()) {
+            return;
+        }
+        //区服筛选
+        List<String> serverIdList = gameServerService.listServerId(param.getGameId(), param.getServerName());
+        Map<Long, CpDTO> cpMap = cpService.cpMap();
+        //相关用户id
+        Map<Long, AgentDTO> agentMap = agentDTOList.stream().collect(Collectors.toMap(AgentDTO::getId, Function.identity()));
+        Set<Long> userIdSet = userMap == null ? null : userMap.keySet();
+        //下载查询
+        WebExcelUtil.httpExport(response, "玩家角色", GameUserRoleExcelVO.class, ((pageNumber, pageSize) -> {
+            //查询订单
+            return page(new Page<>(pageNumber, pageSize), new QueryWrapper<GameUserRole>().lambda()
+                    .in(CollectionUtils.isNotEmpty(userIdSet), GameUserRole::getUserId, userIdSet)
+                    .in(CollectionUtils.isNotEmpty(serverIdList), GameUserRole::getServerId, serverIdList)
+                    .in(gameMap != null, GameUserRole::getGameId, gameMap != null ? gameMap.keySet() : null)
+                    .like(Strings.isNotBlank(param.getRoleName()), GameUserRole::getRoleName, param.getRoleName())
+                    .eq(Objects.equals(param.getIsRecharge(), Boolean.FALSE), GameUserRole::getRechargeCount, 0)
+                    .eq(Strings.isNotBlank(param.getOs()), GameUserRole::getOs, param.getOs())
+                    .gt(Objects.equals(param.getIsRecharge(), Boolean.TRUE), GameUserRole::getRechargeCount, 0)
+                    .gt(param.getVipLevel() != null && param.getVipLevel() > 10, GameUserRole::getRoleVipLevel, param.getVipLevel())
+                    .eq(param.getVipLevel() != null && param.getVipLevel() <= 10, GameUserRole::getRoleVipLevel, param.getVipLevel())
+                    .le(param.getEndDate() != null, GameUserRole::getCreateTime, param.getEndDate() == null ? null : LocalDateTime.of(param.getEndDate(), LocalTime.MAX))
+                    .ge(param.getBeginDate() != null, GameUserRole::getCreateTime, param.getBeginDate() == null ? null : LocalDateTime.of(param.getBeginDate(), LocalTime.MIN))
+                    .le(param.getRechargeEndDate() != null, GameUserRole::getLastRechargeTime, param.getRechargeEndDate() == null ? null : LocalDateTime.of(param.getRechargeEndDate(), LocalTime.MAX))
+                    .ge(param.getRechargeBeginDate() != null, GameUserRole::getLastRechargeTime, param.getRechargeBeginDate() == null ? null : LocalDateTime.of(param.getRechargeBeginDate(), LocalTime.MIN))
+                    .le(param.getRoleLevelMax() != null, GameUserRole::getRoleLevel, param.getRoleLevelMax())
+                    .ge(param.getRoleLevelMin() != null, GameUserRole::getRoleLevel, param.getRoleLevelMin())
+                    .apply(param.getRegPayIntervalTimeMax() != null, "if(last_recharge_time is not null, TIMESTAMPDIFF(minute, reg_time, last_recharge_time), null) <= {0}", param.getRegPayIntervalTimeMax())
+                    .apply(param.getRegPayIntervalTimeMin() != null, "if(last_recharge_time is not null, TIMESTAMPDIFF(minute, reg_time, last_recharge_time), null) >= {0}", param.getRegPayIntervalTimeMin())
+                    .orderByDesc(GameUserRole::getCreateTime)
+            ).convert(u -> this.toVo(u, userMap, gameMap, cpMap, agentMap)).getRecords()
+                    .stream().map(gameUserRoleListVO -> BeanUtil.copy(gameUserRoleListVO, GameUserRoleExcelVO.class))
+                    .collect(Collectors.toList());
+        }), ExcelUtil.DEFAULT_MAX_DATA_SIZE);
+    }
 }

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

@@ -247,7 +247,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
                 .like(Strings.isNotBlank(param.getRoleName()), Order::getRoleName, param.getRoleName())
                 .eq(param.getCpId() != null, Order::getCpId, param.getCpId())
                 .eq(param.getGameId() != null, Order::getGameId, param.getGameId())
-                .in(Objects.equals(gameTuple.getT1(), GameAuthEnum.PITCHER.getValue()), Order::getAgentId, agentIdList)
+                .in(CollectionUtils.isNotEmpty(agentIdList), Order::getAgentId, agentIdList)
                 .eq(Strings.isNotBlank(param.getDeviceSystem()), Order::getDeviceSystem, param.getDeviceSystem())
                 .eq(param.getIsSwitch() != null, Order::getIsSwitch, param.getIsSwitch())
                 .eq(Strings.isNotBlank(param.getProductName()), Order::getProductName, param.getProductName())
@@ -277,18 +277,23 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         Tuple2<String, List<Long>> gameTuple = gameAuthService.getUserGameList(param.getPitcherId());
         List<Long> gameIdList = gameTuple.getT2();
         if (CollectionUtils.isEmpty(gameIdList)) {
-            throw new BaseException("参数错误, 未配置游戏权限");
+            return;
         }
         //渠道获取
         Tuple2<List<Long>, List<AgentDTO>> tuple2 = agentService.getUserAgent(param.getAccountId(), param.getPitcherId(), param.getChannelId());
         List<Long> agentIds = tuple2.getT1();
-        List<AgentDTO> agentDTOList = tuple2.getT2();
+        //渠道
+        Map<Long, AgentDTO> agentMap = tuple2.getT2().stream().collect(Collectors.toMap(AgentDTO::getId, Function.identity()));
         //查询用户id和名字条件
         List<User> userList = new ArrayList<>();
         if (Strings.isBlank(param.getUserId()) && Strings.isNotBlank(param.getUsername())) {
             userList = userService.list(new LambdaQueryWrapper<User>()
                     .like(User::getUsername, param.getUsername()));
         }
+        //商户列表
+        Map<String, PayMerchantDTO> payMerchantMap = payMerchantService.payMerchantMap();
+        //cp信息
+        Map<Long, CpDTO> cpMap = cpService.cpMap();
         final List<Long> userIds = userList.stream().map(User::getId).collect(Collectors.toList());
         List<String> serverIdList = gameServerService.listServerId(param.getGameId(), param.getServerName());
         //excel下载
@@ -296,17 +301,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             //查询订单
             List<OrderVO> orderVOList = page(new Page<>(pageNumber, pageSize), this.getListWrapper(param, gameTuple,
                     agentIds, userIds, serverIdList, "*")).convert(this::toVO).getRecords();
-            //商户列表
-            Map<String, PayMerchantDTO> payMerchantMap = payMerchantService.payMerchantMap();
-            //cp信息
-            Map<Long, CpDTO> cpMap = cpService.cpMap();
             //玩家信息
             List<Long> userIdList = orderVOList.stream().map(OrderVO::getUserId).collect(Collectors.toList());
             Map<Long, UserDTO> userMap = userService.getByUserIds(userIdList);
             //游戏信息
             Map<Long, GameDTO> gameMap = gameService.gameMap(orderVOList.stream().map(OrderVO::getGameId).collect(Collectors.toSet()));
-            //渠道
-            Map<Long, AgentDTO> agentMap = agentDTOList.stream().collect(Collectors.toMap(AgentDTO::getId, Function.identity()));
             //字段信息补充更新
             orderVOList.forEach(vo -> this.toVO(vo, userMap, gameMap, cpMap, agentMap, payMerchantMap));
             //excel字段赋值

+ 5 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/UserServiceImpl.java

@@ -223,9 +223,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
                 .gt(Objects.equals(param.getIsRecharge(), Boolean.TRUE), User::getRechargeCount, 0)
                 .eq(Objects.equals(param.getIsRecharge(), Boolean.FALSE), User::getRechargeCount, 0)
                 .eq(param.getStatus() != null, User::getStatus, param.getStatus())
-                .in(Objects.equals(gameTuple.getT1(), GameAuthEnum.PITCHER.getValue()), User::getAgentId, agentIdList)
+                .in(CollectionUtils.isNotEmpty(agentIdList), User::getAgentId, agentIdList)
                 .apply(param.getRegPayIntervalTimeMin() != null, "if(last_recharge_time is not null, TIMESTAMPDIFF(minute, create_time, last_recharge_time), null) >= {0}", param.getRegPayIntervalTimeMin())
                 .apply(param.getRegPayIntervalTimeMax() != null, "if(last_recharge_time is not null, TIMESTAMPDIFF(minute, create_time, last_recharge_time), null) <= {0}", param.getRegPayIntervalTimeMax())
+                .gt(Objects.equals(param.getCreateRole(), Boolean.TRUE), User::getRoleCount, 0)
+                .le(Objects.equals(param.getCreateRole(), Boolean.FALSE), User::getRoleCount, 0)
+                .ge(param.getRoleCountMin() != null, User::getRoleCount, param.getRoleCountMin())
+                .le(param.getRoleCountMax() != null, User::getRoleCount, param.getRoleCountMax())
                 .orderByDesc(User::getCreateTime)
         ).convert(u -> this.toVo(u, gameMap, cpMap, agentDTOList));
     }