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

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

@@ -2,6 +2,7 @@ package fn
import (
"fmt"
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
"git.rosy.net.cn/baseapi/utils"
"strconv"
"strings"
@@ -234,6 +235,7 @@ func OnWaybillMsg(msg *fnpsapi.OrderStatusNottify) (resp *fnpsapi.CallbackRespon
order.Status = model.WaybillStatusCourierArrived
case fnpsapi.OrderStatusDelivering: // 2 配送中
order.Status = model.WaybillStatusDelivering
delivery.GetOrderRiderInfoToPlatform(order.VendorOrderID)
case fnpsapi.OrderStatusDelivered: // 3 已经送达
order.Status = model.WaybillStatusDelivered
case fnpsapi.OrderStatusAcceptCacle: // 4取消订单
@@ -280,3 +282,29 @@ func GetDesiredFee(vendorOrderID string) (desiredFee int64) {
}
return desiredFee
}
// 获取骑手信息
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *mtpsapi.RiderInfo, err error) {
// 获取订单状态
order, err := api.FnAPI.QueryOrder(orderId)
if err != nil {
return nil, err
}
// 获取骑手坐标
knightInfo, err := api.FnAPI.GetKnightInfo(&fnpsapi.GetOrderDetailReq{PartnerOrderCode: orderId})
if err != nil {
return nil, err
}
return &mtpsapi.RiderInfo{
OrderId: "",
ThirdCarrierOrderId: orderId,
CourierName: knightInfo.CarrierDriverName,
CourierPhone: knightInfo.CarrierDriverPhone,
LogisticsProviderCode: string(mtpsapi.FnPsCode),
LogisticsStatus: order.OrderStatus, // 默认正在配送中
Latitude: knightInfo.CarrierDriverLatitude,
Longitude: knightInfo.CarrierDriverLongitude,
}, nil
}