|
|
@ -15,7 +15,7 @@ using System.Linq.Expressions; |
|
|
|
using System.Threading; |
|
|
|
|
|
|
|
using Volo.Abp.Application.Dtos; |
|
|
|
|
|
|
|
using Volo.Abp.Users; |
|
|
|
using Win_in.Sfs.FileStorage.Application.Contracts; |
|
|
|
using Win_in.Sfs.Shared.Application.Contracts; |
|
|
|
using Win_in.Sfs.Shared.Domain; |
|
|
@ -31,12 +31,17 @@ public class PurchaseReturnNoteAppService : SfsStoreWithDetailsAppServiceBase<Pu |
|
|
|
{ |
|
|
|
private readonly IPurchaseReturnNoteManager _purchaseReturnNoteManager; |
|
|
|
|
|
|
|
private readonly ICurrentUser _currentUser; |
|
|
|
|
|
|
|
public PurchaseReturnNoteAppService( |
|
|
|
IPurchaseReturnNoteRepository repository, |
|
|
|
IPurchaseReturnNoteManager purchaseReturnNoteManager) |
|
|
|
IPurchaseReturnNoteManager purchaseReturnNoteManager, |
|
|
|
ICurrentUser currentUser |
|
|
|
) |
|
|
|
: base(repository) |
|
|
|
{ |
|
|
|
_purchaseReturnNoteManager = purchaseReturnNoteManager; |
|
|
|
_currentUser = currentUser; |
|
|
|
} |
|
|
|
|
|
|
|
[HttpPost("confirm")] |
|
|
@ -66,6 +71,10 @@ public class PurchaseReturnNoteAppService : SfsStoreWithDetailsAppServiceBase<Pu |
|
|
|
public override async Task<PurchaseReturnNoteDTO> CreateAsync(PurchaseReturnNoteEditInput input) |
|
|
|
{ |
|
|
|
var entity = ObjectMapper.Map<PurchaseReturnNoteEditInput, PurchaseReturnNote>(input); |
|
|
|
if (entity.Worker.IsNullOrEmpty() && _currentUser != null) |
|
|
|
{ |
|
|
|
entity.Worker = _currentUser.UserName; |
|
|
|
} |
|
|
|
await _purchaseReturnNoteManager.CreateAsync(entity).ConfigureAwait(false); |
|
|
|
|
|
|
|
var dto = ObjectMapper.Map<PurchaseReturnNote, PurchaseReturnNoteDTO>(entity); |
|
|
|