暂时去除处方平台取消订单
This commit is contained in:
parent
29e05ef1ce
commit
84c7997f12
@ -8,7 +8,6 @@ import (
|
||||
"hospital-admin-api/api/requests"
|
||||
"hospital-admin-api/api/responses/orderProductResponse"
|
||||
"hospital-admin-api/config"
|
||||
"hospital-admin-api/extend/prescription"
|
||||
"hospital-admin-api/extend/weChat"
|
||||
"hospital-admin-api/global"
|
||||
"strconv"
|
||||
@ -143,6 +142,11 @@ func (r *OrderProductService) CancelOrderProduct(req requests.CancelOrderProduct
|
||||
return false, errors.New("订单已取消,无法取消")
|
||||
}
|
||||
|
||||
// 已上报暂不允许取消订单
|
||||
if orderProduct.ReportPreStatus == 1 {
|
||||
return false, errors.New("订单已上报,暂不允许取消")
|
||||
}
|
||||
|
||||
// 检测订单退款状态
|
||||
if orderProduct.RefundStatus == 1 {
|
||||
return false, errors.New("订单申请退款中,无法取消")
|
||||
@ -184,12 +188,12 @@ func (r *OrderProductService) CancelOrderProduct(req requests.CancelOrderProduct
|
||||
var successTime time.Time
|
||||
var refundId string
|
||||
|
||||
// 通知处方平台订单取消
|
||||
_, err = prescription.NoticePreOrderCancel(orderProduct.OrderProductNo)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
return false, errors.New("取消订单失败")
|
||||
}
|
||||
// // 通知处方平台订单取消
|
||||
// _, err = prescription.NoticePreOrderCancel(orderProduct.OrderProductNo)
|
||||
// if err != nil {
|
||||
// tx.Rollback()
|
||||
// return false, err
|
||||
// }
|
||||
|
||||
// 微信退款
|
||||
refundRequest := weChat.RefundRequest{
|
||||
@ -250,6 +254,7 @@ func (r *OrderProductService) CancelOrderProduct(req requests.CancelOrderProduct
|
||||
orderProductData["cancel_time"] = time.Now().Format("2006-01-02 15:04:05") // 订单取消时间
|
||||
orderProductData["cancel_reason"] = 4 // 订单取消原因(1:主动取消 2:复核失败/库存不足 3:支付超时 4:客服取消)
|
||||
orderProductData["cancel_remarks"] = req.CancelRemarks // 取消订单备注(自动添加)
|
||||
// orderProductData["report_pre_status"] = 3 // 上报处方平台状态(0:未上报 1:已上报 2:上报失败 3:上报取消)
|
||||
err = orderProductDao.EditOrderProductById(tx, orderProductId, orderProductData)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user