修复bug

This commit is contained in:
18942506660
2024-01-03 14:59:40 +08:00
parent 52dc793d50
commit c12a45bc61

View File

@@ -47,13 +47,14 @@ namespace WMS.Web.Domain.Services
private readonly IBoxRepositories _boxRepositories; private readonly IBoxRepositories _boxRepositories;
private readonly ISingleDataService _singleDataService; private readonly ISingleDataService _singleDataService;
private readonly IServiceScopeFactory _serviceScopeFactory; private readonly IServiceScopeFactory _serviceScopeFactory;
private readonly IInStockTaskBoxService _inStockTaskService;
public OutStockService(IMapper mapper, ILoginService loginService, public OutStockService(IMapper mapper, ILoginService loginService,
IBasicsRepositories transactionRepositories, IBasicsRepositories transactionRepositories,
IOutStockRepositories outStockRepositories, IOutStockTaskRepositories outStockTaskRepositories, IOutStockRepositories outStockRepositories, IOutStockTaskRepositories outStockTaskRepositories,
IOutStockTaskService outStockTaskService, IErpService erpService, ISerialNumberService serialNumberService, IOutStockTaskService outStockTaskService, IErpService erpService, ISerialNumberService serialNumberService,
IBoxInventoryService boxInventoryService, IInventoryInOutDetailsService inventoryInOutDetailsService, IBoxInventoryService boxInventoryService, IInventoryInOutDetailsService inventoryInOutDetailsService,
IBoxInventoryRepositories boxInventoryRepositories, ILogger<OutStockService> logger, IBoxRepositories boxRepositories, IBoxInventoryRepositories boxInventoryRepositories, ILogger<OutStockService> logger, IBoxRepositories boxRepositories,
ISingleDataService singleDataService, IServiceScopeFactory serviceScopeFactory) ISingleDataService singleDataService, IServiceScopeFactory serviceScopeFactory, IInStockTaskBoxService inStockTaskService)
{ {
_mapper = mapper; _mapper = mapper;
_loginService = loginService; _loginService = loginService;
@@ -70,6 +71,7 @@ namespace WMS.Web.Domain.Services
_boxRepositories = boxRepositories; _boxRepositories = boxRepositories;
_singleDataService = singleDataService; _singleDataService = singleDataService;
_serviceScopeFactory = serviceScopeFactory; _serviceScopeFactory = serviceScopeFactory;
_inStockTaskService = inStockTaskService;
} }
/// <summary> /// <summary>
/// 出库单 /// 出库单
@@ -192,6 +194,12 @@ namespace WMS.Web.Domain.Services
var res_Inventory = await _boxInventoryService.GenerateOutStockBox(entity, false); var res_Inventory = await _boxInventoryService.GenerateOutStockBox(entity, false);
if (!res_Inventory.IsSuccess) res_Rollback = res_Inventory; if (!res_Inventory.IsSuccess) res_Rollback = res_Inventory;
} }
if (res_Rollback.IsSuccess)
{
var res_InStockTask = await _inStockTaskService.UnBind(boxIds, false);
if (!res_InStockTask.IsSuccess) res_Rollback = res_InStockTask;
}
//提交事务 //提交事务
isSuccess = _transactionRepositories.CommitTransaction(res_Rollback.IsSuccess ? false : true, _transaction); isSuccess = _transactionRepositories.CommitTransaction(res_Rollback.IsSuccess ? false : true, _transaction);
if (!res_Rollback.IsSuccess) return res_Rollback; if (!res_Rollback.IsSuccess) return res_Rollback;