物料订单补允许取消
This commit is contained in:
@@ -910,7 +910,7 @@ func CancelOrder(ctx *jxcontext.Context, order *model.GoodsOrder, reason string)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
MarkArrears(db, order, orderPay)
|
MarkArrears(db, order, orderPay)
|
||||||
CancelMatterOrder(db, order)
|
CancelMatterOrder(db, order, reason)
|
||||||
} else {
|
} else {
|
||||||
orderPay.Status = model.PayStatusCanceled
|
orderPay.Status = model.PayStatusCanceled
|
||||||
_, err2 := dao.UpdateEntity(db, orderPay)
|
_, err2 := dao.UpdateEntity(db, orderPay)
|
||||||
@@ -927,7 +927,7 @@ func CancelOrder(ctx *jxcontext.Context, order *model.GoodsOrder, reason string)
|
|||||||
}
|
}
|
||||||
err = errList.GetErrListAsOne()
|
err = errList.GetErrListAsOne()
|
||||||
if len(payList) == 0 {
|
if len(payList) == 0 {
|
||||||
CancelMatterOrder(db, order)
|
CancelMatterOrder(db, order, "")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
err = fmt.Errorf("当前订单状态:%s不允许取消", model.OrderStatusName[order.Status])
|
err = fmt.Errorf("当前订单状态:%s不允许取消", model.OrderStatusName[order.Status])
|
||||||
@@ -935,9 +935,13 @@ func CancelOrder(ctx *jxcontext.Context, order *model.GoodsOrder, reason string)
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func CancelMatterOrder(db *dao.DaoDB, order *model.GoodsOrder) (err error) {
|
func CancelMatterOrder(db *dao.DaoDB, order *model.GoodsOrder, reason string) (err error) {
|
||||||
if order.FromStoreID != 0 {
|
if order.FromStoreID != 0 {
|
||||||
if order.EclpOutID != "" {
|
if order.EclpOutID != "" {
|
||||||
|
//表示是京西的物料订单的子订单(拆分后的订单)
|
||||||
|
if len(order.VendorOrderID) == 16 && order.VendorID == model.VendorIDJX {
|
||||||
|
return fmt.Errorf("不允许取消该子订单,请取消主订单进行退货退款!主订单ID :[%v]", order.VendorOrderID[:len(order.VendorOrderID)-2])
|
||||||
|
}
|
||||||
_, err = api.JdEclpAPI.CancelOrder(order.EclpOutID)
|
_, err = api.JdEclpAPI.CancelOrder(order.EclpOutID)
|
||||||
} else {
|
} else {
|
||||||
var goodsList []*model.GoodsOrder
|
var goodsList []*model.GoodsOrder
|
||||||
@@ -947,6 +951,7 @@ func CancelMatterOrder(db *dao.DaoDB, order *model.GoodsOrder) (err error) {
|
|||||||
if err == nil && len(goodsList) > 0 {
|
if err == nil && len(goodsList) > 0 {
|
||||||
for _, v := range goodsList {
|
for _, v := range goodsList {
|
||||||
_, err = api.JdEclpAPI.CancelOrder(v.EclpOutID)
|
_, err = api.JdEclpAPI.CancelOrder(v.EclpOutID)
|
||||||
|
changeOrderStatus(v.VendorOrderID, model.OrderStatusCanceled, reason)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user