增加了药品订单详情的优惠卷数据

This commit is contained in:
2024-05-21 10:49:42 +08:00
parent 931d2def98
commit e19316cfc3
6 changed files with 191 additions and 4 deletions
+4 -4
View File
@@ -76,7 +76,7 @@ func (r *OrderInquiryService) CancelOrderInquiry(req requests.CancelOrderInquiry
}
// 检测退款金额
if req.RefundAmount > orderInquiry.PaymentAmountTotal {
if *req.RefundAmount > orderInquiry.PaymentAmountTotal {
return false, errors.New("退款金额不可超过实付金额")
}
@@ -120,7 +120,7 @@ func (r *OrderInquiryService) CancelOrderInquiry(req requests.CancelOrderInquiry
OutTradeNo: orderInquiry.InquiryNo,
OutRefundNo: refundNo,
Reason: "客服取消",
RefundAmount: int64(req.RefundAmount * 100),
RefundAmount: int64(*req.RefundAmount * 100),
PaymentAmountTotal: int64(orderInquiry.PaymentAmountTotal * 100),
NotifyUrl: config.C.Wechat.RefundNotifyDomain + config.C.Wechat.PatientInquiryRefundNotifyUrl,
}
@@ -218,7 +218,7 @@ func (r *OrderInquiryService) CancelOrderInquiry(req requests.CancelOrderInquiry
RefundNo: refundNo,
RefundId: refundId,
RefundStatus: refundStatus,
RefundTotal: req.RefundAmount,
RefundTotal: *req.RefundAmount,
RefundReason: req.CancelRemarks,
}
@@ -241,7 +241,7 @@ func (r *OrderInquiryService) CancelOrderInquiry(req requests.CancelOrderInquiry
InquiryRefundNo: refundNo,
RefundId: refundId,
InquiryRefundStatus: refundStatus,
RefundTotal: req.RefundAmount,
RefundTotal: *req.RefundAmount,
RefundReason: req.CancelRemarks,
SuccessTime: model.LocalTime(successTime),
}
+7
View File
@@ -58,6 +58,10 @@ func (r *OrderProductService) GetOrderProduct(orderProductId int64) (g *dto.Orde
return nil, errors.New(err.Error())
}
// 获取药品订单优惠卷
orderProductCouponDao := dao.OrderProductCouponDao{}
orderProductCoupon, err := orderProductCouponDao.GetOrderProductCouponByOrderProductId(orderProduct.OrderProductId)
// 处理返回值
g = dto.GetOrderProductDto(orderProduct)
@@ -79,6 +83,9 @@ func (r *OrderProductService) GetOrderProduct(orderProductId int64) (g *dto.Orde
// 加载退款数据
g.LoadOrderProductRefund(orderProductRefund)
// 加载药品订单优惠卷数据
g.LoadOrderProductCoupon(orderProductCoupon)
return g, nil
}