|
|
@ -6,6 +6,12 @@ import (
|
|
|
|
"github.com/shopspring/decimal"
|
|
|
|
"github.com/shopspring/decimal"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
|
|
|
OrderCancelStatusSuccess = 1 // 取消成功
|
|
|
|
|
|
|
|
OrderCancelStatusFail = 2 // 取消失败
|
|
|
|
|
|
|
|
OrderCancelStatusReject = 3 // 申请拒收
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type order struct {
|
|
|
|
type order struct {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
type ArgsOrderSplit struct {
|
|
|
|
type ArgsOrderSplit struct {
|
|
|
@ -39,6 +45,7 @@ func (o *order) Split(ctx context.Context, args ArgsOrderSplit) (err error) {
|
|
|
|
type ArgsOrderCancel struct {
|
|
|
|
type ArgsOrderCancel struct {
|
|
|
|
Source source // 商品来源
|
|
|
|
Source source // 商品来源
|
|
|
|
SourceOrderSn string // 供应商订单号
|
|
|
|
SourceOrderSn string // 供应商订单号
|
|
|
|
|
|
|
|
Status uint // 订单取消
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Cancel @Title 订单取消
|
|
|
|
// Cancel @Title 订单取消
|
|
|
@ -51,3 +58,42 @@ func (o *order) Cancel(ctx context.Context, args ArgsOrderCancel) (err error) {
|
|
|
|
err = xClient.Call(ctx, "Cancel", args, &reply)
|
|
|
|
err = xClient.Call(ctx, "Cancel", args, &reply)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type ArgsOrderStockOut struct {
|
|
|
|
|
|
|
|
Source source // 商品来源
|
|
|
|
|
|
|
|
SourceOrderSn string // 供应商订单号
|
|
|
|
|
|
|
|
Packages []Package // 包裹运单
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type Package struct {
|
|
|
|
|
|
|
|
LogisticsCode string // 物流编码
|
|
|
|
|
|
|
|
LogisticsName 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
|
|
|
|
|
|
|
|
}
|
|
|
|