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,