Browse Source

更新寄售库存接口,添加0库存删除

master
wanggang 1 year ago
parent
commit
4aeea4a94b
  1. 18
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

18
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

@ -208,7 +208,14 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
var qty = balance.Qty + data.Qty;
balance.InjectFrom(data);
balance.Qty = qty;
this._balanceRepository.UpdateAsync(balance).Wait();
if (balance.Qty == decimal.Zero)
{
await this._balanceRepository.DeleteAsync(balance).ConfigureAwait(false);
}
else
{
await this._balanceRepository.UpdateAsync(balance).ConfigureAwait(false);
}
}
await _logRepository.InsertAsync(log).ConfigureAwait(false);
}
@ -253,7 +260,14 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
{
var qty = balance.Qty - data.Qty;
balance.Qty = qty;
this._balanceRepository.UpdateAsync(balance).Wait();
if (balance.Qty == decimal.Zero)
{
await this._balanceRepository.DeleteAsync(balance).ConfigureAwait(false);
}
else
{
await this._balanceRepository.UpdateAsync(balance).ConfigureAwait(false);
}
}
await _logRepository.InsertAsync(log).ConfigureAwait(false);
}

Loading…
Cancel
Save