增加留存字段
This commit is contained in:
@@ -36,11 +36,12 @@ namespace WMS.Web.Domain.Services
|
||||
private readonly IErpService _erpService;
|
||||
private readonly ISerialNumberService _serialNumberService;
|
||||
private readonly IBoxInventoryService _boxInventoryService;
|
||||
private readonly IInventoryInOutDetailsService _inventoryInOutDetailsService;
|
||||
public OutStockService(IMapper mapper, ILoginService loginService,
|
||||
IBasicsRepositories transactionRepositories,
|
||||
IOutStockRepositories outStockRepositories, IOutStockTaskRepositories outStockTaskRepositories,
|
||||
IOutStockTaskService outStockTaskService, IErpService erpService, ISerialNumberService serialNumberService,
|
||||
IBoxInventoryService boxInventoryService)
|
||||
IBoxInventoryService boxInventoryService, IInventoryInOutDetailsService inventoryInOutDetailsService)
|
||||
{
|
||||
_mapper = mapper;
|
||||
_loginService = loginService;
|
||||
@@ -51,6 +52,7 @@ namespace WMS.Web.Domain.Services
|
||||
_erpService = erpService;
|
||||
_serialNumberService = serialNumberService;
|
||||
_boxInventoryService = boxInventoryService;
|
||||
_inventoryInOutDetailsService = inventoryInOutDetailsService;
|
||||
}
|
||||
/// <summary>
|
||||
/// 出库单
|
||||
@@ -120,6 +122,19 @@ namespace WMS.Web.Domain.Services
|
||||
};
|
||||
inventoryList.Add(inventory);
|
||||
}
|
||||
|
||||
List<InventoryInOutDetailsGenerateDto> generateList = dto.Details.Select(s => new InventoryInOutDetailsGenerateDto()
|
||||
{
|
||||
BoxId = s.BoxId,
|
||||
InventoryInOutType = 2,
|
||||
OrderBillNo = outStockTask.BillNo,
|
||||
Qty = s.Qty,
|
||||
StockCode = outStockTask.StockCode,
|
||||
MaterialId = s.MaterialId,
|
||||
SubStockId = s.SubStockId,
|
||||
OrgCode = outStockTask.OrgCode,
|
||||
OrderType = 1,
|
||||
}).ToList();
|
||||
#endregion
|
||||
|
||||
IDbContextTransaction _transaction = _transactionRepositories.GetTransaction();
|
||||
@@ -143,6 +158,11 @@ namespace WMS.Web.Domain.Services
|
||||
var res_change = await _serialNumberService.OutStock(entity, loginInfo, false);
|
||||
if (!res_change.IsSuccess) res_Rollback = res_change;
|
||||
}
|
||||
if (res_Rollback.IsSuccess)
|
||||
{
|
||||
res_Inventory = await _inventoryInOutDetailsService.GenerateInOrOutDetails(generateList, false);
|
||||
if (!res_Inventory.IsSuccess) res_Rollback = res_Inventory;
|
||||
}
|
||||
//提交事务
|
||||
isSuccess = _transactionRepositories.CommitTransaction(res_Rollback.IsSuccess ? false : true, _transaction);
|
||||
if (!res_Rollback.IsSuccess) return res_Rollback;
|
||||
|
||||
Reference in New Issue
Block a user