|
@ -105,6 +105,27 @@ namespace BBWYB.Server.Business |
|
|
if (request.CargoParamGroupList == null || request.CargoParamGroupList.Count() == 0) |
|
|
if (request.CargoParamGroupList == null || request.CargoParamGroupList.Count() == 0) |
|
|
throw new BusinessException("缺少报价参数"); |
|
|
throw new BusinessException("缺少报价参数"); |
|
|
|
|
|
|
|
|
|
|
|
#region 验证同一个批次中,一个订单sku不能同时拥有多个采购方案
|
|
|
|
|
|
IDictionary<string, long> schemeValidationDictionary = new Dictionary<string, long>(); |
|
|
|
|
|
foreach (var purchaseGroup in request.CargoParamGroupList) |
|
|
|
|
|
{ |
|
|
|
|
|
foreach (var cargo in purchaseGroup.CargoParamList) |
|
|
|
|
|
{ |
|
|
|
|
|
if (!schemeValidationDictionary.ContainsKey(cargo.BelongSkuId)) |
|
|
|
|
|
schemeValidationDictionary.TryAdd(cargo.BelongSkuId, cargo.SchemeId); |
|
|
|
|
|
|
|
|
|
|
|
if (schemeValidationDictionary.TryGetValue(cargo.BelongSkuId, out long schemeId)) |
|
|
|
|
|
{ |
|
|
|
|
|
if (cargo.SchemeId != schemeId) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new BusinessException($"订单sku{cargo.BelongSkuId}只允许使用一个采购方案进行报价"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
schemeValidationDictionary.Clear(); |
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
var extJArray = new List<object>(); |
|
|
var extJArray = new List<object>(); |
|
|
var errorBuilder = new StringBuilder(); |
|
|
var errorBuilder = new StringBuilder(); |
|
|
var freightAmount = 0M; |
|
|
var freightAmount = 0M; |
|
@ -204,6 +225,28 @@ namespace BBWYB.Server.Business |
|
|
if (request.CargoParamGroupList == null || request.CargoParamGroupList.Count() == 0) |
|
|
if (request.CargoParamGroupList == null || request.CargoParamGroupList.Count() == 0) |
|
|
throw new BusinessException("缺少下单商品参数"); |
|
|
throw new BusinessException("缺少下单商品参数"); |
|
|
|
|
|
|
|
|
|
|
|
#region 验证同一个批次中,一个订单sku不能同时拥有多个采购方案
|
|
|
|
|
|
IDictionary<string, long> schemeValidationDictionary = new Dictionary<string, long>(); |
|
|
|
|
|
foreach (var purchaseGroup in request.CargoParamGroupList) |
|
|
|
|
|
{ |
|
|
|
|
|
foreach (var cargo in purchaseGroup.CargoParamList) |
|
|
|
|
|
{ |
|
|
|
|
|
if (!schemeValidationDictionary.ContainsKey(cargo.BelongSkuId)) |
|
|
|
|
|
schemeValidationDictionary.TryAdd(cargo.BelongSkuId, cargo.SchemeId); |
|
|
|
|
|
|
|
|
|
|
|
if (schemeValidationDictionary.TryGetValue(cargo.BelongSkuId, out long schemeId)) |
|
|
|
|
|
{ |
|
|
|
|
|
if (cargo.SchemeId != schemeId) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new BusinessException($"订单sku{cargo.BelongSkuId}只允许使用一个采购方案进行下单"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
schemeValidationDictionary.Clear(); |
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var isRepurchase = fsql.Select<OrderCost>(dbOrder.Id).Any(); |
|
|
var isRepurchase = fsql.Select<OrderCost>(dbOrder.Id).Any(); |
|
|
var orderSkus = fsql.Select<OrderSku>().Where(osku => osku.Price != 0 && osku.OrderId == request.OrderId).ToList(); |
|
|
var orderSkus = fsql.Select<OrderSku>().Where(osku => osku.Price != 0 && osku.OrderId == request.OrderId).ToList(); |
|
|
var orderPurchaseInfoList = fsql.Select<OrderPurchaseInfo>().Where(opi => opi.OrderId == request.OrderId && opi.IsEnabled == true).ToList(); |
|
|
var orderPurchaseInfoList = fsql.Select<OrderPurchaseInfo>().Where(opi => opi.OrderId == request.OrderId && opi.IsEnabled == true).ToList(); |
|
|