修复bug
This commit is contained in:
@@ -123,28 +123,29 @@ namespace WMS.Web.Domain.Services
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
IDbContextTransaction _transaction = _transactionRepositories.GetTransaction();
|
IDbContextTransaction _transaction = _transactionRepositories.GetTransaction();
|
||||||
bool isRollback = false;
|
Result res_Rollback = Result.ReSuccess();
|
||||||
bool isSuccess = true;
|
bool isSuccess = true;
|
||||||
//修改库存
|
//修改库存
|
||||||
var res_Inventory = await _boxInventoryService.HandlBoxInventory(inventoryList, false);
|
var res_Inventory = await _boxInventoryService.HandlBoxInventory(inventoryList, false);
|
||||||
if (!res_Inventory.IsSuccess) isRollback = true;
|
if (!res_Inventory.IsSuccess) res_Rollback = res_Inventory;
|
||||||
if (!isRollback)
|
if (res_Rollback.IsSuccess)
|
||||||
{
|
{
|
||||||
entity = await _outStockRepositories.Add(entity, false);
|
entity = await _outStockRepositories.Add(entity, false);
|
||||||
if (entity == null) isRollback = true;
|
if (entity == null) res_Rollback = Result.ReFailure(ResultCodes.DateWriteError);
|
||||||
}
|
}
|
||||||
if (!isRollback)
|
if (res_Rollback.IsSuccess)
|
||||||
{
|
{
|
||||||
outStockTask = await _outStockTaskRepositories.Edit(outStockTask, false);
|
outStockTask = await _outStockTaskRepositories.Edit(outStockTask, false);
|
||||||
if (outStockTask == null) isRollback = true;
|
if (outStockTask == null) res_Rollback = Result.ReFailure(ResultCodes.DateWriteError);
|
||||||
}
|
}
|
||||||
if (!isRollback)
|
if (res_Rollback.IsSuccess)
|
||||||
{
|
{
|
||||||
var res_change = await _serialNumberService.OutStock(entity, loginInfo, false);
|
var res_change = await _serialNumberService.OutStock(entity, loginInfo, false);
|
||||||
if (!res_change.IsSuccess) isRollback = true;
|
if (!res_change.IsSuccess) res_Rollback = res_change;
|
||||||
}
|
}
|
||||||
//提交事务
|
//提交事务
|
||||||
isSuccess = _transactionRepositories.CommitTransaction(isRollback, _transaction);
|
isSuccess = _transactionRepositories.CommitTransaction(res_Rollback.IsSuccess ? false : true, _transaction);
|
||||||
|
if (!res_Rollback.IsSuccess) return res_Rollback;
|
||||||
if (!isSuccess)
|
if (!isSuccess)
|
||||||
return Result.ReFailure(ResultCodes.DateWriteError);
|
return Result.ReFailure(ResultCodes.DateWriteError);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user