From 0bd90a73e2f146db0bc5383e84aef6c8d980b6f4 Mon Sep 17 00:00:00 2001 From: shanji <18996038927@163.com> Date: Tue, 4 Apr 2023 12:31:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9StorageType=E8=AF=86=E5=88=AB?= =?UTF-8?q?=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BBWY.Server.Business/Sync/OrderSyncBusiness.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/BBWY.Server.Business/Sync/OrderSyncBusiness.cs b/BBWY.Server.Business/Sync/OrderSyncBusiness.cs index 0af8121b..ce214008 100644 --- a/BBWY.Server.Business/Sync/OrderSyncBusiness.cs +++ b/BBWY.Server.Business/Sync/OrderSyncBusiness.cs @@ -294,6 +294,7 @@ namespace BBWY.Server.Business var orderSellerPrice = orderJToken.Value("orderSellerPrice"); var orderTotalPrice = orderJToken.Value("orderTotalPrice"); var storeOrder = orderJToken.Value("storeOrder") ?? string.Empty; + var storageType = ConvertStoreOrder(storeOrder); if (dbOrder == null) { dbOrder = new Order() @@ -316,7 +317,8 @@ namespace BBWY.Server.Business WaybillNo = waybillNo, StoreOrder = storeOrder, StoreId = orderJToken.Value("storeId"), - IsGift = orderTotalPrice == 0M || orderSellerPrice == 0M + IsGift = orderTotalPrice == 0M || orderSellerPrice == 0M, + StorageType = storageType }; if (memoryCache.TryGetValue(orderId, out sDCalculationCostRequest)) @@ -332,8 +334,6 @@ namespace BBWY.Server.Business dbOrder.SDPayChannel = sDCalculationCostRequest.SDPayChannel; } - dbOrder.StorageType = ConvertStoreOrder(storeOrder); - var payType = orderJToken.Value("payType"); if (payType.Contains("-")) dbOrder.PayType = (Enums.PayType)Convert.ToInt32(payType.Substring(0, 1)); @@ -370,6 +370,11 @@ namespace BBWY.Server.Business } #endregion } + else + { + if (storageType != null && dbOrder.StorageType != storageType) + dbOrder.StorageType = storageType; + } #endregion #region 收货人信息 @@ -601,7 +606,8 @@ namespace BBWY.Server.Business .SetIf(orderSellerPrice != dbOrder.OrderSellerPrice, o => o.OrderSellerPrice, orderSellerPrice) .SetIf(orderTotalPrice != dbOrder.OrderTotalPrice, o => o.OrderTotalPrice, orderTotalPrice) .SetIf(orderTotalPrice != dbOrder.OrderTotalPrice && orderTotalPrice > 0M, o => o.IsGift, false) - .SetIf(storeOrder != dbOrder.StoreOrder && dbOrder.StorageType == null, o => o.StorageType, ConvertStoreOrder(storeOrder)); + .SetIf(storeOrder != dbOrder.StoreOrder, o => o.StoreOrder, storeOrder) + .SetIf(storeOrder != dbOrder.StoreOrder, o => o.StorageType, ConvertStoreOrder(storeOrder)); updateOrderList.Add(updateSql); } #endregion