diff --git a/business/jxstore/cms/cms.go b/business/jxstore/cms/cms.go index 1abf229cb..666535d7f 100644 --- a/business/jxstore/cms/cms.go +++ b/business/jxstore/cms/cms.go @@ -645,6 +645,12 @@ func GetSToURidingDistance2(sLng, sLat, uLng, uLat float64, orderId string) (way if handler := partner.GetDeliveryPlatformFromVendorID(v.WaybillVendorID); handler != nil { riderInfo, _ := handler.Handler.GetRiderInfo(v.VendorOrderID, v.ID+1000000, v.VendorWaybillID) if riderInfo != nil { + if len(riderInfo.Longitude) < len("104.065861") && riderInfo.Longitude != "" { + riderInfo.Longitude += "0" + } + if len(riderInfo.Latitude) < len("27.934441") && riderInfo.Latitude != "" { + riderInfo.Latitude += "0" + } v.CourierCoordinate = fmt.Sprintf("%s,%s", riderInfo.Longitude, riderInfo.Latitude) if (v.CourierName == "" || v.CourierMobile == "") && riderInfo.CourierName != "" { v.CourierName = riderInfo.CourierName @@ -656,6 +662,12 @@ func GetSToURidingDistance2(sLng, sLat, uLng, uLat float64, orderId string) (way if handler := partner.GetPurchaseOrderHandlerFromVendorID(v.WaybillVendorID); handler != nil { riderInfo, _ := handler.OrderLogisticsStatus(v.VendorOrderID) if riderInfo != nil { + if len(riderInfo.Longitude) < len("104.065861") && riderInfo.Longitude != "" { + riderInfo.Longitude += "0" + } + if len(riderInfo.Latitude) < len("27.934441") && riderInfo.Latitude != "" { + riderInfo.Latitude += "0" + } v.CourierCoordinate = fmt.Sprintf("%s,%s", riderInfo.Longitude, riderInfo.Latitude) if (v.CourierName == "" || v.CourierMobile == "") && riderInfo.CourierName != "" { v.CourierName = riderInfo.CourierName @@ -689,7 +701,6 @@ func GetSToURidingDistance2(sLng, sLat, uLng, uLat float64, orderId string) (way v.CourierName = "暂无骑手" v.CourierMobile = "暂无电话" } - return v, nil } diff --git a/business/partner/purchase/ebai/order.go b/business/partner/purchase/ebai/order.go index abdd9d136..431af3ea0 100644 --- a/business/partner/purchase/ebai/order.go +++ b/business/partner/purchase/ebai/order.go @@ -834,8 +834,12 @@ func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo data.CourierName = utils.Interface2String(status["name"]) data.CourierPhone = utils.Interface2String(status["phone"]) data.OrderId = utils.Interface2String(status["order_id"]) - data.Latitude = utils.Float64ToStr(utils.MustInterface2Float64(status["latitude"])) - data.Longitude = utils.Float64ToStr(utils.MustInterface2Float64(status["longitude"])) + if status["latitude"] != nil { + data.Latitude = utils.Float64ToStr(utils.MustInterface2Float64(status["latitude"])) + } + if status["longitude"] != nil { + data.Longitude = utils.Float64ToStr(utils.MustInterface2Float64(status["longitude"])) + } return data, nil }