1
This commit is contained in:
@@ -434,10 +434,6 @@ func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeiso
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if order.StatusCode != 3 {
|
|
||||||
return nil, errors.New("订单未分配骑手,或订单已经完成了")
|
|
||||||
}
|
|
||||||
|
|
||||||
result := &mtpsapi.RiderInfo{
|
result := &mtpsapi.RiderInfo{
|
||||||
OrderId: orderId,
|
OrderId: orderId,
|
||||||
ThirdCarrierOrderId: mtPeisongId,
|
ThirdCarrierOrderId: mtPeisongId,
|
||||||
|
|||||||
@@ -396,8 +396,7 @@ func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeiso
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
result := &mtpsapi.RiderInfo{
|
||||||
return &mtpsapi.RiderInfo{
|
|
||||||
OrderId: orderId,
|
OrderId: orderId,
|
||||||
ThirdCarrierOrderId: utils.Interface2String(order["mt_peisong_id"]),
|
ThirdCarrierOrderId: utils.Interface2String(order["mt_peisong_id"]),
|
||||||
CourierName: utils.Interface2String(order["courier_name"]),
|
CourierName: utils.Interface2String(order["courier_name"]),
|
||||||
@@ -406,5 +405,19 @@ func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeiso
|
|||||||
LogisticsStatus: int(utils.MustInterface2Int64(order["status"])), // 默认正在配送中
|
LogisticsStatus: int(utils.MustInterface2Int64(order["status"])), // 默认正在配送中
|
||||||
Latitude: utils.Float64ToStr(jxutils.IntCoordinate2Standard(lat)),
|
Latitude: utils.Float64ToStr(jxutils.IntCoordinate2Standard(lat)),
|
||||||
Longitude: utils.Float64ToStr(jxutils.IntCoordinate2Standard(lng)),
|
Longitude: utils.Float64ToStr(jxutils.IntCoordinate2Standard(lng)),
|
||||||
}, nil
|
}
|
||||||
|
switch int(utils.MustInterface2Int64(order["status"])) {
|
||||||
|
case 20 : //已接单
|
||||||
|
result.LogisticsStatus = model.WaybillStatusCourierAssigned
|
||||||
|
case 30 : //已取货
|
||||||
|
result.LogisticsStatus = model.WaybillStatusDelivering
|
||||||
|
case 50 : //已送达
|
||||||
|
result.LogisticsStatus = model.WaybillStatusDelivered
|
||||||
|
case 90 : //已取消
|
||||||
|
result.LogisticsStatus = model.WaybillStatusCanceled
|
||||||
|
default:
|
||||||
|
result.LogisticsStatus = model.WaybillStatusDeliverFailed
|
||||||
|
}
|
||||||
|
|
||||||
|
return result, nil
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,7 @@ func GetOrderRiderInfoToPlatform(orderId string) {
|
|||||||
if orderId != "" { // 订单id会忽略其他参数
|
if orderId != "" { // 订单id会忽略其他参数
|
||||||
params["keyword"] = orderId
|
params["keyword"] = orderId
|
||||||
} else {
|
} else {
|
||||||
params["statuss"] = "[20,110]"
|
params["statuss"] = "[20]"
|
||||||
}
|
}
|
||||||
|
|
||||||
// 每五分钟查询当前订单信息,待配送状态订单1
|
// 每五分钟查询当前订单信息,待配送状态订单1
|
||||||
@@ -79,14 +79,14 @@ func GetOrderRiderInfoToPlatform(orderId string) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if v.WaybillVendorID == model.VendorIDDada {
|
if v.WaybillVendorID == model.VendorIDDada {
|
||||||
riderInfo.LogisticsProviderCode = "10002"
|
riderInfo.LogisticsProviderCode = string(mtpsapi.DaDaCode)
|
||||||
riderInfo.OrderId = v.VendorOrderID // 运单id
|
riderInfo.OrderId = v.VendorOrderID // 运单id
|
||||||
}
|
}
|
||||||
if v.WaybillVendorID == model.VendorIDFengNiao {
|
if v.WaybillVendorID == model.VendorIDFengNiao {
|
||||||
riderInfo.LogisticsProviderCode = "10004"
|
riderInfo.LogisticsProviderCode = string(mtpsapi.FnPsCode)
|
||||||
}
|
}
|
||||||
if v.WaybillVendorID == model.VendorIDMTPS {
|
if v.WaybillVendorID == model.VendorIDMTPS {
|
||||||
riderInfo.LogisticsProviderCode = "10032"
|
riderInfo.LogisticsProviderCode = string(mtpsapi.MTPsCode)
|
||||||
}
|
}
|
||||||
riderInfo.ThirdCarrierOrderId = v.VendorWaybillID
|
riderInfo.ThirdCarrierOrderId = v.VendorWaybillID
|
||||||
switch riderInfo.LogisticsStatus {
|
switch riderInfo.LogisticsStatus {
|
||||||
|
|||||||
Reference in New Issue
Block a user