修复在线支付保险订单 payAmount 与 payRecordAmount 不一致

在线支付回调(adapayCallback)中主动将 payAmount 减去了 insuranceAmount 再传给回调,
但 order_pay_record 记录的是完整支付金额,导致校验时 payAmount(扣减后) ≠ payRecordAmount(完整)。

修复:
1. OrderService.adapayCallback: callbackDTO 传完整 amount,同时带上 insuranceAmount
2. payOrderSuccessCallback: 下发桩的启动金额用 payAmount - insuranceAmount 计算,
   订单主表 payAmount 仍为完整支付金额,与 payRecordAmount 一致
This commit is contained in:
Guoqs
2026-07-25 16:47:35 +08:00
parent de73b82f65
commit f11b781c27
2 changed files with 9 additions and 11 deletions

View File

@@ -5406,8 +5406,12 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
return;
}
// 获取启动金额
BigDecimal chargeAmount = computeChargeAmount(orderInfo.getMerchantId(), orderInfo.getStationId(), orderInfo.getMemberId(), dto.getPayAmount());
// 获取启动金额:保险金额不计入下发桩的充电额度
BigDecimal payAmountForPile = dto.getPayAmount();
if (dto.getInsuranceAmount() != null && dto.getInsuranceAmount().compareTo(BigDecimal.ZERO) > 0) {
payAmountForPile = dto.getPayAmount().subtract(dto.getInsuranceAmount());
}
BigDecimal chargeAmount = computeChargeAmount(orderInfo.getMerchantId(), orderInfo.getStationId(), orderInfo.getMemberId(), payAmountForPile);
// 发送启动指令
if (StringUtils.equals(pileConnectorDetailVO.getChargePortType(), Constants.THREE)) {