liujie
2026-08-21 77649c76ec1c3afcb93e9963243d637665b3a307
backend/src/main/java/com/tourguide/modules/order/service/OrderRefundService.java
@@ -1,6 +1,7 @@
package com.tourguide.modules.order.service;
import com.tourguide.common.huifu.RequestSeqUtil;
import com.tourguide.modules.order.domain.PaymentMethod;
import com.tourguide.modules.order.domain.RefundStatus;
import com.tourguide.modules.order.entity.TourOrder;
import com.tourguide.modules.order.mapper.TourOrderMapper;
@@ -11,6 +12,7 @@
import org.springframework.util.StringUtils;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Service
public class OrderRefundService {
@@ -40,6 +42,12 @@
        order.setRefundStatus(RefundStatus.REFUNDING.getCode());
        order.setRefundAmount(refundAmount);
        order.setRefundMethod(order.getPaymentMethod());
        if (PaymentMethod.TEMPORARY_BYPASS.matches(order.getPaymentMethod())) {
            order.setRefundStatus(RefundStatus.REFUNDED.getCode());
            order.setRefundTime(LocalDateTime.now());
            orderMapper.updateById(order);
            return;
        }
        orderMapper.updateById(order);
        try {
            paymentRefundGateway.refund(order, refundAmount);