forked from ddrilling/AsbCloudServer
Формирование автоматических суточных отчётов
1. Добавлены Dto. 2. Создан контроллер с заглушками.
This commit is contained in:
parent
f02346a24a
commit
bd5e4b0e71
@ -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!;
|
||||||
|
}
|
44
AsbCloudApp/Data/AutogeneratedDailyReport/HeadBlockDto.cs
Normal file
44
AsbCloudApp/Data/AutogeneratedDailyReport/HeadBlockDto.cs
Normal file
@ -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; }
|
||||||
|
}
|
@ -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; }
|
||||||
|
}
|
@ -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; }
|
||||||
|
}
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user