From 19e6bec2cea150f7c725490082f50822b11d4f2f Mon Sep 17 00:00:00 2001 From: kanade Date: Tue, 20 Dec 2022 10:50:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wholesale/channel/order.go | 35 +++++++++++++++++++++++ wholesale/order.go | 58 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) diff --git a/wholesale/channel/order.go b/wholesale/channel/order.go index 323eef7..7dd6328 100644 --- a/wholesale/channel/order.go +++ b/wholesale/channel/order.go @@ -73,3 +73,38 @@ func (o *order) Submit(ctx context.Context, channelId string, args ArgsOrderSubm err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Submit", args, &reply) return } + +// Pay @Title 支付提单 +func (o *order) Pay(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}), "Pay", orderSn, &reply) +} + +// Close @Title 关闭 +func (o *order) Close(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}), "Close", orderSn, &reply) +} + +type ArgsOrderChannel struct { + OrderSn string // 订单编号 + Reason string // 取消原因 +} + +// Cancel @Title 订单取消 +func (o *order) Cancel(ctx context.Context, channelId string, args ArgsOrderChannel) (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", args, &reply) +} diff --git a/wholesale/order.go b/wholesale/order.go index e0e8a54..3ba69f9 100644 --- a/wholesale/order.go +++ b/wholesale/order.go @@ -59,3 +59,61 @@ func (o *order) FreightFee(ctx context.Context, args ArgsOrderFreightFee) (err e reply := 0 return xClient.Call(ctx, "FreightFee", args, &reply) } + +type ArgsOrderCancel struct { + Source source // 商品来源 + SourceOrderSn string // 供应商订单号 + Status uint // 订单取消 +} + +// Cancel @Title 订单取消 +func (o *order) Cancel(ctx context.Context, args ArgsOrderCancel) (err error) { + xClient, err := client.GetClient(o) + if err != nil { + return + } + reply := 0 + err = xClient.Call(ctx, "Cancel", args, &reply) + return +} + +type ArgsOrderStockOut struct { + Source source // 商品来源 + SourceOrderSn string // 供应商订单号 + Packages []Package // 包裹运单 +} + +type Package struct { + Type uint // 物流类型 + LogisticsCode string // 物流编码 + LogisticsName string // 物流名称 + LogisticsPhone string // 物流联系方式 + WaybillCode string // 运单号 +} + +// StockOut @Title 出库发货 +func (o *order) StockOut(ctx context.Context, args ArgsOrderStockOut) (err error) { + xClient, err := client.GetClient(o) + if err != nil { + return + } + reply := 0 + err = xClient.Call(ctx, "StockOut", args, &reply) + return +} + +type ArgsOrderFinish struct { + Source source // 商品来源 + SourceOrderSn string // 供应商订单号 +} + +// Finish @Title 订单完成 +func (o *order) Finish(ctx context.Context, args ArgsOrderFinish) (err error) { + xClient, err := client.GetClient(o) + if err != nil { + return + } + reply := 0 + err = xClient.Call(ctx, "Finish", args, &reply) + return +}