You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
89 lines
3.5 KiB
89 lines
3.5 KiB
2 years ago
|
//using System.Collections.Generic;
|
||
|
//using System.Threading.Tasks;
|
||
|
//using Volo.Abp.DependencyInjection;
|
||
|
//using Volo.Abp.EventBus;
|
||
|
//using Volo.Abp.ObjectMapping;
|
||
|
//using Volo.Abp.Uow;
|
||
|
//using Win_in.Sfs.Shared.Domain;
|
||
|
//using Win_in.Sfs.Shared.Event;
|
||
|
//using Win_in.Sfs.Wms.Inventory.Application.Contracts;
|
||
|
//using Win_in.Sfs.Wms.Job.Domain;
|
||
|
|
||
|
//namespace Win_in.Sfs.Wms.Job.Event.Inventories
|
||
|
//{
|
||
|
// public class PutawayJobEventHandler :
|
||
|
// JobExpectInOutEventHandlerBase
|
||
|
// , ILocalEventHandler<SfsCreatedEntityEventData<PutawayJob>>
|
||
|
// , ILocalEventHandler<SfsCreatedEntityEventData<List<PutawayJob>>>
|
||
|
// , ILocalEventHandler<SfsCompletedEntityEventData<PutawayJob>>
|
||
|
// , ILocalEventHandler<SfsCancelledEntityEventData<PutawayJob>>
|
||
|
// {
|
||
|
|
||
|
// [UnitOfWork]
|
||
|
// public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<PutawayJob> eventData)
|
||
|
// {
|
||
|
// var entity = eventData.Entity;
|
||
|
// await AddExpectInsAsync(new List<PutawayJob> { entity });
|
||
|
// await AddExpectOutsAsync(new List<PutawayJob> { entity });
|
||
|
// }
|
||
|
|
||
|
// [UnitOfWork]
|
||
|
// public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<PutawayJob>> eventData)
|
||
|
// {
|
||
|
// var entities = eventData.Entity;
|
||
|
// await AddExpectInsAsync(entities);
|
||
|
// await AddExpectOutsAsync(entities);
|
||
|
// }
|
||
|
|
||
|
// [UnitOfWork]
|
||
|
// public virtual async Task HandleEventAsync(SfsCompletedEntityEventData<PutawayJob> eventData)
|
||
|
// {
|
||
|
// var entity = eventData.Entity;
|
||
|
// await ExpectInAppService.RemoveAsync(entity.Number);
|
||
|
// await ExpectOutAppService.RemoveAsync(entity.Number);
|
||
|
// }
|
||
|
|
||
|
// [UnitOfWork]
|
||
|
// public virtual async Task HandleEventAsync(SfsCancelledEntityEventData<PutawayJob> eventData)
|
||
|
// {
|
||
|
// var entity = eventData.Entity;
|
||
|
// await ExpectInAppService.RemoveAsync(entity.Number);
|
||
|
// await ExpectOutAppService.RemoveAsync(entity.Number);
|
||
|
// }
|
||
|
|
||
|
// private async Task AddExpectOutsAsync(List<PutawayJob> entities)
|
||
|
// {
|
||
|
// var expectOuts = new List<ExpectOutCreateInput>();
|
||
|
// foreach (var entity in entities)
|
||
|
// {
|
||
|
// var entityExpectOuts = BuildExpectOutInventoryAsync(entity.Details, entity.Number);
|
||
|
// expectOuts.AddRange(entityExpectOuts);
|
||
|
// }
|
||
|
// await ExpectOutAppService.AddManyAsync(expectOuts);
|
||
|
// }
|
||
|
|
||
|
// private async Task AddExpectInsAsync(List<PutawayJob> entities)
|
||
|
// {
|
||
|
// var expectIns = new List<ExpectInCreateInput>();
|
||
|
// foreach (var entity in entities)
|
||
|
// {
|
||
|
// var entityExpectIns = BuildExpectInInventoryAsync(entity.Details, entity.Number);
|
||
|
// expectIns.AddRange(entityExpectIns);
|
||
|
// }
|
||
|
// await ExpectInAppService.AddManyAsync(expectIns);
|
||
|
// }
|
||
|
|
||
|
// private List<ExpectInCreateInput> BuildExpectInInventoryAsync(List<PutawayJobDetail> balanceDto, string jobNumber)
|
||
|
// {
|
||
|
// var inputs = ObjectMapper.Map<List<PutawayJobDetail>, List<ExpectInCreateInput>>(balanceDto);
|
||
|
// return inputs;
|
||
|
// }
|
||
|
|
||
|
// private List<ExpectOutCreateInput> BuildExpectOutInventoryAsync(List<PutawayJobDetail> balanceDto, string jobNumber)
|
||
|
// {
|
||
|
// var inputs = ObjectMapper.Map<List<PutawayJobDetail>, List<ExpectOutCreateInput>>(balanceDto);
|
||
|
// return inputs;
|
||
|
// }
|
||
|
// }
|
||
|
//}
|