2024-07-04 11:02:45 +05:00
|
|
|
|
using AsbCloudApp.Data.Trajectory;
|
2023-02-13 09:10:48 +05:00
|
|
|
|
using AsbCloudApp.Repositories;
|
2022-12-22 18:08:58 +05:00
|
|
|
|
using AsbCloudApp.Services;
|
2023-05-30 09:53:04 +05:00
|
|
|
|
using AsbCloudInfrastructure.Services.Trajectory;
|
2023-11-28 15:54:47 +05:00
|
|
|
|
using AsbCloudInfrastructure.Services.Trajectory.Export;
|
2022-12-22 18:08:58 +05:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
2024-02-16 13:54:46 +05:00
|
|
|
|
using AsbCloudInfrastructure.Services.Trajectory.Parser;
|
2022-12-22 18:08:58 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
namespace AsbCloudWebApi.Controllers.Trajectory;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Плановая траектория (загрузка и хранение)
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Route("api/well/{idWell}/[controller]")]
|
|
|
|
|
[ApiController]
|
|
|
|
|
public class TrajectoryPlanController : TrajectoryEditableController<TrajectoryGeoPlanDto>
|
2022-12-22 18:08:58 +05:00
|
|
|
|
{
|
2024-08-19 10:01:07 +05:00
|
|
|
|
private readonly TrajectoryService trajectoryVisualizationService;
|
2023-05-19 16:51:41 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
protected override string TemplateFileName => "ЕЦП_шаблон_файла_плановая_траектория.xlsx";
|
2022-12-22 18:08:58 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
public TrajectoryPlanController(IWellService wellService,
|
|
|
|
|
TrajectoryPlanParser parserService,
|
|
|
|
|
TrajectoryPlanExportService trajectoryExportService,
|
|
|
|
|
ITrajectoryEditableRepository<TrajectoryGeoPlanDto> trajectoryRepository,
|
|
|
|
|
TrajectoryService trajectoryVisualizationService)
|
|
|
|
|
: base(wellService, parserService, trajectoryExportService, trajectoryRepository)
|
|
|
|
|
{
|
|
|
|
|
this.trajectoryVisualizationService = trajectoryVisualizationService;
|
|
|
|
|
}
|
2024-01-31 17:24:00 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Получение координат для визуализации траектории (плановой и фактической)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idWell"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("trajectoryCartesianPlanFact")]
|
|
|
|
|
[ProducesResponseType(
|
|
|
|
|
typeof(TrajectoryPlanFactDto<IEnumerable<TrajectoryCartesianPlanDto>, IEnumerable<TrajectoryCartesianFactDto>>),
|
|
|
|
|
(int)System.Net.HttpStatusCode.OK)]
|
|
|
|
|
public async Task<IActionResult> GetTrajectoryCartesianPlanFactAsync(int idWell, CancellationToken token)
|
|
|
|
|
{
|
|
|
|
|
if (!await CanUserAccessToWellAsync(idWell,
|
|
|
|
|
token).ConfigureAwait(false))
|
|
|
|
|
return Forbid();
|
2022-12-22 18:08:58 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
var result = await trajectoryVisualizationService.GetTrajectoryCartesianAsync(idWell, token);
|
|
|
|
|
return Ok(result);
|
|
|
|
|
}
|
2024-01-29 15:39:39 +05:00
|
|
|
|
}
|