|
|
@ -33,7 +33,7 @@ public class CustomerProductionReturnNoteAppService : |
|
|
|
private readonly ICustomerItemAppService _customerItemAppService; |
|
|
|
|
|
|
|
private readonly ICustomerAppService _customerAppService; |
|
|
|
private readonly ICustomerItemRepository _customerItemRepository; |
|
|
|
//private readonly ICustomerItemRepository _customerItemRepository;
|
|
|
|
private readonly ISalePriceSheetAppService _salePriceSheetAppService; |
|
|
|
|
|
|
|
public CustomerProductionReturnNoteAppService( |
|
|
@ -41,17 +41,13 @@ public class CustomerProductionReturnNoteAppService : |
|
|
|
, ICustomerProductionReturnNoteManager CustomerProductionReturnNoteManager |
|
|
|
, ICustomerItemAppService customerItemAppService, |
|
|
|
ISalePriceSheetAppService salePriceSheetAppService, |
|
|
|
ICustomerAppService customerAppService, |
|
|
|
ICustomerItemRepository customerItemRepository |
|
|
|
ICustomerAppService customerAppService |
|
|
|
// ICustomerItemRepository customerItemRepository
|
|
|
|
) : base(repository) |
|
|
|
{ |
|
|
|
|
|
|
|
_customerItemRepository = customerItemRepository; |
|
|
|
|
|
|
|
//_customerItemRepository = customerItemRepository;
|
|
|
|
_customerItemAppService = customerItemAppService; |
|
|
|
|
|
|
|
_salePriceSheetAppService = salePriceSheetAppService; |
|
|
|
|
|
|
|
_CustomerProductionReturnNoteManager = CustomerProductionReturnNoteManager; |
|
|
|
_customerAppService = customerAppService; |
|
|
|
} |
|
|
@ -59,19 +55,12 @@ public class CustomerProductionReturnNoteAppService : |
|
|
|
[HttpGet("{id}")] |
|
|
|
public override async Task<CustomerProductionReturnNoteDTO> GetAsync(Guid id) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
var entity=await base.GetAsync(id).ConfigureAwait(false); |
|
|
|
|
|
|
|
foreach (var itm in entity.Details) |
|
|
|
{ |
|
|
|
itm.CustomerCode=entity.CustomerCode; |
|
|
|
itm.CustomerName=entity.CustomerName; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return entity; |
|
|
|
|
|
|
|
} |
|
|
@ -120,7 +109,7 @@ public class CustomerProductionReturnNoteAppService : |
|
|
|
|
|
|
|
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) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"零件编号{itm.ItemCode}客户编码{entity.CustomerCode}在客户物品关系表中不存在!"); |
|
|
@ -161,13 +150,16 @@ public class CustomerProductionReturnNoteAppService : |
|
|
|
} |
|
|
|
foreach (var itm in entity.Details) |
|
|
|
{ |
|
|
|
itm.FromLocationCode = ""; |
|
|
|
itm.FromLocationArea = ""; |
|
|
|
itm.FromLocationErpCode = ""; |
|
|
|
itm.FromWarehouseCode = ""; |
|
|
|
itm.FromLocationGroup = ""; |
|
|
|
itm.ToContainerCode =string.IsNullOrEmpty(itm.ToContainerCode)? "OK": itm.ToContainerCode; |
|
|
|
itm.ToWarehouseCode= string.IsNullOrEmpty(itm.ToWarehouseCode)? "OK": itm.ToContainerCode; |
|
|
|
itm.FromLocationCode = string.Empty; |
|
|
|
itm.FromStatus = EnumInventoryStatus.OK; |
|
|
|
itm.ToStatus=EnumInventoryStatus.OK; |
|
|
|
itm.FromLocationArea = string.Empty; |
|
|
|
itm.FromLocationErpCode= string.Empty; |
|
|
|
itm.FromWarehouseCode = string.Empty; |
|
|
|
itm.FromLocationGroup = string.Empty; |
|
|
|
itm.FromContainerCode = string.Empty; |
|
|
|
itm.ToContainerCode =string.IsNullOrEmpty(itm.ToContainerCode)? "": itm.ToContainerCode; |
|
|
|
itm.ToWarehouseCode= string.IsNullOrEmpty(itm.ToWarehouseCode)? "": itm.ToContainerCode; |
|
|
|
} |
|
|
|
|
|
|
|
await _CustomerProductionReturnNoteManager.CreateAsync(entity).ConfigureAwait(false); |
|
|
|