This commit is contained in:
邹宗楠
2023-09-11 16:01:28 +08:00
parent bb50866374
commit f7d3eee018

View File

@@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"git.rosy.net.cn/baseapi/platformapi/autonavi" "git.rosy.net.cn/baseapi/platformapi/autonavi"
"git.rosy.net.cn/baseapi/platformapi/baidunavi" "git.rosy.net.cn/baseapi/platformapi/baidunavi"
"git.rosy.net.cn/jx-callback/globals"
"math" "math"
"reflect" "reflect"
"regexp" "regexp"
@@ -648,11 +649,12 @@ func GetSToURidingDistance2(sLng, sLat, uLng, uLat float64, orderId string) (way
// 如果是三方配送,更新骑手信息 // 如果是三方配送,更新骑手信息
if handler := partner.GetDeliveryPlatformFromVendorID(v.WaybillVendorID); handler != nil { if handler := partner.GetDeliveryPlatformFromVendorID(v.WaybillVendorID); handler != nil {
riderInfo, _ := handler.Handler.GetRiderInfo(v.VendorOrderID, v.ID+1000000, v.VendorWaybillID) riderInfo, _ := handler.Handler.GetRiderInfo(v.VendorOrderID, v.ID+1000000, v.VendorWaybillID)
globals.SugarLogger.Debugf("=======riderInfo := %s", utils.Format4Output(riderInfo, false))
if riderInfo != nil { if riderInfo != nil {
if len(riderInfo.Longitude) < len("104.065861") && riderInfo.Longitude != "" { if len(riderInfo.Longitude) < len("104.065861") || riderInfo.Longitude != "" {
riderInfo.Longitude += "0" riderInfo.Longitude += "0"
} }
if len(riderInfo.Latitude) < len("27.934441") && riderInfo.Latitude != "" { if len(riderInfo.Latitude) < len("27.934441") || riderInfo.Latitude != "" {
riderInfo.Latitude += "0" riderInfo.Latitude += "0"
} }
v.CourierCoordinate = fmt.Sprintf("%s,%s", riderInfo.Longitude, riderInfo.Latitude) v.CourierCoordinate = fmt.Sprintf("%s,%s", riderInfo.Longitude, riderInfo.Latitude)
@@ -666,11 +668,12 @@ func GetSToURidingDistance2(sLng, sLat, uLng, uLat float64, orderId string) (way
// 如果是平台配送,获取骑手信息 // 如果是平台配送,获取骑手信息
if handler := partner.GetPurchaseOrderHandlerFromVendorID(v.WaybillVendorID); handler != nil { if handler := partner.GetPurchaseOrderHandlerFromVendorID(v.WaybillVendorID); handler != nil {
riderInfo, _ := handler.OrderLogisticsStatus(v.VendorOrderID) riderInfo, _ := handler.OrderLogisticsStatus(v.VendorOrderID)
globals.SugarLogger.Debugf("=======riderInfo := %s", utils.Format4Output(riderInfo, false))
if riderInfo != nil { if riderInfo != nil {
if len(riderInfo.Longitude) < len("104.065861") && riderInfo.Longitude != "" { if len(riderInfo.Longitude) < len("104.065861") || riderInfo.Longitude != "" {
riderInfo.Longitude += "0" riderInfo.Longitude += "0"
} }
if len(riderInfo.Latitude) < len("27.934441") && riderInfo.Latitude != "" { if len(riderInfo.Latitude) < len("27.934441") || riderInfo.Latitude != "" {
riderInfo.Latitude += "0" riderInfo.Latitude += "0"
} }
v.CourierCoordinate = fmt.Sprintf("%s,%s", riderInfo.Longitude, riderInfo.Latitude) v.CourierCoordinate = fmt.Sprintf("%s,%s", riderInfo.Longitude, riderInfo.Latitude)
@@ -702,6 +705,7 @@ func GetSToURidingDistance2(sLng, sLat, uLng, uLat float64, orderId string) (way
} }
} }
globals.SugarLogger.Debugf("=========v := %s", utils.Format4Output(v, false))
dao.UpdateEntity(db, v, "OriginalData", "CourierCoordinate", "Distance", "DurationTime") dao.UpdateEntity(db, v, "OriginalData", "CourierCoordinate", "Distance", "DurationTime")
if v.CourierName == "" || v.CourierMobile == "" { if v.CourierName == "" || v.CourierMobile == "" {
v.CourierName = "暂无骑手" v.CourierName = "暂无骑手"