forked from ddrilling/AsbCloudServer
Контроллер заглушка для суточного рапорта.
This commit is contained in:
parent
7b957d0edb
commit
9023aef984
216
AsbCloudApp/Data/DailyReportDto.cs
Normal file
216
AsbCloudApp/Data/DailyReportDto.cs
Normal file
@ -0,0 +1,216 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace AsbCloudApp.Data
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class DailyReportDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///название скважины
|
||||||
|
/// <summary>
|
||||||
|
public string WellName { get; set; }
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///название куста
|
||||||
|
///<summary>
|
||||||
|
public string ClusterName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///заказчик
|
||||||
|
///<summary>
|
||||||
|
public string Customer { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///подрядчик
|
||||||
|
///<summary>
|
||||||
|
public string Contractor { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///дата рапорта
|
||||||
|
///<summary>
|
||||||
|
public DateTime ReportDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///глубина забоя на дату начала интервала
|
||||||
|
///<summary>
|
||||||
|
public double? WellDepthIntervalStartDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///глубина забоя на дату окончания интервала
|
||||||
|
///<summary>
|
||||||
|
public double? WellDepthIntervalFinishDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Глубина забоя по стволу на окончание отчетного периода
|
||||||
|
///<summary>
|
||||||
|
public double? BottomholeDepth { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Глубина забоя по вертикали на дату окончания отчетного периода
|
||||||
|
///<summary>
|
||||||
|
public double? VerticalDepth { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Зeнитный угол на дату окончания отчетного периода
|
||||||
|
///<summary>
|
||||||
|
public double? ZenithAngle { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Азимутальный угол на дату окончания отчетного периода
|
||||||
|
///<summary>
|
||||||
|
public double? AzimuthAngle { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///ФИО бурильщиков
|
||||||
|
///<summary>
|
||||||
|
public string FirstDriller { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///ФИО бурильщиков
|
||||||
|
///<summary>
|
||||||
|
public string SecondDriller { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Время работы АПД
|
||||||
|
///<summary>
|
||||||
|
public double? WorkTimeSAUB { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Время работы спин мастер
|
||||||
|
///<summary>
|
||||||
|
public double? WorkTimeSpinMaster { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Время работы торк мастер
|
||||||
|
///<summary>
|
||||||
|
public double? WorkTimeTorkMaster { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///количество метров пробуренных с включенным АПД
|
||||||
|
///<summary>
|
||||||
|
public double? PenetrationSAUB { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///количество метров пробуренных с включенным Спин мастер
|
||||||
|
///<summary>
|
||||||
|
public double? PenetrationSpinMaster { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///количество метров пробуренных с включенным торк мастер
|
||||||
|
///<summary>
|
||||||
|
public double? PenetrationTorkMaster { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Количество запусков МСЕ
|
||||||
|
///<summary>
|
||||||
|
public int CountLaunchesMSE { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///КНБК описание
|
||||||
|
///<summary>
|
||||||
|
public string BHADescription { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Нормативное время на одну операцию по подготовке ствола скважины к наращиванию
|
||||||
|
///<summary>
|
||||||
|
public double? StandardTimeBarrelPreparation { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Нормативное время на одну операцию по наращиванию
|
||||||
|
///<summary>
|
||||||
|
public double? StandardTimeExtension { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Фактическое время проработок при подготовке ствола скважины к наращиванию.
|
||||||
|
///<summary>
|
||||||
|
public double? ActualTimeBarrelPreparation { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Фактическое время наращиваний
|
||||||
|
///<summary>
|
||||||
|
public double? ActualTimeExtension { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Режимы бурения в роторе
|
||||||
|
///<summary>
|
||||||
|
public IEnumerable<string> RotorDrillingModes { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///режимы бурения в слайде
|
||||||
|
///<summary>
|
||||||
|
public IEnumerable<string> SlideDrillingModes { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Количество метров пробуренных в роторе за отчетный период
|
||||||
|
///<summary>
|
||||||
|
public double? PenetrationInRotor { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Количество часов бурения в роторе за отчетный период
|
||||||
|
///<summary>
|
||||||
|
public double? NumberDrillingHours { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///средний диф перепад в роторе за отчетный период
|
||||||
|
///<summary>
|
||||||
|
public double? AVGDiffDropRotor { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///количество метров пробуренных в слайде за отчетный период
|
||||||
|
///<summary>
|
||||||
|
public double? PenetrationInSlide { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///время бурения в роторе за отчетный период
|
||||||
|
///<summary>
|
||||||
|
public double? DrillingTimeInRotor { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///средний диф перепад в слайде за отчетный период
|
||||||
|
///<summary>
|
||||||
|
public double? AVGDiffPressureSlide { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Плановая МСП за секцию
|
||||||
|
///<summary>
|
||||||
|
public double? SectionROPPlan { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Общее время бурения за секцию
|
||||||
|
///<summary>
|
||||||
|
public double? SectionDrillingTimeTotal { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Общая проходка за секцию
|
||||||
|
///<summary>
|
||||||
|
public double? SectionPenetrationTotal { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Количество наращиваний за отчетный период
|
||||||
|
///<summary>
|
||||||
|
public int ExtensionsCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Отклонение относительно ГГД
|
||||||
|
///<summary>
|
||||||
|
public double? DeviationFromTVD { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///указываются все причины, которые влияют на снижение МСП.
|
||||||
|
///<summary>
|
||||||
|
public string DeclinesReasonsROP { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///ФИО Мастера буровой
|
||||||
|
///<summary>
|
||||||
|
public string DrillingMaster { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///ФИО супервайзера
|
||||||
|
///<summary>
|
||||||
|
public string Supervisor { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -9,11 +9,13 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<None Remove="Services\DailyReport\DailyReportTemplate.xlsx" />
|
||||||
<None Remove="Services\WellOperationService\ScheduleReportTemplate.xlsx" />
|
<None Remove="Services\WellOperationService\ScheduleReportTemplate.xlsx" />
|
||||||
<None Remove="Services\WellOperationService\WellOperationImportTemplate.xlsx" />
|
<None Remove="Services\WellOperationService\WellOperationImportTemplate.xlsx" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Services\DailyReport\DailyReportTemplate.xlsx" />
|
||||||
<EmbeddedResource Include="Services\WellOperationService\ScheduleReportTemplate.xlsx" />
|
<EmbeddedResource Include="Services\WellOperationService\ScheduleReportTemplate.xlsx" />
|
||||||
<EmbeddedResource Include="Services\WellOperationService\WellOperationImportTemplate.xlsx" />
|
<EmbeddedResource Include="Services\WellOperationService\WellOperationImportTemplate.xlsx" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
Binary file not shown.
116
AsbCloudWebApi/Controllers/DailyReportController.cs
Normal file
116
AsbCloudWebApi/Controllers/DailyReportController.cs
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
using AsbCloudApp.Data;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.IO;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace AsbCloudWebApi.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/well/{idWell}/[controller]")]
|
||||||
|
[ApiController]
|
||||||
|
[Authorize]
|
||||||
|
public class DailyReportController : ControllerBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Список наборов данных для формирования рапорта
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idWell"></param>
|
||||||
|
/// <param name="begin"></param>
|
||||||
|
/// <param name="end"></param>
|
||||||
|
/// <param name="token"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
//[Permission]
|
||||||
|
[ProducesResponseType(typeof(IEnumerable<DailyReportDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
|
public async Task<IActionResult> GetListAsync(int idWell, DateTime? begin = null, DateTime? end = null, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(1);
|
||||||
|
var dto = new DailyReportDto
|
||||||
|
{
|
||||||
|
};
|
||||||
|
var result = new List<DailyReportDto> { dto };
|
||||||
|
return Ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// новый набор данных для формирования рапорта (на новую дату). Если в архиве на эту дату уже есть данные то вернуться они.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idWell"></param>
|
||||||
|
/// <param name="date"></param>
|
||||||
|
/// <param name="token"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("{date}")]
|
||||||
|
//[Permission]
|
||||||
|
[ProducesResponseType(typeof(DailyReportDto), (int)System.Net.HttpStatusCode.OK)]
|
||||||
|
public async Task<IActionResult> GetOrGenerateAsync(int idWell, [Required] DateTime date, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(1);
|
||||||
|
var dto = new DailyReportDto
|
||||||
|
{
|
||||||
|
ReportDate = date,
|
||||||
|
};
|
||||||
|
return Ok(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Сохранение нового набора данных для формирования рапорта
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idWell"></param>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <param name="token"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
//[Permission]
|
||||||
|
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
|
||||||
|
public async Task<IActionResult> AddAsync(int idWell, [Required] DailyReportDto dto, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(1);
|
||||||
|
return Ok(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Сохранение изменений набора данных для формирования рапорта
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idWell"></param>
|
||||||
|
/// <param name="date"></param>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <param name="token"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPut("{date}")]
|
||||||
|
//[Permission]
|
||||||
|
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
|
||||||
|
public async Task<IActionResult> UpdateAsync(int idWell, [Required] DateTime date, [Required] DailyReportDto dto, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(1);
|
||||||
|
return Ok(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Сформировать и скачать рапорт в формате excel
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idWell"></param>
|
||||||
|
/// <param name="token"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("{date}/excel")]
|
||||||
|
//[Permission]
|
||||||
|
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
|
||||||
|
public async Task<IActionResult> DownloadAsync(int idWell, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(1);
|
||||||
|
var stream = GetExcelTemplateStream();
|
||||||
|
var fileName = "CP.xlsx";
|
||||||
|
return File(stream, "application/octet-stream", fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Stream GetExcelTemplateStream()
|
||||||
|
{
|
||||||
|
var stream = System.Reflection.Assembly.GetExecutingAssembly()
|
||||||
|
.GetManifestResourceStream("AsbCloudInfrastructure.Services.WellOperationService.DailyReportTemplate.xlsx");
|
||||||
|
return stream;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user