新增抖音授权登录,添加定时任务,更新[配送中的订单骑手位置!

This commit is contained in:
邹宗楠
2022-04-14 17:03:43 +08:00
parent f4e821b25f
commit 7a5462bf4c
24 changed files with 352 additions and 38 deletions

View File

@@ -103,6 +103,7 @@ func (c *DeliveryHandler) onWaybillMsg(msg *mtpsapi.CallbackOrderMsg) (retVal *m
order.Remark = order.CourierName + "" + order.CourierMobile
case mtpsapi.OrderStatusPickedUp:
order.Status = model.WaybillStatusDelivering
delivery.GetOrderRiderInfoToPlatform(order.VendorOrderID)
case mtpsapi.OrderStatusDeliverred:
order.Status = model.WaybillStatusDelivered
case mtpsapi.OrderStatusCanceled:
@@ -380,3 +381,23 @@ func (c *DeliveryHandler) GetRidderPosition(ctx *jxcontext.Context, vendorOrgCod
}
return lng, lat, err
}
// 获取骑手信息 美团配送 deliveryId,mtPeisongId这两参数美团专属
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *mtpsapi.RiderInfo, err error) {
// 获取订单状态
order, err := api.MtpsAPI.QueryOrderStatus(deliveryId, mtPeisongId)
if err != nil {
return nil, err
}
return &mtpsapi.RiderInfo{
OrderId: utils.Interface2String(order["mt_peisong_id"]),
ThirdCarrierOrderId: utils.Interface2String(order["order_id"]),
CourierName: utils.Interface2String(order["courier_name"]),
CourierPhone: utils.Interface2String(order["courier_phone"]),
LogisticsProviderCode: string(mtpsapi.MTPsCode),
LogisticsStatus: int(utils.MustInterface2Int64(order["status"])), // 默认正在配送中
Latitude: utils.Interface2String(order["order_id"]),
Longitude: utils.Interface2String(order["order_id"]),
}, nil
}