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 { ShipmentType uint `json:"ShipmentType"` } 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 Cancel = -100 ) var statusMap = map[Status]string{ Submit: "提单成功", WaitPay: "等待付款", IsPay: "已支付", WaitPrint: "待打印", Pick: "拣货完成", OutOfStock: "出库完成", WaitConfirm: "待用户确认收货", UserReject: "用户拒收", UserSign: "用户签收", 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"` PayTime int64 `json:"payTime"` OutWarehouseTime int64 `json:"outWarehouseTime"` PaymentType uint `json:"PaymentType"` Remark string `json:"remark"` OrderType typeState `json:"orderType"` }