diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs index 35ec8c85c..7d8fc7e2d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs @@ -43,7 +43,7 @@ public class InspectJobAppService var result = await _inspectJobManager.AddAsync(entity).ConfigureAwait(false); var dto = ObjectMapper.Map(result); - + return dto; } @@ -55,18 +55,27 @@ public class InspectJobAppService public virtual async Task CompleteSummaryDetailStatusAsync(Guid id, Guid summaryDetailId, InspectJobCompleteSummaryDetailInput input) { - if (input.FilesList != null && input.FilesList.Any()) + try { - var dict = await _fileAppService.CreateManyHasDictAsync(input.FilesList).ConfigureAwait(false); - input.InspectReport = JsonSerializer.Serialize(dict); - } + if (input.FilesList != null && input.FilesList.Any()) + { + var dict = await _fileAppService.CreateManyHasDictAsync(input.FilesList).ConfigureAwait(false); + input.InspectReport = JsonSerializer.Serialize(dict); + } - var summaryDetail = ObjectMapper.Map(input); + var summaryDetail = ObjectMapper.Map(input); - var entity = await _inspectJobManager - .CompleteSummaryDetailStatusAsync(id, summaryDetailId, summaryDetail, CurrentUser).ConfigureAwait(false); + var entity = await _inspectJobManager + .CompleteSummaryDetailStatusAsync(id, summaryDetailId, summaryDetail, CurrentUser).ConfigureAwait(false); + + return ObjectMapper.Map(entity); + } + catch (Exception ex) + { + + throw new UserFriendlyException($"{ex.Message}"); + } - return ObjectMapper.Map(entity); } /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs index 818a6c84d..2c3081d5b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs @@ -197,7 +197,7 @@ public class InspectJobManager : SfsJobManagerBase #endregion - await LocalEventBus.PublishAsync(new SfsUpdateEntitySummaryDetailEventData(CopyJob)) + await LocalEventBus.PublishAsync(new SfsUpdateEntitySummaryDetailEventData(CopyJob),false) .ConfigureAwait(false); return summaryDetailEntity; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/PurchaseReceiptJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/PurchaseReceiptJobEventHandler.cs index b3326c416..10cb54325 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/PurchaseReceiptJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/PurchaseReceiptJobEventHandler.cs @@ -68,6 +68,12 @@ public class PurchaseReceiptJobEventHandler : createInput.Details.Where(p => p.PurchaseReceiptInspectStatus == EnumPurchaseReceiptInspect.NOK); foreach (var detailInput in noOkNoteDetailInputs) { + detailInput.LocationCode = holdLocation.Code; + detailInput.LocationArea = holdLocation.AreaCode; + detailInput.LocationErpCode = holdLocation.ErpLocationCode; + detailInput.LocationGroup = holdLocation.LocationGroupCode; + detailInput.WarehouseCode = holdLocation.WarehouseCode; + detailInput.HandledToLocationCode = holdLocation.Code; detailInput.HandledToLocationArea = holdLocation.AreaCode; detailInput.HandledToLocationErpCode = holdLocation.ErpLocationCode; detailInput.HandledToLocationGroup = holdLocation.LocationGroupCode;