sfps callback
This commit is contained in:
@@ -18,83 +18,101 @@ const (
|
||||
UrlIndexRiderException = "rider_exception" //订单异常回调
|
||||
)
|
||||
|
||||
// RiderStatus 配送状态更改回调
|
||||
// RiderStatus10 配送状态更改回调
|
||||
type RiderStatus10 struct {
|
||||
ArriveShopTime int `json:"arrive_shop_time"`
|
||||
OperatorName string `json:"operator_name"` //配送员姓名
|
||||
OperatorPhone string `json:"operator_phone"` //配送员电话
|
||||
OrderStatus int `json:"order_status"` //10-配送员接单/改派;12:配送员到店;15:配送员配送中
|
||||
PushTime int `json:"push_time"` //状态变更时间
|
||||
RiderLng string `json:"rider_lng"` //配送员位置经度
|
||||
RiderLat string `json:"rider_lat"` //配送员位置纬度
|
||||
SFOrderID string `json:"sf_order_id"` //顺丰订单ID
|
||||
SFUCode string `json:"sf_ucode"`
|
||||
ShopId string `json:"shop_id"` // 店铺ID
|
||||
ShopOrderID string `json:"shop_order_id"` //商家订单ID
|
||||
StatusDesc string `json:"status_desc"` //状态描述
|
||||
UrlIndex string `json:"url_index"` //回调url前缀
|
||||
}
|
||||
|
||||
// RiderStatus 配送状态更改回调 12:配送员到店;15:配送员配送中
|
||||
type RiderStatus struct {
|
||||
ShopId string `json:"shop_id"` // 店铺ID
|
||||
SFOrderID string `json:"sf_order_id"` //顺丰订单ID
|
||||
ShopOrderID string `json:"shop_order_id"` //商家订单ID
|
||||
UrlIndex string `json:"url_index"` //回调url前缀
|
||||
OperatorName string `json:"operator_name"` //配送员姓名
|
||||
OperatorPhone string `json:"operator_phone"` //配送员电话
|
||||
RiderLng string `json:"rider_lng"` //配送员位置经度
|
||||
RiderLat string `json:"rider_lat"` //配送员位置纬度
|
||||
OrderStatus int `json:"order_status"` //10-配送员接单/改派;12:配送员到店;15:配送员配送中
|
||||
StatusDesc string `json:"status_desc"` //状态描述
|
||||
PushTime int `json:"push_time"` //状态变更时间
|
||||
ShopId float64 `json:"shop_id"` // 店铺ID
|
||||
SFOrderID string `json:"sf_order_id"` //顺丰订单ID
|
||||
ShopOrderID string `json:"shop_order_id"` //商家订单ID
|
||||
UrlIndex string `json:"url_index"` //回调url前缀
|
||||
OperatorName string `json:"operator_name"` //配送员姓名
|
||||
OperatorPhone string `json:"operator_phone"` //配送员电话
|
||||
RiderLng float64 `json:"rider_lng"` //配送员位置经度
|
||||
RiderLat float64 `json:"rider_lat"` //配送员位置纬度
|
||||
OrderStatus float64 `json:"order_status"` //10-配送员接单/改派;12:配送员到店;15:配送员配送中
|
||||
StatusDesc string `json:"status_desc"` //状态描述
|
||||
SFUCode string `json:"sf_ucode"`
|
||||
PushTime int `json:"push_time"` //状态变更时间
|
||||
}
|
||||
|
||||
// RiderRecall 骑士撤单状态回调
|
||||
type RiderRecall struct {
|
||||
ShopId string `json:"shop_id"` // 店铺ID
|
||||
SFOrderID string `json:"sf_order_id"` //顺丰订单ID
|
||||
ShopOrderID string `json:"shop_order_id"` //商家订单ID
|
||||
UrlIndex string `json:"url_index"` //回调url前缀
|
||||
OrderStatus int `json:"order_status"` //22-配送员撤单
|
||||
StatusDesc string `json:"status_desc"` //状态描述
|
||||
PushTime int `json:"push_time"` //状态变更时间
|
||||
//OperatorName string `json:"operator_name"` //配送员姓名
|
||||
//OperatorPhone string `json:"operator_phone"` //配送员电话
|
||||
//RiderLng string `json:"rider_lng"` //配送员位置经度
|
||||
//RiderLat string `json:"rider_lat"` //配送员位置纬度
|
||||
OrderStatus float64 `json:"order_status"` //22-配送员撤单
|
||||
PushTime int `json:"push_time"` //状态变更时间
|
||||
SFOrderID string `json:"sf_order_id"` //顺丰订单ID
|
||||
ShopId string `json:"shop_id"` // 店铺ID
|
||||
ShopOrderID string `json:"shop_order_id"` //商家订单ID
|
||||
UrlIndex string `json:"url_index"` //回调url前缀
|
||||
StatusDesc string `json:"status_desc"` //状态描述
|
||||
}
|
||||
|
||||
// OrderComplete 订单完成回调
|
||||
type OrderComplete struct {
|
||||
ShopId string `json:"shop_id"` // 店铺ID
|
||||
SFOrderID string `json:"sf_order_id"` //顺丰订单ID
|
||||
ShopOrderID string `json:"shop_order_id"` //商家订单ID
|
||||
UrlIndex string `json:"url_index"` //回调url前缀
|
||||
OperatorName string `json:"operator_name"` //配送员姓名
|
||||
RiderLng string `json:"rider_lng"` //配送员位置经度
|
||||
RiderLat string `json:"rider_lat"` //配送员位置纬度
|
||||
OrderStatus int `json:"order_status"` //17配送员点击完成
|
||||
StatusDesc string `json:"status_desc"` //状态描述
|
||||
PickUpPic string `json:"pickup_pic"` //只有在店铺打开妥投照片回调开关且有妥投照片时才有此字段
|
||||
PushTime int `json:"push_time"` //完成时间
|
||||
ReceiptType int `json:"receipt_type"` //1:正常签收, 2:商家退回签收
|
||||
OperatorName string `json:"operator_name"` //配送员姓名
|
||||
OperatorPhone string `json:"operator_phone"` //配送员电话
|
||||
OrderStatus float64 `json:"order_status"` //17配送员点击完成
|
||||
PushTime int `json:"push_time"` //完成时间
|
||||
ReceiptType float64 `json:"receipt_type"` //1:正常签收, 2:商家退回签收
|
||||
RiderLng string `json:"rider_lng"` //配送员位置经度
|
||||
RiderLat string `json:"rider_lat"` //配送员位置纬度
|
||||
SFOrderID string `json:"sf_order_id"` //顺丰订单ID
|
||||
SFUCode string `json:"sf_ucode"`
|
||||
ShopId float64 `json:"shop_id"` // 店铺ID
|
||||
ShopOrderID string `json:"shop_order_id"` //商家订单ID
|
||||
UrlIndex string `json:"url_index"` //回调url前缀
|
||||
StatusDesc string `json:"status_desc"` //状态描述
|
||||
//PickUpPic string `json:"pickup_pic"` //只有在店铺打开妥投照片回调开关且有妥投照片时才有此字段
|
||||
|
||||
}
|
||||
|
||||
// SFCancel 顺丰原因订单取消回调
|
||||
type SFCancel struct {
|
||||
ShopId string `json:"shop_id"` // 店铺ID
|
||||
SFOrderID string `json:"sf_order_id"` //顺丰订单ID
|
||||
ShopOrderID string `json:"shop_order_id"` //商家订单ID
|
||||
UrlIndex string `json:"url_index"` //回调url前缀
|
||||
OperatorName string `json:"operator_name"` //配送员姓名
|
||||
OperatorPhone string `json:"operator_phone"` //配送员电话
|
||||
OrderStatus int `json:"order_status"` //2:订单取消
|
||||
StatusDesc string `json:"status_desc"` //状态描述
|
||||
CancelReason string `json:"cancel_reason"` //取消原因
|
||||
CancelCode string `json:"cancel_code"` //取消码
|
||||
RiderLng string `json:"rider_lng"` //配送员位置经度
|
||||
RiderLat string `json:"rider_lat"` //配送员位置纬度
|
||||
PushTime int `json:"push_time"` //状态变更时间
|
||||
CancelReason string `json:"cancel_reason"` //取消原因
|
||||
CancelCode string `json:"cancel_code"` //取消码
|
||||
OperatorName string `json:"operator_name"` //配送员姓名
|
||||
OperatorPhone string `json:"operator_phone"` //配送员电话
|
||||
OrderStatus float64 `json:"order_status"` //2:订单取消
|
||||
PushTime int `json:"push_time"` //状态变更时间
|
||||
RiderLng float64 `json:"rider_lng"` //配送员位置经度
|
||||
RiderLat float64 `json:"rider_lat"` //配送员位置纬度
|
||||
SFOrderID string `json:"sf_order_id"` //顺丰订单ID
|
||||
SFUCode string `json:"sf_ucode"`
|
||||
ShopId float64 `json:"shop_id"` // 店铺ID
|
||||
ShopOrderID string `json:"shop_order_id"` //商家订单ID
|
||||
UrlIndex string `json:"url_index"` //回调url前缀
|
||||
StatusDesc string `json:"status_desc"` //状态描述
|
||||
}
|
||||
|
||||
// RiderException 配送状态更改回调
|
||||
// RiderException 订单异常回调
|
||||
type RiderException struct {
|
||||
ShopId string `json:"shop_id"` // 店铺ID
|
||||
SFOrderID string `json:"sf_order_id"` //顺丰订单ID
|
||||
ShopOrderID string `json:"shop_order_id"` //商家订单ID
|
||||
UrlIndex string `json:"url_index"` //回调url前缀
|
||||
OperatorName string `json:"operator_name"` //配送员姓名
|
||||
OperatorPhone string `json:"operator_phone"` //配送员电话
|
||||
OrderStatus int `json:"order_status"` //固定为91
|
||||
StatusDesc string `json:"status_desc"` //状态描述
|
||||
ExID int `json:"ex_id"` //异常ID
|
||||
ExContent string `json:"ex_content"` //异常详情
|
||||
ExpectTime string `json:"expect_time"` //新的预计送达时间
|
||||
PushTime int `json:"push_time"` //顺丰推送时间
|
||||
ShopId float64 `json:"shop_id"` // 店铺ID
|
||||
SFOrderID string `json:"sf_order_id"` //顺丰订单ID
|
||||
ShopOrderID string `json:"shop_order_id"` //商家订单ID
|
||||
UrlIndex string `json:"url_index"` //回调url前缀
|
||||
OperatorName string `json:"operator_name"` //配送员姓名
|
||||
OperatorPhone string `json:"operator_phone"` //配送员电话
|
||||
OrderStatus float64 `json:"order_status"` //固定为91
|
||||
StatusDesc string `json:"status_desc"` //状态描述
|
||||
ExID int `json:"ex_id"` //异常ID
|
||||
ExContent string `json:"ex_content"` //异常详情
|
||||
ExpectTime string `json:"expect_time"` //新的预计送达时间
|
||||
PushTime int `json:"push_time"` //顺丰推送时间
|
||||
}
|
||||
|
||||
type CallbackResponse struct {
|
||||
|
||||
@@ -81,14 +81,15 @@ const (
|
||||
CancelCodeOther = 313 //其他,请注明原因
|
||||
|
||||
//订单状态
|
||||
OrderStatusNewOrder = 1 //1:订单创建
|
||||
OrderStatusTakeOrder = 10 //10:配送员接单
|
||||
OrderStatusArrivedStore = 12 //12:配送员到店
|
||||
OrderStatusRiderArriving = 15 //15:配送员配送中(已取货)
|
||||
OrderStatusRiderCancel = 22 //配送员撤单
|
||||
OrderStatusFinished = 17 //17:配送员完成订单
|
||||
OrderStatusOrderCancel = 2 //订单取消
|
||||
OrderStatusError = 91 //订单异常
|
||||
OrderStatusNewOrder = 1 //1:订单创建
|
||||
OrderStatusNewOrderDesc = "订单创建" //1:订单创建
|
||||
OrderStatusTakeOrder = 10 //10:配送员接单
|
||||
OrderStatusArrivedStore = 12 //12:配送员到店
|
||||
OrderStatusRiderArriving = 15 //15:配送员配送中(已取货)
|
||||
OrderStatusRiderCancel = 22 //配送员撤单
|
||||
OrderStatusFinished = 17 //17:配送员完成订单
|
||||
OrderStatusOrderCancel = 2 //订单取消
|
||||
OrderStatusError = 91 //订单异常
|
||||
//异常情况枚举
|
||||
ExIDLoseOrBroke = 4003 //托寄物丢失或损坏
|
||||
ExIDStoreSlow = 1001 //商家出货慢
|
||||
|
||||
@@ -101,14 +101,14 @@ func TestCancelOrder(t *testing.T) {
|
||||
|
||||
//订单实时信息查询
|
||||
func TestGetOrderStatus(t *testing.T) {
|
||||
resp, err := api.GetOrderStatus("JS4157196256886")
|
||||
resp, err := api.GetOrderStatus("JS4157016257273")
|
||||
fmt.Println(utils.Format4Output(resp, false))
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
//
|
||||
func TestGetRiderLatestPosition(t *testing.T) {
|
||||
resp, err := api.GetRiderLatestPosition("JS4157196256886")
|
||||
resp, err := api.GetRiderLatestPosition("JS4157016257273")
|
||||
fmt.Println(utils.Format4Output(resp, false))
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user