修复bug

This commit is contained in:
18942506660
2024-04-23 17:57:37 +08:00
parent 1cfe4e0c93
commit 68ad217906

View File

@@ -41,7 +41,7 @@ namespace WMS.Web.Domain.Services
private readonly RedisClientService _redisClientService;
private readonly IErpBasicDataExtendService _erpBasicDataExtendService;
private readonly ISingleDataService _singleDataService;
private readonly IBoxRepositories _boxRepositories;
private IBoxRepositories _boxRepositories;
private readonly IExportExcelService _exportExcelService;
private readonly IServiceScopeFactory _serviceScopeFactory;
@@ -461,11 +461,12 @@ namespace WMS.Web.Domain.Services
/// <returns></returns>
public async Task<Result<OutStockTaskInfoResponse>> GetInfo(int id, LoginInDto loginInfo, IServiceScope scope = null)
{
if (scope == null)
if (scope != null)
{
_outStockTaskRepositories = scope.ServiceProvider.GetRequiredService<IOutStockTaskRepositories>();
_outStockRepositories = scope.ServiceProvider.GetRequiredService<IOutStockRepositories>();
_erpService = scope.ServiceProvider.GetRequiredService<IErpService>();
_boxRepositories= scope.ServiceProvider.GetRequiredService<IBoxRepositories>();
}
var entity = await _outStockTaskRepositories.Get(id);
@@ -486,10 +487,10 @@ namespace WMS.Web.Domain.Services
if (customer_result.IsSuccess)
customers = customer_result.Data.ToList();
var materials_result = await _erpService.BillQueryForMaterial();
//var materials_result = await _erpService.BillQueryForMaterial();
List<ErpMaterialDto> materials = new List<ErpMaterialDto>();
if (materials_result.IsSuccess)
materials = materials_result.Data.ToList();
//if (materials_result.IsSuccess)
// materials = materials_result.Data.ToList();
OutStockTaskInfoResponse response = new OutStockTaskInfoResponse()
{
@@ -539,6 +540,8 @@ namespace WMS.Web.Domain.Services
/// <param name="dto"></param>
/// <returns></returns>
public async Task ExportInfo(OperateRequest dto, string fileName, LoginInDto loginInfo)
{
try
{
var ids = dto.Ids.Distinct().ToList();
using (var scope = _serviceScopeFactory.CreateScope())
@@ -593,5 +596,10 @@ namespace WMS.Web.Domain.Services
await _exportExcelService.Export(list, fileName, loginInfo.UserInfo.StaffId, loginInfo.UserInfo.CompanyId, FileDownLoadOrderType.OutStockTaskInfo);
}
}
catch (Exception ex)
{
throw ex;
}
}
}
}