DD.WellWorkover.Cloud/AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanExportService.cs
Степанов Дмитрий ed2d4ae01b Фикс экспорта
2024-04-10 13:05:20 +03:00

38 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using AsbCloudApp.Data;
using AsbCloudApp.Repositories;
using AsbCloudApp.Requests;
using AsbCloudApp.Requests.ExportOptions;
using AsbCloudApp.Services;
using AsbCloudInfrastructure.Services.ExcelServices;
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
public abstract class ProcessMapPlanExportService<TDto> : ExportExcelService<TDto, WellRelatedExportRequest>
where TDto : ChangeLogAbstract
{
protected readonly IWellService wellService;
private readonly IChangeLogRepository<TDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository;
protected ProcessMapPlanExportService(IChangeLogRepository<TDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
IWellService wellService)
{
this.processMapPlanRepository = processMapPlanRepository;
this.wellService = wellService;
}
protected override async Task<IEnumerable<TDto>> GetDtosAsync(WellRelatedExportRequest options, CancellationToken token)
{
var request = new ProcessMapPlanBaseRequestWithWell(options.IdWell)
{
Moment = DateTimeOffset.UtcNow
};
var dtos = await processMapPlanRepository.Get(request, token);
return dtos;
}
}