aa
This commit is contained in:
@@ -404,3 +404,51 @@ func (a *API) RiderLocation(deliveryId int64, mtPeiSongId string) (lng, lat int,
|
||||
}
|
||||
return lng, lat, err
|
||||
}
|
||||
|
||||
type PreCreateByShopParam struct {
|
||||
DeliveryID int64 `json:"delivery_id"`
|
||||
OrderID string `json:"order_id"`
|
||||
OuterOrderSourceDesc string `json:"outer_order_source_desc"` //101.美团(外卖&闪购) 102.饿了么 103.京东到家
|
||||
OuterOrderSourceNo string `json:"outer_order_source_no"`
|
||||
ShopID string `json:"shop_id"`
|
||||
DeliveryServiceCode int `json:"delivery_service_code"`
|
||||
ReceiverName string `json:"receiver_name"`
|
||||
ReceiverAddress string `json:"receiver_address"`
|
||||
ReceiverPhone string `json:"receiver_phone"`
|
||||
ReceiverLng int `json:"receiver_lng"`
|
||||
ReceiverLat int `json:"receiver_lat"`
|
||||
PayTypeCode int `json:"pay_type_code"`
|
||||
GoodsValue float64 `json:"goods_value"`
|
||||
GoodsWeight float64 `json:"goods_weight"`
|
||||
|
||||
// 以下为可选参数
|
||||
|
||||
CoordinateType int `json:"coordinate_type"`
|
||||
GoodsHeight float64 `json:"goods_height,omitempty"`
|
||||
GoodsWidth float64 `json:"goods_width,omitempty"`
|
||||
GoodsLength float64 `json:"goods_length,omitempty"`
|
||||
GoodsDetail string `json:"goods_detail,omitempty"`
|
||||
GoodsPickupInfo string `json:"goods_pickup_info,omitempty"`
|
||||
GoodsDeliveryInfo string `json:"goods_delivery_info,omitempty"`
|
||||
ExpectedPickupTime int64 `json:"expected_pickup_time,omitempty"` // 期望取货时间,时区为GMT+8,当前距离Epoch(1970年1月1日) 以秒计算的时间,即unix-timestamp。
|
||||
// 期望送达时间,时区为GMT+8,当前距离Epoch(1970年1月1日) 以秒计算的时间,即unix-timestamp
|
||||
// 即时单:以发单时间 + 服务包时效作为期望送达时间(当天送服务包需客户指定期望送达时间)
|
||||
// 预约单:以客户传参数据为准(预约时间必须大于当前下单时间+服务包时效+3分钟)
|
||||
ExpectedDeliveryTime int64 `json:"expected_delivery_time,omitempty"`
|
||||
OrderType int `json:"order_type,omitempty"`
|
||||
PoiSeq string `json:"poi_seq,omitempty"`
|
||||
Note string `json:"note,omitempty"`
|
||||
CashOnDelivery float64 `json:"cash_on_delivery,omitempty"`
|
||||
CashOnPickup float64 `json:"cash_on_pickup,omitempty"`
|
||||
InvoiceTitle string `json:"invoice_title,omitempty"`
|
||||
}
|
||||
|
||||
// 预发单
|
||||
func (a *API) PreCreateByShop(basicParams *PreCreateByShopParam) (lng, lat int, err error) {
|
||||
params := utils.Struct2MapByJson(basicParams)
|
||||
_, err = a.AccessAPI("order/preCreateByShop", params)
|
||||
if err == nil {
|
||||
|
||||
}
|
||||
return lng, lat, err
|
||||
}
|
||||
|
||||
@@ -102,3 +102,27 @@ func TestRiderLocation(t *testing.T) {
|
||||
}
|
||||
t.Logf("lng:%d,lat:%d", lng, lat)
|
||||
}
|
||||
|
||||
func TestPreCreateByShop(t *testing.T) {
|
||||
_, _, err := api.PreCreateByShop(&PreCreateByShopParam{
|
||||
DeliveryID: 123456789,
|
||||
OrderID: "order_123456789",
|
||||
// 设置测试门店 id,测试门店的坐标地址为 97235456,31065079(高德坐标),配送范围3km
|
||||
ShopID: "667235",
|
||||
DeliveryServiceCode: DeliveryServiceCodeRapid,
|
||||
ReceiverName: "xjh",
|
||||
ReceiverAddress: "九里堤",
|
||||
ReceiverPhone: "18112345678",
|
||||
ReceiverLng: 113860710,
|
||||
ReceiverLat: 27628259,
|
||||
CoordinateType: CoordinateTypeMars,
|
||||
GoodsValue: 12.34,
|
||||
GoodsWeight: 3.7,
|
||||
PayTypeCode: 0,
|
||||
OuterOrderSourceDesc: "103",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
//sugarLogger.Debug(result)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user