删除旧 PayoutOrderController,功能统一到 [UsdtPayoutOrderController.java (line 23)](D:/myprojects/usdt/myEpusdt/ruoyi-system/src/main/java/com/ruoyi/system/controller/UsdtPayoutOrderController.java:23)。

删除旧 system/payout 页面及 API。
管理员和商户页面统一使用共享组件 [PayoutOrderView.vue](D:/myprojects/usdt/usdt-ui/src/views/system/usdtPayoutOrder/components/PayoutOrderView.vue)。
管理员支持查询、统计、详情、导出、审核、密码广播和失败重试。
商户仅支持查询、统计和详情,无增删改、审核及执行权限。
增加状态统计、完成 USDT/TRX 金额、手续费汇总。
增加应用、用户、订单号、币种、状态、时间范围等查询条件。
后端关联返回应用名称和用户名。
通用新增、修改、删除接口已移除,防止绕过冻结余额和审核状态机。
更新 [usdt_payout_menu.sql](D:/myprojects/usdt/myEpusdt/sql/usdt_payout_menu.sql),可幂等迁移旧 system:payout:* 权限。
This commit is contained in:
lu7213 committed 2026-10-17 12:43:47 -04:00
1 parent 1eca7a77bc
commit c58e55a2e1
9 files changed
+195 -227

No files matched your search

@@ -32,47 +32,67 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
<result property="deletedAt" column="deleted_at" />
<result property="appName" column="app_name" />
<result property="userName" column="user_name" />
</resultMap>
<sql id="selectUsdtPayoutOrderVo">
select id, trade_id, order_id, app_id, user_id, currency, amount, fee_currency, fee_amount, to_address, status, audit_type, auditor_id, audit_remark, audited_at, block_transaction_id, execute_error, execute_count, executed_at, confirmed_at, notify_url, redirect_url, callback_num, callback_confirm, created_at, updated_at, deleted_at from usdt_payout_order
select p.id, p.trade_id, p.order_id, p.app_id, p.user_id, p.currency, p.amount,
p.fee_currency, p.fee_amount, p.to_address, p.status, p.audit_type,
p.auditor_id, p.audit_remark, p.audited_at, p.block_transaction_id,
p.execute_error, p.execute_count, p.executed_at, p.confirmed_at,
p.notify_url, p.redirect_url, p.callback_num, p.callback_confirm,
p.created_at, p.updated_at, p.deleted_at,
a.name as app_name, u.user_name
from usdt_payout_order p
left join apps a on a.id = p.app_id
left join sys_user u on u.user_id = p.user_id
</sql>
<sql id="payoutQueryConditions">
p.deleted_at is null
<if test="tradeId != null and tradeId != ''"> and p.trade_id like concat('%', #{tradeId}, '%')</if>
<if test="orderId != null and orderId != ''"> and p.order_id like concat('%', #{orderId}, '%')</if>
<if test="appId != null"> and p.app_id = #{appId}</if>
<if test="userId != null"> and p.user_id = #{userId}</if>
<if test="currency != null and currency != ''"> and p.currency = #{currency}</if>
<if test="toAddress != null and toAddress != ''"> and p.to_address like concat('%', #{toAddress}, '%')</if>
<if test="status != null"> and p.status = #{status}</if>
<if test="auditType != null and auditType != ''"> and p.audit_type = #{auditType}</if>
<if test="callbackConfirm != null"> and p.callback_confirm = #{callbackConfirm}</if>
<if test="params != null and params.beginTime != null and params.beginTime != ''">
and p.created_at <![CDATA[ >= ]]> #{params.beginTime}
</if>
<if test="params != null and params.endTime != null and params.endTime != ''">
and p.created_at <![CDATA[ < ]]> date_add(#{params.endTime}, interval 1 day)
</if>
</sql>
<select id="selectUsdtPayoutOrderList" parameterType="UsdtPayoutOrder" resultMap="UsdtPayoutOrderResult">
<include refid="selectUsdtPayoutOrderVo"/>
<where>
<if test="tradeId != null and tradeId != ''"> and trade_id = #{tradeId}</if>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="appId != null "> and app_id = #{appId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="currency != null and currency != ''"> and currency = #{currency}</if>
<if test="amount != null "> and amount = #{amount}</if>
<if test="feeCurrency != null and feeCurrency != ''"> and fee_currency = #{feeCurrency}</if>
<if test="feeAmount != null "> and fee_amount = #{feeAmount}</if>
<if test="toAddress != null and toAddress != ''"> and to_address = #{toAddress}</if>
<if test="status != null "> and status = #{status}</if>
<if test="auditType != null and auditType != ''"> and audit_type = #{auditType}</if>
<if test="auditorId != null and auditorId != ''"> and auditor_id = #{auditorId}</if>
<if test="auditRemark != null and auditRemark != ''"> and audit_remark = #{auditRemark}</if>
<if test="auditedAt != null "> and audited_at = #{auditedAt}</if>
<if test="blockTransactionId != null and blockTransactionId != ''"> and block_transaction_id = #{blockTransactionId}</if>
<if test="executeError != null and executeError != ''"> and execute_error = #{executeError}</if>
<if test="executeCount != null "> and execute_count = #{executeCount}</if>
<if test="executedAt != null "> and executed_at = #{executedAt}</if>
<if test="confirmedAt != null "> and confirmed_at = #{confirmedAt}</if>
<if test="notifyUrl != null and notifyUrl != ''"> and notify_url = #{notifyUrl}</if>
<if test="redirectUrl != null and redirectUrl != ''"> and redirect_url = #{redirectUrl}</if>
<if test="callbackNum != null "> and callback_num = #{callbackNum}</if>
<if test="callbackConfirm != null "> and callback_confirm = #{callbackConfirm}</if>
<if test="createdAt != null "> and created_at = #{createdAt}</if>
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
<if test="deletedAt != null "> and deleted_at = #{deletedAt}</if>
</where>
where <include refid="payoutQueryConditions"/>
order by p.id desc
</select>
<select id="selectStatistics" parameterType="UsdtPayoutOrder"
resultType="com.ruoyi.system.domain.vo.PayoutOrderStatistics">
select count(1) as totalCount,
coalesce(sum(case when p.status = 0 then 1 else 0 end), 0) as pendingAuditCount,
coalesce(sum(case when p.status = 1 then 1 else 0 end), 0) as pendingExecuteCount,
coalesce(sum(case when p.status = 2 then 1 else 0 end), 0) as confirmingCount,
coalesce(sum(case when p.status = 3 then 1 else 0 end), 0) as completedCount,
coalesce(sum(case when p.status = 4 then 1 else 0 end), 0) as rejectedCount,
coalesce(sum(case when p.status = 5 then 1 else 0 end), 0) as failedCount,
coalesce(sum(case when p.status = 3 and p.currency = 'USDT' then p.amount else 0 end), 0) as completedUsdtAmount,
coalesce(sum(case when p.status = 3 and p.currency = 'TRX' then p.amount else 0 end), 0) as completedTrxAmount,
coalesce(sum(case when p.status = 3 then p.fee_amount else 0 end), 0) as feeAmount
from usdt_payout_order p
where <include refid="payoutQueryConditions"/>
</select>
<select id="selectUsdtPayoutOrderById" parameterType="Long" resultMap="UsdtPayoutOrderResult">
<include refid="selectUsdtPayoutOrderVo"/>
where id = #{id}
where p.id = #{id} and p.deleted_at is null
</select>
<insert id="insertUsdtPayoutOrder" parameterType="UsdtPayoutOrder" useGeneratedKeys="true" keyProperty="id">
@@ -178,4 +198,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
</mapper>
</mapper>