diff --git a/business/partner/delivery/dada/waybill.go b/business/partner/delivery/dada/waybill.go index c22b5ad88..c4ffa0294 100644 --- a/business/partner/delivery/dada/waybill.go +++ b/business/partner/delivery/dada/waybill.go @@ -438,7 +438,7 @@ func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeiso return nil, errors.New("订单未分配骑手,或订单已经完成了") } - return &mtpsapi.RiderInfo{ + result := &mtpsapi.RiderInfo{ OrderId: "", ThirdCarrierOrderId: orderId, CourierName: order.TransporterName, @@ -447,5 +447,24 @@ func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeiso LogisticsStatus: order.StatusCode, Latitude: order.TransporterLat, Longitude: order.TransporterLng, - }, nil + } + + switch order.StatusCode { + //case 20: // 骑手接单 + // result.LogisticsStatus = model.WaybillStatusCourierAssigned + case 100: // 骑手到店 + result.LogisticsStatus = model.WaybillStatusCourierArrived + case 3: // 配送中 + result.LogisticsStatus = model.WaybillStatusDelivering + case 4: // 完成 + result.LogisticsStatus = model.WaybillStatusDelivered + case 5: // 取消 + result.LogisticsStatus = model.WaybillStatusAcceptCanceled + case 9: // 配送异常 + result.LogisticsStatus = model.WaybillStatusDeliverFailed + default: + result.LogisticsStatus = 0 + } + + return result, nil } diff --git a/business/partner/delivery/fn/waybill.go b/business/partner/delivery/fn/waybill.go index b6fb8bd82..2e26f6ca4 100644 --- a/business/partner/delivery/fn/waybill.go +++ b/business/partner/delivery/fn/waybill.go @@ -302,7 +302,7 @@ func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeiso return nil, err } - return &mtpsapi.RiderInfo{ + result := &mtpsapi.RiderInfo{ OrderId: utils.Int64ToStr(order.TrackingId), ThirdCarrierOrderId: orderId, CourierName: knightInfo.CarrierDriverName, @@ -311,5 +311,24 @@ func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeiso LogisticsStatus: order.OrderStatus, // 默认正在配送中 Latitude: knightInfo.CarrierDriverLatitude, Longitude: knightInfo.CarrierDriverLongitude, - }, nil + } + + switch order.OrderStatus { + case 20: // 骑手接单 + result.LogisticsStatus = model.WaybillStatusCourierAssigned + case 80: // 骑手到店 + result.LogisticsStatus = model.WaybillStatusCourierArrived + case 2: // 配送中 + result.LogisticsStatus = model.WaybillStatusDelivering + case 3: // 完成 + result.LogisticsStatus = model.WaybillStatusDelivered + case 4: // 取消 + result.LogisticsStatus = model.WaybillStatusAcceptCanceled + case 5: // 配送异常 + result.LogisticsStatus = model.WaybillStatusDeliverFailed + default: + result.LogisticsStatus = 0 + } + + return result, nil } diff --git a/business/partner/delivery/rider.go b/business/partner/delivery/rider.go index ac6adc51a..3b1729df3 100644 --- a/business/partner/delivery/rider.go +++ b/business/partner/delivery/rider.go @@ -26,7 +26,7 @@ import ( //注:若同步配送状态为“配送单已取消”,接口仍支持继续同步配送状态。 说明:商家如未上传此信息,则平台默认值为20(现已要求必传)。 func GetOrderRiderInfoToPlatform(orderId string) { params := make(map[string]interface{}, 0) - params["statuss"] ="[20]" + params["statuss"] = "[20]" params["isDateFinish"] = false params["isIncludeFake"] = true params["mustInvoice"] = false @@ -85,7 +85,7 @@ func GetOrderRiderInfoToPlatform(orderId string) { riderInfo.LogisticsProviderCode = "10032" } riderInfo.ThirdCarrierOrderId = v.VendorWaybillID - switch v.Status { + switch riderInfo.LogisticsStatus { case 20: //配送中 riderInfo.LogisticsStatus = 20 case 110: // 完成