Browse Source

增加 合箱标包校验

Agv分支2024-11-19
郑勃旭 4 months ago
parent
commit
6d01cdc9bd
  1. 17
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs
  2. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/OperationPacking/IntegrationPackingNotes/IntegrationPackingNoteAppService.cs

17
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs

@ -950,14 +950,25 @@ public class CoatingIssueJobAppService
}
try
{
foreach (var detail in entity.Details)
{
var detailDto = new CoatingIssueJobDetailDTO();
if (!string.IsNullOrEmpty(detail.TransferLibFromLocationCode))
{
//库移的最终目标 挪到 推荐的目标
var fromloc = await _locationAppService.GetByCodeAsync(detail.TransferLibToLocationCode).ConfigureAwait(false);
var fromloc = new LocationDTO();
if (detail.TransferLibFromLocationCode == detail.RecommendFromLocationCode &&
detail.TransferLibToLocationCode == detail.RecommendToLocationCode)
{
//库移的最终目标 挪到 推荐的目标
fromloc = await _locationAppService.GetByCodeAsync(detail.RecommendFromLocationCode).ConfigureAwait(false);
}
else
{
//库移的最终目标 挪到 推荐的目标
fromloc = await _locationAppService.GetByCodeAsync(detail.TransferLibToLocationCode).ConfigureAwait(false);
}
var toloc = await _locationAppService.GetByCodeAsync(detail.RecommendToLocationCode).ConfigureAwait(false);
detailDto.InjectFrom(detail);

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/OperationPacking/IntegrationPackingNotes/IntegrationPackingNoteAppService.cs

@ -93,6 +93,7 @@ public class IntegrationPackingNoteAppService :
entity = await _repository.InsertAsync(entity).ConfigureAwait(false);
var balanceDetailDtos = new List<BalanceDTO>();
foreach (var detailInput in input.Details)
{
var balanceDetailDto=await _balanceAppService.GetByPackingCodeAsync(detailInput.PackingCode).ConfigureAwait(false);
@ -106,6 +107,12 @@ public class IntegrationPackingNoteAppService :
await BuildTransferLogsAsync(entity, detailInput)
.ConfigureAwait(false);
transferLogEditInputs.Add(transferLogEditInput);
balanceDetailDtos.Add(balanceDetailDto);
}
if (balanceDetailDtos.Sum(p=>p.Qty) > input.StdPackQty)
{
throw new UserFriendlyException($"合箱数量超过标包");
}
await _transferLogAppService.AddManyAsync(transferLogEditInputs).ConfigureAwait(false);

Loading…
Cancel
Save