2024-07-04 11:02:45 +05:00
|
|
|
using AsbCloudApp.Data;
|
2023-12-27 09:38:00 +05:00
|
|
|
using AsbCloudApp.Data.Progress;
|
2023-12-25 10:53:45 +05:00
|
|
|
using AsbCloudApp.Requests;
|
2021-07-21 15:29:19 +05:00
|
|
|
using System;
|
2021-05-31 12:33:17 +05:00
|
|
|
using System.Collections.Generic;
|
2021-08-11 16:54:42 +05:00
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
2021-05-18 12:33:23 +05:00
|
|
|
|
|
|
|
namespace AsbCloudApp.Services
|
|
|
|
{
|
2022-08-09 11:10:01 +05:00
|
|
|
/// <summary>
|
|
|
|
/// Сервис рапортов
|
|
|
|
/// </summary>
|
2021-05-18 12:33:23 +05:00
|
|
|
public interface IReportService
|
|
|
|
{
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Поставить рапорт в очередь на формирование
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="idWell"></param>
|
|
|
|
/// <param name="idUser"></param>
|
2023-12-25 10:53:45 +05:00
|
|
|
/// <param name="request"></param>
|
2022-08-09 11:10:01 +05:00
|
|
|
/// <param name="handleReportProgress"></param>
|
|
|
|
/// <returns></returns>
|
2023-12-25 10:53:45 +05:00
|
|
|
string EnqueueCreateReportWork(int idWell, int idUser, ReportParametersRequest request,
|
2022-02-17 15:37:27 +05:00
|
|
|
Action<object, string> handleReportProgress);
|
2022-08-09 11:10:01 +05:00
|
|
|
|
2023-12-25 15:47:03 +05:00
|
|
|
/// <summary>
|
|
|
|
/// Создание отчета
|
|
|
|
/// </summary>
|
2023-12-26 14:31:20 +05:00
|
|
|
/// <param name="workId"></param>
|
2023-12-25 15:47:03 +05:00
|
|
|
/// <param name="idWell"></param>
|
|
|
|
/// <param name="idUser"></param>
|
|
|
|
/// <param name="request"></param>
|
|
|
|
/// <param name="progressHandler"></param>
|
|
|
|
/// <param name="token"></param>
|
|
|
|
/// <returns></returns>
|
2023-12-27 09:38:00 +05:00
|
|
|
Task CreateReportAsync(string workId, int idWell, int idUser, ReportParametersRequest request, Action<ProgressDto, string> progressHandler, CancellationToken token);
|
2023-12-25 15:47:03 +05:00
|
|
|
|
2022-08-09 11:10:01 +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>
|
2024-03-21 17:16:16 +05:00
|
|
|
int GetReportPagesCount(int idWell, DateTimeOffset begin, DateTimeOffset end,
|
2021-07-27 16:55:32 +05:00
|
|
|
int stepSeconds, int format);
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// получить диапазон дат за которые есть данные
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="idWell"></param>
|
|
|
|
/// <returns></returns>
|
2022-12-02 14:48:23 +05:00
|
|
|
DatesRangeDto? GetDatesRangeOrDefault(int idWell);
|
2022-08-09 11:10:01 +05:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Список готовых рапортов
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="idWell"></param>
|
|
|
|
/// <param name="token"></param>
|
|
|
|
/// <returns></returns>
|
2022-01-05 17:50:45 +05:00
|
|
|
Task<IEnumerable<ReportPropertiesDto>> GetAllReportsByWellAsync(int idWell, CancellationToken token);
|
2023-11-08 17:12:53 +05:00
|
|
|
|
|
|
|
/// <summary>
|
2023-11-10 15:43:09 +05:00
|
|
|
/// Удаление отчетов, если превышен их период хранения
|
2023-11-08 17:12:53 +05:00
|
|
|
/// </summary>
|
2023-11-10 15:43:09 +05:00
|
|
|
/// <param name="lifetime">период хранения отчетов</param>
|
2023-11-08 17:12:53 +05:00
|
|
|
/// <param name="token"></param>
|
|
|
|
/// <returns></returns>
|
2023-11-10 15:39:52 +05:00
|
|
|
Task<int> DeleteAllOldReportsAsync(TimeSpan lifetime, CancellationToken token);
|
2021-05-18 12:33:23 +05:00
|
|
|
}
|
|
|
|
}
|