DD.WellWorkover.Cloud/AsbCloudApp/Services/IReportService.cs

75 lines
2.6 KiB
C#
Raw Normal View History

using AsbCloudApp.Data;
using AsbCloudApp.Data.Progress;
using AsbCloudApp.Requests;
2021-07-21 15:29:19 +05:00
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
2024-08-19 10:01:07 +05:00
namespace AsbCloudApp.Services;
/// <summary>
/// Сервис рапортов
/// </summary>
public interface IReportService
{
2024-08-19 10:01:07 +05:00
2022-08-09 11:10:01 +05:00
/// <summary>
2024-08-19 10:01:07 +05:00
/// Поставить рапорт в очередь на формирование
2022-08-09 11:10:01 +05:00
/// </summary>
2024-08-19 10:01:07 +05:00
/// <param name="idWell"></param>
/// <param name="idUser"></param>
/// <param name="request"></param>
/// <param name="handleReportProgress"></param>
/// <returns></returns>
string EnqueueCreateReportWork(int idWell, int idUser, ReportParametersRequest request,
Action<object, string> handleReportProgress);
2022-08-09 11:10:01 +05:00
2024-08-19 10:01:07 +05:00
/// <summary>
/// Создание отчета
/// </summary>
/// <param name="workId"></param>
/// <param name="idWell"></param>
/// <param name="idUser"></param>
/// <param name="request"></param>
/// <param name="progressHandler"></param>
/// <param name="token"></param>
/// <returns></returns>
Task CreateReportAsync(string workId, int idWell, int idUser, ReportParametersRequest request, Action<ProgressDto, string> progressHandler, CancellationToken token);
2024-08-19 10:01:07 +05:00
/// <summary>
/// Получить предполагаемый список страниц рапорта
/// </summary>
/// <param name="idWell"></param>
/// <param name="begin"></param>
/// <param name="end"></param>
/// <param name="stepSeconds"></param>
/// <param name="format"></param>
/// <returns></returns>
int GetReportPagesCount(int idWell, DateTimeOffset begin, DateTimeOffset end,
int stepSeconds, int format);
2022-08-09 11:10:01 +05:00
2024-08-19 10:01:07 +05:00
/// <summary>
/// получить диапазон дат за которые есть данные
/// </summary>
/// <param name="idWell"></param>
/// <returns></returns>
DatesRangeDto? GetDatesRangeOrDefault(int idWell);
2022-08-09 11:10:01 +05:00
2024-08-19 10:01:07 +05:00
/// <summary>
/// Список готовых рапортов
/// </summary>
/// <param name="idWell"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<ReportPropertiesDto>> GetAllReportsByWellAsync(int idWell, CancellationToken token);
2024-08-19 10:01:07 +05:00
/// <summary>
/// Удаление отчетов, если превышен их период хранения
/// </summary>
/// <param name="lifetime">период хранения отчетов</param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> DeleteAllOldReportsAsync(TimeSpan lifetime, CancellationToken token);
}