You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
service/supply/order.go

49 lines
1.1 KiB

2 years ago
package supply
import (
"context"
"git.oa00.com/supply-chain/service/client"
"github.com/shopspring/decimal"
)
type order struct {
}
type ArgsOrderSplit struct {
2 years ago
Source source // 商品来源
ParentSourceOrderSn string // 上级订单号
OrderSubs []OrderSub // 子订单
}
type OrderSub struct {
2 years ago
SourceOrderSn string // 供应商订单号
FreightFee decimal.Decimal // 运费
OrderFee decimal.Decimal // 订单金额
Skus []OrderSplitSkuItem // 拆分订单sku
2 years ago
}
type OrderSplitSkuItem struct {
SourceSkuId string
Quantity uint
SupplyPrice decimal.Decimal
}
// Split @Title 拆单
func (o *order) Split(ctx context.Context, args ArgsOrderSplit) (err error) {
xClient, err := client.GetClient(o)
if err != nil {
return
}
reply := 0
err = xClient.Call(ctx, "Lists", args, &reply)
return
}
2 years ago
// Cancel @Title 订单取消
func (o *order) Cancel(ctx context.Context, orderSubSn string) (err error) {
xClient, err := client.GetClient(o)
if err != nil {
return
}
reply := 0
err = xClient.Call(ctx, "Cancel", orderSubSn, &reply)
return
}