diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/AssembleIssueJobsController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/AssembleIssueJobsController.cs index 7630ea0ea..71ba3bc9a 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/AssembleIssueJobsController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/AssembleIssueJobsController.cs @@ -44,7 +44,7 @@ public class AssembleIssueJobsController : AbpController if (jobStatus == "ALL") { status.Add((int)EnumJobStatus.Open); - // status.Add((int)EnumJobStatus.Wait); + status.Add((int)EnumJobStatus.Wait); status.Add((int)EnumJobStatus.Doing); status.Add((int)EnumJobStatus.Partial); } @@ -52,10 +52,10 @@ public class AssembleIssueJobsController : AbpController { status.Add((int)EnumJobStatus.Open); } - //else if (jobStatus == "Wait") - //{ - // status.Add((int)EnumJobStatus.Wait); - //} + else if (jobStatus == "Wait") + { + status.Add((int)EnumJobStatus.Wait); + } else { status.Add((int)EnumJobStatus.Done); @@ -121,7 +121,7 @@ public class AssembleIssueJobsController : AbpController var status = new List { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing, (int)EnumJobStatus.Partial - //, (int)EnumJobStatus.Wait + , (int)EnumJobStatus.Wait }; var jsonStatus = JsonSerializer.Serialize(status); diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/CoatingIssueJobsController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/CoatingIssueJobsController.cs index e8eebd2c8..24ac8c54a 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/CoatingIssueJobsController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/CoatingIssueJobsController.cs @@ -44,7 +44,7 @@ public class CoatingIssueJobsController : AbpController if (jobStatus == "ALL") { status.Add((int)EnumJobStatus.Open); - //status.Add((int)EnumJobStatus.Wait); + status.Add((int)EnumJobStatus.Wait); status.Add((int)EnumJobStatus.Doing); status.Add((int)EnumJobStatus.Partial); } @@ -52,10 +52,10 @@ public class CoatingIssueJobsController : AbpController { status.Add((int)EnumJobStatus.Open); } - //else if (jobStatus == "Wait") - //{ - // status.Add((int)EnumJobStatus.Wait); - //} + else if (jobStatus == "Wait") + { + status.Add((int)EnumJobStatus.Wait); + } else { status.Add((int)EnumJobStatus.Done); diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/InjectionIssueJobsController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/InjectionIssueJobsController.cs index 4806e2192..174cc29ee 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/InjectionIssueJobsController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/InjectionIssueJobsController.cs @@ -44,7 +44,7 @@ public class InjectionIssueJobsController : AbpController if (jobStatus == "ALL") { status.Add((int)EnumJobStatus.Open); - //status.Add((int)EnumJobStatus.Wait); + status.Add((int)EnumJobStatus.Wait); status.Add((int)EnumJobStatus.Doing); status.Add((int)EnumJobStatus.Partial); } @@ -52,10 +52,10 @@ public class InjectionIssueJobsController : AbpController { status.Add((int)EnumJobStatus.Open); } - //else if (jobStatus == "Wait") - //{ - // status.Add((int)EnumJobStatus.Wait); - //} + else if (jobStatus == "Wait") + { + status.Add((int)EnumJobStatus.Wait); + } else { status.Add((int)EnumJobStatus.Done); @@ -121,7 +121,7 @@ public class InjectionIssueJobsController : AbpController var status = new List { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing, (int)EnumJobStatus.Partial - //, (int)EnumJobStatus.Wait + , (int)EnumJobStatus.Wait }; var jsonStatus = JsonSerializer.Serialize(status); diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/KittingIssueJobsController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/KittingIssueJobsController.cs index 7dca7ee99..e18176f4a 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/KittingIssueJobsController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobs/KittingIssueJobsController.cs @@ -44,7 +44,7 @@ public class KittingIssueJobsController : AbpController if (jobStatus=="ALL") { status.Add((int)EnumJobStatus.Open); - //status.Add((int)EnumJobStatus.Wait); + status.Add((int)EnumJobStatus.Wait); status.Add((int)EnumJobStatus.Doing); status.Add((int)EnumJobStatus.Partial); } @@ -52,10 +52,10 @@ public class KittingIssueJobsController : AbpController { status.Add((int)EnumJobStatus.Open); } - //else if(jobStatus == "Wait") - //{ - // status.Add((int)EnumJobStatus.Wait); - //} + else if (jobStatus == "Wait") + { + status.Add((int)EnumJobStatus.Wait); + } else { status.Add((int)EnumJobStatus.Done); @@ -120,8 +120,8 @@ public class KittingIssueJobsController : AbpController { var status = new List { - (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing, (int)EnumJobStatus.Partial - //(int)EnumJobStatus.Wait + (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing, (int)EnumJobStatus.Partial, + (int)EnumJobStatus.Wait }; var jsonStatus = JsonSerializer.Serialize(status); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/ITransferLibJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/ITransferLibJobAppService.cs index b023b698b..ceda17d92 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/ITransferLibJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/TransferLibJobs/ITransferLibJobAppService.cs @@ -8,4 +8,7 @@ public interface ITransferLibJobAppService { Task> GetByRequestNumberAsync(string requestNumber); Task CompleteByRequestAsync(string requestNumber); + + + } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/ITransferLibRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/ITransferLibRequestAppService.cs index d93c634b8..eb66dac2f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/ITransferLibRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferLibRequests/ITransferLibRequestAppService.cs @@ -20,4 +20,9 @@ public interface ITransferLibRequestAppService Task CompleteByJobAsync(string requestNumber); Task CancelByCallRequestNumberAsync(string callJobNumber); Task CompleteByCallRequestNumberAsync(string callRequestNumber); + + Task CompleteByJobNumAsync(string jobNumber); + + Task IsCompleted(string jobNumber); + } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs index 0c889b107..34e0d837f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs @@ -129,15 +129,17 @@ public class AssembleIssueJobAppService { throw new UserFriendlyException($"未找到ID为 {id} 的任务"); } - if (assembleJob.JobStatus == EnumJobStatus.Open || assembleJob.JobStatus == EnumJobStatus.Partial || assembleJob.JobStatus == EnumJobStatus.Wait || assembleJob.JobStatus == EnumJobStatus.Doing) { await _expectOutAppService.RemoveByNumberAsync(assembleJob.Number).ConfigureAwait(false); - await _transferLibRequestAppService.CancelByCallRequestNumberAsync(assembleJob.AssembleRequestNumber) - .ConfigureAwait(false); + //await _transferLibRequestAppService.CancelByCallRequestNumberAsync(assembleJob.Number) + // .ConfigureAwait(false); + + await _transferLibRequestAppService.CompleteByJobNumAsync(assembleJob.Number) + .ConfigureAwait(false); assembleJob.JobStatus = EnumJobStatus.Cancelled; await _repository.UpdateAsync(assembleJob).ConfigureAwait(false); @@ -378,7 +380,7 @@ public class AssembleIssueJobAppService await AssembleIssueRequestAppService.UpdateStatusCompletedAsync(assembleIssueJob.AssembleRequestNumber) .ConfigureAwait(false); - await _transferLibRequestAppService.CancelByCallRequestNumberAsync(assembleIssueJob.AssembleRequestNumber) + await _transferLibRequestAppService.CompleteByJobNumAsync(assembleIssueJob.Number) .ConfigureAwait(false); await _repository.UpdateAsync(assembleIssueJob).ConfigureAwait(false); @@ -400,7 +402,7 @@ public class AssembleIssueJobAppService assembleIssueJob.JobStatus = EnumJobStatus.Done; await _repository.UpdateAsync(assembleIssueJob).ConfigureAwait(false); await _expectOutAppService.RemoveByNumberAsync(assembleIssueJob.Number).ConfigureAwait(false); - await _transferLibRequestAppService.CancelByCallRequestNumberAsync(assembleIssueJob.AssembleRequestNumber) + await _transferLibRequestAppService.CompleteByJobNumAsync(assembleIssueJob.Number) .ConfigureAwait(false); } } @@ -746,12 +748,12 @@ public class AssembleIssueJobAppService if (loctionDto.Type == EnumLocationType.RAW && loctionDto.RowCode != 1) { - input.JobStatus = EnumJobStatus.Open; + input.JobStatus = EnumJobStatus.Wait; } else if (loctionDto.Type == EnumLocationType.RAW && loctionDto.RowCode == 1) { - input.JobStatus = EnumJobStatus.Wait; + jobDetailInputdetail.TransferLibFromArriveDate = jobDetailInputdetail.RecommendFromArriveDate; jobDetailInputdetail.TransferLibFromContainerCode = jobDetailInputdetail.RecommendFromContainerCode; @@ -871,9 +873,24 @@ public class AssembleIssueJobAppService //await _expectOutAppService.RemoveByNumberAsync(assembleIssueJob.Number).ConfigureAwait(false); + + + await AssembleIssueRequestAppService.UpdateStatusCompletedAsync(assembleIssueJob.AssembleRequestNumber) .ConfigureAwait(false); + var flag=await _transferLibRequestAppService.IsCompleted(assembleIssueJob.Number).ConfigureAwait(false); + if (flag==false) + { + await _transferLibRequestAppService.CompleteByJobNumAsync(assembleIssueJob.Number).ConfigureAwait(false); + + } + + + + + + await Task.CompletedTask.ConfigureAwait(false); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs index e93976c35..ca2cc0e21 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs @@ -125,8 +125,7 @@ public class CoatingIssueJobAppService coatingJob.JobStatus == EnumJobStatus.Doing) { await _expectOutAppService.RemoveByNumberAsync(coatingJob.Number).ConfigureAwait(false); - await _transferLibRequestAppService.CancelByCallRequestNumberAsync(coatingJob.CoatingRequestNumber) - .ConfigureAwait(false); + await _transferLibRequestAppService.CompleteByJobNumAsync(coatingJob.Number).ConfigureAwait(false); coatingJob.JobStatus = EnumJobStatus.Cancelled; await _repository.UpdateAsync(coatingJob).ConfigureAwait(false); @@ -299,7 +298,7 @@ public class CoatingIssueJobAppService await CoatingIssueRequestAppService.UpdateStatusCompletedAsync(coatingIssueJob.CoatingRequestNumber) .ConfigureAwait(false); - await _transferLibRequestAppService.CancelByCallRequestNumberAsync(coatingIssueJob.CoatingRequestNumber) + await _transferLibRequestAppService.CompleteByJobNumAsync(coatingIssueJob.Number) .ConfigureAwait(false); await _repository.UpdateAsync(coatingIssueJob).ConfigureAwait(false); @@ -321,7 +320,7 @@ public class CoatingIssueJobAppService coatingIssueJob.JobStatus = EnumJobStatus.Done; await _repository.UpdateAsync(coatingIssueJob).ConfigureAwait(false); await _expectOutAppService.RemoveByNumberAsync(coatingIssueJob.Number).ConfigureAwait(false); - await _transferLibRequestAppService.CancelByCallRequestNumberAsync(coatingIssueJob.CoatingRequestNumber) + await _transferLibRequestAppService.CompleteByJobNumAsync(coatingIssueJob.Number) .ConfigureAwait(false); } } @@ -694,6 +693,17 @@ public class CoatingIssueJobAppService await CoatingIssueRequestAppService.UpdateStatusCompletedAsync(coatingIssueJob.CoatingRequestNumber) .ConfigureAwait(false); + // await _transferLibRequestAppService.CompleteByJobNumAsync(coatingIssueJob.Number).ConfigureAwait(false); + + var flag = await _transferLibRequestAppService.IsCompleted(coatingIssueJob.Number).ConfigureAwait(false); + if (flag == false) + { + await _transferLibRequestAppService.CompleteByJobNumAsync(coatingIssueJob.Number).ConfigureAwait(false); + + } + + + await Task.CompletedTask.ConfigureAwait(false); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs index df5e89502..4dfa06640 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs @@ -117,8 +117,8 @@ public class InjectionIssueJobAppService injectionJob.JobStatus == EnumJobStatus.Doing) { await _expectOutAppService.RemoveByNumberAsync(injectionJob.Number).ConfigureAwait(false); - await _transferLibRequestAppService.CancelByCallRequestNumberAsync(injectionJob.InjectionRequestNumber) - .ConfigureAwait(false); + await _transferLibRequestAppService.CompleteByJobNumAsync(injectionJob.Number).ConfigureAwait(false); + injectionJob.JobStatus = EnumJobStatus.Cancelled; await _repository.UpdateAsync(injectionJob).ConfigureAwait(false); @@ -276,7 +276,7 @@ public class InjectionIssueJobAppService await InjectionIssueRequestAppService.UpdateStatusCompletedAsync(injectionIssueJob.InjectionRequestNumber) .ConfigureAwait(false); - await _transferLibRequestAppService.CancelByCallRequestNumberAsync(injectionIssueJob.InjectionRequestNumber) + await _transferLibRequestAppService.CompleteByJobNumAsync(injectionIssueJob.Number) .ConfigureAwait(false); await _repository.UpdateAsync(injectionIssueJob).ConfigureAwait(false); @@ -298,7 +298,7 @@ public class InjectionIssueJobAppService injectionIssueJob.JobStatus = EnumJobStatus.Done; await _repository.UpdateAsync(injectionIssueJob).ConfigureAwait(false); await _expectOutAppService.RemoveByNumberAsync(injectionIssueJob.Number).ConfigureAwait(false); - await _transferLibRequestAppService.CancelByCallRequestNumberAsync(injectionIssueJob.InjectionRequestNumber) + await _transferLibRequestAppService.CompleteByJobNumAsync(injectionIssueJob.Number) .ConfigureAwait(false); } } @@ -537,11 +537,11 @@ public class InjectionIssueJobAppService if (loctionDto.Type == EnumLocationType.RAW && loctionDto.RowCode != 1) { - input.JobStatus = EnumJobStatus.Open; + input.JobStatus = EnumJobStatus.Wait; } else if (loctionDto.Type == EnumLocationType.RAW && loctionDto.RowCode == 1) { - input.JobStatus = EnumJobStatus.Wait; + jobDetailInputdetail.TransferLibFromArriveDate = jobDetailInputdetail.RecommendFromArriveDate; jobDetailInputdetail.TransferLibFromContainerCode = jobDetailInputdetail.RecommendFromContainerCode; jobDetailInputdetail.TransferLibFromExpireDate = jobDetailInputdetail.RecommendFromExpireDate; @@ -641,6 +641,15 @@ public class InjectionIssueJobAppService await InjectionIssueRequestAppService.UpdateStatusCompletedAsync(injectionIssueJob.InjectionRequestNumber) .ConfigureAwait(false); + + var flag = await _transferLibRequestAppService.IsCompleted(injectionIssueJob.Number).ConfigureAwait(false); + if (flag == false) + { + await _transferLibRequestAppService.CompleteByJobNumAsync(injectionIssueJob.Number).ConfigureAwait(false); + + } + + await Task.CompletedTask.ConfigureAwait(false); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs index cd3f45fe1..479722a50 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/KittingIssueJobs/KittingIssueJobAppService.cs @@ -125,7 +125,7 @@ public class KittingIssueJobAppService kittingJob.JobStatus == EnumJobStatus.Doing) { await _expectOutAppService.RemoveByNumberAsync(kittingJob.Number).ConfigureAwait(false); - await _transferLibRequestAppService.CancelByCallRequestNumberAsync(kittingJob.KittingRequestNumber) + await _transferLibRequestAppService.CompleteByJobNumAsync(kittingJob.KittingRequestNumber) .ConfigureAwait(false); kittingJob.JobStatus = EnumJobStatus.Cancelled; @@ -283,7 +283,7 @@ public class KittingIssueJobAppService await KittingIssueRequestAppService.UpdateStatusCompletedAsync(kittingIssueJob.KittingRequestNumber, kittingIssueJob.Number) .ConfigureAwait(false); - await _transferLibRequestAppService.CancelByCallRequestNumberAsync(kittingIssueJob.KittingRequestNumber) + await _transferLibRequestAppService.CompleteByJobNumAsync(kittingIssueJob.Number) .ConfigureAwait(false); await _repository.UpdateAsync(kittingIssueJob).ConfigureAwait(false); @@ -305,7 +305,7 @@ public class KittingIssueJobAppService kittingIssueJob.JobStatus = EnumJobStatus.Done; await _repository.UpdateAsync(kittingIssueJob).ConfigureAwait(false); await _expectOutAppService.RemoveByNumberAsync(kittingIssueJob.Number).ConfigureAwait(false); - await _transferLibRequestAppService.CancelByCallRequestNumberAsync(kittingIssueJob.KittingRequestNumber) + await _transferLibRequestAppService.CompleteByJobNumAsync(kittingIssueJob.Number) .ConfigureAwait(false); } } @@ -542,12 +542,12 @@ public class KittingIssueJobAppService if (loctionDto.Type == EnumLocationType.RAW && loctionDto.RowCode != 1) { - input.JobStatus = EnumJobStatus.Open; + input.JobStatus = EnumJobStatus.Wait; } else if (loctionDto.Type == EnumLocationType.RAW && loctionDto.RowCode == 1) { - input.JobStatus = EnumJobStatus.Wait; + jobDetailInputdetail.TransferLibFromArriveDate = jobDetailInputdetail.RecommendFromArriveDate; jobDetailInputdetail.TransferLibFromContainerCode = jobDetailInputdetail.RecommendFromContainerCode; @@ -653,6 +653,19 @@ public class KittingIssueJobAppService await KittingIssueRequestAppService.UpdateStatusCompletedAsync(kittingIssueJob.KittingRequestNumber,kittingIssueJob.Number) .ConfigureAwait(false); + + var flag = await _transferLibRequestAppService.IsCompleted(kittingIssueJob.Number).ConfigureAwait(false); + if (flag == false) + { + await _transferLibRequestAppService.CompleteByJobNumAsync(kittingIssueJob.Number).ConfigureAwait(false); + + } + + + + + // await _transferLibRequestAppService.CompleteByJobNumAsync(kittingIssueJob.Number).ConfigureAwait(false); + await Task.CompletedTask.ConfigureAwait(false); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs index f481bddf1..5fd070e75 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/SparePartIssueJobs/SparePartIssueJobAppService.cs @@ -118,7 +118,7 @@ public class SparePartIssueJobAppService sparePartJob.JobStatus == EnumJobStatus.Doing) { await _expectOutAppService.RemoveByNumberAsync(sparePartJob.Number).ConfigureAwait(false); - await _transferLibRequestAppService.CancelByCallRequestNumberAsync(sparePartJob.SparePartRequestNumber) + await _transferLibRequestAppService.CompleteByJobNumAsync(sparePartJob.SparePartRequestNumber) .ConfigureAwait(false); sparePartJob.JobStatus = EnumJobStatus.Cancelled; @@ -277,7 +277,7 @@ public class SparePartIssueJobAppService await SparePartIssueRequestAppService.UpdateStatusCompletedAsync(sparePartIssueJob.SparePartRequestNumber) .ConfigureAwait(false); - await _transferLibRequestAppService.CancelByCallRequestNumberAsync(sparePartIssueJob.SparePartRequestNumber) + await _transferLibRequestAppService.CompleteByJobNumAsync(sparePartIssueJob.Number) .ConfigureAwait(false); await _repository.UpdateAsync(sparePartIssueJob).ConfigureAwait(false); @@ -299,7 +299,7 @@ public class SparePartIssueJobAppService sparePartIssueJob.JobStatus = EnumJobStatus.Done; await _repository.UpdateAsync(sparePartIssueJob).ConfigureAwait(false); await _expectOutAppService.RemoveByNumberAsync(sparePartIssueJob.Number).ConfigureAwait(false); - await _transferLibRequestAppService.CancelByCallRequestNumberAsync(sparePartIssueJob.SparePartRequestNumber) + await _transferLibRequestAppService.CompleteByJobNumAsync(sparePartIssueJob.Number) .ConfigureAwait(false); } } @@ -628,8 +628,19 @@ public class SparePartIssueJobAppService //await _expectOutAppService.RemoveByNumberAsync(sparePartIssueJob.Number).ConfigureAwait(false); - await SparePartIssueRequestAppService.UpdateStatusCompletedAsync(sparePartIssueJob.SparePartRequestNumber) - .ConfigureAwait(false); + + var flag = await _transferLibRequestAppService.IsCompleted(sparePartIssueJob.Number).ConfigureAwait(false); + if (flag == false) + { + await _transferLibRequestAppService.CompleteByJobNumAsync(sparePartIssueJob.Number).ConfigureAwait(false); + + } + + + //await SparePartIssueRequestAppService.UpdateStatusCompletedAsync(sparePartIssueJob.SparePartRequestNumber) + // .ConfigureAwait(false); + + await Task.CompletedTask.ConfigureAwait(false); } 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 edeb8f883..b0cfd8036 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 @@ -299,6 +299,26 @@ public class TransferLibJobAppService return ObjectMapper.Map, List>(list); } + + [HttpPost("get-by-job/Id")] + [UnitOfWork] + public async Task IsCompleted(string jobNumber) + { + var list = await _repository.GetListAsync(p => p.JobNumber == jobNumber).ConfigureAwait(false); + if (list.Count > 0) + { + return true; + } + return false; + + + } + + + + + + public override async Task CancelAcceptAsync(Guid id) { var job = await _repository.FindAsync(p => p.Id == id).ConfigureAwait(false); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAppService.cs index 2eea4d3ae..72b3ed6db 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAppService.cs @@ -161,7 +161,7 @@ public class UnplannedIssueJobAppService foreach (var requestDtoDetail in requestDto.Details) //非计划领料明细 { var locationCodes = await _locationAppService - .GetListByErpLocationCodes(new StringList(requestDtoDetail.LocationErpCode)) + .GetListByErpLocationCodes(new StringList(requestDtoDetail.FromErpLocationCode)) .ConfigureAwait(false); //获取存放库位 if (locationCodes.Count == 0) { 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 93267adb9..6f15c7508 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 @@ -378,7 +378,7 @@ public class TransferLibRequestAppService : SfsStoreRequestAppServiceBase } else { - throw new UserFriendlyException($"【{request.RequestStatus.GetDisplayName()}】状态不允许取消"); + throw new UserFriendlyException($"【{request.RequestStatus.GetDisplayName()}】状态不允许完成"); } await _transferLibJobAppService.CompleteByRequestAsync(request.Number).ConfigureAwait(false); @@ -401,11 +401,25 @@ public class TransferLibRequestAppService : SfsStoreRequestAppServiceBase { if (request.RequestStatus != EnumRequestStatus.Completed) { - throw new UserFriendlyException($"【{request.RequestStatus.GetDisplayName()}】状态不允许取消"); + throw new UserFriendlyException($"【{request.RequestStatus.GetDisplayName()}】状态不允许完成"); } } } + + [HttpPost("Complete-By-JobNum")] + public async Task CompleteByJobNumAsync(string jobNumber) + { + var list = await _repository.GetListAsync(p => p.CallJobNumber == jobNumber).ConfigureAwait(false); + foreach (var request in list) + { + await CompleteAsync(request.Id).ConfigureAwait(false); + } + } + + + + /// /// 【创建】库移请求 /// @@ -479,4 +493,19 @@ public class TransferLibRequestAppService : SfsStoreRequestAppServiceBase protected void ChecktQty(TransferLibRequestImportInput importInput, List validationRresult) { } + + public async Task IsCompleted(string jobNumber) + { + var list = await _repository.GetListAsync(p => p.CallJobNumber == jobNumber).ConfigureAwait(false); + if (list.Count > 0) + { + var entity=list.FirstOrDefault(); + if (entity.RequestStatus == EnumRequestStatus.Completed) + { + return true; + } + } + return false; + + } }