This commit is contained in:
邹宗楠
2023-12-13 10:33:16 +08:00
parent 6eb43ff464
commit 90ec9e487c

View File

@@ -342,14 +342,12 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *utils.RiderInfo) error
if order.Status == model.OrderStatusCanceled {
return fmt.Errorf(utils.Int2Str(model.OrderStatusCanceled))
}
storeId := 0
if order.StoreID != 0 {
storeId = order.StoreID
} else {
storeId = order.JxStoreID
storeId := jxutils.GetSaleStoreIDFromOrder(order)
storeDetail, err := dao.GetStoreDetail(dao.GetDB(), storeId, order.VendorID, order.VendorOrgCode)
if err != nil || storeDetail == nil {
globals.SugarLogger.Debugf("根据订单信息获取门店详情错误:%d %d", storeId, order.VendorID)
return fmt.Errorf(utils.Int2Str(model.OrderStatusCanceled))
}
storeDetail, _ := dao.GetStoreDetail(dao.GetDB(), storeId, order.VendorID, order.VendorOrgCode)
waybill2, err := cms.GetSToURidingDistance2(jxutils.IntCoordinate2Standard(storeDetail.Lng), jxutils.IntCoordinate2Standard(storeDetail.Lat), jxutils.IntCoordinate2Standard(order.ConsigneeLng), jxutils.IntCoordinate2Standard(order.ConsigneeLat), fakeWayBill.VendorOrderID)
if err != nil {
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "百度地图骑行方案获取错误:", utils.Format4Output(err.Error(), false))
@@ -448,6 +446,7 @@ func UpdateFakeWayBillToTiktok() {
if err = makeRiderInfo(fakeWayBill[i], riderInfo); err != nil && err.Error() == utils.Int2Str(model.OrderStatusCanceled) {
fakeWayBill[i].Status = model.OrderStatusCanceled
dao.UpdateEntity(dao.GetDB(), fakeWayBill[i], "Status")
continue
}
globals.SugarLogger.Debugf("==============riderInfo : %s", utils.Format4Output(riderInfo, false))
if riderInfo.CourierName == "" && fakeWayBill[i].CourierName != "" {