修复余额不足仍可启动充电问题

统一启动金额优先级并在启动前校验会员余额。

同步完成订单创建和余额支付后再返回鉴权成功,并增加支付凭证补偿、异常停机和结算保护。
This commit is contained in:
Guoqs
2026-07-25 09:54:37 +08:00
parent bfa209becb
commit 1b37a7d5e8
18 changed files with 851 additions and 126 deletions

View File

@@ -2896,6 +2896,27 @@
</if>
</select>
<!--
余额支付订单支付凭证补偿范围:
只扫描最近时间窗口内已经进入充电/待结算/异常状态的订单,
避免把普通的未启动待支付订单提前改成异常订单。
-->
<select id="queryOrdersForPaymentReconcile" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from order_basic_info
where del_flag = '0'
and pay_mode = '1'
and order_status in ('1', '2', '4')
<if test="startTime != null and startTime != ''">
and create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
</if>
<if test="endTime != null and endTime != ''">
and create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
</if>
order by create_time asc
</select>
<update id="updateOrderStatusById">
update order_basic_info
set order_status = #{orderStatus,jdbcType=VARCHAR}