From b8f4236e46e6d958f621f6d1d93c095c6016b44f Mon Sep 17 00:00:00 2001 From: sian Date: Sun, 25 Dec 2022 13:59:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E2=80=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wholesale/channel/order.go | 11 +++++++ wholesale/order.go | 63 ++++++++++++++++++++++++++++++++------ 2 files changed, 65 insertions(+), 9 deletions(-) diff --git a/wholesale/channel/order.go b/wholesale/channel/order.go index 03c9719..2323bee 100644 --- a/wholesale/channel/order.go +++ b/wholesale/channel/order.go @@ -186,3 +186,14 @@ func (o *order) SubDetail(ctx context.Context, channelId, orderSn string) (reply err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "SubDetail", orderSn, &reply) return } + +// Finish @Title 确认收货 +func (o *order) Finish(ctx context.Context, channelId, orderSn string) error { + xClient, err := client.GetClient(o) + if err != nil { + return err + } + reply := 0 + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Finish", orderSn, &reply) + return err +} diff --git a/wholesale/order.go b/wholesale/order.go index f159b87..e5cb6b3 100644 --- a/wholesale/order.go +++ b/wholesale/order.go @@ -140,15 +140,17 @@ type ReplyOrderLists struct { } type OrderItem struct { - OrderSubSn string - Status uint - CancelStatus uint - OrderFee decimal.Decimal - FreightFee decimal.Decimal - CreatedAt int64 - PayAt int64 - CloseAt int64 - FinishAt int64 + Id uint + OrderSubSn string + SourceOrderSn string + Status uint + CancelStatus uint + OrderFee decimal.Decimal + FreightFee decimal.Decimal + CreatedAt int64 + PayAt int64 + CloseAt int64 + FinishAt int64 } // Lists @Title 订单列表 @@ -160,3 +162,46 @@ func (o *order) Lists(ctx context.Context, args ArgsOrderLists) (reply ReplyOrde err = xClient.Call(ctx, "Lists", args, &reply) return } + +type ReplyOrderInfo struct { + Id uint + Status uint + CancelStatus uint + OrderSunSu string + SourceOrderSn string + CreatedAt int64 + PayAt int64 + CloseAt int64 + FinishAt int64 + OrderFee decimal.Decimal + FreightFee decimal.Decimal + Skus []OrderSkuItem + Customer Customer + ReceiverName string + ReceiverMobile string + Address string +} + +type Customer struct { + Name string + Phone string + HopeStockOutAt int64 // 期望发货时间 +} + +type OrderSkuItem struct { + Img string + Name string + SkuId uint + Price decimal.Decimal + Quantity uint +} + +// Info @Title 订单列表 +func (o *order) Info(ctx context.Context, orderSubSn uint64) (reply ReplyOrderInfo, err error) { + xClient, err := client.GetClient(o) + if err != nil { + return ReplyOrderInfo{}, err + } + err = xClient.Call(ctx, "Info", orderSubSn, &reply) + return +}