移箱调整
This commit is contained in:
@@ -147,15 +147,11 @@ namespace WMS.Web.Domain.Services
|
|||||||
entity.Create(IsUp == true ? MoveBoxType.Up : MoveBoxType.Down, d.BoxId, subStock?.ErpOrgCode, subStock?.StockCode, d.SubStockId, loginInfo.UserInfo.StaffId);
|
entity.Create(IsUp == true ? MoveBoxType.Up : MoveBoxType.Down, d.BoxId, subStock?.ErpOrgCode, subStock?.StockCode, d.SubStockId, loginInfo.UserInfo.StaffId);
|
||||||
entityList.Add(entity);
|
entityList.Add(entity);
|
||||||
}
|
}
|
||||||
var inventoryList = _mapper.Map<List<BoxInventoryMoveGenerateDto>>(dto);
|
|
||||||
inventoryList.ForEach(f => f.InventoryInOutType = IsUp == true ? 1 : 2);
|
|
||||||
|
|
||||||
IDbContextTransaction _transaction = _basbicsRepositories.GetTransaction();
|
IDbContextTransaction _transaction = _basbicsRepositories.GetTransaction();
|
||||||
bool isSuccess = true;
|
bool isSuccess = true;
|
||||||
Result res_Rollback = Result.ReSuccess();
|
Result res_Rollback = Result.ReSuccess();
|
||||||
var res_Inventory = await _boxInventoryService.GenerateMoveBox(inventoryList, false);
|
|
||||||
if (!res_Inventory.IsSuccess) res_Rollback = res_Inventory;
|
|
||||||
|
|
||||||
if (res_Rollback.IsSuccess)
|
if (res_Rollback.IsSuccess)
|
||||||
{
|
{
|
||||||
isSuccess = await _moveBoxRecordRepositories.AddRange(entityList, false);
|
isSuccess = await _moveBoxRecordRepositories.AddRange(entityList, false);
|
||||||
@@ -166,6 +162,11 @@ namespace WMS.Web.Domain.Services
|
|||||||
var res_change = await _serialNumberService.MoveBox(entityList, loginInfo, false);
|
var res_change = await _serialNumberService.MoveBox(entityList, loginInfo, false);
|
||||||
if (!res_change.IsSuccess) res_Rollback = res_change;
|
if (!res_change.IsSuccess) res_Rollback = res_change;
|
||||||
}
|
}
|
||||||
|
if(res_Rollback.IsSuccess)
|
||||||
|
{
|
||||||
|
var res_Inventory = await _boxInventoryService.GenerateMoveBox(entityList, false);
|
||||||
|
if (!res_Inventory.IsSuccess) res_Rollback = res_Inventory;
|
||||||
|
}
|
||||||
//提交事务
|
//提交事务
|
||||||
isSuccess = _basbicsRepositories.CommitTransaction(res_Rollback.IsSuccess ? false : true, _transaction);
|
isSuccess = _basbicsRepositories.CommitTransaction(res_Rollback.IsSuccess ? false : true, _transaction);
|
||||||
if (!res_Rollback.IsSuccess) return res_Rollback;
|
if (!res_Rollback.IsSuccess) return res_Rollback;
|
||||||
|
|||||||
Reference in New Issue
Block a user