diff --git a/AsbCloudApp/Data/AutogeneratedDailyReport/AutoGeneratedDailyReportDto.cs b/AsbCloudApp/Data/AutogeneratedDailyReport/AutoGeneratedDailyReportDto.cs new file mode 100644 index 00000000..234a80c1 --- /dev/null +++ b/AsbCloudApp/Data/AutogeneratedDailyReport/AutoGeneratedDailyReportDto.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; + +namespace AsbCloudApp.Data.AutogeneratedDailyReport; + +/// +/// DTO авто-сгенерированного суточного отчёта +/// +public class AutoGeneratedDailyReportDto +{ + /// + /// Дата формирования отчёта + /// + public DateOnly ReportDate { get; set; } + + /// + /// Название файла + /// + public string FileName { get; set; } = null!; + + /// + /// Начальная дата + /// + public DateOnly From { get; set; } + + /// + /// Конечная дата + /// + public DateOnly To { get; set; } + + /// + /// Блок заголовка + /// + public HeadBlockDto Head { get; set; } = null!; + + /// + /// Блок подсистем + /// + public IEnumerable Subsystems { get; set; } = null!; + + /// + /// Блок ограничивающих параметров + /// + public IEnumerable LimitingParameters { get; set; } = null!; +} \ No newline at end of file diff --git a/AsbCloudApp/Data/AutogeneratedDailyReport/HeadBlockDto.cs b/AsbCloudApp/Data/AutogeneratedDailyReport/HeadBlockDto.cs new file mode 100644 index 00000000..756abba1 --- /dev/null +++ b/AsbCloudApp/Data/AutogeneratedDailyReport/HeadBlockDto.cs @@ -0,0 +1,44 @@ +using System; + +namespace AsbCloudApp.Data.AutogeneratedDailyReport; + +/// +/// +/// +public class HeadBlockDto +{ + /// + /// + /// + public string WellName { get; set; } = null!; + + /// + /// + /// + public string ClusterName { get; set; } = null!; + + /// + /// + /// + public string Customer { get; set; } = null!; + + /// + /// + /// + public string Deposit { get; set; } = null!; + + /// + /// + /// + public DateTime ReportDate { get; set; } + + /// + /// + /// + public double WellDepthIntervalStartDate { get; set; } + + /// + /// + /// + public double WellDepthIntervalFinishDate { get; set; } +} \ No newline at end of file diff --git a/AsbCloudApp/Data/AutogeneratedDailyReport/LimitingParameterRecordDto.cs b/AsbCloudApp/Data/AutogeneratedDailyReport/LimitingParameterRecordDto.cs new file mode 100644 index 00000000..67172684 --- /dev/null +++ b/AsbCloudApp/Data/AutogeneratedDailyReport/LimitingParameterRecordDto.cs @@ -0,0 +1,22 @@ +namespace AsbCloudApp.Data.AutogeneratedDailyReport; + +/// +/// Блок ограничивающих параметров +/// +public class LimitingParameterRecordDto +{ + /// + /// Время использования, мин + /// + public double TotalHours { get; set; } + + /// + /// Название ограничивающего параметра + /// + public string NameFeedRegulator { get; set; } = null!; + + /// + /// Процент по проходке, % + /// + public double PercentDepth { get; set; } +} \ No newline at end of file diff --git a/AsbCloudApp/Data/AutogeneratedDailyReport/SubsystemRecordDto.cs b/AsbCloudApp/Data/AutogeneratedDailyReport/SubsystemRecordDto.cs new file mode 100644 index 00000000..34b2e4a7 --- /dev/null +++ b/AsbCloudApp/Data/AutogeneratedDailyReport/SubsystemRecordDto.cs @@ -0,0 +1,27 @@ +namespace AsbCloudApp.Data.AutogeneratedDailyReport; + +/// +/// Блок подсистем +/// +public class SubsystemRecordDto +{ + /// + /// Название подсистемы + /// + public string Name { get; set; } = null!; + + /// + /// Использование, % + /// + public double KUsage { get; set; } + + /// + /// Время работы, ч + /// + public double UsedTimeHours { get; set; } + + /// + /// Проходка + /// + public double Depth { get; set; } +} \ No newline at end of file diff --git a/AsbCloudWebApi/Controllers/AutoGeneratedDailyReportController.cs b/AsbCloudWebApi/Controllers/AutoGeneratedDailyReportController.cs new file mode 100644 index 00000000..aeb8b9f7 --- /dev/null +++ b/AsbCloudWebApi/Controllers/AutoGeneratedDailyReportController.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading; +using System.Threading.Tasks; +using AsbCloudApp.Data.AutogeneratedDailyReport; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace AsbCloudWebApi.Controllers; + +/// +/// Контроллер для автоматически сгенерированных отчётов +/// +[ApiController] +[Route("api/well/{idWell}/[controller]")] +[Authorize] +public class AutoGeneratedDailyReportController : ControllerBase +{ + /// + /// Метод генерации отчёта + /// + /// Id скважины + /// Дата работы системы + /// + /// + [HttpPost] + [Route("generate")] + [ProducesResponseType(typeof(PhysicalFileResult), (int)HttpStatusCode.OK)] + [ProducesResponseType(StatusCodes.Status204NoContent)] + public Task GenerateAsync([FromRoute] int idWell, DateOnly date, CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } + + /// + /// Получение списка файлов отчёта + /// + /// Id скважины + /// Дата начала работ на скважине + /// Дата окончания работ на скважине + /// + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)] + public Task GetListAsync([FromRoute] int idWell, DateOnly? begin, DateOnly? end, + CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } +} \ No newline at end of file