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.
jcook-sdk/api/rest/order/order.go

143 lines
3.5 KiB

3 years ago
package order
import "git.oa00.com/go/jcook-sdk/api/rest"
// QueryOrderDetailRequest 订单详细.
type QueryOrderDetailRequest struct {
CustomerID uint `json:"customerId"`
ChannelID uint `json:"channelId"`
TraceID string `json:"traceId"`
AppKey string `json:"appKey"`
OrderID uint `json:"orderId"`
Pin string `json:"pin"`
ClientIp string `json:"clientIp"`
ClientPort string `json:"clientPort"`
}
func (o QueryOrderDetailRequest) GetApiName() string {
return "jingdong.ctp.order.getOrderDetail"
}
func (o QueryOrderDetailRequest) GetRespName() string {
return "jingdong_ctp_order_getOrderDetail_responce"
}
func (o QueryOrderDetailRequest) GetRespObj() interface{} {
return QueryOrderDetailResponse{}
}
// QueryOrderDetailResponse 订单详情.
type QueryOrderDetailResponse struct {
Result struct {
ErrCode uint `json:"errCode"`
ErrMsg string `json:"errMsg"`
Success bool `json:"success"`
Data Detail `json:"data"`
} `json:"result"`
}
type Detail struct {
SkuList []SkuDetailParam `json:"skuList"`
OrderID uint `json:"orderId"`
BaseOrderInfo BaseOrder `json:"baseOrderInfo"`
OrderRelationFee RelateFee `json:"orderRelationFee"`
Shipment ShipmentParam `json:"shipment"`
}
type ShipmentParam struct {
3 years ago
ShipmentType uint `json:"ShipmentType"`
3 years ago
}
type RelateFee struct {
ShouldPaymentFee float64 `json:"shouldPaymentFee"`
FreightFee float64 `json:"freightFee"`
}
type SkuDetailParam struct {
ImgUrl string `json:"imgUrl"`
Weight float64 `json:"weight"`
Color string `json:"color"`
CategoryID uint `json:"categoryId"`
SkuID uint `json:"skuId"`
SkuName string `json:"skuName"`
ShouldPrice float64 `json:"shouldPrice"`
Quantity uint `json:"Quantity"`
Bulk float64 `json:"bulk"`
SkuGiftType uint `json:"skuGiftType"`
MainSkuID uint `json:"mainSkuId"`
}
type status int
const (
Submit status = 0
WaitPay = 1
IsPay = 4
WaitPrint = 6
Pick = 7
OutOfStock = 8
WaitConfirm = 15
UserReject = 16
UserSign = 18
Lock = 21
3 years ago
Cancel = -100
)
var statusMap = map[status]string{
Submit: "提单成功",
WaitPay: "等待付款",
IsPay: "已支付",
WaitPrint: "待打印",
Pick: "拣货完成",
OutOfStock: "出库完成",
WaitConfirm: "待用户确认收货",
UserReject: "用户拒收",
UserSign: "用户签收",
3 years ago
Lock: "订单锁定",
Cancel: "已取消",
}
func (o status) String() string {
if value, ok := statusMap[o]; !ok {
return rest.UnKnow
} else {
return value
}
}
type typeState int8
const (
Self typeState = iota
Shop
Factory
Other = 99
)
var typeMap = map[typeState]string{
Self: "京东自营订单或混单",
Shop: "商家自发货订单",
Factory: "厂直订单",
Other: "其他订单",
}
func (o typeState) String() string {
if value, ok := typeMap[o]; !ok {
return rest.UnKnow
} else {
return value
}
}
type BaseOrder struct {
RootOrderID uint `json:"rootOrderId"`
OrderStatus status `json:"orderStatus"`
SubmitTime int64 `json:"submitTime"`
CompleteTime int64 `json:"completeTime"`
3 years ago
PayTime int64 `json:"payTime"`
OutWarehouseTime int64 `json:"outWarehouseTime"`
3 years ago
PaymentType uint `json:"PaymentType"`
Remark string `json:"remark"`
OrderType typeState `json:"orderType"`
}