|
@ -36,10 +36,10 @@ public class KittingIssueJobAppService |
|
|
{ |
|
|
{ |
|
|
private readonly IKittingIssueJobManager _kittingIssueJobManager; |
|
|
private readonly IKittingIssueJobManager _kittingIssueJobManager; |
|
|
private readonly ILocationAppService _locationAppService; |
|
|
private readonly ILocationAppService _locationAppService; |
|
|
private readonly ITransferLibJobAppService _transferLibJobAppService; |
|
|
|
|
|
private readonly IKittingIssueNoteAppService _kittingIssueNoteAppService; |
|
|
private readonly IKittingIssueNoteAppService _kittingIssueNoteAppService; |
|
|
private readonly IExpectOutAppService _expectOutAppService; |
|
|
private readonly IExpectOutAppService _expectOutAppService; |
|
|
private readonly IHttpClientFactory _httpClientFactory; |
|
|
private readonly IHttpClientFactory _httpClientFactory; |
|
|
|
|
|
private readonly ITransferLibRequestAppService _transferLibRequestAppService; |
|
|
private readonly IOptions<RestoOptions> _options; |
|
|
private readonly IOptions<RestoOptions> _options; |
|
|
|
|
|
|
|
|
protected IKittingIssueRequestAppService KittingIssueRequestAppService => |
|
|
protected IKittingIssueRequestAppService KittingIssueRequestAppService => |
|
@ -47,23 +47,19 @@ public class KittingIssueJobAppService |
|
|
|
|
|
|
|
|
public KittingIssueJobAppService( |
|
|
public KittingIssueJobAppService( |
|
|
IKittingIssueJobRepository repository, IKittingIssueJobManager kittingIssueJobManager, |
|
|
IKittingIssueJobRepository repository, IKittingIssueJobManager kittingIssueJobManager, |
|
|
ILocationAppService locationAppService, ITransferLibJobAppService transferLibJobAppService, |
|
|
ILocationAppService locationAppService, |
|
|
IKittingIssueNoteAppService kittingIssueNoteAppService, IExpectOutAppService expectOutAppService |
|
|
IKittingIssueNoteAppService kittingIssueNoteAppService, IExpectOutAppService expectOutAppService |
|
|
, IHttpClientFactory httpClientFactory |
|
|
, IHttpClientFactory httpClientFactory |
|
|
, IOptions<RestoOptions> options |
|
|
, IOptions<RestoOptions> options, ITransferLibRequestAppService transferLibRequestAppService) : base( |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
) : base( |
|
|
|
|
|
repository, kittingIssueJobManager) |
|
|
repository, kittingIssueJobManager) |
|
|
{ |
|
|
{ |
|
|
_kittingIssueJobManager = kittingIssueJobManager; |
|
|
_kittingIssueJobManager = kittingIssueJobManager; |
|
|
_locationAppService = locationAppService; |
|
|
_locationAppService = locationAppService; |
|
|
_transferLibJobAppService = transferLibJobAppService; |
|
|
|
|
|
_kittingIssueNoteAppService = kittingIssueNoteAppService; |
|
|
_kittingIssueNoteAppService = kittingIssueNoteAppService; |
|
|
_expectOutAppService = expectOutAppService; |
|
|
_expectOutAppService = expectOutAppService; |
|
|
_httpClientFactory = httpClientFactory; |
|
|
_httpClientFactory = httpClientFactory; |
|
|
_options = options; |
|
|
_options = options; |
|
|
|
|
|
_transferLibRequestAppService = transferLibRequestAppService; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[HttpPost("add-many")] |
|
|
[HttpPost("add-many")] |
|
@ -115,21 +111,12 @@ public class KittingIssueJobAppService |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
await _expectOutAppService.RemoveByNumberAsync(kittingJob.Number).ConfigureAwait(false); |
|
|
await _expectOutAppService.RemoveByNumberAsync(kittingJob.Number).ConfigureAwait(false); |
|
|
|
|
|
await _transferLibRequestAppService.CancelByCallRequestNumberAsync(kittingJob.KittingRequestNumber).ConfigureAwait(false); |
|
|
|
|
|
|
|
|
kittingJob.JobStatus = EnumJobStatus.Cancelled; |
|
|
kittingJob.JobStatus = EnumJobStatus.Cancelled; |
|
|
await _repository.UpdateAsync(kittingJob).ConfigureAwait(false); |
|
|
await _repository.UpdateAsync(kittingJob).ConfigureAwait(false); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[HttpPost("cancel-by-request/{requestNumber}")] |
|
|
|
|
|
public virtual async Task CancelByMaterialRequestAsync(string requestNumber) |
|
|
|
|
|
{ |
|
|
|
|
|
var entities = await _repository.GetListAsync(p => p.KittingRequestNumber == requestNumber) |
|
|
|
|
|
.ConfigureAwait(false); |
|
|
|
|
|
foreach (var entity in entities) |
|
|
|
|
|
{ |
|
|
|
|
|
await _kittingIssueJobManager.CancelAsync(entity).ConfigureAwait(false); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[HttpPost("by-request-number/{requestNumber}")] |
|
|
[HttpPost("by-request-number/{requestNumber}")] |
|
|
public virtual async Task<List<KittingIssueJobDTO>> GetByRequestNumberAsync(string requestNumber) |
|
|
public virtual async Task<List<KittingIssueJobDTO>> GetByRequestNumberAsync(string requestNumber) |
|
|
{ |
|
|
{ |
|
@ -249,6 +236,8 @@ public class KittingIssueJobAppService |
|
|
await _expectOutAppService.RemoveByNumberAsync(kittingIssueJob.Number).ConfigureAwait(false); |
|
|
await _expectOutAppService.RemoveByNumberAsync(kittingIssueJob.Number).ConfigureAwait(false); |
|
|
|
|
|
|
|
|
await KittingIssueRequestAppService.UpdateStatusCompletedAsync(kittingIssueJob.KittingRequestNumber).ConfigureAwait(false); |
|
|
await KittingIssueRequestAppService.UpdateStatusCompletedAsync(kittingIssueJob.KittingRequestNumber).ConfigureAwait(false); |
|
|
|
|
|
await _transferLibRequestAppService.CancelByCallRequestNumberAsync(kittingIssueJob.KittingRequestNumber).ConfigureAwait(false); |
|
|
|
|
|
|
|
|
await _repository.UpdateAsync(kittingIssueJob).ConfigureAwait(false); |
|
|
await _repository.UpdateAsync(kittingIssueJob).ConfigureAwait(false); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -267,6 +256,7 @@ public class KittingIssueJobAppService |
|
|
kittingIssueJob.JobStatus = EnumJobStatus.Done; |
|
|
kittingIssueJob.JobStatus = EnumJobStatus.Done; |
|
|
await _repository.UpdateAsync(kittingIssueJob).ConfigureAwait(false); |
|
|
await _repository.UpdateAsync(kittingIssueJob).ConfigureAwait(false); |
|
|
await _expectOutAppService.RemoveByNumberAsync(kittingIssueJob.Number).ConfigureAwait(false); |
|
|
await _expectOutAppService.RemoveByNumberAsync(kittingIssueJob.Number).ConfigureAwait(false); |
|
|
|
|
|
await _transferLibRequestAppService.CancelByCallRequestNumberAsync(kittingIssueJob.KittingRequestNumber).ConfigureAwait(false); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|