From 4eb92a6aa834b76c03560de9b67fca8aa0abf65e Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Wed, 12 Jun 2024 13:28:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=96=E6=B6=88=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=8C=85=E8=AE=A2=E5=8D=95=E5=85=B3=E8=81=94=E9=97=AE?= =?UTF-8?q?=E8=AF=8A=E8=AE=A2=E5=8D=95=E5=8F=96=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/service/orderServicePackage.go | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/api/service/orderServicePackage.go b/api/service/orderServicePackage.go index 4c311a0..0bbdab9 100644 --- a/api/service/orderServicePackage.go +++ b/api/service/orderServicePackage.go @@ -378,17 +378,8 @@ func (r *OrderServicePackageService) CancelOrderServicePackage(req requests.Canc refundId = "模拟退款:" + strconv.FormatInt(global.Snowflake.Generate().Int64(), 10) refundStatus = 3 successTime = time.Now() - - // 模拟退款时手动退还优惠卷 - if orderInquiry.CouponAmountTotal > 0 { - orderService := OrderService{} - res, err := orderService.ReturnOrderCoupon(orderInquiry.InquiryNo, tx) - if err != nil || !res { - // 退还优惠卷失败 - tx.Rollback() - return false, err - } - } + // 退款编号 + refundNo = strconv.FormatInt(global.Snowflake.Generate().Int64(), 10) // 修改订单为取消 orderData := make(map[string]interface{}) @@ -423,7 +414,7 @@ func (r *OrderServicePackageService) CancelOrderServicePackage(req requests.Canc RefundNo: refundNo, RefundId: refundId, RefundStatus: refundStatus, - RefundTotal: *req.RefundAmount, + RefundTotal: orderInquiry.PaymentAmountTotal, RefundReason: req.CancelRemarks, } @@ -446,7 +437,7 @@ func (r *OrderServicePackageService) CancelOrderServicePackage(req requests.Canc InquiryRefundNo: refundNo, RefundId: refundId, InquiryRefundStatus: refundStatus, - RefundTotal: *req.RefundAmount, + RefundTotal: orderInquiry.PaymentAmountTotal, RefundReason: req.CancelRemarks, SuccessTime: model.LocalTime(successTime), }