|
|
@ -23,16 +23,20 @@ public class UnplannedReceiptNoteAppService : |
|
|
|
SfsStoreWithDetailsAppServiceBase<UnplannedReceiptNote, UnplannedReceiptNoteDTO, SfsStoreRequestInputBase, UnplannedReceiptNoteEditInput, |
|
|
|
UnplannedReceiptNoteDetail, UnplannedReceiptNoteDetailDTO, SfsStoreRequestInputBase, UnplannedReceiptNoteImportInput>, |
|
|
|
IUnplannedReceiptNoteAppService |
|
|
|
|
|
|
|
{ |
|
|
|
private readonly IUnplannedReceiptNoteManager _unplannedReceiptNoteManager; |
|
|
|
private readonly ISfsUserAppService _userAppService; |
|
|
|
private readonly IUnplannedReceiptRequestManager _unplannedReceiptRequestManager; |
|
|
|
|
|
|
|
public UnplannedReceiptNoteAppService(IUnplannedReceiptNoteRepository repository, |
|
|
|
IUnplannedReceiptNoteManager unplannedReceiptNoteManager, |
|
|
|
IUnplannedReceiptRequestManager unplannedReceiptRequestManager, |
|
|
|
ISfsUserAppService userAppService) : base(repository) |
|
|
|
{ |
|
|
|
_unplannedReceiptNoteManager = unplannedReceiptNoteManager; |
|
|
|
_userAppService = userAppService; |
|
|
|
_unplannedReceiptRequestManager = unplannedReceiptRequestManager; |
|
|
|
} |
|
|
|
|
|
|
|
[HttpPost("")] |
|
|
@ -42,6 +46,9 @@ public class UnplannedReceiptNoteAppService : |
|
|
|
var entity = ObjectMapper.Map<UnplannedReceiptNoteEditInput, UnplannedReceiptNote>(input); |
|
|
|
|
|
|
|
entity.Details = new List<UnplannedReceiptNoteDetail>(); |
|
|
|
var receipt= await _unplannedReceiptRequestManager.GetByNumberAsync(input.UnplannedReceiptRequestNumber).ConfigureAwait(false); |
|
|
|
entity.Worker = receipt.Worker; |
|
|
|
|
|
|
|
|
|
|
|
foreach (var inputDetail in input.Details) |
|
|
|
{ |
|
|
@ -49,7 +56,7 @@ public class UnplannedReceiptNoteAppService : |
|
|
|
|
|
|
|
detail.ExtraProperties = inputDetail.ExtraProperties; |
|
|
|
|
|
|
|
var userName = await _userAppService.GetUserNameByUserAsync(input.Worker).ConfigureAwait(false); |
|
|
|
// var userName = await _userAppService.GetUserNameByUserAsync(input.Worker).ConfigureAwait(false);
|
|
|
|
entity.Details.Add(detail); |
|
|
|
} |
|
|
|
|
|
|
|