This commit is contained in:
邹宗楠
2023-11-28 18:26:57 +08:00
parent 56d14778f8
commit 88684cd942
5 changed files with 32 additions and 17 deletions

View File

@@ -83,10 +83,10 @@ func (c *DeliveryHandler) OnWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaap
func (c *DeliveryHandler) onWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaapi.CallbackResponse) {
order, goodsOrder := c.callbackMsg2Waybill(msg)
store, _ := dao.GetStoreDetail(dao.GetDB(), goodsOrder.JxStoreID, goodsOrder.VendorID, goodsOrder.VendorOrgCode)
switch msg.OrderStatus {
case dadaapi.OrderStatusWaitingForAccept:
dadaOrder, err := api.DadaAPI.QueryOrderInfo(msg.OrderID)
if err == nil {
if dadaOrder, err2 := api.DadaAPI.QueryOrderInfo(msg.OrderID); err2 == nil {
order.ActualFee = jxutils.StandardPrice2Int(dadaOrder.ActualFee)
order.DesiredFee = jxutils.StandardPrice2Int(dadaOrder.DeliveryFee) + int64(store.FreightMarkup)
}
@@ -94,7 +94,7 @@ func (c *DeliveryHandler) onWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaap
case dadaapi.OrderStatusAccepted:
order.Status = model.WaybillStatusCourierAssigned
order.Remark = order.CourierName + "" + order.CourierMobile
if dadaOrder, err := api.DadaAPI.QueryOrderInfo(msg.OrderID); err == nil {
if dadaOrder, err2 := api.DadaAPI.QueryOrderInfo(msg.OrderID); err2 == nil {
order.ActualFee = jxutils.StandardPrice2Int(dadaOrder.ActualFee)
order.DesiredFee = jxutils.StandardPrice2Int(dadaOrder.DeliveryFee) + int64(store.FreightMarkup)
}
@@ -116,7 +116,8 @@ func (c *DeliveryHandler) onWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaap
switch order.OrderVendorID {
case model.VendorIDDD:
tiktokStatusPush(order, msg.OrderStatus)
Lng, Lat, _ := partner.GetRidderPositionGetter(order.WaybillVendorID).GetRidderPosition(nil, order.VendorOrderID, order.VendorOrderID, order.VendorWaybillID, order.VendorWaybillID2)
tiktokStatusPush(order, msg.OrderStatus, utils.Float64ToStr(Lng), utils.Float64ToStr(Lat))
case model.VendorIDMTWM, model.VendorIDTaoVegetable:
delivery.GetOrderRiderInfoToPlatform(order.VendorOrderID, order.Status) // 骑手位置更新
if goodsOrder.VendorID == model.VendorIDTaoVegetable && msg.OrderStatus == dadaapi.OrderStatusAccepted {
@@ -128,15 +129,17 @@ func (c *DeliveryHandler) onWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaap
}
// 抖音订单状态回传
func tiktokStatusPush(order *model.Waybill, status int) {
func tiktokStatusPush(order *model.Waybill, status int, lng, lat string) {
result := &utils.RiderInfo{
OrderId: order.VendorOrderID,
ThirdCarrierOrderId: order.VendorOrderID,
ThirdCarrierOrderId: order.VendorWaybillID,
CourierName: order.CourierName,
CourierPhone: order.CourierMobile,
LogisticsStatus: order.Status,
OpCode: "",
LogisticsProviderCode: utils.DaDaCode,
Longitude: lng,
Latitude: lat,
}
switch status {