新增代付订单 SQL、实体和 Mapper。
开放接口增加 /api/v1/payout/create 和 /api/v1/payout/query。 pay_usdt_num 按 TRX 手续费处理。 USDT 代付冻结 USDT 本金和 TRX 手续费。 TRX 代付冻结 TRX 本金与手续费总额。 创建时锁定 apps 行,避免与代收入账并发覆盖余额。 支持 appId + order_id 幂等。 审核通过进入待执行,拒绝时原路解冻。 已提供 [usdt_payout_order.sql](D:/myprojects/usdt/myEpusdt/sql/usdt_payout_order.sql)。 JDK 8 多模块编译通过。
This commit is contained in:
1 parent
14b3093177
commit
9c879c1312
7 files changed
+179
No files matched your search
@@ -30,6 +30,14 @@ public interface AppsMapper extends BaseMapper<AppsPlus>
|
||||
@Param("trxBalance") java.math.BigDecimal trxBalance,
|
||||
@Param("updatedAt") java.util.Date updatedAt);
|
||||
|
||||
/** 在已持有应用行锁时原子写入代付可用及冻结余额。 */
|
||||
int updatePayoutBalances(@Param("id") Long id,
|
||||
@Param("usdtBalance") java.math.BigDecimal usdtBalance,
|
||||
@Param("trxBalance") java.math.BigDecimal trxBalance,
|
||||
@Param("usdtFrozenBalance") java.math.BigDecimal usdtFrozenBalance,
|
||||
@Param("trxFrozenBalance") java.math.BigDecimal trxFrozenBalance,
|
||||
@Param("updatedAt") java.util.Date updatedAt);
|
||||
|
||||
int updateKeyPair(@Param("id") Long id, @Param("publicKey") String publicKey,
|
||||
@Param("privateKey") String privateKey, @Param("updatedAt") java.util.Date updatedAt);
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.system.domain.UsdtPayoutOrder;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
public interface UsdtPayoutOrderMapper extends BaseMapper<UsdtPayoutOrder> {
|
||||
@Select("select * from usdt_payout_order where id=#{id} and deleted_at is null for update")
|
||||
UsdtPayoutOrder selectByIdForUpdate(@Param("id") Long id);
|
||||
}
|
||||
Reference in new issue
Block a user