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