forked from ddrilling/AsbCloudServer
Merge branch 'dev' into feature/notifications_updates
# Conflicts: # AsbCloudWebApi/Controllers/NotificationController.cs
This commit is contained in:
commit
360bfba8c0
@ -53,8 +53,8 @@ namespace AsbCloudApp.Data
|
|||||||
public IEnumerable<CompanyDto> Companies { get; set; } = Enumerable.Empty<CompanyDto>();
|
public IEnumerable<CompanyDto> Companies { get; set; } = Enumerable.Empty<CompanyDto>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Отставание от ГГД, дней
|
/// Отставание от ГГД, проценты
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double TvdLagDays { get; set; } = 0;
|
public double? TvdLagPercent { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,9 +95,8 @@ namespace AsbCloudApp.Data
|
|||||||
public PlanFactDto<double?> WellDepth { get; set; } = null!;
|
public PlanFactDto<double?> WellDepth { get; set; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Отставание от ГГД, дни
|
/// Отставание от ГГД, проценты
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double TvdLagDays { get; set; }
|
public double TvdLagPercent { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,13 +97,6 @@ namespace AsbCloudApp.Services
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
DatesRangeDto GetDatesRange(int idWell);
|
DatesRangeDto GetDatesRange(int idWell);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Проверить задан ли у скважины часовой пояс и задать его если он не задан
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="token"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task EnshureTimezonesIsSetAsync(CancellationToken token);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ВРЕМЕННЫЙ метод
|
/// ВРЕМЕННЫЙ метод
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -105,7 +105,7 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (limitingLast.IdFeedRegulator != idLimiting)
|
if (limitingLast.IdFeedRegulator != idLimiting || limitingLast.DepthStart < wellDepth)
|
||||||
{
|
{
|
||||||
limitingParameters.Add(new LimitingParameter {
|
limitingParameters.Add(new LimitingParameter {
|
||||||
IdTelemetry = idTelemetry,
|
IdTelemetry = idTelemetry,
|
||||||
@ -114,7 +114,7 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
DateEnd = date,
|
DateEnd = date,
|
||||||
DepthStart = limitingLast.DepthStart,
|
DepthStart = limitingLast.DepthStart,
|
||||||
DepthEnd = wellDepth
|
DepthEnd = wellDepth
|
||||||
});
|
});
|
||||||
|
|
||||||
limitingLast = new LimitingParameter
|
limitingLast = new LimitingParameter
|
||||||
{
|
{
|
||||||
|
@ -45,13 +45,8 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
{
|
{
|
||||||
var trimData = TrimLimitingParameters(item, request).ToArray();
|
var trimData = TrimLimitingParameters(item, request).ToArray();
|
||||||
|
|
||||||
//TODO: временный фикс, нужно избежать отрицательных значений в ограничивающих параметрах.
|
var allItemDepths = trimData.Sum(x => x.DepthEnd - x.DepthStart);
|
||||||
//Проблема возникает при при формировании LimitingParameter в LimitingParameterCalcWorkFactory.
|
var allItemDates = trimData.Sum(x => (x.DateEnd - x.DateStart).TotalMinutes);
|
||||||
//Начальная глубина ограничивающего параметра не может быть больше конечной.
|
|
||||||
var allItemDepths = trimData.Where(x => x.DepthStart < x.DepthEnd)
|
|
||||||
.Sum(x => x.DepthEnd - x.DepthStart);
|
|
||||||
var allItemDates = trimData.Where(x => x.DepthStart < x.DepthEnd)
|
|
||||||
.Sum(x => (x.DateEnd - x.DateStart).TotalMinutes);
|
|
||||||
|
|
||||||
result.Add(new LimitingParameterDto
|
result.Add(new LimitingParameterDto
|
||||||
{
|
{
|
||||||
|
@ -138,8 +138,7 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
wellMapInfo.FirstFactOperationDateStart = wellOperationsStat?.Total.Fact?.Start
|
wellMapInfo.FirstFactOperationDateStart = wellOperationsStat?.Total.Fact?.Start
|
||||||
?? wellOperationsStat?.Total.Plan?.Start;
|
?? wellOperationsStat?.Total.Plan?.Start;
|
||||||
|
|
||||||
wellMapInfo.LastPredictOperationDateEnd = wellOperationsStat?.Total.Plan?.End?
|
wellMapInfo.LastPredictOperationDateEnd = wellOperationsStat?.Total.Plan?.End;
|
||||||
.AddDays(wellOperationsStat?.TvdLagDays ?? 0d);
|
|
||||||
|
|
||||||
wellMapInfo.WellDepth = new()
|
wellMapInfo.WellDepth = new()
|
||||||
{
|
{
|
||||||
@ -163,7 +162,7 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
wellMapInfo.SaubUsage = wellSubsystemStat?.SubsystemAKB?.KUsage ?? 0d;
|
wellMapInfo.SaubUsage = wellSubsystemStat?.SubsystemAKB?.KUsage ?? 0d;
|
||||||
wellMapInfo.SpinUsage = wellSubsystemStat?.SubsystemSpinMaster?.KUsage ?? 0d;
|
wellMapInfo.SpinUsage = wellSubsystemStat?.SubsystemSpinMaster?.KUsage ?? 0d;
|
||||||
wellMapInfo.TorqueKUsage = wellSubsystemStat?.SubsystemTorqueMaster?.KUsage ?? 0d;
|
wellMapInfo.TorqueKUsage = wellSubsystemStat?.SubsystemTorqueMaster?.KUsage ?? 0d;
|
||||||
wellMapInfo.TvdLagDays = wellOperationsStat?.TvdLagDays ?? 0d;
|
wellMapInfo.TvdLagPercent = wellOperationsStat?.TvdLagPercent ?? 0d;
|
||||||
wellMapInfo.IdsCompanies = well.Companies.Select(c => c.Id);
|
wellMapInfo.IdsCompanies = well.Companies.Select(c => c.Id);
|
||||||
|
|
||||||
return wellMapInfo;
|
return wellMapInfo;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -300,26 +300,6 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task EnshureTimezonesIsSetAsync(CancellationToken token)
|
|
||||||
{
|
|
||||||
var cache = await GetCacheAsync(token);
|
|
||||||
if (!cache.Any(w => w.Timezone is null))
|
|
||||||
return;
|
|
||||||
|
|
||||||
var defaultTimeZone = new SimpleTimezone
|
|
||||||
{
|
|
||||||
Hours = 5,
|
|
||||||
IsOverride = false,
|
|
||||||
TimezoneId = "Assumed",
|
|
||||||
};
|
|
||||||
|
|
||||||
await dbSet.Where(w => w.Timezone == null)
|
|
||||||
.ForEachAsync(w => w.Timezone = defaultTimeZone, token);
|
|
||||||
|
|
||||||
await dbContext.SaveChangesAsync(token);
|
|
||||||
DropCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
public SimpleTimezoneDto GetTimezone(int idWell)
|
public SimpleTimezoneDto GetTimezone(int idWell)
|
||||||
{
|
{
|
||||||
var well = GetOrDefault(idWell);
|
var well = GetOrDefault(idWell);
|
||||||
|
@ -27,9 +27,7 @@ namespace AsbCloudInfrastructure
|
|||||||
context.Database.SetCommandTimeout(TimeSpan.FromSeconds(2 * 60));
|
context.Database.SetCommandTimeout(TimeSpan.FromSeconds(2 * 60));
|
||||||
context.Database.Migrate();
|
context.Database.Migrate();
|
||||||
|
|
||||||
var wellService = provider.GetRequiredService<IWellService>();
|
// TODO: Сделать инициализацию кеша телеметрии более явной.
|
||||||
wellService.EnshureTimezonesIsSetAsync(CancellationToken.None).Wait();// TODO: make this background work
|
|
||||||
|
|
||||||
_ = provider.GetRequiredService<TelemetryDataCache<TelemetryDataSaubDto>>();
|
_ = provider.GetRequiredService<TelemetryDataCache<TelemetryDataSaubDto>>();
|
||||||
_ = provider.GetRequiredService<TelemetryDataCache<TelemetryDataSpinDto>>();
|
_ = provider.GetRequiredService<TelemetryDataCache<TelemetryDataSpinDto>>();
|
||||||
|
|
||||||
|
@ -28,8 +28,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// Merge telemetries. No body required.
|
/// Merge telemetries. No body required.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost("/merge/{idFrom}/{idTo}")]
|
||||||
[Route("/merge/{idFrom}/{idTo}")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
public async Task<IActionResult> MergeTelemetriesAsync(int idFrom, int idTo, CancellationToken token)
|
public async Task<IActionResult> MergeTelemetriesAsync(int idFrom, int idTo, CancellationToken token)
|
||||||
{
|
{
|
||||||
|
@ -18,13 +18,5 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
public AdminWellController(IWellService service)
|
public AdminWellController(IWellService service)
|
||||||
: base(service)
|
: base(service)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
[HttpPost("EnshureTimezonesIsSet")]
|
|
||||||
[Permission]
|
|
||||||
public async Task<IActionResult> EnshureTimezonesIsSet(CancellationToken token)
|
|
||||||
{
|
|
||||||
await ((IWellService)service).EnshureTimezonesIsSetAsync(token);
|
|
||||||
return Ok();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
using AsbCloudApp.Data.User;
|
using AsbCloudApp.Data.User;
|
||||||
using AsbCloudApp.Repositories;
|
using AsbCloudApp.Repositories;
|
||||||
using AsbCloudApp.Services;
|
using AsbCloudApp.Services;
|
||||||
using AsbCloudInfrastructure.Repository;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Swashbuckle.AspNetCore.Annotations;
|
using Swashbuckle.AspNetCore.Annotations;
|
||||||
|
@ -40,10 +40,9 @@ public class AutoGeneratedDailyReportController : ControllerBase
|
|||||||
/// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("generate")]
|
[ProducesResponseType(typeof(PhysicalFileResult), (int)HttpStatusCode.OK, "application/octet-stream")]
|
||||||
[ProducesResponseType(typeof(PhysicalFileResult), (int)HttpStatusCode.OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public async Task<IActionResult> GenerateAsync([FromRoute] int idWell,
|
public async Task<IActionResult> GenerateReportAsync([FromRoute] int idWell,
|
||||||
[Required] DateOnly reportDate,
|
[Required] DateOnly reportDate,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
@ -54,7 +53,7 @@ public class AutoGeneratedDailyReportController : ControllerBase
|
|||||||
reportDate,
|
reportDate,
|
||||||
cancellationToken);
|
cancellationToken);
|
||||||
|
|
||||||
return File(reportFile.stream, "application/octet-stream", reportFile.fileName);
|
return File(reportFile.stream, reportFile.fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -64,7 +63,7 @@ public class AutoGeneratedDailyReportController : ControllerBase
|
|||||||
/// <param name="request">Параметры запроса</param>
|
/// <param name="request">Параметры запроса</param>
|
||||||
/// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("all")]
|
||||||
[ProducesResponseType(typeof(PaginationContainer<AutoGeneratedDailyReportInfoDto>), (int)HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(PaginationContainer<AutoGeneratedDailyReportInfoDto>), (int)HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetListAsync([FromRoute][Required] int idWell,
|
public async Task<IActionResult> GetListAsync([FromRoute][Required] int idWell,
|
||||||
[FromQuery] AutoGeneratedDailyReportRequest request,
|
[FromQuery] AutoGeneratedDailyReportRequest request,
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
using AsbCloudApp.Data;
|
using AsbCloudApp.Data;
|
||||||
using AsbCloudApp.Data.DailyReport;
|
using AsbCloudApp.Data.DailyReport;
|
||||||
using AsbCloudApp.Exceptions;
|
using AsbCloudApp.Exceptions;
|
||||||
using AsbCloudApp.Repositories;
|
|
||||||
using AsbCloudApp.Services;
|
using AsbCloudApp.Services;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@ -10,6 +9,7 @@ using System.Collections.Generic;
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
namespace AsbCloudWebApi.Controllers
|
namespace AsbCloudWebApi.Controllers
|
||||||
{
|
{
|
||||||
@ -24,16 +24,13 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
{
|
{
|
||||||
private readonly IDailyReportService dailyReportService;
|
private readonly IDailyReportService dailyReportService;
|
||||||
private readonly IWellService wellService;
|
private readonly IWellService wellService;
|
||||||
private readonly IWellOperationRepository operationRepository;
|
|
||||||
|
|
||||||
public DailyReportController(
|
public DailyReportController(
|
||||||
IDailyReportService dailyReportService,
|
IDailyReportService dailyReportService,
|
||||||
IWellService wellService,
|
IWellService wellService)
|
||||||
IWellOperationRepository operationRepository)
|
|
||||||
{
|
{
|
||||||
this.dailyReportService = dailyReportService;
|
this.dailyReportService = dailyReportService;
|
||||||
this.wellService = wellService;
|
this.wellService = wellService;
|
||||||
this.operationRepository = operationRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -165,7 +162,8 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("{date}/excel")]
|
[HttpGet("{date}/excel")]
|
||||||
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public async Task<IActionResult> DownloadAsync(int idWell, DateOnly date, CancellationToken token)
|
public async Task<IActionResult> DownloadAsync(int idWell, DateOnly date, CancellationToken token)
|
||||||
{
|
{
|
||||||
if (!await UserHasAccesToWellAsync(idWell, token))
|
if (!await UserHasAccesToWellAsync(idWell, token))
|
||||||
@ -175,13 +173,12 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
?? throw new ArgumentInvalidException($"Скважина c id:{idWell} не найдена", nameof(idWell));
|
?? throw new ArgumentInvalidException($"Скважина c id:{idWell} не найдена", nameof(idWell));
|
||||||
|
|
||||||
var stream = await dailyReportService.MakeReportAsync(idWell, date, token);
|
var stream = await dailyReportService.MakeReportAsync(idWell, date, token);
|
||||||
if (stream is not null)
|
if (stream is null)
|
||||||
{
|
|
||||||
var fileName = $"Суточный рапорт по скважине {well.Caption} куст {well.Cluster}.xlsx";
|
|
||||||
return File(stream, "application/octet-stream", fileName);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return NoContent();
|
return NoContent();
|
||||||
|
|
||||||
|
var fileName = $"Суточный рапорт по скважине {well.Caption} куст {well.Cluster}.xlsx";
|
||||||
|
return File(stream, fileName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async Task<bool> UserHasAccesToWellAsync(int idWell, CancellationToken token)
|
protected async Task<bool> UserHasAccesToWellAsync(int idWell, CancellationToken token)
|
||||||
|
@ -83,7 +83,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="idWell"></param>
|
/// <param name="idWell"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("ClearError")]
|
[HttpDelete("errors")]
|
||||||
[Permission("DrillingProgram.get")]
|
[Permission("DrillingProgram.get")]
|
||||||
public IActionResult ClearError(int idWell)
|
public IActionResult ClearError(int idWell)
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,6 @@ public class FactTrajectoryController : ControllerBase
|
|||||||
/// <param name="cancellationToken">Токен отмены операции</param>
|
/// <param name="cancellationToken">Токен отмены операции</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("getRows")]
|
|
||||||
[ProducesResponseType(typeof(IEnumerable<TrajectoryGeoPlanDto>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(IEnumerable<TrajectoryGeoPlanDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetRowsAsync([FromRoute] int idWell,
|
public async Task<IActionResult> GetRowsAsync([FromRoute] int idWell,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
|
@ -73,8 +73,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="request"> </param>
|
/// <param name="request"> </param>
|
||||||
/// <param name="token"> Токен отмены задачи </param>
|
/// <param name="token"> Токен отмены задачи </param>
|
||||||
/// <returns>Список информации о файлах в этой категории</returns>
|
/// <returns>Список информации о файлах в этой категории</returns>
|
||||||
[HttpGet]
|
[HttpGet("/api/files")]
|
||||||
[Route("/api/files")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(PaginationContainer<FileInfoDto>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(PaginationContainer<FileInfoDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetFilesInfoAsync(
|
public async Task<IActionResult> GetFilesInfoAsync(
|
||||||
@ -101,8 +100,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="idFile">id запрашиваемого файла</param>
|
/// <param name="idFile">id запрашиваемого файла</param>
|
||||||
/// <param name="token"> Токен отмены задачи </param>
|
/// <param name="token"> Токен отмены задачи </param>
|
||||||
/// <returns>Запрашиваемый файл</returns>
|
/// <returns>Запрашиваемый файл</returns>
|
||||||
[HttpGet]
|
[HttpGet("{idFile}")]
|
||||||
[Route("{idFile}")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetFileAsync(
|
public async Task<IActionResult> GetFileAsync(
|
||||||
@ -220,8 +218,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="idFile">id запрашиваемого файла</param>
|
/// <param name="idFile">id запрашиваемого файла</param>
|
||||||
/// <param name="token"> Токен отмены задачи </param>
|
/// <param name="token"> Токен отмены задачи </param>
|
||||||
/// <returns>Запрашиваемый файл</returns>
|
/// <returns>Запрашиваемый файл</returns>
|
||||||
[HttpGet]
|
[HttpGet("/api/files/{idFile}")]
|
||||||
[Route("/api/files/{idFile}")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(FileInfoDto), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(FileInfoDto), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetFileInfoAsync([FromRoute] int idFile, CancellationToken token)
|
public async Task<IActionResult> GetFileInfoAsync([FromRoute] int idFile, CancellationToken token)
|
||||||
|
@ -102,8 +102,7 @@ public class HelpPageController : ControllerBase
|
|||||||
/// <param name="idCategory">Id категории файла. Допустимое значение параметра: 20000</param>
|
/// <param name="idCategory">Id категории файла. Допустимое значение параметра: 20000</param>
|
||||||
/// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("isExisting")]
|
||||||
[Route("isExisting")]
|
|
||||||
[ProducesResponseType(typeof(bool), (int)HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(bool), (int)HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> IsExistingAsync(
|
public async Task<IActionResult> IsExistingAsync(
|
||||||
[Required] string key,
|
[Required] string key,
|
||||||
|
@ -24,9 +24,8 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
this.wellService = wellService;
|
this.wellService = wellService;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet("categories")]
|
||||||
[Permission]
|
[Permission]
|
||||||
[Route("categories")]
|
|
||||||
public async Task<IActionResult> GetCategoriesAsync([FromRoute] int idWell, CancellationToken token)
|
public async Task<IActionResult> GetCategoriesAsync([FromRoute] int idWell, CancellationToken token)
|
||||||
{
|
{
|
||||||
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
|
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
|
||||||
@ -36,9 +35,8 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
return Ok(result);
|
return Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet("last/{idCategory}")]
|
||||||
[Permission]
|
[Permission]
|
||||||
[Route("last/{idCategory}")]
|
|
||||||
public async Task<IActionResult> GetLastAsync([FromRoute] int idWell, [FromRoute] int idCategory, CancellationToken token)
|
public async Task<IActionResult> GetLastAsync([FromRoute] int idWell, [FromRoute] int idCategory, CancellationToken token)
|
||||||
{
|
{
|
||||||
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
|
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
|
||||||
@ -55,9 +53,8 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="idCategory">Категория скважины. Не обязательный параметр.</param>
|
/// <param name="idCategory">Категория скважины. Не обязательный параметр.</param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("history")]
|
||||||
[Permission]
|
[Permission]
|
||||||
[Route("history")]
|
|
||||||
public async Task<IActionResult> GetHisoryAsync([FromRoute] int idWell, CancellationToken token,
|
public async Task<IActionResult> GetHisoryAsync([FromRoute] int idWell, CancellationToken token,
|
||||||
int? idCategory = null)
|
int? idCategory = null)
|
||||||
{
|
{
|
||||||
@ -90,9 +87,8 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
return Ok(result);
|
return Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpDelete]
|
[HttpDelete("history/{idData}")]
|
||||||
[Permission]
|
[Permission]
|
||||||
[Route("history/{idData}")]
|
|
||||||
public async Task<IActionResult> MarkAsDeleteAsync([FromRoute] int idWell, [FromRoute] int idData, CancellationToken token)
|
public async Task<IActionResult> MarkAsDeleteAsync([FromRoute] int idWell, [FromRoute] int idData, CancellationToken token)
|
||||||
{
|
{
|
||||||
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
|
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
|
||||||
|
@ -17,7 +17,7 @@ namespace AsbCloudWebApi.Controllers;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[Route("api/notification")]
|
[Route("api/[controller]")]
|
||||||
public class NotificationController : ControllerBase
|
public class NotificationController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly NotificationService notificationService;
|
private readonly NotificationService notificationService;
|
||||||
@ -79,8 +79,7 @@ public class NotificationController : ControllerBase
|
|||||||
/// <param name="idNotification">Id уведомления</param>
|
/// <param name="idNotification">Id уведомления</param>
|
||||||
/// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("{idNotification}")]
|
||||||
[Route("{idNotification}")]
|
|
||||||
[ProducesResponseType(typeof(NotificationDto), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(NotificationDto), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetAsync([Required] int idNotification,
|
public async Task<IActionResult> GetAsync([Required] int idNotification,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
@ -125,8 +124,7 @@ public class NotificationController : ControllerBase
|
|||||||
/// <param name="idNotification">Id уведомления</param>
|
/// <param name="idNotification">Id уведомления</param>
|
||||||
/// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpDelete]
|
[HttpDelete("{idNotification}")]
|
||||||
[Route("{idNotification}")]
|
|
||||||
public async Task<IActionResult> DeleteAsync([Required] int idNotification,
|
public async Task<IActionResult> DeleteAsync([Required] int idNotification,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
@ -77,8 +77,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="idCluster">id куста</param>
|
/// <param name="idCluster">id куста</param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("cluster/{idCluster}/stat")]
|
||||||
[Route("cluster/{idCluster}/stat")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(StatClusterDto), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(StatClusterDto), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetStatClusterAsync(int idCluster,
|
public async Task<IActionResult> GetStatClusterAsync(int idCluster,
|
||||||
@ -99,8 +98,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="idWells">список скважин</param>
|
/// <param name="idWells">список скважин</param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("wellsStats")]
|
||||||
[Route("wellsStats")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(IEnumerable<StatWellDto>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(IEnumerable<StatWellDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetWellsStatAsync([FromQuery] IEnumerable<int> idWells, CancellationToken token)
|
public async Task<IActionResult> GetWellsStatAsync([FromQuery] IEnumerable<int> idWells, CancellationToken token)
|
||||||
@ -123,8 +121,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="idWell">id скважины</param>
|
/// <param name="idWell">id скважины</param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("well/{idWell}/stat")]
|
||||||
[Route("well/{idWell}/stat")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(StatWellDto), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(StatWellDto), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetStatWellAsync(int idWell,
|
public async Task<IActionResult> GetStatWellAsync(int idWell,
|
||||||
@ -144,8 +141,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="idWell"></param>
|
/// <param name="idWell"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("well/{idWell}/tvd")]
|
||||||
[Route("well/{idWell}/tvd")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(IEnumerable<PlanFactPredictBase<WellOperationDto>>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(IEnumerable<PlanFactPredictBase<WellOperationDto>>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetTvdAsync(int idWell,
|
public async Task<IActionResult> GetTvdAsync(int idWell,
|
||||||
|
@ -8,7 +8,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Целевые и нормативные значения по глубине
|
/// Целевые и нормативные значения по глубине
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Route("api/operationValue")]
|
[Route("api/[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public class OperationValueController : CrudWellRelatedController<OperationValueDto, IRepositoryWellRelated<OperationValueDto>>
|
public class OperationValueController : CrudWellRelatedController<OperationValueDto, IRepositoryWellRelated<OperationValueDto>>
|
||||||
|
@ -38,18 +38,18 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Возвращает шаблон для заполнения строк плановой траектории
|
/// Возвращает excel шаблон для заполнения строк плановой траектории
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Запрашиваемый файл</returns>
|
/// <returns>Запрашиваемый файл</returns>
|
||||||
[HttpGet]
|
[HttpGet("template")]
|
||||||
[Route("template")]
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK,"application/octet-stream")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public IActionResult GetTemplate()
|
public IActionResult GetTemplate()
|
||||||
{
|
{
|
||||||
var stream = plannedTrajectoryImportService.GetTemplateFile();
|
var stream = plannedTrajectoryImportService.GetTemplateFile();
|
||||||
var fileName = "ЕЦП_шаблон_файла_плановая_траектория.xlsx";
|
var fileName = "ЕЦП_шаблон_файла_плановая_траектория.xlsx";
|
||||||
return File(stream, "application/octet-stream", fileName);
|
return File(stream, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -58,9 +58,9 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="idWell">id скважины</param>
|
/// <param name="idWell">id скважины</param>
|
||||||
/// <param name="token"> Токен отмены задачи </param>
|
/// <param name="token"> Токен отмены задачи </param>
|
||||||
/// <returns>Запрашиваемый файл</returns>
|
/// <returns>Запрашиваемый файл</returns>
|
||||||
[HttpGet]
|
[HttpGet("export")]
|
||||||
[Route("export")]
|
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")]
|
||||||
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public async Task<IActionResult> ExportAsync([FromRoute] int idWell, CancellationToken token)
|
public async Task<IActionResult> ExportAsync([FromRoute] int idWell, CancellationToken token)
|
||||||
{
|
{
|
||||||
if (!await CanUserAccessToWellAsync(idWell,
|
if (!await CanUserAccessToWellAsync(idWell,
|
||||||
@ -68,7 +68,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
return Forbid();
|
return Forbid();
|
||||||
var stream = await plannedTrajectoryImportService.ExportAsync(idWell, token);
|
var stream = await plannedTrajectoryImportService.ExportAsync(idWell, token);
|
||||||
var fileName = await plannedTrajectoryImportService.GetFileNameAsync(idWell, token);
|
var fileName = await plannedTrajectoryImportService.GetFileNameAsync(idWell, token);
|
||||||
return File(stream, "application/octet-stream", fileName);
|
return File(stream, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -79,8 +79,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="deleteBeforeImport">Удалить операции перед импортом, если фал валидный</param>
|
/// <param name="deleteBeforeImport">Удалить операции перед импортом, если фал валидный</param>
|
||||||
/// <param name="token"> Токен отмены задачи </param>
|
/// <param name="token"> Токен отмены задачи </param>
|
||||||
/// <returns>количество успешно записанных строк в БД</returns>
|
/// <returns>количество успешно записанных строк в БД</returns>
|
||||||
[HttpPost]
|
[HttpPost("import/{deleteBeforeImport}")]
|
||||||
[Route("import/{deleteBeforeImport}")]
|
|
||||||
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> ImportAsync(int idWell,
|
public async Task<IActionResult> ImportAsync(int idWell,
|
||||||
[FromForm] IFormFileCollection files,
|
[FromForm] IFormFileCollection files,
|
||||||
@ -118,7 +117,6 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="token"> Токен отмены задачи </param>
|
/// <param name="token"> Токен отмены задачи </param>
|
||||||
/// <returns>Список добавленных координат плановой траектории</returns>
|
/// <returns>Список добавленных координат плановой траектории</returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("getRows")]
|
|
||||||
[ProducesResponseType(typeof(IEnumerable<TrajectoryGeoPlanDto>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(IEnumerable<TrajectoryGeoPlanDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetAsync([FromRoute] int idWell, CancellationToken token)
|
public async Task<IActionResult> GetAsync([FromRoute] int idWell, CancellationToken token)
|
||||||
{
|
{
|
||||||
@ -137,7 +135,6 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns>количество успешно записанных строк в БД</returns>
|
/// <returns>количество успешно записанных строк в БД</returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("addRow")]
|
|
||||||
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> AddAsync(int idWell, [FromBody] TrajectoryGeoPlanDto row,
|
public async Task<IActionResult> AddAsync(int idWell, [FromBody] TrajectoryGeoPlanDto row,
|
||||||
CancellationToken token)
|
CancellationToken token)
|
||||||
@ -160,8 +157,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="rows"></param>
|
/// <param name="rows"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns>количество успешно записанных строк в БД</returns>
|
/// <returns>количество успешно записанных строк в БД</returns>
|
||||||
[HttpPost]
|
[HttpPost("range")]
|
||||||
[Route("addRangeRows")]
|
|
||||||
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> AddRangeAsync(int idWell, [FromBody] IEnumerable<TrajectoryGeoPlanDto> rows,
|
public async Task<IActionResult> AddRangeAsync(int idWell, [FromBody] IEnumerable<TrajectoryGeoPlanDto> rows,
|
||||||
CancellationToken token)
|
CancellationToken token)
|
||||||
@ -231,7 +227,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="idWell"></param>
|
/// <param name="idWell"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("trajectoryCartesianPlanFact")]
|
||||||
[ProducesResponseType(typeof(PlanFactBase<IEnumerable<TrajectoryCartesianPlanDto>, IEnumerable<TrajectoryCartesianFactDto>>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(PlanFactBase<IEnumerable<TrajectoryCartesianPlanDto>, IEnumerable<TrajectoryCartesianFactDto>>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetTrajectoryCartesianPlanFactAsync(int idWell, CancellationToken token)
|
public async Task<IActionResult> GetTrajectoryCartesianPlanFactAsync(int idWell, CancellationToken token)
|
||||||
{
|
{
|
||||||
|
@ -57,9 +57,8 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="updateFrom"> Дата, с которой следует искать новые параметры </param>
|
/// <param name="updateFrom"> Дата, с которой следует искать новые параметры </param>
|
||||||
/// <param name="token"> Токен отмены задачи </param>
|
/// <param name="token"> Токен отмены задачи </param>
|
||||||
/// <returns> Список параметров для коридоров бурения </returns>
|
/// <returns> Список параметров для коридоров бурения </returns>
|
||||||
[HttpGet]
|
[HttpGet("/api/telemetry/{uid}/drillFlowChart")]
|
||||||
[Obsolete("use GetByUidAsync(..) instead")]
|
[Obsolete("use GetByUidAsync(..) instead")]
|
||||||
[Route("/api/telemetry/{uid}/drillFlowChart")]
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[ProducesResponseType(typeof(IEnumerable<ProcessMapPlanDto>), (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)
|
||||||
@ -77,8 +76,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="updateFrom"> Дата, с которой следует искать новые параметры </param>
|
/// <param name="updateFrom"> Дата, с которой следует искать новые параметры </param>
|
||||||
/// <param name="token"> Токен отмены задачи </param>
|
/// <param name="token"> Токен отмены задачи </param>
|
||||||
/// <returns> Список параметров для коридоров бурения </returns>
|
/// <returns> Список параметров для коридоров бурения </returns>
|
||||||
[HttpGet]
|
[HttpGet("/api/telemetry/{uid}/processMap")]
|
||||||
[Route("/api/telemetry/{uid}/processMap")]
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[ProducesResponseType(typeof(IEnumerable<ProcessMapPlanDto>), (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)
|
||||||
@ -99,9 +97,9 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="wellId"></param>
|
/// <param name="wellId"></param>
|
||||||
/// /// <param name="token"></param>
|
/// /// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("report/{wellId}")]
|
||||||
[Route("getReportFile/{wellId}")]
|
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")]
|
||||||
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public async Task<IActionResult> GetReportFileAsync(int wellId, CancellationToken token)
|
public async Task<IActionResult> GetReportFileAsync(int wellId, CancellationToken token)
|
||||||
{
|
{
|
||||||
var stream = await processMapReportService.MakeReportAsync(wellId, token);
|
var stream = await processMapReportService.MakeReportAsync(wellId, token);
|
||||||
@ -110,14 +108,12 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
var well = await wellService.GetOrDefaultAsync(wellId, token);
|
var well = await wellService.GetOrDefaultAsync(wellId, token);
|
||||||
if (well is null)
|
if (well is null)
|
||||||
return NoContent();
|
return NoContent();
|
||||||
else
|
|
||||||
{
|
var fileName = $"РТК по скважине {well.Caption} куст {well.Cluster}.xlsx";
|
||||||
var fileName = $"РТК по скважине {well.Caption} куст {well.Cluster}.xlsx";
|
return File(stream, fileName);
|
||||||
return File(stream, "application/octet-stream", fileName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
return NoContent();
|
return NoContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -126,8 +122,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="wellId"></param>
|
/// <param name="wellId"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("report/{wellId}/data")]
|
||||||
[Route("getDrillProcessMap/{wellId}")]
|
|
||||||
[ProducesResponseType(typeof(IEnumerable<ProcessMapReportDto>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(IEnumerable<ProcessMapReportDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetDrillProcessMap(int wellId, CancellationToken token)
|
public async Task<IActionResult> GetDrillProcessMap(int wellId, CancellationToken token)
|
||||||
{
|
{
|
||||||
@ -169,14 +164,13 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// Возвращает шаблон файла импорта плановой РТК
|
/// Возвращает шаблон файла импорта плановой РТК
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Запрашиваемый файл</returns>
|
/// <returns>Запрашиваемый файл</returns>
|
||||||
[HttpGet]
|
[HttpGet("template")]
|
||||||
[Route("template")]
|
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")]
|
||||||
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
|
|
||||||
public async Task<IActionResult> GetTemplateAsync(CancellationToken cancellationToken)
|
public async Task<IActionResult> GetTemplateAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var stream = await processMapPlanImportService.GetExcelTemplateStreamAsync(cancellationToken);
|
var stream = await processMapPlanImportService.GetExcelTemplateStreamAsync(cancellationToken);
|
||||||
var fileName = "ЕЦП_шаблон_файла_РТК.xlsx";
|
var fileName = "ЕЦП_шаблон_файла_РТК.xlsx";
|
||||||
return File(stream, "application/octet-stream", fileName);
|
return File(stream, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -187,8 +181,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="file">Загружаемый файл</param>
|
/// <param name="file">Загружаемый файл</param>
|
||||||
/// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost("import/{idWell}/{options}")]
|
||||||
[Route("import/{idWell}/{options}")]
|
|
||||||
public async Task<IActionResult> ImportAsync(int idWell,
|
public async Task<IActionResult> ImportAsync(int idWell,
|
||||||
int options,
|
int options,
|
||||||
[Required] IFormFile file,
|
[Required] IFormFile file,
|
||||||
@ -226,9 +219,9 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="idWell">Id скважины</param>
|
/// <param name="idWell">Id скважины</param>
|
||||||
/// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("export/{idWell}")]
|
||||||
[Route("export/{idWell}")]
|
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")]
|
||||||
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public async Task<IActionResult> ExportAsync(int idWell, CancellationToken cancellationToken)
|
public async Task<IActionResult> ExportAsync(int idWell, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
int? idUser = User.GetUserId();
|
int? idUser = User.GetUserId();
|
||||||
@ -243,7 +236,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
|
|
||||||
var stream = await processMapPlanImportService.ExportAsync(idWell, cancellationToken);
|
var stream = await processMapPlanImportService.ExportAsync(idWell, cancellationToken);
|
||||||
var fileName = $"РТК-план по скважине {well.Caption} куст {well.Cluster}.xlsx";
|
var fileName = $"РТК-план по скважине {well.Caption} куст {well.Cluster}.xlsx";
|
||||||
return File(stream, "application/octet-stream", fileName);
|
return File(stream, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task NotifyUsersBySignalR(int idWell, CancellationToken token)
|
private async Task NotifyUsersBySignalR(int idWell, CancellationToken token)
|
||||||
|
@ -104,8 +104,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="request">Параметры запроса</param>
|
/// <param name="request">Параметры запроса</param>
|
||||||
/// <param name="token">Токен для отмены задачи</param>
|
/// <param name="token">Токен для отмены задачи</param>
|
||||||
/// <returns>прогнозируемое кол-во страниц отчета</returns>
|
/// <returns>прогнозируемое кол-во страниц отчета</returns>
|
||||||
[HttpGet]
|
[HttpGet("reportSize")]
|
||||||
[Route("reportSize")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(string), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(string), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetReportSizeAsync([Required] int idWell,
|
public async Task<IActionResult> GetReportSizeAsync([Required] int idWell,
|
||||||
@ -133,8 +132,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="idWell">id скважины</param>
|
/// <param name="idWell">id скважины</param>
|
||||||
/// <param name="token">Токен для отмены задачи</param>
|
/// <param name="token">Токен для отмены задачи</param>
|
||||||
/// <returns>Даты самого старого и самого свежего отчетов в БД</returns>
|
/// <returns>Даты самого старого и самого свежего отчетов в БД</returns>
|
||||||
[HttpGet]
|
[HttpGet("datesRange")]
|
||||||
[Route("datesRange")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetReportsDateRangeAsync(int idWell, CancellationToken token)
|
public async Task<IActionResult> GetReportsDateRangeAsync(int idWell, CancellationToken token)
|
||||||
|
@ -8,6 +8,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
namespace AsbCloudWebApi.Controllers.SAUB
|
namespace AsbCloudWebApi.Controllers.SAUB
|
||||||
{
|
{
|
||||||
@ -120,10 +121,10 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
|||||||
/// <param name="idCluster"></param>
|
/// <param name="idCluster"></param>
|
||||||
/// <param name="token"> Токен отмены задачи </param>
|
/// <param name="token"> Токен отмены задачи </param>
|
||||||
/// <returns>Запрашиваемый файл</returns>
|
/// <returns>Запрашиваемый файл</returns>
|
||||||
[HttpGet]
|
[HttpGet("export")]
|
||||||
[Route("export")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public async Task<IActionResult> ExportAsync(int? idWell, int? idCluster, CancellationToken token)
|
public async Task<IActionResult> ExportAsync(int? idWell, int? idCluster, CancellationToken token)
|
||||||
{
|
{
|
||||||
if (idCluster is null && idWell is null)
|
if (idCluster is null && idWell is null)
|
||||||
@ -151,7 +152,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
|||||||
|
|
||||||
var stream = await detectedOperationService.ExportAsync(idsWells, token);
|
var stream = await detectedOperationService.ExportAsync(idsWells, token);
|
||||||
var fileName = "operations.xlsx";
|
var fileName = "operations.xlsx";
|
||||||
return File(stream, "application/octet-stream", fileName);
|
return File(stream, fileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,8 +64,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
|||||||
/// <param name="idWell">id скважины</param>
|
/// <param name="idWell">id скважины</param>
|
||||||
/// <param name="token">Токен для отмены задачи</param>
|
/// <param name="token">Токен для отмены задачи</param>
|
||||||
/// <returns>список сообщений по скважине</returns>
|
/// <returns>список сообщений по скважине</returns>
|
||||||
[HttpGet]
|
[HttpGet("datesRange")]
|
||||||
[Route("datesRange")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetMessagesDateRangeAsync(int idWell, CancellationToken token)
|
public async Task<IActionResult> GetMessagesDateRangeAsync(int idWell, CancellationToken token)
|
||||||
|
@ -44,8 +44,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
|||||||
/// <param name="info">Информация об отправителе</param>
|
/// <param name="info">Информация об отправителе</param>
|
||||||
/// <param name="token">Токен отмены задачи</param>
|
/// <param name="token">Токен отмены задачи</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost("{uid}/info")]
|
||||||
[Route("{uid}/info")]
|
|
||||||
public async Task<IActionResult> PostInfoAsync(string uid, [FromBody] TelemetryInfoDto info,
|
public async Task<IActionResult> PostInfoAsync(string uid, [FromBody] TelemetryInfoDto info,
|
||||||
CancellationToken token)
|
CancellationToken token)
|
||||||
{
|
{
|
||||||
@ -60,8 +59,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
|||||||
/// <param name="dtos">сообщения</param>
|
/// <param name="dtos">сообщения</param>
|
||||||
/// <param name="token">Токен для отмены задачи</param>
|
/// <param name="token">Токен для отмены задачи</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost("{uid}/message")]
|
||||||
[Route("{uid}/message")]
|
|
||||||
public async Task<IActionResult> PostMessagesAsync(string uid, [FromBody] IEnumerable<TelemetryMessageDto> dtos,
|
public async Task<IActionResult> PostMessagesAsync(string uid, [FromBody] IEnumerable<TelemetryMessageDto> dtos,
|
||||||
CancellationToken token)
|
CancellationToken token)
|
||||||
{
|
{
|
||||||
@ -82,8 +80,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
|||||||
/// <param name="events">справочник событий</param>
|
/// <param name="events">справочник событий</param>
|
||||||
/// <param name="token">Токен для отмены задачи</param>
|
/// <param name="token">Токен для отмены задачи</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost("{uid}/event")]
|
||||||
[Route("{uid}/event")]
|
|
||||||
public async Task<IActionResult> PostEventsAsync(string uid, [FromBody] List<EventDto> events,
|
public async Task<IActionResult> PostEventsAsync(string uid, [FromBody] List<EventDto> events,
|
||||||
CancellationToken token)
|
CancellationToken token)
|
||||||
{
|
{
|
||||||
@ -99,8 +96,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
|||||||
/// <param name="users">справочник пользователей телеметрии</param>
|
/// <param name="users">справочник пользователей телеметрии</param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost("{uid}/user")]
|
||||||
[Route("{uid}/user")]
|
|
||||||
public async Task<IActionResult> PostUsersAsync(string uid, [FromBody] List<TelemetryUserDto> users,
|
public async Task<IActionResult> PostUsersAsync(string uid, [FromBody] List<TelemetryUserDto> users,
|
||||||
CancellationToken token)
|
CancellationToken token)
|
||||||
{
|
{
|
||||||
|
@ -44,8 +44,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
|||||||
/// <param name="dtos">Данные</param>
|
/// <param name="dtos">Данные</param>
|
||||||
/// <param name="token">Токен для отмены задачи</param>
|
/// <param name="token">Токен для отмены задачи</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost("{uid}")]
|
||||||
[Route("{uid}")]
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public virtual async Task<IActionResult> PostDataAsync(string uid, [FromBody] IEnumerable<TDto> dtos,
|
public virtual async Task<IActionResult> PostDataAsync(string uid, [FromBody] IEnumerable<TDto> dtos,
|
||||||
CancellationToken token)
|
CancellationToken token)
|
||||||
@ -102,8 +101,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
|||||||
/// <param name="idWell">id скважины</param>
|
/// <param name="idWell">id скважины</param>
|
||||||
/// <param name="token">Токен завершения задачи</param>
|
/// <param name="token">Токен завершения задачи</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("{idWell}/datesRange")]
|
||||||
[Route("{idWell}/datesRange")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public virtual async Task<ActionResult<DatesRangeDto>> GetDataDatesRangeAsync(int idWell,
|
public virtual async Task<ActionResult<DatesRangeDto>> GetDataDatesRangeAsync(int idWell,
|
||||||
|
@ -3,11 +3,10 @@ using AsbCloudApp.Services;
|
|||||||
using AsbCloudWebApi.SignalR;
|
using AsbCloudWebApi.SignalR;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.SignalR;
|
using Microsoft.AspNetCore.SignalR;
|
||||||
using System.IO;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using AsbCloudInfrastructure.Services;
|
|
||||||
using System;
|
using System;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
namespace AsbCloudWebApi.Controllers.SAUB
|
namespace AsbCloudWebApi.Controllers.SAUB
|
||||||
{
|
{
|
||||||
@ -44,7 +43,8 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
|||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("{idWell}/export/csv")]
|
[HttpGet("{idWell}/export/csv")]
|
||||||
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public async Task<IActionResult> GetZippedCsv(int idWell, DateTime beginDate, DateTime endDate, CancellationToken token)
|
public async Task<IActionResult> GetZippedCsv(int idWell, DateTime beginDate, DateTime endDate, CancellationToken token)
|
||||||
{
|
{
|
||||||
int? idCompany = User.GetCompanyId();
|
int? idCompany = User.GetCompanyId();
|
||||||
@ -60,7 +60,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
|||||||
|
|
||||||
var stream = await telemetryDataSaubService.GetZippedCsv(idWell, beginDate, endDate, token).ConfigureAwait(false);
|
var stream = await telemetryDataSaubService.GetZippedCsv(idWell, beginDate, endDate, token).ConfigureAwait(false);
|
||||||
var fileName = $"DataSaub idWell{idWell} {beginDate:yyyy-MM-DDTHH-mm} - {endDate:yyyy-MM-DDTHH-mm}.zip";
|
var fileName = $"DataSaub idWell{idWell} {beginDate:yyyy-MM-DDTHH-mm} - {endDate:yyyy-MM-DDTHH-mm}.zip";
|
||||||
return File(stream, "application/octet-stream", fileName);
|
return File(stream, fileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,8 +45,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
|||||||
/// <param name="dto"></param>
|
/// <param name="dto"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost("{uid}")]
|
||||||
[Route("{uid}")]
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<IActionResult> PostDataAsync(string uid, [FromBody] TelemetryWirelineRunOutBaseDto dto, CancellationToken token)
|
public async Task<IActionResult> PostDataAsync(string uid, [FromBody] TelemetryWirelineRunOutBaseDto dto, CancellationToken token)
|
||||||
{
|
{
|
||||||
|
@ -71,7 +71,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="idWell"></param>
|
/// <param name="idWell"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("getCompositeProcessMap")]
|
[HttpGet("compositeProcessMap")]
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(IEnumerable<ProcessMapPlanDto>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(IEnumerable<ProcessMapPlanDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetCompositeProcessMap(int idWell, CancellationToken token)
|
public async Task<IActionResult> GetCompositeProcessMap(int idWell, CancellationToken token)
|
||||||
|
@ -160,8 +160,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// Получение справочника категорий файлов
|
/// Получение справочника категорий файлов
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("wellCaseCategories")]
|
||||||
[Route("wellCaseCategories")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
public async Task<IActionResult> GetWellCaseCategoriesAsync(CancellationToken token)
|
public async Task<IActionResult> GetWellCaseCategoriesAsync(CancellationToken token)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using AsbCloudApp.Data;
|
using AsbCloudApp.Data;
|
||||||
using AsbCloudApp.Exceptions;
|
|
||||||
using AsbCloudApp.Repositories;
|
using AsbCloudApp.Repositories;
|
||||||
using AsbCloudApp.Requests;
|
using AsbCloudApp.Requests;
|
||||||
using AsbCloudApp.Services;
|
using AsbCloudApp.Services;
|
||||||
@ -10,7 +9,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
@ -40,8 +38,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// Возвращает словарь типов секций
|
/// Возвращает словарь типов секций
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("sectionTypes")]
|
||||||
[Route("sectionTypes")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(IEnumerable<WellSectionTypeDto>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(IEnumerable<WellSectionTypeDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public IActionResult GetSectionTypes()
|
public IActionResult GetSectionTypes()
|
||||||
@ -55,8 +52,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="includeParents">флаг, нужно ли включать родителей в список</param>
|
/// <param name="includeParents">флаг, нужно ли включать родителей в список</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("categories")]
|
||||||
[Route("categories")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(IEnumerable<WellOperationCategoryDto>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(IEnumerable<WellOperationCategoryDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public IActionResult GetCategories(bool includeParents = true)
|
public IActionResult GetCategories(bool includeParents = true)
|
||||||
@ -72,8 +68,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="currentDate">дата для нахождения последней сопоставленной плановой операции</param>
|
/// <param name="currentDate">дата для нахождения последней сопоставленной плановой операции</param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("operationsPlan")]
|
||||||
[Route("operationsPlan")]
|
|
||||||
[ProducesResponseType(typeof(WellOperationPlanDto), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(WellOperationPlanDto), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetOperationsPlanAsync(
|
public async Task<IActionResult> GetOperationsPlanAsync(
|
||||||
[FromRoute] int idWell,
|
[FromRoute] int idWell,
|
||||||
@ -97,8 +92,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="request"></param>
|
/// <param name="request"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns>Список операций на скважине</returns>
|
/// <returns>Список операций на скважине</returns>
|
||||||
[HttpGet]
|
[HttpGet("fact")]
|
||||||
[Route("fact")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(IEnumerable<WellOperationDto>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(IEnumerable<WellOperationDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetPageOperationsFactAsync(
|
public async Task<IActionResult> GetPageOperationsFactAsync(
|
||||||
@ -125,8 +119,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="request"></param>
|
/// <param name="request"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns>Список операций на скважине в контейнере для постраничного просмотра</returns>
|
/// <returns>Список операций на скважине в контейнере для постраничного просмотра</returns>
|
||||||
[HttpGet]
|
[HttpGet("plan")]
|
||||||
[Route("plan")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(PaginationContainer<WellOperationDto>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(PaginationContainer<WellOperationDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetPageOperationsPlanAsync(
|
public async Task<IActionResult> GetPageOperationsPlanAsync(
|
||||||
@ -152,8 +145,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="request"></param>
|
/// <param name="request"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet("groupStat")]
|
||||||
[Route("groupStat")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(IEnumerable<WellGroupOpertionDto>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(IEnumerable<WellGroupOpertionDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetGroupOperationsAsync(
|
public async Task<IActionResult> GetGroupOperationsAsync(
|
||||||
@ -179,8 +171,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="idOperation">id нужной операции</param>
|
/// <param name="idOperation">id нужной операции</param>
|
||||||
/// <param name="token">Токен отмены задачи</param>
|
/// <param name="token">Токен отмены задачи</param>
|
||||||
/// <returns>Нужную операцию на скважине</returns>
|
/// <returns>Нужную операцию на скважине</returns>
|
||||||
[HttpGet]
|
[HttpGet("{idOperation}")]
|
||||||
[Route("{idOperation}")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(WellOperationDto), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(WellOperationDto), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetOrDefaultAsync(int idWell, int idOperation,
|
public async Task<IActionResult> GetOrDefaultAsync(int idWell, int idOperation,
|
||||||
@ -282,9 +273,8 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="options">Удалить операции перед импортом = 1, если фал валидный</param>
|
/// <param name="options">Удалить операции перед импортом = 1, если фал валидный</param>
|
||||||
/// <param name="token"> Токен отмены задачи </param>
|
/// <param name="token"> Токен отмены задачи </param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost("import/{options}")]
|
||||||
[Permission]
|
[Permission]
|
||||||
[Route("import/{options}")]
|
|
||||||
public async Task<IActionResult> ImportAsync(int idWell,
|
public async Task<IActionResult> ImportAsync(int idWell,
|
||||||
[FromForm] IFormFileCollection files,
|
[FromForm] IFormFileCollection files,
|
||||||
int options,
|
int options,
|
||||||
@ -324,12 +314,12 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// Создает excel файл с операциями по скважине
|
/// Создает excel файл с операциями по скважине
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="idWell">id скважины</param>
|
/// <param name="idWell">id скважины</param>
|
||||||
/// <param name="token"> Токен отмены задачи </param>
|
/// <param name="token">Токен отмены задачи </param>
|
||||||
/// <returns>Запрашиваемый файл</returns>
|
/// <returns>Запрашиваемый файл</returns>
|
||||||
[HttpGet]
|
[HttpGet("export")]
|
||||||
[Route("export")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public async Task<IActionResult> ExportAsync([FromRoute] int idWell, CancellationToken token)
|
public async Task<IActionResult> ExportAsync([FromRoute] int idWell, CancellationToken token)
|
||||||
{
|
{
|
||||||
int? idCompany = User.GetCompanyId();
|
int? idCompany = User.GetCompanyId();
|
||||||
@ -343,7 +333,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
|
|
||||||
var stream = wellOperationImportService.Export(idWell);
|
var stream = wellOperationImportService.Export(idWell);
|
||||||
var fileName = await wellService.GetWellCaptionByIdAsync(idWell, token) + "_operations.xlsx";
|
var fileName = await wellService.GetWellCaptionByIdAsync(idWell, token) + "_operations.xlsx";
|
||||||
return File(stream, "application/octet-stream", fileName);
|
return File(stream, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -353,8 +343,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="scheduleReportService"></param>
|
/// <param name="scheduleReportService"></param>
|
||||||
/// <param name="token"> Токен отмены задачи</param>
|
/// <param name="token"> Токен отмены задачи</param>
|
||||||
/// <returns>Запрашиваемый файл</returns>
|
/// <returns>Запрашиваемый файл</returns>
|
||||||
[HttpGet]
|
[HttpGet("scheduleReport")]
|
||||||
[Route("scheduleReport")]
|
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> ScheduleReportAsync([FromRoute] int idWell, [FromServices] IScheduleReportService scheduleReportService, CancellationToken token)
|
public async Task<IActionResult> ScheduleReportAsync([FromRoute] int idWell, [FromServices] IScheduleReportService scheduleReportService, CancellationToken token)
|
||||||
@ -377,15 +366,14 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// Возвращает шаблон файла импорта
|
/// Возвращает шаблон файла импорта
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Запрашиваемый файл</returns>
|
/// <returns>Запрашиваемый файл</returns>
|
||||||
[HttpGet]
|
[HttpGet("template")]
|
||||||
[Route("template")]
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK, "application/octet-stream")]
|
||||||
public IActionResult GetTemplate()
|
public IActionResult GetTemplate()
|
||||||
{
|
{
|
||||||
var stream = wellOperationImportService.GetExcelTemplateStream();
|
var stream = wellOperationImportService.GetExcelTemplateStream();
|
||||||
var fileName = "ЕЦП_шаблон_файла_операций.xlsx";
|
var fileName = "ЕЦП_шаблон_файла_операций.xlsx";
|
||||||
return File(stream, "application/octet-stream", fileName);
|
return File(stream, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<bool> CanUserAccessToWellAsync(int idWell, CancellationToken token)
|
private async Task<bool> CanUserAccessToWellAsync(int idWell, CancellationToken token)
|
||||||
|
Loading…
Reference in New Issue
Block a user