diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs index b0cfd8036..d165f5fbd 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs @@ -343,7 +343,9 @@ public class TransferLibJobAppService if (job.JobStatus == EnumJobStatus.Open || job.JobStatus == EnumJobStatus.Partial || job.JobStatus == EnumJobStatus.Doing || job.JobStatus == EnumJobStatus.Wait) { + await _repository.UpdateAsync(job).ConfigureAwait(false); + await _expectOutAppService.RemoveByNumberAsync(job.Number).ConfigureAwait(false); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferLibRequests/TransferLibRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferLibRequests/TransferLibRequestAppService.cs index d20e60820..9178e507b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferLibRequests/TransferLibRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferLibRequests/TransferLibRequestAppService.cs @@ -386,6 +386,12 @@ public class TransferLibRequestAppService : SfsStoreRequestAppServiceBase return ObjectMapper.Map(request); } + + + + + + [HttpPost("Complete-By-Job")] public async Task CompleteByJobAsync(string requestNumber) { @@ -414,6 +420,14 @@ public class TransferLibRequestAppService : SfsStoreRequestAppServiceBase foreach (var request in list) { await CompleteAsync(request.Id).ConfigureAwait(false); + var jobs = await _transferLibJobAppService.GetByRequestNumberAsync(request.Number).ConfigureAwait(false); + foreach (var itm in jobs) + { + if (itm.JobStatus != EnumJobStatus.Done) + { + await _transferLibJobAppService.CompleteAsync(itm.Id, itm).ConfigureAwait(false); + } + } } }