From 90ec9e487cc467051d5955a652153f7f536768fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Wed, 13 Dec 2023 10:33:16 +0800 Subject: [PATCH] 1 --- business/partner/delivery/rider.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/business/partner/delivery/rider.go b/business/partner/delivery/rider.go index afc72748c..021c61942 100644 --- a/business/partner/delivery/rider.go +++ b/business/partner/delivery/rider.go @@ -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 != "" {