|
|
@ -3,6 +3,7 @@ package channel
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"context"
|
|
|
|
"git.oa00.com/supply-chain/service/client"
|
|
|
|
"git.oa00.com/supply-chain/service/client"
|
|
|
|
|
|
|
|
"git.oa00.com/supply-chain/service/lib/bean"
|
|
|
|
"github.com/shopspring/decimal"
|
|
|
|
"github.com/shopspring/decimal"
|
|
|
|
"github.com/smallnest/rpcx/share"
|
|
|
|
"github.com/smallnest/rpcx/share"
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -20,7 +21,9 @@ const (
|
|
|
|
OrderSubStatusSendOutGoods = 3 // 出库/发货
|
|
|
|
OrderSubStatusSendOutGoods = 3 // 出库/发货
|
|
|
|
OrderSubStatusDelivered = 4 // 妥投
|
|
|
|
OrderSubStatusDelivered = 4 // 妥投
|
|
|
|
OrderSubStatusFinal = 5 // 完成
|
|
|
|
OrderSubStatusFinal = 5 // 完成
|
|
|
|
OrderSubStatusCancel = 6 // 取消
|
|
|
|
|
|
|
|
|
|
|
|
OrderCancelSubStatusFalse = 1 // 未取消
|
|
|
|
|
|
|
|
OrderCancelSubStatusTrue = 2 // 已取消
|
|
|
|
|
|
|
|
|
|
|
|
OrderSubIsSplitFalse = 1 // 无
|
|
|
|
OrderSubIsSplitFalse = 1 // 无
|
|
|
|
OrderSubIsSplitTrue = 2 // 被拆单
|
|
|
|
OrderSubIsSplitTrue = 2 // 被拆单
|
|
|
@ -126,3 +129,71 @@ func (o *order) Cancel(ctx context.Context, channelId string, orderSn string) (e
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Cancel", orderSn, &reply)
|
|
|
|
return xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Cancel", orderSn, &reply)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type OrderListsSearch struct {
|
|
|
|
|
|
|
|
Status []uint // 订单状态
|
|
|
|
|
|
|
|
CancelStatus uint // 订单取消状态
|
|
|
|
|
|
|
|
OrderSn string // 订单编号
|
|
|
|
|
|
|
|
ReceiverName string // 收件人
|
|
|
|
|
|
|
|
ReceiverMobile string // 手机号
|
|
|
|
|
|
|
|
LadingBillDateStart string // 提单日期
|
|
|
|
|
|
|
|
LadingBillDateEnd string // 提单日期
|
|
|
|
|
|
|
|
FinishDateStart string // 完成日期
|
|
|
|
|
|
|
|
FinishDateEnd string // 完成日期
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
type ArgsOrderLists struct {
|
|
|
|
|
|
|
|
Search OrderListsSearch
|
|
|
|
|
|
|
|
Page bean.Page
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type OrderItem struct {
|
|
|
|
|
|
|
|
OrderId uint `json:"orderId"`
|
|
|
|
|
|
|
|
OrderSn uint64 `json:"orderSn"`
|
|
|
|
|
|
|
|
ReceiverName string `json:"receiverName"`
|
|
|
|
|
|
|
|
ReceiverMobile string `json:"receiverMobile"`
|
|
|
|
|
|
|
|
Address string `json:"address"`
|
|
|
|
|
|
|
|
FreightFee decimal.Decimal `json:"freightFee"`
|
|
|
|
|
|
|
|
OrderFee decimal.Decimal `json:"orderFee"`
|
|
|
|
|
|
|
|
LadingBillAt int64 `json:"ladingBillAt"`
|
|
|
|
|
|
|
|
FinishAt int64 `json:"finishAt"`
|
|
|
|
|
|
|
|
Status uint `json:"status"`
|
|
|
|
|
|
|
|
CancelStatus uint `json:"cancelStatus"`
|
|
|
|
|
|
|
|
CreatedAt int64 `json:"createdAt"`
|
|
|
|
|
|
|
|
Skus []OrderSku `json:"skus"`
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type OrderSku struct {
|
|
|
|
|
|
|
|
Id uint `json:"id"`
|
|
|
|
|
|
|
|
SkuId uint `json:"skuId"`
|
|
|
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
|
|
|
GuidePrice decimal.Decimal `json:"guidePrice"`
|
|
|
|
|
|
|
|
ImgUrl string `json:"imgUrl"`
|
|
|
|
|
|
|
|
Size string `json:"size"`
|
|
|
|
|
|
|
|
Color string `json:"color"`
|
|
|
|
|
|
|
|
Quantity uint `json:"quantity"`
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type ReplyOrderList struct {
|
|
|
|
|
|
|
|
Lists []OrderItem `json:"lists"`
|
|
|
|
|
|
|
|
Total int64 `json:"total"`
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Lists @Title 订单列表
|
|
|
|
|
|
|
|
func (o *order) Lists(ctx context.Context, channelId string, args ArgsOrderLists) (reply ReplyOrderList, err error) {
|
|
|
|
|
|
|
|
xClient, err := client.GetClient(o)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Lists", args, &reply)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Detail @Title 订单详情
|
|
|
|
|
|
|
|
func (o *order) Detail(ctx context.Context, channelId string, orderSn string) (reply OrderItem, err error) {
|
|
|
|
|
|
|
|
xClient, err := client.GetClient(o)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Detail", orderSn, &reply)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|