Browse Source

修改bug

dev_DY_CC
刘云峰 11 months 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 IExpectOutAppService _expectOutAppService;
private readonly IBalanceAppService _balanceAppService;
private readonly IItemBasicAppService _itemBasicAppService;
protected ITransferLibRequestAppService TransferLibRequestAppService =>
LazyServiceProvider.LazyGetRequiredService<ITransferLibRequestAppService>();
@ -34,13 +35,15 @@ public class TransferLibJobAppService
public TransferLibJobAppService(
ITransferLibJobRepository repository, ITransferLibJobManager TransferLibJobManager,
IServiceProvider serviceProvider, ILocationAppService locationAppService,
IExpectOutAppService expectOutAppService, IBalanceAppService balanceAppService) : base(repository,
TransferLibJobManager)
IExpectOutAppService expectOutAppService, IBalanceAppService balanceAppService,
IItemBasicAppService itemBasicAppService) :
base(repository, TransferLibJobManager)
{
_serviceProvider = serviceProvider;
_locationAppService = locationAppService;
_expectOutAppService = expectOutAppService;
_balanceAppService = balanceAppService;
_itemBasicAppService = itemBasicAppService;
}
/// <summary>
@ -202,6 +205,13 @@ public class TransferLibJobAppService
#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)
{
detail.HandledFromContainerCode = string.Empty;
@ -213,6 +223,15 @@ public class TransferLibJobAppService
.ConfigureAwait(false);
var toLocationDto =
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.HandledFromLocationCode = fromLocationDto.Code;

Loading…
Cancel
Save