diff --git a/supply/channel/order.go b/supply/channel/order.go index 98e8364..c2c2608 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -21,6 +21,9 @@ const ( OrderSubStatusDelivered = 4 // 妥投 OrderSubStatusFinal = 5 // 完成 OrderSubStatusCancel = 6 // 取消 + + OrderSubIsSplitFalse = 1 // 无 + OrderSubIsSplitTrue = 2 // 被拆单 ) type order struct { @@ -113,3 +116,13 @@ func (o *order) Close(ctx context.Context, channelId string, orderSn string) (er } return xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Close", orderSn, &reply) } + +// Cancel @Title 订单取消 +func (o *order) Cancel(ctx context.Context, channelId string, orderSn string) (err error) { + reply := 0 + xClient, err := client.GetClient(o) + if err != nil { + return + } + return xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Cancel", orderSn, &reply) +} diff --git a/supply/interface/order.go b/supply/interface/order.go index 1630fc4..acf9975 100644 --- a/supply/interface/order.go +++ b/supply/interface/order.go @@ -14,6 +14,8 @@ type OrderInterface interface { LadingBill(ctx context.Context, orderSn string, reply *int) error // Close @Title 关闭订单 Close(ctx context.Context, orderSn string, reply *int) error + // Cancel @Title 取消订单 + Cancel(ctx context.Context, orderSn string, reply *int) error } type ArgsOrderFreightFee struct { Skus []OrderFreightFeeSkuItem // 商品信息