forked from ddrilling/AsbCloudServer
Незначительные переименования
This commit is contained in:
parent
e142e1eff5
commit
225d6ef827
@ -1,13 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
|
|
||||||
namespace AsbCloudApp.Data.ProcessMap
|
namespace AsbCloudApp.Data.ProcessMap
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// РТК
|
/// РТК
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ProcessMapDto : IId, IWellRelated
|
public class ProcessMapPlanDto : IId, IWellRelated
|
||||||
{
|
{
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
@ -13,16 +13,34 @@ namespace AsbCloudApp.Data.ProcessMap
|
|||||||
public int IdWell { get; set; }
|
public int IdWell { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Глубина по стволу, м
|
/// название секции скважины
|
||||||
|
/// </summary>
|
||||||
|
public int IdWellSectionType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// название секции скважины
|
||||||
|
/// </summary>
|
||||||
|
public string WellSectionTypeName { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Глубина по стволу от, м
|
||||||
/// <para>
|
/// <para>
|
||||||
/// на начало интервала
|
/// на начало интервала
|
||||||
/// </para>
|
/// </para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double DepthStart { get; set; }
|
public double DepthStart { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Глубина по стволу до, м
|
||||||
|
/// <para>
|
||||||
|
/// на конец интервала
|
||||||
|
/// </para>
|
||||||
|
/// </summary>
|
||||||
|
public double DepthEnd { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Дата/ время
|
/// Дата/ время
|
||||||
/// <para>
|
/// <para>
|
||||||
/// на начало интервала
|
/// на начало интервала
|
||||||
/// </para>
|
/// </para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -34,14 +52,9 @@ namespace AsbCloudApp.Data.ProcessMap
|
|||||||
public double MechDrillingHours { get; set; }
|
public double MechDrillingHours { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// название секции скважины
|
/// Режим бурения (Ротор/слайд/ручной)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int IdWellSectionType { get; set; }
|
public string DrillingMode { get; set; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// название секции скважины
|
|
||||||
/// </summary>
|
|
||||||
public string WellSectionTypeName { get; set; } = null!;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Проходка, м
|
/// Проходка, м
|
||||||
|
@ -34,6 +34,6 @@ namespace AsbCloudApp.Data.ProcessMap
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Процент бурения по уставке, %
|
/// Процент бурения по уставке, %
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double? PercDrillingSetpoint { get; set; }
|
public double? PercDrillingBySetpoint { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ namespace AsbCloudApp.Repositories
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// ÐÒÊ
|
/// ÐÒÊ
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IProcessMapRepository : IRepositoryWellRelated<ProcessMapDto>
|
public interface IProcessMapRepository : IRepositoryWellRelated<ProcessMapPlanDto>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ïîëó÷èòü ïàðàìåòðû áóðåíèÿ íà÷èíàÿ ñ äàòû.
|
/// Ïîëó÷èòü ïàðàìåòðû áóðåíèÿ íà÷èíàÿ ñ äàòû.
|
||||||
@ -20,7 +20,7 @@ namespace AsbCloudApp.Repositories
|
|||||||
/// <param name="updateFrom"></param>
|
/// <param name="updateFrom"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<IEnumerable<ProcessMapDto>> GetAllAsync(int idWell,
|
Task<IEnumerable<ProcessMapPlanDto>> GetAllAsync(int idWell,
|
||||||
DateTime? updateFrom, CancellationToken token = default);
|
DateTime? updateFrom, CancellationToken token = default);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -29,6 +29,6 @@ namespace AsbCloudApp.Repositories
|
|||||||
/// <param name="requests"></param>
|
/// <param name="requests"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<IEnumerable<ProcessMapDto>> GetProcessMapAsync(IEnumerable<ProcessMapRequest> requests, CancellationToken token);
|
Task<IEnumerable<ProcessMapPlanDto>> GetProcessMapAsync(IEnumerable<ProcessMapRequest> requests, CancellationToken token);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -34,6 +34,6 @@ namespace AsbCloudApp.Repositories
|
|||||||
/// <param name="idWell"></param>
|
/// <param name="idWell"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<IEnumerable<ProcessMapDto>> GetCompositeProcessMap(int idWell, CancellationToken token);
|
Task<IEnumerable<ProcessMapPlanDto>> GetCompositeProcessMap(int idWell, CancellationToken token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ using System.Threading.Tasks;
|
|||||||
namespace AsbCloudInfrastructure.Repository
|
namespace AsbCloudInfrastructure.Repository
|
||||||
{
|
{
|
||||||
#nullable enable
|
#nullable enable
|
||||||
public class ProcessMapRepository : CrudWellRelatedRepositoryBase<ProcessMapDto, ProcessMap>,
|
public class ProcessMapRepository : CrudWellRelatedRepositoryBase<ProcessMapPlanDto, ProcessMap>,
|
||||||
IProcessMapRepository
|
IProcessMapRepository
|
||||||
{
|
{
|
||||||
private readonly IWellService wellService;
|
private readonly IWellService wellService;
|
||||||
@ -32,7 +32,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
this.wellService = wellService;
|
this.wellService = wellService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IEnumerable<ProcessMapDto>> GetAllAsync(int idWell,
|
public async Task<IEnumerable<ProcessMapPlanDto>> GetAllAsync(int idWell,
|
||||||
DateTime? updateFrom, CancellationToken token)
|
DateTime? updateFrom, CancellationToken token)
|
||||||
{
|
{
|
||||||
var requests = new[]
|
var requests = new[]
|
||||||
@ -53,7 +53,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
return dtos;
|
return dtos;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IEnumerable<ProcessMapDto>> GetProcessMapAsync(IEnumerable<ProcessMapRequest> requests, CancellationToken token)
|
public async Task<IEnumerable<ProcessMapPlanDto>> GetProcessMapAsync(IEnumerable<ProcessMapRequest> requests, CancellationToken token)
|
||||||
{
|
{
|
||||||
var entities = await BuildQuery(requests)
|
var entities = await BuildQuery(requests)
|
||||||
.ToListAsync(token)
|
.ToListAsync(token)
|
||||||
@ -62,7 +62,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
return dtos;
|
return dtos;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async Task<int> InsertAsync(ProcessMapDto dto,
|
public override async Task<int> InsertAsync(ProcessMapPlanDto dto,
|
||||||
CancellationToken token)
|
CancellationToken token)
|
||||||
{
|
{
|
||||||
dto.LastUpdate = DateTime.UtcNow;
|
dto.LastUpdate = DateTime.UtcNow;
|
||||||
@ -70,7 +70,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async Task<int> UpdateAsync(ProcessMapDto dto,
|
public override async Task<int> UpdateAsync(ProcessMapPlanDto dto,
|
||||||
CancellationToken token)
|
CancellationToken token)
|
||||||
{
|
{
|
||||||
dto.LastUpdate = DateTime.UtcNow;
|
dto.LastUpdate = DateTime.UtcNow;
|
||||||
@ -105,9 +105,9 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
}
|
}
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
protected override ProcessMapDto Convert(ProcessMap entity)
|
protected override ProcessMapPlanDto Convert(ProcessMap entity)
|
||||||
{
|
{
|
||||||
var dto = entity.Adapt<ProcessMapDto>();
|
var dto = entity.Adapt<ProcessMapPlanDto>();
|
||||||
dto.LastUpdate = entity.LastUpdate.ToRemoteDateTime(entity.Well.Timezone.Hours);
|
dto.LastUpdate = entity.LastUpdate.ToRemoteDateTime(entity.Well.Timezone.Hours);
|
||||||
dto.AxialLoad = new PlanLimitDto
|
dto.AxialLoad = new PlanLimitDto
|
||||||
{
|
{
|
||||||
@ -137,7 +137,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override ProcessMap Convert(ProcessMapDto dto)
|
protected override ProcessMap Convert(ProcessMapPlanDto dto)
|
||||||
{
|
{
|
||||||
var entity = dto.Adapt<ProcessMap>();
|
var entity = dto.Adapt<ProcessMap>();
|
||||||
entity.AxialLoadPlan = dto.AxialLoad.Plan;
|
entity.AxialLoadPlan = dto.AxialLoad.Plan;
|
||||||
|
@ -50,7 +50,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public async Task<IEnumerable<ProcessMapDto>> GetCompositeProcessMap(int idWell, CancellationToken token)
|
public async Task<IEnumerable<ProcessMapPlanDto>> GetCompositeProcessMap(int idWell, CancellationToken token)
|
||||||
{
|
{
|
||||||
var dtos = await GetAsync(idWell, token);
|
var dtos = await GetAsync(idWell, token);
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
|
|||||||
.SetVal(dataParam.Limit);
|
.SetVal(dataParam.Limit);
|
||||||
|
|
||||||
sheet.Cell(row, column + columnOffsetPercent)
|
sheet.Cell(row, column + columnOffsetPercent)
|
||||||
.SetVal(dataParam.PercDrillingSetpoint);
|
.SetVal(dataParam.PercDrillingBySetpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void FillIntervalModeDataSpeed(IXLWorksheet sheet, ProcessMapReportParamsDto dataParam, int column, int row)
|
private static void FillIntervalModeDataSpeed(IXLWorksheet sheet, ProcessMapReportParamsDto dataParam, int column, int row)
|
||||||
@ -192,7 +192,7 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
|
|||||||
.SetVal(dataParam.Limit);
|
.SetVal(dataParam.Limit);
|
||||||
|
|
||||||
sheet.Cell(row, column + columnOffsetPercent)
|
sheet.Cell(row, column + columnOffsetPercent)
|
||||||
.SetVal(dataParam.PercDrillingSetpoint);
|
.SetVal(dataParam.PercDrillingBySetpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Stream GetExcelTemplateStream()
|
private static Stream GetExcelTemplateStream()
|
||||||
|
@ -96,7 +96,7 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
|
|||||||
|
|
||||||
private static IEnumerable<ProcessMapReportDto> HandleSection(
|
private static IEnumerable<ProcessMapReportDto> HandleSection(
|
||||||
IEnumerable<WellOperationDto> sectionOperations,
|
IEnumerable<WellOperationDto> sectionOperations,
|
||||||
IEnumerable<ProcessMapDto> sectionProcessMap,
|
IEnumerable<ProcessMapPlanDto> sectionProcessMap,
|
||||||
IEnumerable<TelemetryDataSaubStatDto> telemetryDataStat,
|
IEnumerable<TelemetryDataSaubStatDto> telemetryDataStat,
|
||||||
IEnumerable<LimitingParameterDataDto> limitingParameters,
|
IEnumerable<LimitingParameterDataDto> limitingParameters,
|
||||||
IEnumerable<SubsystemOperationTimeDto> subsystemsOperationTime)
|
IEnumerable<SubsystemOperationTimeDto> subsystemsOperationTime)
|
||||||
@ -116,7 +116,7 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
|
|||||||
private static ProcessMapReportDto MakeProcessMapReportDto(
|
private static ProcessMapReportDto MakeProcessMapReportDto(
|
||||||
(double min, double max) depthInterval,
|
(double min, double max) depthInterval,
|
||||||
IEnumerable<WellOperationDto> sectionOperations,
|
IEnumerable<WellOperationDto> sectionOperations,
|
||||||
IEnumerable<ProcessMapDto> sectionProcessMap,
|
IEnumerable<ProcessMapPlanDto> sectionProcessMap,
|
||||||
IEnumerable<TelemetryDataSaubStatDto> telemetryDataStat,
|
IEnumerable<TelemetryDataSaubStatDto> telemetryDataStat,
|
||||||
IEnumerable<LimitingParameterDataDto> limitingParameters,
|
IEnumerable<LimitingParameterDataDto> limitingParameters,
|
||||||
IEnumerable<SubsystemOperationTimeDto> subsystemsOperationTime)
|
IEnumerable<SubsystemOperationTimeDto> subsystemsOperationTime)
|
||||||
|
@ -105,7 +105,7 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
|
|
||||||
int? idSection = wellLastFactSection?.Id;
|
int? idSection = wellLastFactSection?.Id;
|
||||||
|
|
||||||
ProcessMapDto? welllProcessMap;
|
ProcessMapPlanDto? welllProcessMap;
|
||||||
if (idSection is not null)
|
if (idSection is not null)
|
||||||
{
|
{
|
||||||
welllProcessMap = wellProcessMaps.FirstOrDefault(p => p.IdWellSectionType == idSection);
|
welllProcessMap = wellProcessMaps.FirstOrDefault(p => p.IdWellSectionType == idSection);
|
||||||
|
@ -18,7 +18,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public class ProcessMapController : CrudWellRelatedController<ProcessMapDto, IProcessMapRepository>
|
public class ProcessMapController : CrudWellRelatedController<ProcessMapPlanDto, IProcessMapRepository>
|
||||||
{
|
{
|
||||||
private readonly ITelemetryService telemetryService;
|
private readonly ITelemetryService telemetryService;
|
||||||
private readonly IProcessMapReportService processMapReportService;
|
private readonly IProcessMapReportService processMapReportService;
|
||||||
@ -49,14 +49,14 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
[Obsolete("use GetByUidAsync(..) instead")]
|
[Obsolete("use GetByUidAsync(..) instead")]
|
||||||
[Route("/api/telemetry/{uid}/drillFlowChart")]
|
[Route("/api/telemetry/{uid}/drillFlowChart")]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[ProducesResponseType(typeof(IEnumerable<ProcessMapDto>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(IEnumerable<ProcessMapPlanDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public IActionResult GetByTelemetry(string uid, DateTime updateFrom, CancellationToken token)
|
public IActionResult GetByTelemetry(string uid, DateTime updateFrom, CancellationToken token)
|
||||||
{
|
{
|
||||||
var idWell = telemetryService.GetIdWellByTelemetryUid(uid);
|
var idWell = telemetryService.GetIdWellByTelemetryUid(uid);
|
||||||
if (idWell is null)
|
if (idWell is null)
|
||||||
return BadRequest($"Wrong uid {uid}");
|
return BadRequest($"Wrong uid {uid}");
|
||||||
|
|
||||||
var dto = Enumerable.Empty<ProcessMapDto>();
|
var dto = Enumerable.Empty<ProcessMapPlanDto>();
|
||||||
return Ok(dto);
|
return Ok(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("/api/telemetry/{uid}/processMap")]
|
[Route("/api/telemetry/{uid}/processMap")]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[ProducesResponseType(typeof(IEnumerable<ProcessMapDto>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(IEnumerable<ProcessMapPlanDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetByUidAsync(string uid, DateTime updateFrom, CancellationToken token)
|
public async Task<IActionResult> GetByUidAsync(string uid, DateTime updateFrom, CancellationToken token)
|
||||||
{
|
{
|
||||||
var idWell = telemetryService.GetIdWellByTelemetryUid(uid);
|
var idWell = telemetryService.GetIdWellByTelemetryUid(uid);
|
||||||
@ -133,7 +133,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public override async Task<ActionResult<int>> InsertAsync([FromBody] ProcessMapDto value, CancellationToken token)
|
public override async Task<ActionResult<int>> InsertAsync([FromBody] ProcessMapPlanDto value, CancellationToken token)
|
||||||
{
|
{
|
||||||
value.IdUser = User.GetUserId() ?? -1;
|
value.IdUser = User.GetUserId() ?? -1;
|
||||||
return await base.InsertAsync(value, token);
|
return await base.InsertAsync(value, token);
|
||||||
@ -146,7 +146,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns>1 - успешно отредактировано, 0 - нет</returns>
|
/// <returns>1 - успешно отредактировано, 0 - нет</returns>
|
||||||
[HttpPut]
|
[HttpPut]
|
||||||
public override async Task<ActionResult<int>> UpdateAsync([FromBody] ProcessMapDto value, CancellationToken token)
|
public override async Task<ActionResult<int>> UpdateAsync([FromBody] ProcessMapPlanDto value, CancellationToken token)
|
||||||
{
|
{
|
||||||
value.IdUser = User.GetUserId() ?? -1;
|
value.IdUser = User.GetUserId() ?? -1;
|
||||||
return await base.UpdateAsync(value, token);
|
return await base.UpdateAsync(value, token);
|
||||||
|
@ -73,7 +73,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("getCompositeProcessMap")]
|
[HttpGet("getCompositeProcessMap")]
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(IEnumerable<ProcessMapDto>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(IEnumerable<ProcessMapPlanDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetCompositeProcessMap(int idWell, CancellationToken token = default)
|
public async Task<IActionResult> GetCompositeProcessMap(int idWell, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
|
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
|
||||||
|
Loading…
Reference in New Issue
Block a user