finance
黄伟 2 years ago
parent ebbd5504b3
commit 0678d12dd6

@ -3,6 +3,7 @@ package channel
import (
"context"
"git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/lib/bean"
"github.com/shopspring/decimal"
"github.com/smallnest/rpcx/share"
)
@ -108,3 +109,58 @@ func (o *order) Cancel(ctx context.Context, channelId string, args ArgsOrderChan
}
return xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Cancel", args, &reply)
}
type ArgsOrderLists struct {
Search OrderSearch
Page bean.Page
}
type OrderSearch struct {
Status []uint // 订单状态
CancelStatus uint // 取消状态
OrderSubSn string // 订单号
CreatedStartDate string // 创建开始日期
CreatedEndDate string // 创建结束日期
PayStartDate string // 支付开始日期
PayEndDate string // 支付结束日期
}
type ReplyOrderLists struct {
Lists []OrderItem `json:"lists"`
Total int64 `json:"total"`
}
type OrderItem struct {
Id uint `json:"id"`
OrderSubSn string `json:"orderSubSn"`
FreightFee decimal.Decimal `json:"freightFee"`
OrderFee decimal.Decimal `json:"orderFee"`
Status uint `json:"status"`
CancelStatus uint `json:"cancelStatus"`
CreatedAt int64 `json:"createdAt"`
PayTime int64 `json:"payTime"`
FinishAt int64 `json:"finishAt"`
StockOutAt int64 `json:"stockOutAt"`
CloseAt int64 `json:"closeAt"`
Skus []OrderSkuItem `json:"skus"`
}
type OrderSkuItem struct {
SkuName string `json:"skuName"`
SkuId uint `json:"skuId"`
Size string `json:"size"`
Color string `json:"color"`
PackingRate uint `json:"packingRate"`
SupplyPrice decimal.Decimal `json:"supplyPrice"`
Quantity uint `json:"quantity"`
}
// Lists @Title 订单列表
func (o *order) Lists(ctx context.Context, channelId string, args ArgsOrderLists) (reply ReplyOrderLists, err error) {
xClient, err := client.GetClient(o)
if err != nil {
return ReplyOrderLists{}, err
}
err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Lists", args, &reply)
return
}

Loading…
Cancel
Save