From 56719838f935268f0e74041542f53447aa984537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 17 Jun 2020 15:04:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=95=86=E5=9F=8E=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/order.go | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index 2845122c2..ed6930662 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -1019,10 +1019,10 @@ func SaveJdsOrders(ctx *jxcontext.Context, orderCreatedStart, orderCreatedEnd ti } orders, err := result2Orders(ctx, orderResult) for _, order := range orders { - // order.StoreID = 102919 - // order.JxStoreID = 102919 - // order.StoreName = "商城模板(成都发货)" - // order.VendorStoreID = model.JdShopMainVendorStoreID + order.StoreID = 102919 + order.JxStoreID = 102919 + order.StoreName = "商城模板(成都发货)" + order.VendorStoreID = model.JdShopMainVendorStoreID partner.CurOrderManager.OnOrderNew(order, model.Order2Status(order)) globals.SugarLogger.Debugf("SaveJdsOrders, order: [%v]", utils.Format4Output(order, false)) noticeMsg := fmt.Sprintf("京东商城新订单,订单号:[%v] ,将要发到的门店id:[%v] , 门店名:[%v]", order.VendorOrderID, order.StoreID, order.StoreName) @@ -1084,13 +1084,7 @@ func result2Orders(ctx *jxcontext.Context, result *jdshopapi.AllOrdersResult) (o order.ConsigneeLng = jxutils.StandardCoordinate2Int(lng) order.ConsigneeLat = jxutils.StandardCoordinate2Int(lat) } - // if order.StoreName != "" { - // storeMaps, _ := dao.GetStoresMapList(dao.GetDB(), []int{model.VendorIDJDShop}, nil, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", order.StoreName) - // if len(storeMaps) > 0 { - // order.StoreID = storeMaps[0].StoreID - // order.VendorStoreID = storeMaps[0].VendorStoreID - // } - // } else { + storeList, err := common.GetStoreListByLocation(ctx, jxutils.IntCoordinate2Standard(order.ConsigneeLng), jxutils.IntCoordinate2Standard(order.ConsigneeLat), 5000, false, true) if err != nil { globals.SugarLogger.Debugf("jds GetStoreListByLocation error: %v", err.Error()) @@ -1098,6 +1092,10 @@ func result2Orders(ctx *jxcontext.Context, result *jdshopapi.AllOrdersResult) (o } order.StoreID = storeList[0].ID order.StoreName = storeList[0].Name + storeMaps, _ := dao.GetStoresMapList(dao.GetDB(), []int{model.VendorIDJDShop}, []int{order.StoreID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "") + if len(storeMaps) > 0 { + order.VendorStoreID = storeMaps[0].VendorStoreID + } // } //如果是暂停,表示是预订单 if jdsOrder.OrderStatus == jdshopapi.JdsOrderStatusPause { @@ -1183,6 +1181,7 @@ func TransferJdsOrder(ctx *jxcontext.Context, vendorOrderID string, storeID int) if len(storeMaps) > 0 { order.StoreID = storeID order.StoreName = storeMaps[0].StoreName + order.VendorStoreID = storeMaps[0].VendorStoreID } else { return "", fmt.Errorf("未查询到该门店对应的平台信息!门店:[%v]", order.StoreID) }