|
|
@ -2,6 +2,7 @@ using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Volo.Abp.Domain.Repositories; |
|
|
|
using Volo.Abp.EventBus; |
|
|
|
using Volo.Abp.Uow; |
|
|
|
using Win_in.Sfs.Basedata.Application.Contracts; |
|
|
@ -10,6 +11,7 @@ using Win_in.Sfs.Shared.Event; |
|
|
|
using Win_in.Sfs.Wms.Inventory.Application.Contracts; |
|
|
|
using Win_in.Sfs.Wms.Store.Domain; |
|
|
|
using Win_in.Sfs.Wms.Store.Event.Transaction; |
|
|
|
using static ClosedXML.Excel.XLPredefinedFormat; |
|
|
|
|
|
|
|
namespace Win_in.Sfs.Wms.Store.Event.Transactions; |
|
|
|
|
|
|
@ -23,12 +25,14 @@ public class ThirdLocationNoteEventHandler |
|
|
|
|
|
|
|
private readonly ILocationAppService _locationAppService; |
|
|
|
private readonly IThirdLocationRequestManager _thirdLocationRequestManager; |
|
|
|
private readonly IThirdLocationRequestRepository _ThirdLocationRequestRepository; |
|
|
|
|
|
|
|
public ThirdLocationNoteEventHandler(ILocationAppService locationAppService |
|
|
|
, IThirdLocationRequestManager thirdLocationRequestManager) |
|
|
|
, IThirdLocationRequestRepository ThirdLocationRequestRepository, IThirdLocationRequestManager thirdLocationRequestManager) |
|
|
|
{ |
|
|
|
_locationAppService = locationAppService; |
|
|
|
_thirdLocationRequestManager = thirdLocationRequestManager; |
|
|
|
_ThirdLocationRequestRepository = ThirdLocationRequestRepository; |
|
|
|
} |
|
|
|
|
|
|
|
[UnitOfWork] |
|
|
@ -45,13 +49,20 @@ public class ThirdLocationNoteEventHandler |
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(entity.RequestNumber)) |
|
|
|
{ |
|
|
|
var thirdLocationRequest = await _thirdLocationRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false); |
|
|
|
foreach(var item in thirdLocationRequest.Details) |
|
|
|
//var thirdLocationRequest = await _thirdLocationRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false);
|
|
|
|
|
|
|
|
var entities = await _ThirdLocationRequestRepository.GetListAsync(p => p.Number == entity.RequestNumber, "Number", true).ConfigureAwait(false); |
|
|
|
if(entities.Count>0) |
|
|
|
{ |
|
|
|
item.IssuedQty = entity.Details[0].RecommendQty; |
|
|
|
item.ReceivedQty = entity.Details[0].HandledQty; |
|
|
|
foreach (var item in entities[0].Details) |
|
|
|
{ |
|
|
|
item.IssuedQty = entity.Details[0].RecommendQty; |
|
|
|
item.ReceivedQty = entity.Details[0].HandledQty; |
|
|
|
} |
|
|
|
await _thirdLocationRequestManager.CompleteAsync(entities[0]).ConfigureAwait(false); |
|
|
|
|
|
|
|
} |
|
|
|
await _thirdLocationRequestManager.CompleteAsync(thirdLocationRequest).ConfigureAwait(false); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|