This commit is contained in:
邹宗楠
2024-01-11 16:05:39 +08:00
parent 3b2c26c040
commit b4ddfa37df
2 changed files with 4 additions and 3 deletions

View File

@@ -686,7 +686,6 @@ func GetSToURidingDistance2(sLng, sLat, uLng, uLat float64, orderId string) (way
courierDistance = float64(v.Distance)
}
nowCourierDrop := int64(math.Ceil((courierDistance / float64(v.Distance)) * float64(len(riderLine)))) // 当前骑手骑行距离,占中的骑行距离百分比.
v.CourierCoordinate = riderLine[nowCourierDrop]
if nowCourierDrop >= int64(len(riderLine)) {
v.CourierCoordinate = riderLine[nowCourierDrop-1]
}
@@ -696,6 +695,10 @@ func GetSToURidingDistance2(sLng, sLat, uLng, uLat float64, orderId string) (way
if v.Status >= model.WaybillStatusDelivered {
v.CourierCoordinate = riderLine[len(riderLine)-1]
}
if v.CourierCoordinate == "" {
v.CourierCoordinate = riderLine[nowCourierDrop]
}
}
dao.UpdateEntity(db, v, "OriginalData", "CourierCoordinate", "Distance", "DurationTime")

View File

@@ -451,7 +451,6 @@ func UpdateFakeWayBillToTiktok() {
// continue
//}
globals.SugarLogger.Debugf("==========fakeWayBill %s", utils.Format4Output(fakeWayBill[i], false))
riderInfo := &utils.RiderInfo{
OrderId: fakeWayBill[i].VendorOrderID,
ThirdCarrierOrderId: fakeWayBill[i].VendorWaybillID,
@@ -486,7 +485,6 @@ func UpdateFakeWayBillToTiktok() {
paramsMap := utils.Struct2Map(riderInfo, "", true)
handler := partner.GetPurchaseOrderHandlerFromVendorID(fakeWayBill[i].OrderVendorID)
order, _ := partner.CurOrderManager.LoadOrder(fakeWayBill[i].VendorOrderID, fakeWayBill[i].OrderVendorID)
globals.SugarLogger.Debugf("==========paramsMap %s", utils.Format4Output(paramsMap, false))
if handler != nil {
if err := handler.GetOrderRider(order.VendorOrgCode, order.VendorStoreID, paramsMap); err != nil {
partner.CurOrderManager.OnOrderMsg(order, tao_vegetable.OrderStatusDelivery, fmt.Sprintf("Fake Pull Rider Info Err :%s--%s--%v", riderInfo.OrderId, riderInfo.ThirdCarrierOrderId, err))