物料订单状态查询struct
This commit is contained in:
@@ -31,6 +31,18 @@ const (
|
||||
orderType10 = "10" //订单号类型(10:代表ECLP订单号, 20:代表商家订单号)
|
||||
orderType20 = "20"
|
||||
SalePlatformSource = "6"
|
||||
|
||||
SoStatusCode10010 = "10010" //订单初始化
|
||||
SoStatusCode10022 = "10022" //暂停
|
||||
SoStatusCode10014 = "10014" //已下发库房
|
||||
SoStatusCode10015 = "10015" //任务已分配
|
||||
SoStatusCode10016 = "10016" //拣货下架
|
||||
SoStatusCode10019 = "10019" //交接发货
|
||||
SoStatusCode10018 = "10018" //货品已打包
|
||||
SoStatusCode10017 = "10017" //复核
|
||||
SoStatusCode10054 = "10054" //分拣中心发货
|
||||
SoStatusCode10033 = "10033" //站点验收
|
||||
SoStatusCode10034 = "10034" //妥投
|
||||
)
|
||||
|
||||
type API struct {
|
||||
@@ -81,12 +93,10 @@ type CancelOrderResult struct {
|
||||
|
||||
type QueryOrderStatusResult struct {
|
||||
OrderStatusList []struct {
|
||||
OrderStatus struct {
|
||||
SoStatusCode string `json:"soStatusCode"`
|
||||
OperateTime string `json:"operateTime"`
|
||||
SoStatusName string `json:"soStatusName"`
|
||||
OperateUser string `json:"operateUser"`
|
||||
} `json:"orderStatus"`
|
||||
SoStatusCode string `json:"soStatusCode"`
|
||||
OperateTime string `json:"operateTime"`
|
||||
SoStatusName string `json:"soStatusName"`
|
||||
OperateUser string `json:"operateUser"`
|
||||
} `json:"orderStatusList"`
|
||||
IsvUUID string `json:"isvUUID"`
|
||||
EclpSoNo string `json:"eclpSoNo"`
|
||||
@@ -94,13 +104,11 @@ type QueryOrderStatusResult struct {
|
||||
|
||||
type GetTrackMessagePlusByOrderResult struct {
|
||||
ResultData []struct {
|
||||
___ struct {
|
||||
OpeTitle string `json:"opeTitle"`
|
||||
OpeTime string `json:"opeTime"`
|
||||
OpeRemark string `json:"opeRemark"`
|
||||
OpeName string `json:"opeName"`
|
||||
WaybillCode string `json:"waybillCode"`
|
||||
} `json:"___"`
|
||||
OpeTitle string `json:"opeTitle"`
|
||||
OpeTime string `json:"opeTime"`
|
||||
OpeRemark string `json:"opeRemark"`
|
||||
OpeName string `json:"opeName"`
|
||||
WaybillCode string `json:"waybillCode"`
|
||||
} `json:"resultData"`
|
||||
ResultCode string `json:"resultCode"`
|
||||
ResultMessage string `json:"resultMessage"`
|
||||
@@ -249,7 +257,7 @@ func (a *API) QueryOrderStatus(eclpSoNo string) (queryOrderStatus *QueryOrderSta
|
||||
"eclpSoNo": eclpSoNo,
|
||||
})
|
||||
if err == nil {
|
||||
utils.Map2StructByJson(result, &queryOrderStatus, false)
|
||||
utils.Map2StructByJson(result["jingdong_eclp_order_queryOrderStatus_responce"].(map[string]interface{})["queryorderstatus_result"], &queryOrderStatus, false)
|
||||
}
|
||||
return queryOrderStatus, err
|
||||
}
|
||||
@@ -263,7 +271,7 @@ func (a *API) GetTrackMessagePlusByOrder(bizCode string) (getTrackMessagePlusByO
|
||||
"type": orderType20,
|
||||
})
|
||||
if err == nil {
|
||||
utils.Map2StructByJson(result, &getTrackMessagePlusByOrderResult, false)
|
||||
utils.Map2StructByJson(result["jingdong_eclp_order_getTrackMessagePlusByOrder_responce"].(map[string]interface{})["getTrackMessagePlusByOrder_result"], &getTrackMessagePlusByOrderResult, false)
|
||||
}
|
||||
return getTrackMessagePlusByOrderResult, err
|
||||
}
|
||||
|
||||
@@ -59,10 +59,18 @@ func TestCancelOrder(t *testing.T) {
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
func TestQueryOrderStatus(t *testing.T) {
|
||||
api.QueryOrderStatus("")
|
||||
result, err := api.QueryOrderStatus("ESL96778165421301")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
func TestGetTrackMessagePlusByOrder(t *testing.T) {
|
||||
api.GetTrackMessagePlusByOrder("")
|
||||
result, err := api.GetTrackMessagePlusByOrder("46526340012148")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
func TestSearchShopStock(t *testing.T) {
|
||||
api.SearchShopStock(&SearchShopStockParam{})
|
||||
|
||||
Reference in New Issue
Block a user