|
@ -59,19 +59,12 @@ public class CustomerProductionReturnNoteAppService : |
|
|
[HttpGet("{id}")] |
|
|
[HttpGet("{id}")] |
|
|
public override async Task<CustomerProductionReturnNoteDTO> GetAsync(Guid id) |
|
|
public override async Task<CustomerProductionReturnNoteDTO> GetAsync(Guid id) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var entity=await base.GetAsync(id).ConfigureAwait(false); |
|
|
var entity=await base.GetAsync(id).ConfigureAwait(false); |
|
|
|
|
|
|
|
|
foreach (var itm in entity.Details) |
|
|
foreach (var itm in entity.Details) |
|
|
{ |
|
|
{ |
|
|
itm.CustomerCode=entity.CustomerCode; |
|
|
itm.CustomerCode=entity.CustomerCode; |
|
|
itm.CustomerName=entity.CustomerName; |
|
|
itm.CustomerName=entity.CustomerName; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return entity; |
|
|
return entity; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -120,9 +113,9 @@ public class CustomerProductionReturnNoteAppService : |
|
|
|
|
|
|
|
|
foreach (var itm in input.Details) |
|
|
foreach (var itm in input.Details) |
|
|
{ |
|
|
{ |
|
|
var part= custitmDetail.FirstOrDefault(p => p.CustomerCode == entity.CustomerCode && p.ItemCode==itm.ItemCode); |
|
|
var part = custitmDetail.FirstOrDefault(p => p.CustomerCode == entity.CustomerCode && p.ItemCode == itm.ItemCode); |
|
|
if (part == null) |
|
|
if (part == null) |
|
|
{ |
|
|
{ |
|
|
throw new UserFriendlyException($"零件编号{itm.ItemCode}客户编码{entity.CustomerCode}在客户物品关系表中不存在!"); |
|
|
throw new UserFriendlyException($"零件编号{itm.ItemCode}客户编码{entity.CustomerCode}在客户物品关系表中不存在!"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|