|
|
@ -192,6 +192,15 @@ public class BalanceManager : DomainService, IBalanceManager |
|
|
|
Logger.LogDebug($"{transaction.DocNumber}|BeforeOutBound:{existBalance}"); |
|
|
|
if (transaction.ManageType == EnumItemManageType.SingleUnit) |
|
|
|
{ |
|
|
|
if (existBalance == null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"库位在{transaction.LocationCode}," + |
|
|
|
$"物品编号为{transaction.ItemCode}," + |
|
|
|
$"箱码为{transaction.PackingCode}," + |
|
|
|
$"批次为{transaction.Lot}," + |
|
|
|
$"状态为{transaction.Status.GetDisplayName()}" + |
|
|
|
$"的库存未找到"); |
|
|
|
} |
|
|
|
//检查出库数量与库存数量是否一致
|
|
|
|
transaction.CheckSingleUnitQtyEqual(existBalance.Qty); |
|
|
|
|
|
|
@ -263,6 +272,16 @@ public class BalanceManager : DomainService, IBalanceManager |
|
|
|
balance.Status |
|
|
|
).ConfigureAwait(false); |
|
|
|
|
|
|
|
if (existBalance == null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"库位在{balance.LocationCode}," + |
|
|
|
$"物品编号为{balance.ItemCode}," + |
|
|
|
$"箱码为{balance.PackingCode}," + |
|
|
|
$"批次为{balance.Lot}," + |
|
|
|
$"状态为{balance.Status.GetDisplayName()}" + |
|
|
|
$"的库存未找到"); |
|
|
|
} |
|
|
|
|
|
|
|
//if (!existBalance.IsActive)
|
|
|
|
//{
|
|
|
|
// throw new UserFriendlyException(
|
|
|
@ -318,9 +337,8 @@ public class BalanceManager : DomainService, IBalanceManager |
|
|
|
|
|
|
|
protected virtual async Task<Balance> GetFirstAsync(string packingCode, string itemCode, string lot, string locationCode, EnumInventoryStatus enumInventoryStatus) |
|
|
|
{ |
|
|
|
|
|
|
|
var balance = await _balanceRepository |
|
|
|
.FindAsync(p => p.ItemCode == itemCode |
|
|
|
.FirstOrDefaultAsync(p => p.ItemCode == itemCode |
|
|
|
&& p.LocationCode == locationCode |
|
|
|
&& p.Lot == lot |
|
|
|
&& p.PackingCode == packingCode |
|
|
|