This commit is contained in:
wyn
2026-05-08 09:14:07 +08:00
parent e1eecb5cdc
commit d3b25e8078
10 changed files with 119 additions and 105 deletions

View File

@@ -34,6 +34,7 @@ import com.peanut.modules.common.dao.UserCourseBuyDao;
import com.peanut.modules.common.entity.*;
import com.peanut.modules.common.service.*;
import com.peanut.modules.master.service.CourseCatalogueService;
import com.peanut.modules.pay.alipay.dto.ReFundDTO;
import com.peanut.modules.pay.alipay.service.AliPayService;
import com.peanut.modules.pay.weChatPay.dto.WeChatRefundInfo;
import com.peanut.modules.pay.weChatPay.dto.WechatPaymentInfo;
@@ -672,9 +673,6 @@ public class BuyOrderController {
|| Constants.ORDER_STATUS_OUT_OF_TIME.equals(buyOrder.getOrderStatus())) {
return R.error("当前订单状态不支持退单");
}
if(Constants.PAYMENT_METHOD_ALI_PAY.equals(buyOrder.getPaymentMethod())){
return R.error("当前订单支付方式暂不支持退单");
}
//设置状态为退款中
buyOrder.setOrderStatus(Constants.ORDER_STATUS_REFUNDING);
buyOrderService.updateById(buyOrder);
@@ -747,9 +745,14 @@ public class BuyOrderController {
try {
wxpayService.refund(weChatRefundInfo);
} catch (Exception e) {
System.out.println("msg=" + e.getMessage()); // 👈 关键
System.out.println("msg=" + e.getMessage());
}
}
}else if (Constants.PAYMENT_METHOD_ALI_PAY.equals(buyOrder.getPaymentMethod())) {
buyOrderRefundLogService.insertRefundLog(refundId,2,0);
if (refundFee.compareTo(BigDecimal.ZERO) > 0) {
aliPayService.refund(buyOrder,user,buyOrderRefund);
}
}
// else if (Constants.PAYMENT_METHOD_ALI_PAY.equals(buyOrder.getPaymentMethod())) {
// buyOrderRefundLogService.insertRefundLog(refundId,2,0);