订单处理

finance
杨赟 2 years ago
parent 39fd78e95a
commit 19e6bec2ce

@ -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)
}

@ -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
}

Loading…
Cancel
Save