盘点没有箱库存 可以盘进库存
This commit is contained in:
@@ -193,6 +193,34 @@ namespace WMS.Web.Repositories
|
||||
{
|
||||
return await _context.BoxInventory.Include(x => x.Details).Where(x => x.BoxId == id).FirstOrDefaultAsync();
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加及时库存
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <param name="isTransaction"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task<BoxInventory> Add(BoxInventory entity, bool isTransaction = true)
|
||||
{
|
||||
IDbContextTransaction _transaction = null;
|
||||
if (isTransaction)
|
||||
_transaction = _context.Database.BeginTransaction();
|
||||
try
|
||||
{
|
||||
await _context.BoxInventory.AddAsync(entity);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
if (_transaction != null)
|
||||
_transaction.Commit();
|
||||
return entity;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_transaction != null)
|
||||
_transaction.Rollback();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量添加
|
||||
|
||||
Reference in New Issue
Block a user