diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/DTOs/ContainerNoteDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/DTOs/ContainerNoteDTO.cs index 262c27d0e..f899f7793 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/DTOs/ContainerNoteDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/DTOs/ContainerNoteDTO.cs @@ -14,6 +14,12 @@ public class ContainerNoteDTO : SfsStoreDTOBase, IHasJob [Display(Name = "任务ID")] public string JobNumber { get; set; } + /// + /// 器具申请号码 + /// + [Display(Name = "器具申请号码")] + public string ContainerRequestNumber { get; set; } + /// /// 呼叫库位代码 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteEditInput.cs index 498d54b42..676aef13f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteEditInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteEditInput.cs @@ -20,10 +20,16 @@ public class ContainerNoteEditInput : SfsStoreCreateOrUpdateInputBase /// /// 任务ID /// - [Display(Name = "任务ID")] - [Required(ErrorMessage = "{0}是必填项")] + [Display(Name = "任务ID")] public string JobNumber { get; set; } + /// + /// 器具申请号码 + /// + [Display(Name = "器具申请号码")] + [Required(ErrorMessage = "{0}是必填项")] + public string ContainerRequestNumber { get; set; } + /// /// 呼叫库位代码 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteImportInput.cs index 1544bc32d..57e02c619 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteImportInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteImportInput.cs @@ -12,6 +12,13 @@ public class ContainerNoteImportInput : SfsStoreImportInputBase, IHasJobNumber [Display(Name = "任务ID")] public string JobNumber { get; set; } + /// + /// 器具申请号码 + /// + [Display(Name = "器具申请号码")] + [Required(ErrorMessage = "{0}是必填项")] + public string ContainerRequestNumber { get; set; } + /// /// 呼叫库位代码 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/ContainerNote.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/ContainerNote.cs index 5ad47ed4f..79edc854b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/ContainerNote.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/ContainerNote.cs @@ -19,6 +19,12 @@ public class ContainerNote : SfsStoreAggregateRootBase, IHa [IgnoreUpdate] public string JobNumber { get; set; } + /// + /// 器具申请号码 + /// + [Display(Name = "器具申请号码")] + public string ContainerRequestNumber { get; set; } + /// /// 呼叫库位代码 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ContainerRequestMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ContainerRequestMapperProfile.cs index 32b4c026e..3d34447b1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ContainerRequestMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ContainerRequestMapperProfile.cs @@ -34,6 +34,36 @@ public partial class StoreEventAutoMapperProfile : Profile .Ignore(x => x.CompleteTime) .Ignore(x => x.Details) ; - + + CreateMap() + .ForMember(x => x.ContainerRequestNumber, y => y.MapFrom(d => d.Number)) + .Ignore(x => x.JobNumber) + .Ignore(x => x.Confirmed) + .Ignore(x => x.Details); + + CreateMap() + .ForMember(x => x.FromContainerCode, y => y.MapFrom(d => d.ContainerCode)) + .ForMember(x => x.FromLocationCode, y => y.MapFrom(d => d.LocationCode)) + .ForMember(x => x.FromLocationErpCode, y => y.MapFrom(d => d.LocationErpCode)) + .ForMember(x => x.FromWarehouseCode, y => y.MapFrom(d => d.WarehouseCode)) + .ForMember(x => x.FromLocationArea, y => y.MapFrom(d => d.LocationArea)) + .ForMember(x => x.FromLocationGroup, y => y.MapFrom(d => d.LocationGroup)) + .ForMember(x => x.FromLot, y => y.MapFrom(d => d.Lot)) + .ForMember(x => x.FromPackingCode, y => y.MapFrom(d => d.PackingCode)) + .ForMember(x => x.FromStatus, y => y.MapFrom(d => d.Status)) + .ForMember(x => x.FromWarehouseCode, y => y.MapFrom(d => d.WarehouseCode)) + .ForMember(x => x.ToContainerCode, y => y.MapFrom(d => d.ContainerCode)) + .ForMember(x => x.ToLocationCode, y => y.MapFrom(d => d.LocationCode)) + .ForMember(x => x.ToLocationErpCode, y => y.MapFrom(d => d.LocationErpCode)) + .ForMember(x => x.ToWarehouseCode, y => y.MapFrom(d => d.WarehouseCode)) + .ForMember(x => x.ToLocationArea, y => y.MapFrom(d => d.LocationArea)) + .ForMember(x => x.ToLocationGroup, y => y.MapFrom(d => d.LocationGroup)) + .ForMember(x => x.ToLot, y => y.MapFrom(d => d.Lot)) + .ForMember(x => x.ToPackingCode, y => y.MapFrom(d => d.PackingCode)) + .ForMember(x => x.ToStatus, y => y.MapFrom(d => d.Status)) + .ForMember(x => x.ToWarehouseCode, y => y.MapFrom(d => d.WarehouseCode)) + .Ignore(t => t.StdPackQty) + .IgnoreIHasRecommendAndHandledFrom(); + } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ContainerRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ContainerRequestEventHandler.cs index 0e2aad82c..db5ee4914 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ContainerRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ContainerRequestEventHandler.cs @@ -25,17 +25,22 @@ public class ContainerRequestEventHandler , ILocalEventHandler>> { - + private readonly IContainerNoteAppService _containerNoteApp; private readonly IContainerJobAppService _containerJobApp; + private readonly IEquipmentLocAppService _equipmentLocApp; + private readonly IContainerRequestManager _containerRequestManager; public ContainerRequestEventHandler( - IContainerJobAppService containerJobApp - , IContainerRequestManager containerRequestManager) + IContainerNoteAppService containerNoteApp, + IContainerJobAppService containerJobApp, + IEquipmentLocAppService equipmentLocApp, + IContainerRequestManager containerRequestManager) { - + _containerNoteApp = containerNoteApp; _containerJobApp = containerJobApp; + _equipmentLocApp= equipmentLocApp; _containerRequestManager = containerRequestManager; } @@ -102,7 +107,8 @@ public class ContainerRequestEventHandler //东阳特殊逻辑 if (entity.DirectCreateNote) { - + var noteCreateInput = await BuildContainerNoteAsync(entity).ConfigureAwait(false); + await _containerNoteApp.CreateAsync(noteCreateInput).ConfigureAwait(false); } else { @@ -114,7 +120,32 @@ public class ContainerRequestEventHandler #region 私有 - + + private async Task BuildContainerNoteAsync(ContainerRequest request) + { + + var createInput = ObjectMapper.Map(request); + + createInput.Details = new List(); + + foreach (var detail in request.Details) + { + detail.ToLocationCode = request.RequestLocationCode; + + var container = await _equipmentLocApp.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); + + if(container != null) + { + detail.ItemCode = container.Code; + } + + } + + return createInput; + } + + + private async Task BuildContainerJobsAsync(ContainerRequest request) {