This commit is contained in:
邹宗楠
2023-09-11 15:38:39 +08:00
parent 3ef02e9dfe
commit bb50866374
2 changed files with 36 additions and 32 deletions

View File

@@ -616,7 +616,8 @@ func GetSToURidingDistance2(sLng, sLat, uLng, uLat float64, orderId string) (way
var (
//origin = fmt.Sprintf("%f,%f", sLng, sLat)
//destination = fmt.Sprintf("%f,%f", uLng, uLat)
db = dao.GetDB()
db = dao.GetDB()
vendorMaps = map[int]int{model.VendorIDDada: 1, model.VendorIDFengNiao: 1, model.VendorIDMTPS: 1, model.VendorIDUUPT: 1, model.VendorIDSFPS: 1}
)
for {
@@ -643,37 +644,40 @@ 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
v.CourierMobile = riderInfo.CourierPhone
if vendorMaps[v.WaybillVendorID] == model.YES {
// 如果是三方配送,更新骑手信息
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
v.CourierMobile = riderInfo.CourierPhone
}
}
}
}
// 如果是平台配送,获取骑手信息
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
v.CourierMobile = riderInfo.CourierPhone
} else {
// 如果是平台配送,获取骑手信息
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
v.CourierMobile = riderInfo.CourierPhone
}
}
}
}
@@ -735,7 +739,7 @@ func GetCyclingLine(sLng, sLat, uLng, uLat float64) (polyLineList []string, dist
}
distance = int64(path.Result.Routes[0].Distance) // 距离
duration = int64(path.Result.Routes[0].Duration) // 时间
for _, v := range path.Result.Routes[0].Steps {
polyLineList = append(polyLineList, strings.Split(v.Path, ";")...)
}

View File

@@ -281,7 +281,7 @@ func (d DeliveryHandler) GetWaybillFee(order *model.GoodsOrder) (deliveryFeeInfo
}
func (d DeliveryHandler) ComplaintRider(bill *model.Waybill, resonID int, resonContent string) (err error) {
return nil
return fmt.Errorf("顺丰暂未实现投诉")
}
// GetDeliverLiquidatedDamages 获取取消运单违约金