mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update 超时关闭订单退款处理
This commit is contained in:
@@ -2084,20 +2084,27 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
// return;
|
||||
// }
|
||||
|
||||
BigDecimal orderAmount = orderBasicInfo.getOrderAmount() == null ? BigDecimal.ZERO : orderBasicInfo.getOrderAmount();
|
||||
if (orderAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果超时关闭的订单,存在支付信息,都退款处理
|
||||
List<OrderPayRecord> orderPayRecordList = orderPayRecordService.getOrderPayRecordList(orderCode);
|
||||
logger.info("校验未支付订单orderCode:{}, 支付信息:{}", orderCode, JSON.toJSONString(orderPayRecordList));
|
||||
for (OrderPayRecord orderPayRecord : orderPayRecordList) {
|
||||
List<PaymentInfo> paymentInfos = orderPayRecordService.parseDeductionRecord(orderPayRecord.getDeductionRecord());
|
||||
for (PaymentInfo paymentInfo : paymentInfos) {
|
||||
String paymentId = paymentInfo.getPaymentId();
|
||||
BigDecimal payAmt = new BigDecimal(paymentInfo.getAmount());
|
||||
if (MerchantDelayModeEnum.DELAY.getMode().equals(delayMode)) {
|
||||
// 延时分账商户,创建交易撤销请求
|
||||
adapayService.createPaymentReverseRequest(paymentId, payAmt, wechatAppId, memberId, ScenarioEnum.ORDER.getValue(), orderCode);
|
||||
} else {
|
||||
// 实时分账商户,创建交易退款请求
|
||||
adapayService.createRefundRequest(paymentId, payAmt, wechatAppId, memberId, ScenarioEnum.ORDER.getValue(), orderCode);
|
||||
if (CollectionUtils.isNotEmpty(orderPayRecordList)) {
|
||||
for (OrderPayRecord orderPayRecord : orderPayRecordList) {
|
||||
List<PaymentInfo> paymentInfos = orderPayRecordService.parseDeductionRecord(orderPayRecord.getDeductionRecord());
|
||||
for (PaymentInfo paymentInfo : paymentInfos) {
|
||||
String paymentId = paymentInfo.getPaymentId();
|
||||
BigDecimal payAmt = new BigDecimal(paymentInfo.getAmount());
|
||||
if (MerchantDelayModeEnum.DELAY.getMode().equals(delayMode)) {
|
||||
// 延时分账商户,创建交易撤销请求
|
||||
adapayService.createPaymentReverseRequest(paymentId, payAmt, wechatAppId, memberId, ScenarioEnum.ORDER.getValue(), orderCode);
|
||||
} else {
|
||||
// 实时分账商户,创建交易退款请求
|
||||
adapayService.createRefundRequest(paymentId, payAmt, wechatAppId, memberId, ScenarioEnum.ORDER.getValue(), orderCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user