1
This commit is contained in:
@@ -363,7 +363,6 @@ func UpdateFakeWayBillToTiktok() {
|
||||
}
|
||||
|
||||
for i := 0; i < len(fakeWayBill); i++ {
|
||||
globals.SugarLogger.Debugf("=======fakeWayBill orderID : %s", fakeWayBill[i].VendorOrderID)
|
||||
// 判断当前订单是否可以推送,UpdatedAt > 当前时间 就跳过
|
||||
if fakeWayBill[i].StatusTime.After(time.Now()) {
|
||||
continue
|
||||
@@ -509,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