feat(game): 添加租户key并优化游戏投注记录查询
- 在 GameBettingDetails 模型中添加 tenantKey 字段 - 修改 getBetRecord 接口,根据租户key查询投注记录 - 新增 GameBettingDetailsResponse 类用于响应数据 - 更新 mapper 和 service 实现类,支持租户keymain-p
parent
0a2b408c2b
commit
3ce519cb00
|
@ -6,6 +6,7 @@ import cn.hutool.core.util.NumberUtil;
|
|||
import com.dtflys.forest.annotation.Post;
|
||||
import com.ff.annotation.CheckHeader;
|
||||
import com.ff.api.request.*;
|
||||
import com.ff.api.response.GameBettingDetailsResponse;
|
||||
import com.ff.api.response.GameExchangeBalanceResponse;
|
||||
import com.ff.api.response.GameResponse;
|
||||
import com.ff.api.response.MemberInfoAllResponse;
|
||||
|
@ -298,17 +299,31 @@ public class ApiGameController extends BaseController {
|
|||
*/
|
||||
@PostMapping("/get/bet/record")
|
||||
public TableDataInfo getBetRecord(@Validated @RequestBody GameGetBetRecordRequest gameCreateFreeSpinRequest) {
|
||||
TenantSecretKey tenantSecretKey = keyConfig.get();
|
||||
|
||||
startPage();
|
||||
PageHelper.startPage(gameCreateFreeSpinRequest.getPageNo(), gameCreateFreeSpinRequest.getPageSize(), "wagers_time desc");
|
||||
GameBettingDetails gameBettingDetails = GameBettingDetails.builder()
|
||||
.platformCode(gameCreateFreeSpinRequest.getPlatformCode())
|
||||
.currencyCode(gameCreateFreeSpinRequest.getCurrencyCode())
|
||||
.tenantKey(tenantSecretKey.getTenantKey())
|
||||
.build();
|
||||
Map<String, Object> params = gameBettingDetails.getParams();
|
||||
params.put("beginTime", gameCreateFreeSpinRequest.getBeginTime());
|
||||
params.put("endTime", gameCreateFreeSpinRequest.getEndTime());
|
||||
List<GameBettingDetails> bettingDetails = gameBettingDetailsService.selectGameBettingDetailsList(gameBettingDetails);
|
||||
return getDataTable(bettingDetails);
|
||||
TableDataInfo dataTable = getDataTable(bettingDetails);
|
||||
List<GameBettingDetailsResponse> result=new ArrayList<>();
|
||||
for (GameBettingDetails row : (List<GameBettingDetails>) dataTable.getRows()) {
|
||||
GameBettingDetailsResponse gameBettingDetailsResponse=new GameBettingDetailsResponse();
|
||||
BeanUtils.copyProperties(row, gameBettingDetailsResponse);
|
||||
Member member = memberService.selectMemberById(row.getMemberId());
|
||||
gameBettingDetailsResponse.setAccount(member.getMemberAccount());
|
||||
result.add(gameBettingDetailsResponse);
|
||||
}
|
||||
dataTable.setRows(result);
|
||||
|
||||
return dataTable;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,91 @@
|
|||
package com.ff.api.response;
|
||||
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 会员投注细目对象 ff_game_betting_details
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class GameBettingDetailsResponse implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = -988976119749917266L;
|
||||
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
private String tenantKey;
|
||||
|
||||
|
||||
/** 币种编码 */
|
||||
private String currencyCode;
|
||||
|
||||
|
||||
|
||||
/** 游戏id */
|
||||
private Long gameId;
|
||||
|
||||
/** 游戏类型 ff_game_type 字典 */
|
||||
private Integer gameType;
|
||||
|
||||
/** 游戏平台 */
|
||||
private String platformCode;
|
||||
|
||||
/** 游戏名称 */
|
||||
private String gameName;
|
||||
|
||||
/** 注单状态 1: 赢 2: 输 3: 平局 */
|
||||
private Integer gameStatus;
|
||||
|
||||
/** 注单类型 */
|
||||
private Integer gameStatusType;
|
||||
|
||||
/** 游戏币种类型 */
|
||||
private String gameCurrencyCode;
|
||||
|
||||
/** 系统账号 */
|
||||
private String account;
|
||||
|
||||
/** 游戏注单唯一值 */
|
||||
private Long wagersId;
|
||||
|
||||
/** 投注时间 (Unix 时间戳) */
|
||||
private Long wagersTime;
|
||||
|
||||
/** 投注金额 */
|
||||
private BigDecimal betAmount;
|
||||
|
||||
/** 派彩时间 (Unix 时间戳) */
|
||||
private Long payoffTime;
|
||||
|
||||
/** 派彩金额 */
|
||||
private BigDecimal payoffAmount;
|
||||
|
||||
/** 对帐时间 (Unix 时间戳) */
|
||||
private Long settlementTime;
|
||||
|
||||
/** 有效投注金额 ※注 1 */
|
||||
private BigDecimal turnover;
|
||||
|
||||
/** 订单id */
|
||||
private String orderNo;
|
||||
|
||||
/** 结算状态 1 未结算 2已结算 3 已撤单 */
|
||||
private Integer settlementStatus;
|
||||
|
||||
|
||||
}
|
|
@ -694,6 +694,7 @@ public class GamesJILIServiceImpl implements IGamesService {
|
|||
|
||||
//数据构造
|
||||
GameBettingDetails gameBettingDetails = GameBettingDetails.builder()
|
||||
.tenantKey(member.getTenantKey())
|
||||
//保存我们的币种id
|
||||
.currencyCode(systemByCode)
|
||||
.memberId(member.getId())
|
||||
|
|
|
@ -542,6 +542,7 @@ public class GamesXKServiceImpl implements IGamesService {
|
|||
}
|
||||
//数据构造
|
||||
GameBettingDetails gameBettingDetails = GameBettingDetails.builder()
|
||||
.tenantKey(member.getTenantKey())
|
||||
//保存我们的币种id
|
||||
.currencyCode(systemByCode)
|
||||
.memberId(member.getId())
|
||||
|
|
|
@ -25,6 +25,13 @@ public class GameBettingDetails extends BaseEntity
|
|||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
private String tenantKey;
|
||||
|
||||
|
||||
/** 币种编码 */
|
||||
@Excel(name = "币种编码")
|
||||
private String currencyCode;
|
||||
|
@ -89,6 +96,7 @@ public class GameBettingDetails extends BaseEntity
|
|||
@Excel(name = "派彩金额")
|
||||
private BigDecimal payoffAmount;
|
||||
|
||||
|
||||
/** 对帐时间 (Unix 时间戳) */
|
||||
@Excel(name = "对帐时间 (Unix 时间戳)")
|
||||
private Long settlementTime;
|
||||
|
|
|
@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<resultMap type="GameBettingDetails" id="GameBettingDetailsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="tenantKey" column="tenant_key" />
|
||||
<result property="currencyCode" column="currency_code" />
|
||||
<result property="memberId" column="member_id" />
|
||||
<result property="gameCode" column="game_code" />
|
||||
|
@ -33,12 +34,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectGameBettingDetailsVo">
|
||||
select id, currency_code, member_id, game_code, game_id, game_type, platform_code, game_name, game_status, game_status_type, game_currency_code, account, wagers_id, wagers_time, bet_amount, payoff_time, payoff_amount, settlement_time, turnover, order_no, settlement_status, create_by, create_time, update_by, update_time from ff_game_betting_details
|
||||
select id,tenant_key, currency_code, member_id, game_code, game_id, game_type, platform_code, game_name, game_status, game_status_type, game_currency_code, account, wagers_id, wagers_time, bet_amount, payoff_time, payoff_amount, settlement_time, turnover, order_no, settlement_status, create_by, create_time, update_by, update_time from ff_game_betting_details
|
||||
</sql>
|
||||
|
||||
<select id="selectGameBettingDetailsList" parameterType="GameBettingDetails" resultMap="GameBettingDetailsResult">
|
||||
<include refid="selectGameBettingDetailsVo"/>
|
||||
<where>
|
||||
<if test="tenantKey != null and tenantKey != ''"> and tenant_key = #{tenantKey}</if>
|
||||
<if test="currencyCode != null and currencyCode != ''"> and currency_code = #{currencyCode}</if>
|
||||
<if test="memberId != null "> and member_id = #{memberId}</if>
|
||||
<if test="gameCode != null "> and game_code = #{gameCode}</if>
|
||||
|
@ -89,6 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<insert id="insertGameBettingDetails" parameterType="GameBettingDetails" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ff_game_betting_details
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="tenantKey != null">tenant_key,</if>
|
||||
<if test="currencyCode != null">currency_code,</if>
|
||||
<if test="memberId != null">member_id,</if>
|
||||
<if test="gameCode != null">game_code,</if>
|
||||
|
@ -115,6 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="tenantKey != null">#{tenantKey},</if>
|
||||
<if test="currencyCode != null">#{currencyCode},</if>
|
||||
<if test="memberId != null">#{memberId},</if>
|
||||
<if test="gameCode != null">#{gameCode},</if>
|
||||
|
@ -145,6 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<update id="updateGameBettingDetails" parameterType="GameBettingDetails">
|
||||
update ff_game_betting_details
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="tenantKey != null">tenant_key = #{tenantKey},</if>
|
||||
<if test="currencyCode != null">currency_code = #{currencyCode},</if>
|
||||
<if test="memberId != null">member_id = #{memberId},</if>
|
||||
<if test="gameCode != null">game_code = #{gameCode},</if>
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue