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/data/order.go

202 lines
8.9 KiB

1 year ago
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 ArgsPayOrderLists struct {
StartLadingBillAt string
EndLadingBillAt string
1 year ago
Page bean.Page
1 year ago
}
type ReplyPayOrderLists struct {
1 year ago
Lists []PayOrderItem `json:"lists"`
Total int64 `json:"total"`
1 year ago
}
1 year ago
type PayOrderItem struct {
1 year ago
SourceName string `json:"sourceName"` // 供应渠道
SourceSonName string `json:"sourceSonName"` // 供应商
CustomerName string `json:"customerName"` // 客户名
OrderSn string `json:"orderSn"` // 原始订单号
OrderSubSn string `json:"orderSubSn"` // 订单号
SupplierOrderSn string `json:"supplierOrderSn"` // 供应商订单号
OrderStatus uint `json:"orderStatus"` // 订单状态
LadingBillAt int64 `json:"ladingBillAt"` // 支付时间
StockOutAt int64 `json:"stockOutAt"` // 发货时间
FinishAt int64 `json:"finishAt"` // 确认收货时间
SkuName string `json:"skuName"` // 商品名称
SkuUpcCode string `json:"skuUpcCode"` // 商品条码
Specification string `json:"specification"` // 规格
Quality uint `json:"quality"` // 数量
ProduceSupplyPrice decimal.Decimal `json:"produceSupplyPrice"` // 采购单价
ProduceTotalPrice decimal.Decimal `json:"produceTotalPrice"` // 采购总金额
ProduceFreightFee decimal.Decimal `json:"ProduceFreightFee"` // 采购应付运费
ProducePrice decimal.Decimal `json:"producePrice"` // 采购合计金额
SaleSupplyPrice decimal.Decimal `json:"saleSupplyPrice"` // 销售单价
SaleTotalPrice decimal.Decimal `json:"saleTotalPrice"` // 销售总金额
SaleFreightFee decimal.Decimal `json:"saleFreightFee"` // 销售应收运费
SalePrice decimal.Decimal `json:"salePrice"` // 销售合计金额
Unit string `json:"unit"` // 单位
Tax string `json:"tax"` // 税率
ReceiverName string `json:"receiverName"` // 收件人
ReceiverPhone string `json:"receiverPhone"` // 收件人手机号
ReceiverAddress string `json:"receiverAddress"` // 收件人地址
}
1 year ago
// PayOrderList @Title 支付订单统计
func (o *order) PayOrderList(ctx context.Context, args ArgsPayOrderLists) (result ReplyPayOrderLists, err error) {
1 year ago
xClient, err := client.GetClient(o)
if err != nil {
return
}
1 year ago
err = xClient.Call(ctx, "PayOrderList", args, &result)
1 year ago
return
}
1 year ago
type ArgsCancelOrderLists struct {
StartCancelAt string
EndCancelAt string
Page bean.Page
}
type ReplyCancelOrderLists struct {
Lists []CancelOrderItem `json:"lists"`
Total int64 `json:"total"`
}
type CancelOrderItem struct {
SourceName string `json:"sourceName"` // 供应渠道
SourceSonName string `json:"sourceSonName"` // 供应商
CustomerName string `json:"customerName"` // 客户名
OrderSn string `json:"orderSn"` // 原始订单号
OrderSubSn string `json:"orderSubSn"` // 订单号
SupplierOrderSn string `json:"supplierOrderSn"` // 供应商订单号
OrderStatus uint `json:"orderStatus"` // 订单状态
LadingBillAt int64 `json:"ladingBillAt"` // 支付时间
StockOutAt int64 `json:"stockOutAt"` // 发货时间
CancelAt int64 `json:"cancelAt"` // 取消时间
TotalPrice decimal.Decimal `json:"totalPrice"` // 商品金额
FreightFee decimal.Decimal `json:"freightFee"` // 运费
Price decimal.Decimal `json:"price"` // 销售合计金额
RefundPrice decimal.Decimal `json:"refundPrice"` // 退款金额
}
// CancelOrderLists @Title 取消订单统计
func (o *order) CancelOrderLists(ctx context.Context, args ArgsCancelOrderLists) (result ReplyCancelOrderLists, err error) {
xClient, err := client.GetClient(o)
if err != nil {
return
}
err = xClient.Call(ctx, "CancelOrderLists", args, &result)
return
}
1 year ago
type ArgsStockOutOrderList struct {
StartStockOutAt string
EndStockOutAt string
Page bean.Page
}
type ReplyStockOutOrderList struct {
Lists []StockOutOrderItem `json:"lists"`
Total int64 `json:"total"`
}
type StockOutOrderItem struct {
SourceName string `json:"sourceName"` // 供应渠道
SourceSonName string `json:"sourceSonName"` // 供应商
CustomerName string `json:"customerName"` // 客户名
OrderSn string `json:"orderSn"` // 原始订单号
OrderSubSn string `json:"orderSubSn"` // 订单号
SupplierOrderSn string `json:"supplierOrderSn"` // 供应商订单号
OrderStatus uint `json:"orderStatus"` // 订单状态
LadingBillAt int64 `json:"ladingBillAt"` // 支付时间
StockOutAt int64 `json:"stockOutAt"` // 发货时间
FinishAt int64 `json:"finishAt"` // 确认收货时间
SkuName string `json:"skuName"` // 商品名称
SkuUpcCode string `json:"skuUpcCode"` // 商品条码
Specification string `json:"specification"` // 规格
Quality uint `json:"quality"` // 数量
ProduceSupplyPrice decimal.Decimal `json:"produceSupplyPrice"` // 采购单价
ProduceTotalPrice decimal.Decimal `json:"produceTotalPrice"` // 采购总金额
ProduceFreightFee decimal.Decimal `json:"ProduceFreightFee"` // 采购应付运费
ProducePrice decimal.Decimal `json:"producePrice"` // 采购合计金额
SaleSupplyPrice decimal.Decimal `json:"saleSupplyPrice"` // 销售单价
SaleTotalPrice decimal.Decimal `json:"saleTotalPrice"` // 销售总金额
SaleFreightFee decimal.Decimal `json:"saleFreightFee"` // 销售应收运费
SalePrice decimal.Decimal `json:"salePrice"` // 销售合计金额
Unit string `json:"unit"` // 单位
Tax string `json:"tax"` // 税率
ReceiverName string `json:"receiverName"` // 收件人
ReceiverPhone string `json:"receiverPhone"` // 收件人手机号
ReceiverAddress string `json:"receiverAddress"` // 收件人地址
}
// StockOutOrderList @Title 发货订单统计
func (o *order) StockOutOrderList(ctx context.Context, args ArgsStockOutOrderList) (result ReplyStockOutOrderList, err error) {
xClient, err := client.GetClient(o)
if err != nil {
return
}
err = xClient.Call(ctx, "StockOutOrderList", args, &result)
return
}
1 year ago
type JdOrderItem struct {
CustomerName string `json:"customerName"`
OrderSn string `json:"orderSn"`
OrderSubSn string `json:"orderSubSn"`
SupplierOrderSn string `json:"supplierOrderSn"`
OrderStatus uint `json:"orderStatus"`
CreatedAt int64 `json:"createdAt"`
LadingBillAt int64 `json:"ladingBillAt"`
StockOutAt int64 `json:"stockOutAt"`
FinishAt int64 `json:"finishAt"`
SkuName string `json:"skuName"`
SkuUpcCode string `json:"skuUpcCode"`
Specification string `json:"specification"`
Quality uint `json:"quality"`
ProduceSupplyPrice decimal.Decimal `json:"produceSupplyPrice"`
ProduceTotalPrice decimal.Decimal `json:"produceTotalPrice"`
ProduceFreightFee decimal.Decimal `json:"produceFreightFee"`
ProducePrice decimal.Decimal `json:"producePrice"`
SaleSupplyPrice decimal.Decimal `json:"saleSupplyPrice"`
SaleTotalPrice decimal.Decimal `json:"saleTotalPrice"`
SaleFreightFee decimal.Decimal `json:"saleFreightFee"`
SalePrice decimal.Decimal `json:"salePrice"`
Unit string `json:"unit"`
Tax string `json:"tax"`
ReceiverName string `json:"receiverName"`
ReceiverPhone string `json:"receiverPhone"`
ReceiverAddress string `json:"receiverAddress"`
}
type ArgsJdOrderList struct {
StartAt string
EndAt string
Page bean.Page
}
type ReplyJdOrderList struct {
Lists []JdOrderItem `json:"lists"`
Total int64 `json:"total"`
}
// JdList @Title 京东订单
func (o *order) JdList(ctx context.Context, args ArgsJdOrderList) (result ReplyJdOrderList, err error) {
xClient, err := client.GetClient(o)
if err != nil {
return
}
err = xClient.Call(ctx, "JdList", args, &result)
return
}