|
|
@ -144,18 +144,18 @@ public class DeliverRequestFisAppService : |
|
|
|
detail.Uom = itemBasicDto.BasicUom; |
|
|
|
detail.StdPackQty=itemBasicDto.StdPackQty; |
|
|
|
} |
|
|
|
var itemlist=itemTransformRequest.Details.Select(p => p.ItemCode).Distinct(); |
|
|
|
var customerCode = itemTransformRequest.CustomerCode; |
|
|
|
var errors=await CheckCustomerItem(itemlist.ToList(),customerCode).ConfigureAwait(false); |
|
|
|
if (errors.Count > 0) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"客户零件关系表中没有查到客户为{customerCode},零件号为{string.Join(",", errors.ToArray())}的零件关系"); |
|
|
|
} |
|
|
|
var priceErrors=await IsExistCustomerItemPrice(itemlist.ToList(), customerCode).ConfigureAwait(false); |
|
|
|
if (priceErrors.Count > 0) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"销售价格表中没有查到客户为{customerCode},零件号为{string.Join(",", priceErrors.ToArray())}的零件关系和价格"); |
|
|
|
} |
|
|
|
//var itemlist=itemTransformRequest.Details.Select(p => p.ItemCode).Distinct();
|
|
|
|
//var customerCode = itemTransformRequest.CustomerCode;
|
|
|
|
//var errors=await CheckCustomerItem(itemlist.ToList(),customerCode).ConfigureAwait(false);
|
|
|
|
//if (errors.Count > 0)
|
|
|
|
//{
|
|
|
|
// throw new UserFriendlyException($"客户零件关系表中没有查到客户为{customerCode},零件号为{string.Join(",", errors.ToArray())}的零件关系");
|
|
|
|
//}
|
|
|
|
//var priceErrors=await IsExistCustomerItemPrice(itemlist.ToList(), customerCode).ConfigureAwait(false);
|
|
|
|
//if (priceErrors.Count > 0)
|
|
|
|
//{
|
|
|
|
// throw new UserFriendlyException($"销售价格表中没有查到客户为{customerCode},零件号为{string.Join(",", priceErrors.ToArray())}的零件关系和价格");
|
|
|
|
//}
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -278,16 +278,16 @@ public class DeliverRequestFisAppService : |
|
|
|
|
|
|
|
var itemlist = entity.Details.Select(p => p.ItemCode).Distinct(); |
|
|
|
var customerCode = entity.CustomerCode; |
|
|
|
var errors = await CheckCustomerItem(itemlist.ToList(), customerCode).ConfigureAwait(false); |
|
|
|
if (errors.Count > 0) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"客户零件关系表中没有查到客户为{customerCode},零件号为{string.Join(",", errors.ToArray())}的零件关系"); |
|
|
|
} |
|
|
|
var priceErrors = await IsExistCustomerItemPrice(itemlist.ToList(), customerCode).ConfigureAwait(false); |
|
|
|
if (priceErrors.Count > 0) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"销售价格表中没有查到客户为{customerCode},零件号为{string.Join(",", priceErrors.ToArray())}的零件关系和价格"); |
|
|
|
} |
|
|
|
//var errors = await CheckCustomerItem(itemlist.ToList(), customerCode).ConfigureAwait(false);
|
|
|
|
//if (errors.Count > 0)
|
|
|
|
//{
|
|
|
|
// throw new UserFriendlyException($"客户零件关系表中没有查到客户为{customerCode},零件号为{string.Join(",", errors.ToArray())}的零件关系");
|
|
|
|
//}
|
|
|
|
//var priceErrors = await IsExistCustomerItemPrice(itemlist.ToList(), customerCode).ConfigureAwait(false);
|
|
|
|
//if (priceErrors.Count > 0)
|
|
|
|
//{
|
|
|
|
// throw new UserFriendlyException($"销售价格表中没有查到客户为{customerCode},零件号为{string.Join(",", priceErrors.ToArray())}的零件关系和价格");
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
await _deliverRequestManager.CreateAsync(entity).ConfigureAwait(false); |
|
|
|