2023-11-28 15:54:47 +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.Import;
|
|
|
|
|
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;
|
|
|
|
|
|
2023-11-21 15:10:22 +05:00
|
|
|
|
namespace AsbCloudWebApi.Controllers.Trajectory
|
2022-12-22 18:08:58 +05:00
|
|
|
|
{
|
2023-05-19 16:51:41 +05:00
|
|
|
|
|
2022-12-22 18:08:58 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Плановая траектория (загрузка и хранение)
|
|
|
|
|
/// </summary>
|
2023-11-30 15:08:58 +05:00
|
|
|
|
[Route("api/well/{idWell}/[controller]")]
|
2022-12-22 18:08:58 +05:00
|
|
|
|
[ApiController]
|
2023-11-30 15:08:58 +05:00
|
|
|
|
public class TrajectoryPlanController : TrajectoryEditableController<TrajectoryGeoPlanDto>
|
2022-12-22 18:08:58 +05:00
|
|
|
|
{
|
2023-05-30 11:21:07 +05:00
|
|
|
|
private readonly TrajectoryService trajectoryVisualizationService;
|
2022-12-22 18:08:58 +05:00
|
|
|
|
|
2023-12-05 14:48:56 +05:00
|
|
|
|
protected override string fileName => "ЕЦП_шаблон_файла_плановая_траектория.xlsx";
|
|
|
|
|
|
2023-11-30 15:08:58 +05:00
|
|
|
|
public TrajectoryPlanController(IWellService wellService,
|
2023-11-30 15:20:22 +05:00
|
|
|
|
TrajectoryPlanParserService trajectoryPlanImportService,
|
|
|
|
|
TrajectoryPlanExportService trajectoryPlanExportService,
|
|
|
|
|
ITrajectoryEditableRepository<TrajectoryGeoPlanDto> trajectoryPlanRepository,
|
2023-05-30 11:21:07 +05:00
|
|
|
|
TrajectoryService trajectoryVisualizationService)
|
2023-11-22 13:14:37 +05:00
|
|
|
|
: base(
|
|
|
|
|
wellService,
|
2023-11-30 15:20:22 +05:00
|
|
|
|
trajectoryPlanImportService,
|
|
|
|
|
trajectoryPlanExportService,
|
|
|
|
|
trajectoryPlanRepository)
|
2022-12-22 18:08:58 +05:00
|
|
|
|
{
|
2023-02-13 09:19:11 +05:00
|
|
|
|
this.trajectoryVisualizationService = trajectoryVisualizationService;
|
2022-12-22 18:08:58 +05:00
|
|
|
|
}
|
|
|
|
|
|
2023-02-13 09:19:11 +05:00
|
|
|
|
/// <summary>
|
2023-05-04 16:54:09 +05:00
|
|
|
|
/// Получение координат для визуализации траектории (плановой и фактической)
|
2023-02-13 09:19:11 +05:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="idWell"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2023-08-08 12:21:09 +05:00
|
|
|
|
[HttpGet("trajectoryCartesianPlanFact")]
|
2023-11-28 15:54:47 +05:00
|
|
|
|
[ProducesResponseType(typeof(TrajectoryPlanFactDto<IEnumerable<TrajectoryCartesianPlanDto>, IEnumerable<TrajectoryCartesianFactDto>>), (int)System.Net.HttpStatusCode.OK)]
|
2023-05-30 11:21:07 +05:00
|
|
|
|
public async Task<IActionResult> GetTrajectoryCartesianPlanFactAsync(int idWell, CancellationToken token)
|
2023-02-13 09:19:11 +05:00
|
|
|
|
{
|
2023-11-28 15:54:47 +05:00
|
|
|
|
if (!await CanUserAccessToWellAsync(idWell,
|
2023-02-13 12:39:45 +05:00
|
|
|
|
token).ConfigureAwait(false))
|
|
|
|
|
return Forbid();
|
|
|
|
|
|
2023-05-30 11:21:07 +05:00
|
|
|
|
var result = await trajectoryVisualizationService.GetTrajectoryCartesianAsync(idWell, token);
|
2023-02-13 09:19:11 +05:00
|
|
|
|
return Ok(result);
|
|
|
|
|
}
|
2022-12-22 18:08:58 +05:00
|
|
|
|
}
|
2023-05-19 16:51:41 +05:00
|
|
|
|
|
2022-12-22 18:08:58 +05:00
|
|
|
|
}
|