diff --git a/jd/data/data.go b/jd/data/data.go new file mode 100644 index 0000000..7f92dcb --- /dev/null +++ b/jd/data/data.go @@ -0,0 +1,5 @@ +package data + +type Data struct { + Order order +} diff --git a/jd/data/order.go b/jd/data/order.go new file mode 100644 index 0000000..115ed6c --- /dev/null +++ b/jd/data/order.go @@ -0,0 +1,46 @@ +package data + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" + "github.com/shopspring/decimal" +) + +type order struct { +} + +type ArgsOrderLists struct { + StartCreatedAt string + EndCreatedAt string + Page bean.Page +} + +type ReplyOrderLists struct { + Lists []OrderItem `json:"lists"` + Total int64 `json:"total"` +} + +type OrderItem struct { + OrderSubSn string `json:"orderSubSn"` // 订单号 + SourceOrderSn string `json:"sourceOrderSn"` // 供应商订单号(云交易外部订单号) + Status uint `json:"status"` // 订单状态 + CreatedAt int64 `json:"createdAt"` // 创建时间 + LadingBillAt int64 `json:"ladingBillAt"` // 支付时间 + StockOutAt int64 `json:"stockOutAt"` // 发货时间 + FinishAt int64 `json:"finishAt"` // 确认收获时间 + ProcureTotalPrice decimal.Decimal `json:"procureTotalPrice"` // 采购商品金额 + ProcureFreightPrice decimal.Decimal `json:"procureFreightPrice"` // 应付运费 + ProcurePrice decimal.Decimal `json:"procurePrice"` // 采购合计金额 + ServiceFee decimal.Decimal `json:"serviceFee"` // 技术服务费 采购合金金额*1% +} + +// Lists @Title 订单列表 +func (o *order) Lists(ctx context.Context, args ArgsOrderLists) (reply ReplyOrderLists, err error) { + xClient, err := client.GetClient(o) + if err != nil { + return + } + err = xClient.Call(ctx, "PayOrderList", args, &reply) + return +} diff --git a/jd/jd.go b/jd/jd.go index 7233742..b5d483e 100644 --- a/jd/jd.go +++ b/jd/jd.go @@ -1,6 +1,9 @@ package jd -import "git.oa00.com/supply-chain/service/jd/jdsdk" +import ( + "git.oa00.com/supply-chain/service/jd/data" + "git.oa00.com/supply-chain/service/jd/jdsdk" +) type Jd struct { Task task @@ -8,4 +11,5 @@ type Jd struct { Category category Sku sku Jdsdk jdsdk.Jdsdk + Data data.Data }