Browse Source

修改bug

dev_DY_CC
刘云峰 1 year ago
parent
commit
4dcb744c68
  1. 23
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs

23
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs

@ -27,6 +27,7 @@ public class TransferLibJobAppService
private readonly ILocationAppService _locationAppService; private readonly ILocationAppService _locationAppService;
private readonly IExpectOutAppService _expectOutAppService; private readonly IExpectOutAppService _expectOutAppService;
private readonly IBalanceAppService _balanceAppService; private readonly IBalanceAppService _balanceAppService;
private readonly IItemBasicAppService _itemBasicAppService;
protected ITransferLibRequestAppService TransferLibRequestAppService => protected ITransferLibRequestAppService TransferLibRequestAppService =>
LazyServiceProvider.LazyGetRequiredService<ITransferLibRequestAppService>(); LazyServiceProvider.LazyGetRequiredService<ITransferLibRequestAppService>();
@ -34,13 +35,15 @@ public class TransferLibJobAppService
public TransferLibJobAppService( public TransferLibJobAppService(
ITransferLibJobRepository repository, ITransferLibJobManager TransferLibJobManager, ITransferLibJobRepository repository, ITransferLibJobManager TransferLibJobManager,
IServiceProvider serviceProvider, ILocationAppService locationAppService, IServiceProvider serviceProvider, ILocationAppService locationAppService,
IExpectOutAppService expectOutAppService, IBalanceAppService balanceAppService) : base(repository, IExpectOutAppService expectOutAppService, IBalanceAppService balanceAppService,
TransferLibJobManager) IItemBasicAppService itemBasicAppService) :
base(repository, TransferLibJobManager)
{ {
_serviceProvider = serviceProvider; _serviceProvider = serviceProvider;
_locationAppService = locationAppService; _locationAppService = locationAppService;
_expectOutAppService = expectOutAppService; _expectOutAppService = expectOutAppService;
_balanceAppService = balanceAppService; _balanceAppService = balanceAppService;
_itemBasicAppService = itemBasicAppService;
} }
/// <summary> /// <summary>
@ -202,6 +205,13 @@ public class TransferLibJobAppService
#endregion #endregion
List<ItemBasicDTO> itemLst = new List<ItemBasicDTO>();
if (dto.Details.Any(itm => itm.StdPackQty == 0))
{
var codeLst = dto.Details.Where(itm => itm.StdPackQty == 0).Select(itm => itm.ItemCode).ToList();
itemLst = await _itemBasicAppService.GetByCodesAsync(codeLst).ConfigureAwait(false);
}
foreach (var detail in dto.Details) foreach (var detail in dto.Details)
{ {
detail.HandledFromContainerCode = string.Empty; detail.HandledFromContainerCode = string.Empty;
@ -213,6 +223,15 @@ public class TransferLibJobAppService
.ConfigureAwait(false); .ConfigureAwait(false);
var toLocationDto = var toLocationDto =
await _locationAppService.GetByCodeAsync(detail.HandledToLocationCode).ConfigureAwait(false); await _locationAppService.GetByCodeAsync(detail.HandledToLocationCode).ConfigureAwait(false);
//标包为空时赋值
if (detail.StdPackQty == 0)
{
var itemObj = itemLst.FirstOrDefault(itm => itm.Code == detail.ItemCode);
if (itemObj != null)
{
detail.StdPackQty = itemObj.StdPackQty;
}
}
detail.HandledFromLocationArea = fromLocationDto.AreaCode; detail.HandledFromLocationArea = fromLocationDto.AreaCode;
detail.HandledFromLocationCode = fromLocationDto.Code; detail.HandledFromLocationCode = fromLocationDto.Code;

Loading…
Cancel
Save