|
|
@ -8,6 +8,10 @@ using Win_in.Sfs.Shared.Domain.Shared; |
|
|
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|
|
|
using Win_in.Sfs.Wms.Store.Domain; |
|
|
|
using Win_in.Sfs.Wms.Store.Domain.Shared; |
|
|
|
using Volo.Abp.Domain.Entities; |
|
|
|
using static Volo.Abp.Identity.Settings.IdentitySettingNames; |
|
|
|
using Volo.Abp.Users; |
|
|
|
using Volo.Abp.Domain.Repositories; |
|
|
|
|
|
|
|
namespace Win_in.Sfs.Wms.Store.Application; |
|
|
|
|
|
|
@ -19,13 +23,14 @@ public class ProductRecycleJobAppService |
|
|
|
, IProductRecycleJobAppService |
|
|
|
{ |
|
|
|
private readonly IProductRecycleJobManager _productRecycleJobManager; |
|
|
|
|
|
|
|
private readonly IProductRecycleJobRepository _repository; |
|
|
|
private readonly IProductRecycleRequestAppService _productRecycleRequestAppService; |
|
|
|
public ProductRecycleJobAppService( |
|
|
|
IProductRecycleJobRepository repository, IProductRecycleJobManager productRecycleJobManager, |
|
|
|
IProductRecycleRequestAppService productRecycleRequestAppService) |
|
|
|
: base(repository, productRecycleJobManager) |
|
|
|
{ |
|
|
|
_repository = repository; |
|
|
|
_productRecycleJobManager = productRecycleJobManager; |
|
|
|
_productRecycleRequestAppService = productRecycleRequestAppService; |
|
|
|
} |
|
|
@ -55,4 +60,20 @@ public class ProductRecycleJobAppService |
|
|
|
var handleDto = ObjectMapper.Map<ProductRecycleJob, ProductRecycleJobDTO>(handleResult); |
|
|
|
return handleDto; |
|
|
|
} |
|
|
|
/// <summary>
|
|
|
|
/// 根据请求号完成任务
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="number"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost("complete-by-request-number")] |
|
|
|
public async Task<ProductRecycleJobDTO> CompleteByRequestNumberAsync(string number) |
|
|
|
{ |
|
|
|
var entity = await _repository.FirstOrDefaultAsync(r => r.RequestNumber == number).ConfigureAwait(false); |
|
|
|
await entity.CompleteAsync(CurrentUser.Id, CurrentUser.Name, Clock.Now).ConfigureAwait(false); |
|
|
|
|
|
|
|
var updatejob = await _repository.UpdateAsync(entity).ConfigureAwait(false); |
|
|
|
var dto = ObjectMapper.Map<ProductRecycleJob, ProductRecycleJobDTO>(updatejob); |
|
|
|
|
|
|
|
return dto; |
|
|
|
} |
|
|
|
} |
|
|
|