Browse Source

添加编码客户编码显示

Agv分支2024-11-19
赵新宇 4 months ago
parent
commit
7c78757f65
  1. 30
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs

30
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CustomerProductionReturnNotes/CustomerProductionReturnNoteAppService.cs

@ -93,7 +93,7 @@ public class CustomerProductionReturnNoteAppService :
if (customerlist.Count > 0)
{
entity.CustomerName = customerlist.FirstOrDefault().Name;
entity.CustomerName =$"{customerlist.FirstOrDefault().Name}({entity.CustomerCode})" ;
}
else
{
@ -105,16 +105,16 @@ public class CustomerProductionReturnNoteAppService :
var custitmDetail = await _customerItemAppService.GetListByPartsAsync(parts.ToList()).ConfigureAwait(false);
#region 20241230修改
var query = from itm in custitmDetail
join itm1 in custitmDetail on itm.ItemCode equals itm1.ItemCode
where itm.CustomerCode != itm1.CustomerCode
select itm;
var diff= query.ToList();
if (diff.Count > 0)
{
var diffparts=diff.Select(p => p.ItemCode).Distinct().ToList();
throw new UserFriendlyException($"零件编号{string.Join(",",diffparts)},对应多个客户不能进行退货,请查看客户零件关系表!");
}
//var query = from itm in custitmDetail
// join itm1 in custitmDetail on itm.ItemCode equals itm1.ItemCode
// where itm.CustomerCode != itm1.CustomerCode
// select itm;
//var diff= query.ToList();
//if (diff.Count > 0)
//{
// var diffparts=diff.Select(p => p.ItemCode).Distinct().ToList();
// throw new UserFriendlyException($"零件编号{string.Join(",",diffparts)},对应多个客户不能进行退货,请查看客户零件关系表!");
//}
#endregion
#region 20241230修改
@ -123,15 +123,9 @@ public class CustomerProductionReturnNoteAppService :
var part= custitmDetail.FirstOrDefault(p => p.CustomerCode == entity.CustomerCode && p.ItemCode==itm.ItemCode);
if (part == null)
{
throw new UserFriendlyException($"零件编号{itm.ItemCode}客户编码{entity.CustomerCode}在零件关系表中不存在!");
throw new UserFriendlyException($"零件编号{itm.ItemCode}客户编码{entity.CustomerCode}在客户物料关系表中不存在!");
}
}
#endregion

Loading…
Cancel
Save