This commit is contained in:
邹宗楠
2022-11-02 15:53:45 +08:00
parent 660bfdabcb
commit 667c66f7c7
7 changed files with 90 additions and 36 deletions

View File

@@ -76,18 +76,19 @@ func (c *DeliveryHandler) onWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaap
}
order.Status = model.WaybillStatusNew
case dadaapi.OrderStatusAccepted:
order.Status = model.WaybillStatusAccepted
order.Status = model.WaybillStatusCourierAssigned
order.Remark = order.CourierName + "" + order.CourierMobile
if dadaOrder, err := api.DadaAPI.QueryOrderInfo(msg.OrderID); err == nil {
order.ActualFee = jxutils.StandardPrice2Int(dadaOrder.ActualFee)
order.DesiredFee = jxutils.StandardPrice2Int(dadaOrder.DeliveryFee)
}
case dadaapi.OrderStatusReturningInOrder:
order.Status = model.WaybillStatusCourierArrived
case dadaapi.OrderStatusDelivering:
order.Status = model.WaybillStatusDelivering
//delivery.GetOrderRiderInfoToPlatform(order.VendorOrderID)
case dadaapi.OrderStatusFinished:
order.Status = model.WaybillStatusDelivered
case dadaapi.OrderStatusCanceled, dadaapi.OrderStatusExpired:
case dadaapi.OrderStatusCanceled:
order.Status = model.WaybillStatusCanceled
case dadaapi.OrderStatusAddOrderFailed:
order.Status = model.WaybillStatusFailed
@@ -455,24 +456,36 @@ func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeiso
}
switch order.StatusCode {
case 20: // 骑手接单
result.LogisticsStatus = model.WaybillStatusCourierAssigned
result.LogisticsContext = model.RiderGetOrder
case 100: // 骑手到店
result.LogisticsStatus = model.WaybillStatusCourierArrived
result.LogisticsContext = model.RiderGetOrder
case 3: // 配送中
case dadaapi.OrderStatusWaitingForAccept: // 接单
result.LogisticsStatus = model.WaybillStatusAccepted
result.LogisticsContext = model.RiderWaitRider
case dadaapi.OrderStatusAccepted: // 待取货
result.LogisticsStatus = model.WaybillStatusCourierAssigned // 分配骑手
result.LogisticsContext = model.RiderWaitGetGoods
case dadaapi.OrderStatusDelivering: // 配送中
result.LogisticsStatus = model.WaybillStatusDelivering
result.LogisticsContext = model.RiderGetOrderDelivering
case 4: // 完成
case dadaapi.OrderStatusFinished: // 完成
result.LogisticsStatus = model.WaybillStatusDelivered
result.LogisticsContext = model.RiderGetOrderDelivered
case 5: // 取消
case dadaapi.OrderStatusCanceled: // 取消
result.LogisticsStatus = model.WaybillStatusCanceled
result.LogisticsContext = model.RiderGetOrderCanceled
case 9: // 配送异常
case 8: // 指派单,不处理
result.LogisticsStatus = 0
result.LogisticsContext = model.RiderGetOrderDeliverOther
case 9: // 配送异常返回值
result.LogisticsStatus = model.WaybillStatusDeliverFailed
result.LogisticsContext = model.RiderGetOrderDeliverFailed
case 10: // 妥投异常之物品返回完成 - 不处理
result.LogisticsStatus = 0
result.LogisticsContext = model.RiderGetOrderDeliverOther
case dadaapi.OrderStatusReturningInOrder: // 骑手到店
result.LogisticsStatus = model.WaybillStatusCourierArrived
result.LogisticsContext = model.RiderToStore
case dadaapi.OrderStatusAddOrderFailed: // 创建达达运单失败 - 不处理
result.LogisticsStatus = model.WaybillStatusFailed
result.LogisticsContext = model.RiderGetOrderDeliverOther
default:
result.LogisticsStatus = 0
result.LogisticsContext = model.RiderGetOrderDeliverOther