Browse Source

三方库申请已发数量更新

dev_DY_CC
周红军 12 months ago
parent
commit
46adbcdc73
  1. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs
  2. 23
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs

@ -98,10 +98,10 @@ public class ThirdLocationJobAppService
return dtos; return dtos;
} }
[HttpPost("cancel-by-request/{assembleNumber}")] [HttpPost("cancel-by-request/{thirdLocationNumber}")]
public virtual async Task CancelByMaterialRequestAsync(string assembleNumber) public virtual async Task CancelByMaterialRequestAsync(string thirdLocationNumber)
{ {
var entities = await _repository.GetListAsync(p => p.RequestNumber == assembleNumber).ConfigureAwait(false); var entities = await _repository.GetListAsync(p => p.RequestNumber == thirdLocationNumber).ConfigureAwait(false);
foreach (var entity in entities) foreach (var entity in entities)
{ {
await _thirdLocationJobManager.CancelAsync(entity).ConfigureAwait(false); await _thirdLocationJobManager.CancelAsync(entity).ConfigureAwait(false);

23
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs

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

Loading…
Cancel
Save