增加重置箱接口
This commit is contained in:
@@ -379,5 +379,34 @@ namespace WMS.Web.Repositories
|
||||
|
||||
return _mapper.Map<List<SerialNumbers>>(res.Clone());
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据箱id批量删除
|
||||
/// </summary>
|
||||
/// <param name="boxIds"></param>
|
||||
/// <param name="isTransaction"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DeleteEntityList(List<int> boxIds, bool isTransaction = true)
|
||||
{
|
||||
IDbContextTransaction _transaction = null;
|
||||
if (isTransaction)
|
||||
_transaction = _context.Database.BeginTransaction();
|
||||
try
|
||||
{
|
||||
var res = await _context.SerialNumbers
|
||||
.Where(f => boxIds.Contains(f.BoxId)).ToListAsync();
|
||||
|
||||
_context.SerialNumbers.RemoveRange(res);
|
||||
await _context.SaveChangesAsync();
|
||||
if (_transaction != null)
|
||||
_transaction.Commit();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_transaction != null)
|
||||
_transaction.Rollback();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user