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