From 2e0a838fa1f9048a05d90d253bd7fe1f9415de0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Wed, 4 Dec 2024 15:49:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=9B=B4=E6=96=B0=E8=A3=85?= =?UTF-8?q?=E9=85=8D=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AssembleIssueJobAppService.cs | 15 ++++----------- .../Notes/TransferNotes/TransferNoteAppService.cs | 2 -- .../Requests/TransferRequestEventHandler.cs | 14 +++++++------- 3 files changed, 11 insertions(+), 20 deletions(-) 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 0205ebd67..70246183b 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 @@ -867,7 +867,6 @@ public class AssembleIssueJobAppService { successList.Add(jobres.Message); } - if (errors.Count > 0) { res.Code = -1; @@ -964,18 +963,14 @@ public class AssembleIssueJobAppService { errors.Add($"零件号{detail.MatCode}不存在!"); } - - var entity = itmDetails.FirstOrDefault(p => p.ItemCode == detail.MatCode); if (entity == null) { errors.Add($"零件号{detail.MatCode}不在任务明细内!"); } - - - if (errors.Count > 0) { + await unitOfWork.RollbackAsync().ConfigureAwait(false); return ret = new AgvResultObject() { Code = "-1", @@ -985,7 +980,7 @@ public class AssembleIssueJobAppService } var dto = new AssembleIssueJobDetailDTO(); dto.InjectFrom(entity); - dto.HandledToLocationCode = toloc.Code; + dto.HandledToLocationCode = tolocation.Code; dto.HandledToLocationGroup = tolocation.LocationGroupCode; dto.HandledToLocationArea = tolocation.AreaCode; dto.HandledToLocationErpCode = tolocation.ErpLocationCode; @@ -1006,14 +1001,12 @@ public class AssembleIssueJobAppService details.Add(dto); - - - //await ExecuteDetailExtAsync(itm.Id, entity.Id, dto).ConfigureAwait(false); } if (errors.Count > 0) { + await unitOfWork.RollbackAsync().ConfigureAwait(false); ret = new AgvResultObject() { Code = "-1", @@ -1040,7 +1033,7 @@ public class AssembleIssueJobAppService ReqCode = job.AssembleRequestNumber, Message = ex.Message, }; - await unitOfWork.RollbackAsync(); + await unitOfWork.RollbackAsync().ConfigureAwait(false); return ret; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs index e95b66e22..e653dce09 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs @@ -695,9 +695,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase transfer.Type = EnumTransSubType.Agv_Transfer_WIP.ToString(); transfer.Worker = "Agv"; transfer.UseOnTheWayLocation = false; - List transferNoteDetailInputs = new List(); - TransferNoteDetailInput detailInput = new TransferNoteDetailInput(); var fromloc = await _postionLocationAppService.GetByCodeAsync(detail.BeginPosition).ConfigureAwait(false); if (fromloc == null) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/TransferRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/TransferRequestEventHandler.cs index faf18743c..fda8445bf 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/TransferRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/TransferRequestEventHandler.cs @@ -49,8 +49,8 @@ public class TransferRequestEventHandler { - try - { + //try + //{ var entity = eventData.Entity; var enumTransSubType = Enum.Parse(entity.Type); @@ -85,11 +85,11 @@ public class TransferRequestEventHandler } } - } - catch (Exception e) - { - throw new UserFriendlyException($"{e.Message}"); - } + //} + //catch (Exception e) + //{ + // throw new UserFriendlyException($"{e.Message}"); + //} }