GetOrderWaybillInfo可选参数:isGetPos支持获取运单骑手实时信息
This commit is contained in:
@@ -410,3 +410,12 @@ func (c *DeliveryHandler) AddWaybillTip(ctx *jxcontext.Context, vendorOrgCode, v
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) GetRidderPosition(ctx *jxcontext.Context, vendorOrgCode, vendorOrderID, vendorWaybillID, vendorWaybillID2 string) (lng, lat float64, err error) {
|
||||
order, err := api.DadaAPI.QueryOrderInfo2(vendorOrderID)
|
||||
if err == nil {
|
||||
lng = utils.Str2Float64WithDefault(order.TransporterLng, 0)
|
||||
lat = utils.Str2Float64WithDefault(order.TransporterLat, 0)
|
||||
}
|
||||
return lng, lat, err
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"time"
|
||||
|
||||
_ "git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
"git.rosy.net.cn/jx-callback/globals/testinit"
|
||||
@@ -18,15 +19,14 @@ func TestCreateWaybill(t *testing.T) {
|
||||
orderID := "817540316000041"
|
||||
if order, err := partner.CurOrderManager.LoadOrder(orderID, model.VendorIDJD); err == nil {
|
||||
// globals.SugarLogger.Debug(order)
|
||||
c := new(DeliveryHandler)
|
||||
_, err = c.CreateWaybill(order, nil)
|
||||
_, err = CurDeliveryHandler.CreateWaybill(order, 0)
|
||||
if err == nil {
|
||||
time.Sleep(1 * time.Second)
|
||||
bill := &model.Waybill{
|
||||
VendorOrderID: orderID,
|
||||
WaybillVendorID: model.VendorIDDada,
|
||||
}
|
||||
err = c.CancelWaybill(bill, partner.CancelWaybillReasonOther, "")
|
||||
err = CurDeliveryHandler.CancelWaybill(bill, partner.CancelWaybillReasonOther, "")
|
||||
if err != nil {
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
@@ -37,3 +37,11 @@ func TestCreateWaybill(t *testing.T) {
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetRidderPosition(t *testing.T) {
|
||||
lng, lat, err := CurDeliveryHandler.GetRidderPosition(jxcontext.AdminCtx, "", "80704840263399812", "", "")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Logf("lng:%f, lat:%f", lng, lat)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user