|
|
@ -12,6 +12,7 @@ import (
|
|
|
|
const (
|
|
|
|
const (
|
|
|
|
ReplyOrderFreightFeeErrCodeNone = 0 // 无错误
|
|
|
|
ReplyOrderFreightFeeErrCodeNone = 0 // 无错误
|
|
|
|
ReplyOrderFreightFeeErrCodeErr = 1 // 有错误
|
|
|
|
ReplyOrderFreightFeeErrCodeErr = 1 // 有错误
|
|
|
|
|
|
|
|
ReplyOrderFreightFeeErrCodeDone = 2 // 已下架
|
|
|
|
|
|
|
|
|
|
|
|
OrderStatusLock = 1 // 锁单待确认
|
|
|
|
OrderStatusLock = 1 // 锁单待确认
|
|
|
|
OrderStatusLadingBill = 2 // 提单
|
|
|
|
OrderStatusLadingBill = 2 // 提单
|
|
|
@ -28,6 +29,10 @@ const (
|
|
|
|
|
|
|
|
|
|
|
|
OrderSubIsSplitFalse = 1 // 无
|
|
|
|
OrderSubIsSplitFalse = 1 // 无
|
|
|
|
OrderSubIsSplitTrue = 2 // 被拆单
|
|
|
|
OrderSubIsSplitTrue = 2 // 被拆单
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OrderSubTypeApi = 1 // api接口下单
|
|
|
|
|
|
|
|
OrderSubTypeCustomerWeb = 2 // 客户商城下单
|
|
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type order struct {
|
|
|
|
type order struct {
|
|
|
@ -72,6 +77,7 @@ type ArgsOrderSubmit struct {
|
|
|
|
OrderFee decimal.Decimal // 订单金额-不含运费
|
|
|
|
OrderFee decimal.Decimal // 订单金额-不含运费
|
|
|
|
FreightFees []OrderFreightFee // 运费
|
|
|
|
FreightFees []OrderFreightFee // 运费
|
|
|
|
UserIp string // 下单用户ip
|
|
|
|
UserIp string // 下单用户ip
|
|
|
|
|
|
|
|
Type uint // 下单方式
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type OrderFreightFee struct {
|
|
|
|
type OrderFreightFee struct {
|
|
|
@ -87,8 +93,8 @@ type Receiver struct {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ReplyOrderSubmit struct {
|
|
|
|
type ReplyOrderSubmit struct {
|
|
|
|
OrderSn string
|
|
|
|
OrderSn string `json:"orderSn"`
|
|
|
|
ChannelOrderSn string
|
|
|
|
ChannelOrderSn string `json:"channelOrderSn"`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Submit @Title 下单
|
|
|
|
// Submit @Title 下单
|
|
|
@ -147,6 +153,7 @@ type ReplyOrderSplit struct {
|
|
|
|
OrderFee decimal.Decimal `json:"orderFee"`
|
|
|
|
OrderFee decimal.Decimal `json:"orderFee"`
|
|
|
|
Skus []OrderSplitSkuItem `json:"skus"`
|
|
|
|
Skus []OrderSplitSkuItem `json:"skus"`
|
|
|
|
SubOrders []*OrderSubSplit `json:"subOrders"`
|
|
|
|
SubOrders []*OrderSubSplit `json:"subOrders"`
|
|
|
|
|
|
|
|
Type uint `json:"type"`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
type OrderSubSplit struct {
|
|
|
|
type OrderSubSplit struct {
|
|
|
|
OrderSn string `json:"orderSn"`
|
|
|
|
OrderSn string `json:"orderSn"`
|
|
|
@ -171,6 +178,7 @@ func (o *order) Split(ctx context.Context, channelId string, args ArgsOrderSplit
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type OrderListsSearch struct {
|
|
|
|
type OrderListsSearch struct {
|
|
|
|
|
|
|
|
SkuIds []uint // 商品Ids
|
|
|
|
SkuName string // 商品名称
|
|
|
|
SkuName string // 商品名称
|
|
|
|
Status []uint // 订单状态
|
|
|
|
Status []uint // 订单状态
|
|
|
|
CancelStatus uint // 订单取消状态
|
|
|
|
CancelStatus uint // 订单取消状态
|
|
|
@ -203,6 +211,7 @@ type OrderItem struct {
|
|
|
|
CloseAt int64 `json:"closeAt"`
|
|
|
|
CloseAt int64 `json:"closeAt"`
|
|
|
|
Skus []OrderSku `json:"skus"`
|
|
|
|
Skus []OrderSku `json:"skus"`
|
|
|
|
Packages []OrderPackage `json:"packages"`
|
|
|
|
Packages []OrderPackage `json:"packages"`
|
|
|
|
|
|
|
|
StockOutAt int64 `json:"stockOutAt"`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type OrderSku struct {
|
|
|
|
type OrderSku struct {
|
|
|
@ -236,6 +245,30 @@ func (o *order) Lists(ctx context.Context, channelId string, args ArgsOrderLists
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type ArgsOrderDetail struct {
|
|
|
|
|
|
|
|
RootOrderSn string
|
|
|
|
|
|
|
|
ChannelOrderSn string
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
type ReplyOrderDetail struct {
|
|
|
|
|
|
|
|
ChannelOrderSn string
|
|
|
|
|
|
|
|
OrderSn string
|
|
|
|
|
|
|
|
OrderFee decimal.Decimal
|
|
|
|
|
|
|
|
FreightFee decimal.Decimal
|
|
|
|
|
|
|
|
Receiver OrderReceiver
|
|
|
|
|
|
|
|
CreatedAt int64
|
|
|
|
|
|
|
|
LadingBillAt int64
|
|
|
|
|
|
|
|
CloseAt int64
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type OrderReceiver struct {
|
|
|
|
|
|
|
|
ReceiverName string
|
|
|
|
|
|
|
|
ReceiverMobile string
|
|
|
|
|
|
|
|
ReceiverEmail string
|
|
|
|
|
|
|
|
ReceiverZipCode string
|
|
|
|
|
|
|
|
Address string
|
|
|
|
|
|
|
|
UserIp string
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Detail @Title 订单详情
|
|
|
|
// Detail @Title 订单详情
|
|
|
|
func (o *order) Detail(ctx context.Context, channelId string, orderSn string) (reply OrderItem, err error) {
|
|
|
|
func (o *order) Detail(ctx context.Context, channelId string, orderSn string) (reply OrderItem, err error) {
|
|
|
|
xClient, err := client.GetClient(o)
|
|
|
|
xClient, err := client.GetClient(o)
|
|
|
|