From 1c1280a6fd7a6f2c7bb5e4ed9c43eeaa4f9f4b9e Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Thu, 18 May 2023 16:51:51 +0800 Subject: [PATCH] 1 --- .../BatchPurchase/BatchPurchaseBusiness.cs | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs b/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs index 5b4517d1..14dafed5 100644 --- a/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs +++ b/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs @@ -319,19 +319,22 @@ namespace BBWY.Server.Business if (purchasePlatform == Enums.Platform.拳探) { - var skuPackConfig = request.PackSkuConfigList.FirstOrDefault(s => s.SkuId == firstProductParam.BelongSkuId); - skuPackConfigList.Add(new + var skuPackConfig = request.PackSkuConfigList?.FirstOrDefault(s => s.SkuId == firstProductParam.BelongSkuId); + if (skuPackConfig != null) { - skuId = firstProductParam.BelongSkuId, - skuCount = skuPackConfig.PurchaseCount, - markMessage = string.Empty, - wareHourses = skuPackConfig.PackSkuSplitConfigList.Select(x => new + skuPackConfigList.Add(new { - wareId = x.Store.Id, - wareName = x.Store.Name, - count = x.PackCount - }) - }); + skuId = firstProductParam.BelongSkuId, + skuCount = skuPackConfig.PurchaseCount, + markMessage = string.Empty, + wareHourses = skuPackConfig.PackSkuSplitConfigList.Select(x => new + { + wareId = x.Store.Id, + wareName = x.Store.Name, + count = x.PackCount + }) + }); + } } }