From 2cf157af9a688aaec636fcf5844232da14786be9 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Wed, 1 Jun 2022 21:52:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=87=BA=E5=BA=93=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=87=87=E8=B4=AD=E8=B4=A6=E5=8F=B7=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=BA=97=E9=93=BAId=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BBWY.Server.Business/Order/OrderBusiness.cs | 1 + .../PurchaseOrder/PurchaseOrderBusiness.cs | 20 +++++++++++++++++-- .../Db/Order/OrderDropShipping.cs | 5 ++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/BBWY.Server.Business/Order/OrderBusiness.cs b/BBWY.Server.Business/Order/OrderBusiness.cs index ba30f992..eec9c8da 100644 --- a/BBWY.Server.Business/Order/OrderBusiness.cs +++ b/BBWY.Server.Business/Order/OrderBusiness.cs @@ -709,6 +709,7 @@ namespace BBWY.Server.Business else { orderDropShipping.CreateTime = DateTime.Now; + orderDropShipping.ShopId = dbOrder.ShopId; insertOrderDropShipping = fsql.Insert(orderDropShipping); } diff --git a/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs b/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs index 04363d45..096e9fd7 100644 --- a/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs +++ b/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs @@ -382,7 +382,8 @@ namespace BBWY.Server.Business SkuAmount = purchaseOrderSimpleInfo.ProductAmount, PurchaseFreight = purchaseOrderSimpleInfo.FreightAmount, PurchaseOrderId = createOrderResponse.PurchaseOrderId, - PurchasePlatform = createOnlinePurchaseOrderRequest.Platform + PurchasePlatform = createOnlinePurchaseOrderRequest.Platform, + ShopId = dbOrder.ShopId }; insertOrderDropShipping = fsql.Insert(orderDropShipping); #endregion @@ -455,6 +456,7 @@ namespace BBWY.Server.Business string logisticsCompanyListInfo = string.Empty; string logisticsCompanyId = string.Empty; string orderId = string.Empty; + long? shopId = null; OutStockRequest outStockRequest = null; try { @@ -466,11 +468,25 @@ namespace BBWY.Server.Business orderId = orderDropshipping.OrderId; #endregion + #region 查询订单 + if (orderDropshipping.ShopId == null) + { + var order = fsql.Select(orderId).ToOne(); + if (order == null) + throw new Exception("未查询到订单"); + shopId = order.ShopId; + } + else + { + shopId = orderDropshipping.ShopId.Value; + } + #endregion + #region 查询采购账号 currentProgress = "查询采购账号"; var purchaseAccount = fsql.Select().WhereIf(orderDropshipping.PurchaseAccountId != 0, pa => pa.Id == orderDropshipping.PurchaseAccountId) .WhereIf(orderDropshipping.PurchaseAccountId == 0, pa => pa.AccountName == orderDropshipping.BuyerAccount) - .Where(pa => pa.PurchasePlatformId == callbackPlatform).ToOne(); + .Where(pa => pa.PurchasePlatformId == callbackPlatform && pa.ShopId == shopId.Value).ToOne(); if (purchaseAccount == null) throw new Exception($"未查询到采购账号{orderDropshipping.BuyerAccount}"); #endregion diff --git a/BBWY.Server.Model/Db/Order/OrderDropShipping.cs b/BBWY.Server.Model/Db/Order/OrderDropShipping.cs index 79d66140..ca834339 100644 --- a/BBWY.Server.Model/Db/Order/OrderDropShipping.cs +++ b/BBWY.Server.Model/Db/Order/OrderDropShipping.cs @@ -70,7 +70,10 @@ namespace BBWY.Server.Model.Db [Column(StringLength = 200)] public string SellerAccount { get; set; } - + /// + /// 商家Id + /// + public long? ShopId { get; set; } }