Merge branch 'jdshop' of https://e.coding.net/rosydev/jx-callback into jdshop
This commit is contained in:
@@ -122,6 +122,8 @@ func GetOrderRiderInfoToPlatform(orderId string, wayBillStatus int) {
|
||||
globals.SugarLogger.Debug("Get Order waybill rider info err MT:%v", err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,6 +297,8 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
|
||||
riderInfo.CourierName = ""
|
||||
riderInfo.CourierPhone = ""
|
||||
riderInfo.OpCode = tiktok_api.TiktokLogisticsStatusCALLRIDER
|
||||
riderInfo.Latitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lat))
|
||||
riderInfo.Longitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lng))
|
||||
|
||||
// 下一状态以及推送时间
|
||||
fakeWayBill.Status = model.WaybillStatusCourierAssigned
|
||||
@@ -504,3 +508,41 @@ func LoadingStoreOrderSettleAmount(startTime, endTime int64, jxStoreId []int) er
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func GetVendorRiderInfo(wayBillVendorId, vendorId int, vendorOrderId, vendorWaybillId string) (riderInfo *mtpsapi.RiderInfo, err error) {
|
||||
riderInfo = &mtpsapi.RiderInfo{}
|
||||
if handlerInfo := partner.GetDeliveryPlatformFromVendorID(wayBillVendorId); handlerInfo != nil {
|
||||
if wayBillVendorId == model.VendorIDDada || wayBillVendorId == model.VendorIDFengNiao || wayBillVendorId == model.VendorIDUUPT {
|
||||
riderInfo, err = handlerInfo.Handler.GetRiderInfo(vendorOrderId, 0, vendorWaybillId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else if wayBillVendorId == model.VendorIDMTPS {
|
||||
riderInfo, err = handlerInfo.Handler.GetRiderInfo(vendorOrderId, time.Now().Unix()+1000000, vendorWaybillId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if riderInfo.Longitude == "" || riderInfo.Latitude == "" {
|
||||
order, err := partner.CurOrderManager.LoadOrder(vendorOrderId, vendorId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if order.Status >= model.OrderStatusEndBegin {
|
||||
riderInfo.Longitude = utils.Float64ToStr(utils.Int2Float64(order.ConsigneeLng) / 1000000)
|
||||
riderInfo.Latitude = utils.Float64ToStr(utils.Int2Float64(order.ConsigneeLat) / 1000000)
|
||||
} else {
|
||||
store, err := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID, order.VendorOrgCode)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
riderInfo.Longitude = utils.Float64ToStr(utils.Int2Float64(store.Lng) / 1000000)
|
||||
riderInfo.Latitude = utils.Float64ToStr(utils.Int2Float64(store.Lat) / 1000000)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user