美团配送推送抖店配送信息

This commit is contained in:
邹宗楠
2022-11-25 10:16:56 +08:00
parent 20a71bdb2c
commit 3538b5a809
4 changed files with 56 additions and 160 deletions

View File

@@ -126,6 +126,44 @@ func (c *DeliveryHandler) onWaybillMsg(msg *mtpsapi.CallbackOrderMsg) (retVal *m
// 加入调度器
err := mtpsapi.Err2CallbackResponse(partner.CurOrderManager.OnWaybillStatusChanged(order), order.VendorStatus)
defer delivery.GetOrderRiderInfoToPlatform(order.VendorOrderID, order.Status) // 骑手位置更新
if order.OrderVendorID == model.VendorIDDD {
result := &mtpsapi.RiderInfo{
OrderId: order.VendorOrderID,
ThirdCarrierOrderId: order.VendorOrderID,
CourierName: order.CourierName,
CourierPhone: order.CourierMobile,
LogisticsProviderCode: "10032",
LogisticsStatus: order.Status,
OpCode: "",
}
switch msg.Status {
case mtpsapi.OrderStatusWaitingForSchedule: // 待接单,召唤骑手
result.LogisticsStatus = model.WaybillStatusNew
result.LogisticsContext = model.RiderWaitRider
case mtpsapi.OrderStatusAccepted: // 已接单
result.LogisticsStatus = model.WaybillStatusCourierAssigned // 分配骑手
result.LogisticsContext = model.RiderWaitGetGoods
case mtpsapi.OrderStatusDeliverred: // 完成
result.LogisticsStatus = model.WaybillStatusDelivered
result.LogisticsContext = model.RiderGetOrderDelivered
case mtpsapi.OrderStatusCanceled: // 取消
result.LogisticsStatus = model.WaybillStatusCanceled
result.LogisticsContext = model.RiderGetOrderCanceled
case mtpsapi.OrderStatusPickedUp: // 骑手到店
result.LogisticsStatus = model.WaybillStatusCourierArrived
result.LogisticsContext = model.RiderToStore
default:
result.LogisticsStatus = 0
result.LogisticsContext = model.RiderGetOrderDeliverOther
}
delivery.PullTiktokRiderInfo(result)
if result.LogisticsStatus == model.WaybillStatusCourierArrived {
result.LogisticsStatus = model.WaybillStatusDelivering
result.LogisticsContext = model.RiderGetOrderDelivering
delivery.PullTiktokRiderInfo(result)
}
}
return err
}