Browse Source

器具记录更新

dev_DY_CC
周红军 1 year ago
parent
commit
0939b98f82
  1. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/DTOs/ContainerNoteDTO.cs
  2. 10
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteEditInput.cs
  3. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteImportInput.cs
  4. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/ContainerNote.cs
  5. 32
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ContainerRequestMapperProfile.cs
  6. 43
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ContainerRequestEventHandler.cs

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/DTOs/ContainerNoteDTO.cs

@ -14,6 +14,12 @@ public class ContainerNoteDTO : SfsStoreDTOBase<ContainerNoteDetailDTO>, IHasJob
[Display(Name = "任务ID")]
public string JobNumber { get; set; }
/// <summary>
/// 器具申请号码
/// </summary>
[Display(Name = "器具申请号码")]
public string ContainerRequestNumber { get; set; }
/// <summary>
/// 呼叫库位代码
/// </summary>

10
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteEditInput.cs

@ -20,10 +20,16 @@ public class ContainerNoteEditInput : SfsStoreCreateOrUpdateInputBase
/// <summary>
/// 任务ID
/// </summary>
[Display(Name = "任务ID")]
[Required(ErrorMessage = "{0}是必填项")]
[Display(Name = "任务ID")]
public string JobNumber { get; set; }
/// <summary>
/// 器具申请号码
/// </summary>
[Display(Name = "器具申请号码")]
[Required(ErrorMessage = "{0}是必填项")]
public string ContainerRequestNumber { get; set; }
/// <summary>
/// 呼叫库位代码
/// </summary>

7
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; }
/// <summary>
/// 器具申请号码
/// </summary>
[Display(Name = "器具申请号码")]
[Required(ErrorMessage = "{0}是必填项")]
public string ContainerRequestNumber { get; set; }
/// <summary>
/// 呼叫库位代码
/// </summary>

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/ContainerNote.cs

@ -19,6 +19,12 @@ public class ContainerNote : SfsStoreAggregateRootBase<ContainerNoteDetail>, IHa
[IgnoreUpdate]
public string JobNumber { get; set; }
/// <summary>
/// 器具申请号码
/// </summary>
[Display(Name = "器具申请号码")]
public string ContainerRequestNumber { get; set; }
/// <summary>
/// 呼叫库位代码
/// </summary>

32
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<ContainerRequest, ContainerNoteEditInput>()
.ForMember(x => x.ContainerRequestNumber, y => y.MapFrom(d => d.Number))
.Ignore(x => x.JobNumber)
.Ignore(x => x.Confirmed)
.Ignore(x => x.Details);
CreateMap<BalanceDTO, ContainerNoteDetailInput>()
.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();
}
}

43
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ContainerRequestEventHandler.cs

@ -25,17 +25,22 @@ public class ContainerRequestEventHandler
, ILocalEventHandler<SfsCreatedEntityEventData<List<ContainerRequest>>>
{
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<ContainerNoteEditInput> BuildContainerNoteAsync(ContainerRequest request)
{
var createInput = ObjectMapper.Map<ContainerRequest, ContainerNoteEditInput>(request);
createInput.Details = new List<ContainerNoteDetailInput>();
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<ContainerJobEditInput> BuildContainerJobsAsync(ContainerRequest request)
{

Loading…
Cancel
Save