From 914e2cd9d82d6eb68e949917e541a64c41bdac03 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Wed, 31 May 2023 22:01:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E4=B8=8B=E5=8D=95=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=AA=8C=E8=AF=81=E6=9D=A5=E6=BA=90sku?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BatchPurchase/BatchPurchaseBusiness.cs | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs b/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs index 14f652ae..9f5b44e1 100644 --- a/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs +++ b/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs @@ -207,8 +207,10 @@ namespace BBWY.Server.Business public BatchCreareOrderResponse BatchCreateOrder(BatchPurchaseCreateOrderRequest request) { /* - 下单报价日志 + 下单日志 */ + var loggerName = $"批量采购-{request.ShopName}"; + nLogManager.GetLogger(loggerName).Info(JsonConvert.SerializeObject(request)); if (request.ProductParamList == null || request.ProductParamList.Count() == 0) throw new BusinessException("缺少商品参数"); @@ -250,13 +252,18 @@ namespace BBWY.Server.Business #region 处理JD SKU和拳探SKU的对应关系 var belongSkus_mappingList = new List(); - foreach (var belongSkuGroup in belongSkuGroups) + if (purchasePlatform == Enums.Platform.拳探) { - var firstProductParam = belongSkuGroup.FirstOrDefault(); - if (!belongSkus_mappingList.Any(j => j.Value("BelongSkuId") == firstProductParam.BelongSkuId)) + foreach (var belongSkuGroup in belongSkuGroups) { - belongSkus_mappingList.Add(JObject.FromObject(new { firstProductParam.BelongSkuId, SkuId = firstProductParam.PurchaseSkuId })); + var firstProductParam = belongSkuGroup.FirstOrDefault(); + if (!belongSkus_mappingList.Any(j => j.Value("BelongSkuId") == firstProductParam.BelongSkuId)) + { + belongSkus_mappingList.Add(JObject.FromObject(new { firstProductParam.BelongSkuId, SkuId = firstProductParam.PurchaseSkuId })); + } } + if (belongSkus_mappingList.Count() == 0) + throw new BusinessException("缺少来源SKU信息"); } #endregion @@ -331,14 +338,14 @@ namespace BBWY.Server.Business }; insertPurchaseOrderSkuList.Add(purchaseOrderSku); - + if (purchasePlatform == Enums.Platform.拳探) { var skuPackConfig = request.PackSkuConfigList?.FirstOrDefault(s => s.SkuId == firstProductParam.BelongSkuId); - + if (skuPackConfig != null) { - + skuPackConfigList.Add(new { skuId = firstProductParam.BelongSkuId,