From bd5e4b0e714e111abed246952236761b9a732d59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=94?= =?UTF-8?q?=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=90=D0=BB=D0=B5=D0=BA?= =?UTF-8?q?=D1=81=D0=B0=D0=BD=D0=B4=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= <da.stepanov@digitaldrilling.ru> Date: Thu, 20 Jul 2023 15:53:46 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=BE=D1=80=D0=BC=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B0=D0=B2=D1=82=D0=BE=D0=BC?= =?UTF-8?q?=D0=B0=D1=82=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=B8=D1=85=20=D1=81?= =?UTF-8?q?=D1=83=D1=82=D0=BE=D1=87=D0=BD=D1=8B=D1=85=20=D0=BE=D1=82=D1=87?= =?UTF-8?q?=D1=91=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Добавлены Dto. 2. Создан контроллер с заглушками. --- .../AutoGeneratedDailyReportDto.cs | 45 ++++++++++++++++ .../AutogeneratedDailyReport/HeadBlockDto.cs | 44 ++++++++++++++++ .../LimitingParameterRecordDto.cs | 22 ++++++++ .../SubsystemRecordDto.cs | 27 ++++++++++ .../AutoGeneratedDailyReportController.cs | 52 +++++++++++++++++++ 5 files changed, 190 insertions(+) create mode 100644 AsbCloudApp/Data/AutogeneratedDailyReport/AutoGeneratedDailyReportDto.cs create mode 100644 AsbCloudApp/Data/AutogeneratedDailyReport/HeadBlockDto.cs create mode 100644 AsbCloudApp/Data/AutogeneratedDailyReport/LimitingParameterRecordDto.cs create mode 100644 AsbCloudApp/Data/AutogeneratedDailyReport/SubsystemRecordDto.cs create mode 100644 AsbCloudWebApi/Controllers/AutoGeneratedDailyReportController.cs 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; + +/// <summary> +/// DTO авто-сгенерированного суточного отчёта +/// </summary> +public class AutoGeneratedDailyReportDto +{ + /// <summary> + /// Дата формирования отчёта + /// </summary> + public DateOnly ReportDate { get; set; } + + /// <summary> + /// Название файла + /// </summary> + public string FileName { get; set; } = null!; + + /// <summary> + /// Начальная дата + /// </summary> + public DateOnly From { get; set; } + + /// <summary> + /// Конечная дата + /// </summary> + public DateOnly To { get; set; } + + /// <summary> + /// Блок заголовка + /// </summary> + public HeadBlockDto Head { get; set; } = null!; + + /// <summary> + /// Блок подсистем + /// </summary> + public IEnumerable<SubsystemRecordDto> Subsystems { get; set; } = null!; + + /// <summary> + /// Блок ограничивающих параметров + /// </summary> + public IEnumerable<LimitingParameterRecordDto> 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; + +/// <summary> +/// ���� ��������� +/// </summary> +public class HeadBlockDto +{ + /// <summary> + /// �������� �������� + /// </summary> + public string WellName { get; set; } = null!; + + /// <summary> + /// �������� ����� + /// </summary> + public string ClusterName { get; set; } = null!; + + /// <summary> + /// �������� + /// </summary> + public string Customer { get; set; } = null!; + + /// <summary> + /// ������������� + /// </summary> + public string Deposit { get; set; } = null!; + + /// <summary> + /// ���� ������� + /// </summary> + public DateTime ReportDate { get; set; } + + /// <summary> + /// ������� ����� �� ���� ������ ��������� + /// </summary> + public double WellDepthIntervalStartDate { get; set; } + + /// <summary> + /// ������� ����� �� ���� ��������� ��������� + /// </summary> + 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; + +/// <summary> +/// Блок ограничивающих параметров +/// </summary> +public class LimitingParameterRecordDto +{ + /// <summary> + /// Время использования, мин + /// </summary> + public double TotalHours { get; set; } + + /// <summary> + /// Название ограничивающего параметра + /// </summary> + public string NameFeedRegulator { get; set; } = null!; + + /// <summary> + /// Процент по проходке, % + /// </summary> + 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; + +/// <summary> +/// Блок подсистем +/// </summary> +public class SubsystemRecordDto +{ + /// <summary> + /// Название подсистемы + /// </summary> + public string Name { get; set; } = null!; + + /// <summary> + /// Использование, % + /// </summary> + public double KUsage { get; set; } + + /// <summary> + /// Время работы, ч + /// </summary> + public double UsedTimeHours { get; set; } + + /// <summary> + /// Проходка + /// </summary> + 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; + +/// <summary> +/// Контроллер для автоматически сгенерированных отчётов +/// </summary> +[ApiController] +[Route("api/well/{idWell}/[controller]")] +[Authorize] +public class AutoGeneratedDailyReportController : ControllerBase +{ + /// <summary> + /// Метод генерации отчёта + /// </summary> + /// <param name="idWell">Id скважины</param> + /// <param name="date">Дата работы системы</param> + /// <param name="cancellationToken"></param> + /// <returns></returns> + [HttpPost] + [Route("generate")] + [ProducesResponseType(typeof(PhysicalFileResult), (int)HttpStatusCode.OK)] + [ProducesResponseType(StatusCodes.Status204NoContent)] + public Task<IActionResult> GenerateAsync([FromRoute] int idWell, DateOnly date, CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } + + /// <summary> + /// Получение списка файлов отчёта + /// </summary> + /// <param name="idWell">Id скважины</param> + /// <param name="begin">Дата начала работ на скважине</param> + /// <param name="end">Дата окончания работ на скважине</param> + /// <param name="cancellationToken"></param> + /// <returns></returns> + [HttpGet] + [ProducesResponseType(typeof(IEnumerable<AutoGeneratedDailyReportDto>), (int)HttpStatusCode.OK)] + public Task<IActionResult> GetListAsync([FromRoute] int idWell, DateOnly? begin, DateOnly? end, + CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } +} \ No newline at end of file