diff --git a/business/partner/purchase/jx/localjx/order.go b/business/partner/purchase/jx/localjx/order.go index d774d4cca..0b11abae3 100644 --- a/business/partner/purchase/jx/localjx/order.go +++ b/business/partner/purchase/jx/localjx/order.go @@ -514,9 +514,11 @@ func CancelOrder(ctx *jxcontext.Context, order *model.GoodsOrder, reason string) if orderPay.Status == model.PayStatusYes { refundID := utils.Int64ToStr(GenRefundID(order)) orderPayRefund, err2 := refundOrderByWX(ctx, orderPay, refundID) - if err = err2; err == nil { + if err2 == nil { dao.WrapAddIDCULDEntity(orderPayRefund, ctx.GetUserName()) errList.AddErr(dao.CreateEntity(dao.GetDB(), orderPay)) + } else { + errList.AddErr(err2) } } else { orderPay.Status = model.PayStatusCanceled @@ -524,7 +526,9 @@ func CancelOrder(ctx *jxcontext.Context, order *model.GoodsOrder, reason string) errList.AddErr(err2) } } - errList.AddErr(changeOrderStatus(order.VendorOrderID, model.OrderStatusCanceled, reason)) + if errList.GetErrListAsOne() == nil { + errList.AddErr(changeOrderStatus(order.VendorOrderID, model.OrderStatusCanceled, reason)) + } err = errList.GetErrListAsOne() } } else {