Merge branch 'jdshop' of https://e.coding.net/rosydev/jx-callback into jdshop
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -330,6 +330,12 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *utils.RiderInfo) {
|
||||
return
|
||||
}
|
||||
courierCoordinate := strings.Split(waybill2.CourierCoordinate, ",")
|
||||
if len(courierCoordinate) < 2 && fakeWayBill.Status < model.WaybillStatusDelivered {
|
||||
courierCoordinate = append(courierCoordinate, utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lng)), utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lat)))
|
||||
}
|
||||
if len(courierCoordinate) < 2 && fakeWayBill.Status >= model.WaybillStatusDelivered {
|
||||
courierCoordinate = append(courierCoordinate, utils.Float64ToStr(jxutils.IntCoordinate2Standard(order.ConsigneeLng)), utils.Float64ToStr(jxutils.IntCoordinate2Standard(order.ConsigneeLat)))
|
||||
}
|
||||
switch fakeWayBill.Status {
|
||||
case 5: // 呼叫骑手
|
||||
riderInfo.LogisticsContext = "呼叫骑手,新建运单"
|
||||
@@ -439,7 +445,6 @@ func UpdateFakeWayBillToTiktok() {
|
||||
order, _ := partner.CurOrderManager.LoadOrder(fakeWayBill[i].VendorOrderID, fakeWayBill[i].OrderVendorID)
|
||||
if err := handler.GetOrderRider(fakeWayBill[i].VendorOrgCode, order.VendorStoreID, paramsMap); err != nil {
|
||||
globals.SugarLogger.Debugf("Fake Pull Rider Info Err :%s--%s--%v", riderInfo.OrderId, riderInfo.ThirdCarrierOrderId, err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -919,12 +919,17 @@ func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo
|
||||
if err != nil {
|
||||
return nil, errors.New("获取本地门店账号信息失败,请重试")
|
||||
}
|
||||
|
||||
status, err := getAPI(orderInfo.VendorOrgCode, 0, "").OrderLogisticsStatus(utils.Str2Int64(orderId))
|
||||
api := getAPI(orderInfo.VendorOrgCode, orderInfo.JxStoreID, orderInfo.VendorOrderID)
|
||||
// 获取骑手信息
|
||||
status, err := api.OrderLogisticsStatus(utils.Str2Int64(orderId))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 获取骑手坐标最后一个
|
||||
lng, lat, _ := api.GetDeliveryPath(utils.Str2Int64(orderId), orderInfo.VendorOrderID)
|
||||
status.Longitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(int(lng)))
|
||||
status.Latitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(int(lat)))
|
||||
return status, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user