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) }