2024-04-10 15:05:20 +05:00
|
|
|
using System;
|
2024-03-14 11:05:58 +05:00
|
|
|
using System.Collections.Generic;
|
2024-03-14 10:30:25 +05:00
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using AsbCloudApp.Data;
|
|
|
|
using AsbCloudApp.Repositories;
|
|
|
|
using AsbCloudApp.Requests;
|
2024-03-14 15:18:02 +05:00
|
|
|
using AsbCloudApp.Requests.ExportOptions;
|
2024-03-14 10:30:25 +05:00
|
|
|
using AsbCloudApp.Services;
|
|
|
|
using AsbCloudInfrastructure.Services.ExcelServices;
|
|
|
|
|
|
|
|
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
|
|
|
|
|
2024-03-14 15:18:02 +05:00
|
|
|
public abstract class ProcessMapPlanExportService<TDto> : ExportExcelService<TDto, WellRelatedExportRequest>
|
2024-03-14 10:30:25 +05:00
|
|
|
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;
|
|
|
|
}
|
2024-03-14 15:18:02 +05:00
|
|
|
|
|
|
|
protected override async Task<IEnumerable<TDto>> GetDtosAsync(WellRelatedExportRequest options, CancellationToken token)
|
2024-03-14 11:05:58 +05:00
|
|
|
{
|
2024-04-10 15:05:20 +05:00
|
|
|
var request = new ProcessMapPlanBaseRequestWithWell(options.IdWell)
|
|
|
|
{
|
|
|
|
Moment = DateTimeOffset.UtcNow
|
|
|
|
};
|
|
|
|
|
2024-03-14 11:05:58 +05:00
|
|
|
var dtos = await processMapPlanRepository.Get(request, token);
|
|
|
|
return dtos;
|
|
|
|
}
|
2024-03-14 10:30:25 +05:00
|
|
|
}
|