|
@ -25,17 +25,22 @@ public class ContainerRequestEventHandler |
|
|
, ILocalEventHandler<SfsCreatedEntityEventData<List<ContainerRequest>>> |
|
|
, ILocalEventHandler<SfsCreatedEntityEventData<List<ContainerRequest>>> |
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
|
|
|
private readonly IContainerNoteAppService _containerNoteApp; |
|
|
private readonly IContainerJobAppService _containerJobApp; |
|
|
private readonly IContainerJobAppService _containerJobApp; |
|
|
|
|
|
private readonly IEquipmentLocAppService _equipmentLocApp; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private readonly IContainerRequestManager _containerRequestManager; |
|
|
private readonly IContainerRequestManager _containerRequestManager; |
|
|
|
|
|
|
|
|
public ContainerRequestEventHandler( |
|
|
public ContainerRequestEventHandler( |
|
|
IContainerJobAppService containerJobApp |
|
|
IContainerNoteAppService containerNoteApp, |
|
|
, IContainerRequestManager containerRequestManager) |
|
|
IContainerJobAppService containerJobApp, |
|
|
|
|
|
IEquipmentLocAppService equipmentLocApp, |
|
|
|
|
|
IContainerRequestManager containerRequestManager) |
|
|
{ |
|
|
{ |
|
|
|
|
|
_containerNoteApp = containerNoteApp; |
|
|
_containerJobApp = containerJobApp; |
|
|
_containerJobApp = containerJobApp; |
|
|
|
|
|
_equipmentLocApp= equipmentLocApp; |
|
|
_containerRequestManager = containerRequestManager; |
|
|
_containerRequestManager = containerRequestManager; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -102,7 +107,8 @@ public class ContainerRequestEventHandler |
|
|
//东阳特殊逻辑
|
|
|
//东阳特殊逻辑
|
|
|
if (entity.DirectCreateNote) |
|
|
if (entity.DirectCreateNote) |
|
|
{ |
|
|
{ |
|
|
|
|
|
var noteCreateInput = await BuildContainerNoteAsync(entity).ConfigureAwait(false); |
|
|
|
|
|
await _containerNoteApp.CreateAsync(noteCreateInput).ConfigureAwait(false); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
@ -115,6 +121,31 @@ public class ContainerRequestEventHandler |
|
|
#region 私有
|
|
|
#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) |
|
|
private async Task<ContainerJobEditInput> BuildContainerJobsAsync(ContainerRequest request) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|