Browse Source

Merge branch 'dev_DY_CC' of http://dev.ccwin-in.com:3000/BoXu.Zheng/WZC2 into dev_DY_CC

dev_DY_CC
郑勃旭 4 months ago
parent
commit
6d60f695b6
  1. 36
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs

36
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs

@ -96,6 +96,10 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
+ $"在实际库存中查询到【ERP料号】{balanceDto.ItemCode}【库位】{balanceDto.LocationCode}【箱码】{balanceDto.PackingCode}【状态】{balanceDto.Status}【数量】{balanceDto.Qty}" + $"在实际库存中查询到【ERP料号】{balanceDto.ItemCode}【库位】{balanceDto.LocationCode}【箱码】{balanceDto.PackingCode}【状态】{balanceDto.Status}【数量】{balanceDto.Qty}"
+ $"【库存不足】"); + $"【库存不足】");
} }
} }
} }
@ -111,6 +115,8 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
var fromLocationDto = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false); var fromLocationDto = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false);
await CheckPackingCode(balanceDto.PackingCode).ConfigureAwait(false);
CheckLocation(toLocationDto, detail); CheckLocation(toLocationDto, detail);
CheckFromLocation(fromLocationDto, detail); CheckFromLocation(fromLocationDto, detail);
if (toLocationDto.Type != fromLocationDto.Type) if (toLocationDto.Type != fromLocationDto.Type)
@ -150,6 +156,9 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
detail.ToLocationArea = balanceDto.LocationArea; detail.ToLocationArea = balanceDto.LocationArea;
detail.ToStatus = balanceDto.Status; detail.ToStatus = balanceDto.Status;
detail.ToLot = balanceDto.Lot; detail.ToLot = balanceDto.Lot;
} }
} }
} }
@ -157,6 +166,17 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
return dictionary; return dictionary;
} }
private async Task CheckPackingCode(string packingCode)
{
var packingcode = await _expectOutAppService.GetListByPackingCodeAsync(packingCode).ConfigureAwait(false);
if (packingcode != null)
{
throw new UserFriendlyException($"箱码{packingCode}在预计出中已存在!");
}
}
/// <summary> /// <summary>
/// 拆箱 /// 拆箱
/// </summary> /// </summary>
@ -394,6 +414,13 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
+ $"【库存不足】"); + $"【库存不足】");
} }
} }
foreach (var detail in entity.Details)
{
if (!string.IsNullOrEmpty(detail.FromPackingCode))
{
await CheckPackingCode(detail.FromPackingCode).ConfigureAwait(false);
}
}
entity =await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false); entity =await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false);
@ -428,6 +455,15 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
+ $"【库存不足】"); + $"【库存不足】");
} }
} }
foreach (var detail in entity.Details)
{
if (!string.IsNullOrEmpty(detail.FromPackingCode))
{
await CheckPackingCode(detail.FromPackingCode).ConfigureAwait(false);
}
}
resultEntity.Add(await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false)); resultEntity.Add(await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false));
_ = ObjectMapper.Map<TransferNote, TransferNoteDTO>(entity); _ = ObjectMapper.Map<TransferNote, TransferNoteDTO>(entity);

Loading…
Cancel
Save