Sfoglia il codice sorgente

fix : 游戏提现记录

bilingfeng 1 anno fa
parent
commit
156565628a

+ 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服务启动成功 <dubbo升级3.0, 实名认证列表增加游戏id和名称返回> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 <dubbo升级3.0, 游戏提现记录> ( ´・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 14 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/OrderController.java

@@ -2,10 +2,13 @@ package com.zanxiang.game.module.manage.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.zanxiang.erp.security.annotation.PreAuthorize;
+import com.zanxiang.game.module.manage.pojo.params.GameRemitLogListParam;
 import com.zanxiang.game.module.manage.pojo.params.OrderParam;
 import com.zanxiang.game.module.manage.pojo.params.PayCallCpLogParam;
+import com.zanxiang.game.module.manage.pojo.vo.GameRemitLogVO;
 import com.zanxiang.game.module.manage.pojo.vo.LogPayCpVO;
 import com.zanxiang.game.module.manage.pojo.vo.OrderListVO;
+import com.zanxiang.game.module.manage.service.IGameRemitLogService;
 import com.zanxiang.game.module.manage.service.ILogPayCpService;
 import com.zanxiang.game.module.manage.service.IOrderService;
 import com.zanxiang.module.util.pojo.ResultVO;
@@ -38,6 +41,9 @@ public class OrderController {
     @Autowired
     private ILogPayCpService logPayCpService;
 
+    @Autowired
+    private IGameRemitLogService gameRemitLogService;
+
     @ApiOperation(value = "订单列表")
     @PostMapping(value = "/list")
     @PreAuthorize(permissionKey = "manage:order:orderList")
@@ -61,4 +67,12 @@ public class OrderController {
     public void getOrderExcel(@Validated @RequestBody OrderParam param, HttpServletResponse response) {
         orderService.getOrderExcel(param, response);
     }
+
+    @ApiOperation(value = "游戏提现记录")
+    @PostMapping(value = "/remit/Log")
+    @PreAuthorize(permissionKey = "manage:order:remitLog")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameRemitLogVO.class, responseContainer = "list")})
+    public ResultVO<IPage<GameRemitLogVO>> listOfPage(@Validated @RequestBody GameRemitLogListParam param) {
+        return ResultVO.ok(gameRemitLogService.listOfPage(param));
+    }
 }

+ 49 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/params/GameRemitLogListParam.java

@@ -0,0 +1,49 @@
+package com.zanxiang.game.module.manage.pojo.params;
+
+import com.zanxiang.game.module.mybatis.entity.GameRemitLog;
+import com.zanxiang.module.web.pojo.BaseListDTO;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.time.LocalDate;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-08-08
+ * @description : 提现记录查询参数
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class GameRemitLogListParam extends BaseListDTO<GameRemitLog> {
+
+    /**
+     * 用户id
+     */
+    @ApiModelProperty(notes = "用户id")
+    private Long userId;
+
+    /**
+     * 游戏id
+     */
+    @ApiModelProperty(notes = "游戏id")
+    private Long gameId;
+
+    /**
+     * 交易订单号
+     */
+    @ApiModelProperty(notes = "交易订单号")
+    private String merchantOrderNo;
+
+    /**
+     * 提现开始时间
+     */
+    @ApiModelProperty(notes = "提现开始时间")
+    private LocalDate startTime;
+
+    /**
+     * 提现结束时间
+     */
+    @ApiModelProperty(notes = "提现结束时间")
+    private LocalDate endTime;
+}

+ 72 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/pojo/vo/GameRemitLogVO.java

@@ -1,9 +1,81 @@
 package com.zanxiang.game.module.manage.pojo.vo;
 
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
 /**
  * @author : lingfeng
  * @time : 2023-08-08
  * @description : 提现记录
  */
+@Data
 public class GameRemitLogVO {
+
+    /**
+     * 主键
+     */
+    @ApiModelProperty(notes = "主键")
+    private Long id;
+
+    /**
+     * 用户id
+     */
+    @ApiModelProperty(notes = "用户id")
+    private Long userId;
+
+    /**
+     * 游戏id
+     */
+    @ApiModelProperty(notes = "游戏id")
+    private Long gameId;
+
+    /**
+     * 游戏名称
+     */
+    @ApiModelProperty(notes = "游戏名称")
+    private String gameName;
+
+    /**
+     * 交易订单号
+     */
+    @ApiModelProperty(notes = "交易订单号")
+    private String merchantOrderNo;
+
+    /**
+     * 金额(单位 : 分)
+     */
+    @ApiModelProperty(notes = "金额(单位 : 分)")
+    private Long amount;
+
+    /**
+     * 提现平台
+     */
+    @ApiModelProperty(notes = "提现平台")
+    private String payPlatform;
+
+    /**
+     * 提现账号
+     */
+    @ApiModelProperty(notes = "提现账号")
+    private String payAccount;
+
+    /**
+     * 提现时间
+     */
+    @ApiModelProperty(notes = "提现时间")
+    private LocalDateTime createdTime;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(notes = "创建时间")
+    private LocalDateTime createTime;
+
+    /**
+     * 更新时间
+     */
+    @ApiModelProperty(notes = "更新时间")
+    private LocalDateTime updateTime;
 }

+ 11 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/IGameRemitLogService.java

@@ -1,6 +1,9 @@
 package com.zanxiang.game.module.manage.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zanxiang.game.module.manage.pojo.params.GameRemitLogListParam;
+import com.zanxiang.game.module.manage.pojo.vo.GameRemitLogVO;
 import com.zanxiang.game.module.mybatis.entity.GameRemitLog;
 
 /**
@@ -9,4 +12,12 @@ import com.zanxiang.game.module.mybatis.entity.GameRemitLog;
  * @description : 游戏提现记录
  */
 public interface IGameRemitLogService extends IService<GameRemitLog> {
+
+    /**
+     * 列表页面
+     *
+     * @param param 参数
+     * @return {@link IPage}<{@link GameRemitLogVO}>
+     */
+    IPage<GameRemitLogVO> listOfPage(GameRemitLogListParam param);
 }

+ 69 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/GameRemitLogServiceImpl.java

@@ -1,11 +1,34 @@
 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.game.module.manage.pojo.dto.AgentDTO;
+import com.zanxiang.game.module.manage.pojo.dto.GameDTO;
+import com.zanxiang.game.module.manage.pojo.params.GameRemitLogListParam;
+import com.zanxiang.game.module.manage.pojo.vo.GameRemitLogVO;
+import com.zanxiang.game.module.manage.service.IAgentService;
 import com.zanxiang.game.module.manage.service.IGameRemitLogService;
+import com.zanxiang.game.module.manage.service.IGameService;
+import com.zanxiang.game.module.manage.service.IUserService;
 import com.zanxiang.game.module.mybatis.entity.GameRemitLog;
+import com.zanxiang.game.module.mybatis.entity.User;
 import com.zanxiang.game.module.mybatis.mapper.GameRemitLogMapper;
+import com.zanxiang.module.util.bean.BeanUtil;
 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 java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
 
 /**
  * @author : lingfeng
@@ -16,4 +39,50 @@ import org.springframework.stereotype.Service;
 @Service
 public class GameRemitLogServiceImpl extends ServiceImpl<GameRemitLogMapper, GameRemitLog> implements IGameRemitLogService {
 
+    @Autowired
+    private IGameService gameService;
+
+    @Autowired
+    private IAgentService agentService;
+
+    @Autowired
+    private IUserService userService;
+
+    @Override
+    public IPage<GameRemitLogVO> listOfPage(GameRemitLogListParam param) {
+        //渠道获取
+        Tuple2<List<Long>, List<AgentDTO>> tuple2 = agentService.getUserAgent(null, null, null);
+        if (CollectionUtils.isNotEmpty(tuple2.getT1())) {
+            return new Page<>();
+        }
+        //查询渠道的用户
+        List<Long> userIdList = userService.list(new LambdaQueryWrapper<User>()
+                .in(User::getAgentId, tuple2.getT1())
+        ).stream().map(User::getId).collect(Collectors.toList());
+        if (CollectionUtils.isEmpty(userIdList)) {
+            return new Page<>();
+        }
+        if (param.getUserId() != null && !userIdList.contains(param.getUserId())) {
+            return new Page<>();
+        }
+        return page(param.toPage(), new QueryWrapper<GameRemitLog>().lambda()
+                .in(CollectionUtils.isNotEmpty(userIdList), GameRemitLog::getUserId, userIdList)
+                .eq(param.getUserId() != null, GameRemitLog::getUserId, param.getUserId())
+                .eq(param.getGameId() != null, GameRemitLog::getGameId, param.getGameId())
+                .eq(Strings.isNotBlank(param.getMerchantOrderNo()), GameRemitLog::getMerchantOrderNo, param.getMerchantOrderNo())
+                .ge(param.getStartTime() != null, GameRemitLog::getCreatedTime, param.getStartTime() == null ? null : LocalDateTime.of(param.getStartTime(), LocalTime.MIN))
+                .le(param.getEndTime() != null, GameRemitLog::getCreatedTime, param.getEndTime() == null ? null : LocalDateTime.of(param.getEndTime(), LocalTime.MAX))
+                .orderByDesc(GameRemitLog::getCreatedTime)
+        ).convert(this::toVo);
+    }
+
+    private GameRemitLogVO toVo(GameRemitLog gameRemitLog) {
+        if (Objects.isNull(gameRemitLog)) {
+            return null;
+        }
+        GameRemitLogVO gameRemitLogVO = BeanUtil.copy(gameRemitLog, GameRemitLogVO.class);
+        GameDTO gameDTO = gameService.getById(gameRemitLog.getGameId());
+        gameRemitLogVO.setGameName(gameDTO == null ? null : gameDTO.getName());
+        return gameRemitLogVO;
+    }
 }

+ 51 - 0
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameUserConfig.java

@@ -0,0 +1,51 @@
+package com.zanxiang.game.module.mybatis.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-08-08
+ * @description : 有效用户配置
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@ToString
+@Builder
+@TableName("t_game_user_config")
+public class GameUserConfig implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 游戏id
+     */
+    private Long gameId;
+
+    /**
+     * 游戏角色等级
+     */
+    private Long roleLevel;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+}

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

@@ -0,0 +1,12 @@
+package com.zanxiang.game.module.mybatis.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zanxiang.game.module.mybatis.entity.GameUserConfig;
+
+/**
+ * @author : lingfeng
+ * @time : 2023-08-08
+ * @description : 有效用户配置
+ */
+public interface GameUserConfigMapper extends BaseMapper<GameUserConfig> {
+}