diff --git a/supply/channel/order.go b/supply/channel/order.go index ea21030..da7b614 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -136,6 +136,40 @@ func (o *order) Cancel(ctx context.Context, channelId string, args ArgsOrderChan return xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Cancel", args, &reply) } +type ArgsOrderSplit struct { + RootOrderSn string + ChannelOrderSn string +} +type ReplyOrderSplit struct { + OrderSn string `json:"orderSn"` + ChannelOrderSn string `json:"channelOrderSn"` + FreightFee decimal.Decimal `json:"freightFee"` + OrderFee decimal.Decimal `json:"orderFee"` + Skus []OrderSplitSkuItem `json:"skus"` + SubOrders []*OrderSubSplit `json:"subOrders"` +} +type OrderSubSplit struct { + OrderSn string `json:"orderSn"` + FreightFee decimal.Decimal `json:"freightFee"` + OrderFee decimal.Decimal `json:"orderFee"` + Skus []OrderSplitSkuItem `json:"skus"` + SubOrders []*OrderSubSplit `json:"subOrders"` +} +type OrderSplitSkuItem struct { + SkuId uint `json:"skuId"` + Quantity uint `json:"quantity"` +} + +// Split @Title 获取拆单信息 +func (o *order) Split(ctx context.Context, channelId string, args ArgsOrderSplit) (reply ReplyOrderSplit, err error) { + xClient, err := client.GetClient(o) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Split", args, &reply) + return +} + type OrderListsSearch struct { SkuName string // 商品名称 Status []uint // 订单状态