修改取消服务包订单关联问诊订单取消
This commit is contained in:
parent
2f0906718e
commit
4eb92a6aa8
@ -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),
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user