diff --git a/AsbCloudApp/Data/OperationDetailsDto.cs b/AsbCloudApp/Data/TelemetryOperationDetailsDto.cs similarity index 75% rename from AsbCloudApp/Data/OperationDetailsDto.cs rename to AsbCloudApp/Data/TelemetryOperationDetailsDto.cs index 9d1c2b35..2e0c6670 100644 --- a/AsbCloudApp/Data/OperationDetailsDto.cs +++ b/AsbCloudApp/Data/TelemetryOperationDetailsDto.cs @@ -1,6 +1,6 @@ namespace AsbCloudApp.Data { - public class OperationDetailsDto + public class TelemetryOperationDetailsDto { public string OperationName { get; set; } public int DurationSec { get; set; } diff --git a/AsbCloudApp/Data/OperationDto.cs b/AsbCloudApp/Data/TelemetryOperationDto.cs similarity index 89% rename from AsbCloudApp/Data/OperationDto.cs rename to AsbCloudApp/Data/TelemetryOperationDto.cs index 8a4d8e14..9ee6e06f 100644 --- a/AsbCloudApp/Data/OperationDto.cs +++ b/AsbCloudApp/Data/TelemetryOperationDto.cs @@ -2,7 +2,7 @@ namespace AsbCloudApp.Data { - public class OperationDto + public class TelemetryOperationDto { public int Id { get; set; } public string Name { get; set; } diff --git a/AsbCloudApp/Data/OperationDurationDto.cs b/AsbCloudApp/Data/TelemetryOperationDurationDto.cs similarity index 75% rename from AsbCloudApp/Data/OperationDurationDto.cs rename to AsbCloudApp/Data/TelemetryOperationDurationDto.cs index 15dc1f80..183dd7e8 100644 --- a/AsbCloudApp/Data/OperationDurationDto.cs +++ b/AsbCloudApp/Data/TelemetryOperationDurationDto.cs @@ -1,6 +1,6 @@ namespace AsbCloudApp.Data { - public class OperationDurationDto + public class TelemetryOperationDurationDto { public string OperationName { get; set; } public double Duration { get; set; } diff --git a/AsbCloudApp/Data/OperationInfoDto.cs b/AsbCloudApp/Data/TelemetryOperationInfoDto.cs similarity index 55% rename from AsbCloudApp/Data/OperationInfoDto.cs rename to AsbCloudApp/Data/TelemetryOperationInfoDto.cs index b7a1bdcd..898a215e 100644 --- a/AsbCloudApp/Data/OperationInfoDto.cs +++ b/AsbCloudApp/Data/TelemetryOperationInfoDto.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; namespace AsbCloudApp.Data { - public class OperationInfoDto + public class TelemetryOperationInfoDto { public DateTimeOffset IntervalBegin { get; set; } - public IEnumerable Operations { get; set; } + public IEnumerable Operations { get; set; } } } diff --git a/AsbCloudApp/Data/WellOperationDto.cs b/AsbCloudApp/Data/WellOperationDto.cs new file mode 100644 index 00000000..7b8c5a4d --- /dev/null +++ b/AsbCloudApp/Data/WellOperationDto.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AsbCloudApp.Data +{ + public class WellOperationDto + { + } +} diff --git a/AsbCloudApp/Services/IAnalyticsService.cs b/AsbCloudApp/Services/IAnalyticsService.cs index af18cde3..b8efff23 100644 --- a/AsbCloudApp/Services/IAnalyticsService.cs +++ b/AsbCloudApp/Services/IAnalyticsService.cs @@ -7,15 +7,15 @@ namespace AsbCloudApp.Services { public interface IAnalyticsService { - PaginationContainer GetOperationsByWell(int wellId, + PaginationContainer GetOperationsByWell(int wellId, IEnumerable categoryids = default, DateTime begin = default, DateTime end = default, int skip = 0, int take = 32); IEnumerable GetWellDepthToDay(int wellId); IEnumerable GetWellDepthToInterval(int wellId, int intervalHoursTimestamp, int workBeginTimestamp); - IEnumerable GetOperationsSummary(int wellId, + IEnumerable GetOperationsSummary(int wellId, DateTime begin = default, DateTime end = default); - IEnumerable GetOperationsToInterval(int wellId, + IEnumerable GetOperationsToInterval(int wellId, int intervalHoursTimestamp, int workBeginTimestamp); void SaveAnalytics(DataSaubBase dataSaub); } diff --git a/AsbCloudApp/Services/IWellService.cs b/AsbCloudApp/Services/IWellService.cs index 6d57f34d..e5c54762 100644 --- a/AsbCloudApp/Services/IWellService.cs +++ b/AsbCloudApp/Services/IWellService.cs @@ -8,6 +8,7 @@ namespace AsbCloudApp.Services IEnumerable GetWellsByCompany(int idCompany); IEnumerable GetTransmittingWells(int idCompany); bool IsCompanyOwnsWell(int idCompany, int wellId); - IEnumerable GetStat(int wellId, int idCompany); + IEnumerable GetSections(int wellId); + object GetOperations(int wellId); } } diff --git a/AsbCloudDb/Model/AsbCloudDbContext.cs b/AsbCloudDb/Model/AsbCloudDbContext.cs index caf1e0c7..74485f23 100644 --- a/AsbCloudDb/Model/AsbCloudDbContext.cs +++ b/AsbCloudDb/Model/AsbCloudDbContext.cs @@ -27,7 +27,7 @@ namespace AsbCloudDb.Model public virtual DbSet Reports { get; set; } public virtual DbSet Files { get; set; } public virtual DbSet FileCategories { get; set; } - public virtual DbSet Operations { get; set; } + public virtual DbSet Operations { get; set; } public virtual DbSet TelemetryAnalysis { get; set; } public virtual DbSet SectionAnalysis { get; set; } public virtual DbSet WellTypes { get; set; } @@ -189,26 +189,26 @@ namespace AsbCloudDb.Model }); }); - modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { - entity.HasData(new List { - new Operation {Id = 1, Name = "Невозможно определить операцию"}, - new Operation {Id = 2, Name = "Роторное бурение" }, - new Operation {Id = 3, Name = "Слайдирование" }, - new Operation {Id = 4, Name = "Подъем с проработкой" }, - new Operation {Id = 5, Name = "Спуск с проработкой" }, - new Operation {Id = 6, Name = "Подъем с промывкой" }, - new Operation {Id = 7, Name = "Спуск с промывкой" }, - new Operation {Id = 8, Name = "Спуск в скважину" }, - new Operation {Id = 9, Name = "Спуск с вращением" }, - new Operation {Id = 10, Name = "Подъем из скважины" }, - new Operation {Id = 11, Name = "Подъем с вращением" }, - new Operation {Id = 12, Name = "Промывка в покое" }, - new Operation {Id = 13, Name = "Промывка с вращением" }, - new Operation {Id = 14, Name = "Удержание в клиньях" }, - new Operation {Id = 15, Name = "Неподвижное состояние" }, - new Operation {Id = 16, Name = "Вращение без циркуляции" }, - new Operation {Id = 17, Name = "На поверхности" } + entity.HasData(new List { + new TelemetryOperation {Id = 1, Name = "Невозможно определить операцию"}, + new TelemetryOperation {Id = 2, Name = "Роторное бурение" }, + new TelemetryOperation {Id = 3, Name = "Слайдирование" }, + new TelemetryOperation {Id = 4, Name = "Подъем с проработкой" }, + new TelemetryOperation {Id = 5, Name = "Спуск с проработкой" }, + new TelemetryOperation {Id = 6, Name = "Подъем с промывкой" }, + new TelemetryOperation {Id = 7, Name = "Спуск с промывкой" }, + new TelemetryOperation {Id = 8, Name = "Спуск в скважину" }, + new TelemetryOperation {Id = 9, Name = "Спуск с вращением" }, + new TelemetryOperation {Id = 10, Name = "Подъем из скважины" }, + new TelemetryOperation {Id = 11, Name = "Подъем с вращением" }, + new TelemetryOperation {Id = 12, Name = "Промывка в покое" }, + new TelemetryOperation {Id = 13, Name = "Промывка с вращением" }, + new TelemetryOperation {Id = 14, Name = "Удержание в клиньях" }, + new TelemetryOperation {Id = 15, Name = "Неподвижное состояние" }, + new TelemetryOperation {Id = 16, Name = "Вращение без циркуляции" }, + new TelemetryOperation {Id = 17, Name = "На поверхности" } }); }); diff --git a/AsbCloudDb/Model/IAsbCloudDbContext.cs b/AsbCloudDb/Model/IAsbCloudDbContext.cs index d5bb5949..bcb1127b 100644 --- a/AsbCloudDb/Model/IAsbCloudDbContext.cs +++ b/AsbCloudDb/Model/IAsbCloudDbContext.cs @@ -23,7 +23,7 @@ namespace AsbCloudDb.Model DbSet Reports { get; set; } DbSet Files { get; set; } DbSet FileCategories { get; set; } - DbSet Operations { get; set; } + DbSet Operations { get; set; } DbSet TelemetryAnalysis { get; set; } int SaveChanges(); diff --git a/AsbCloudDb/Model/TelemetryAnalysis.cs b/AsbCloudDb/Model/TelemetryAnalysis.cs index 2ef09d85..1c705d5f 100644 --- a/AsbCloudDb/Model/TelemetryAnalysis.cs +++ b/AsbCloudDb/Model/TelemetryAnalysis.cs @@ -28,8 +28,8 @@ namespace AsbCloudDb.Model [JsonIgnore] [ForeignKey(nameof(IdOperation))] - [InverseProperty(nameof(Model.Operation.Analysis))] - public virtual Operation Operation { get; set; } + [InverseProperty(nameof(Model.TelemetryOperation.Analysis))] + public virtual TelemetryOperation Operation { get; set; } [Column("unix_date", TypeName = "bigint"), Comment("Unix timestamp для Linq запросов с вычислением дат")] diff --git a/AsbCloudDb/Model/Operation.cs b/AsbCloudDb/Model/TelemetryOperation.cs similarity index 78% rename from AsbCloudDb/Model/Operation.cs rename to AsbCloudDb/Model/TelemetryOperation.cs index 112cc16d..e4ef782e 100644 --- a/AsbCloudDb/Model/Operation.cs +++ b/AsbCloudDb/Model/TelemetryOperation.cs @@ -5,8 +5,8 @@ using System.ComponentModel.DataAnnotations.Schema; namespace AsbCloudDb.Model { - [Table("t_operation"), Comment("Справочник операций на скважине")] - public class Operation + [Table("t_telemetry_operation"), Comment("Справочник операций на скважине")] + public class TelemetryOperation { [Key] [Column("id")] diff --git a/AsbCloudInfrastructure/Services/AnalyticsService.cs b/AsbCloudInfrastructure/Services/AnalyticsService.cs index 6721c9c1..2492449e 100644 --- a/AsbCloudInfrastructure/Services/AnalyticsService.cs +++ b/AsbCloudInfrastructure/Services/AnalyticsService.cs @@ -14,9 +14,9 @@ namespace AsbCloudInfrastructure.Services private readonly IAsbCloudDbContext db; private readonly ITelemetryService telemetryService; private readonly ISaubDataCache saubDataCache; - private readonly CacheTable cacheOperations; - private readonly OperationDetectorService operationDetectorService; - private readonly IEnumerable operations; + private readonly CacheTable cacheOperations; + private readonly TelemetryOperationDetectorService operationDetectorService; + private readonly IEnumerable operations; public AnalyticsService(IAsbCloudDbContext db, ITelemetryService telemetryService, ISaubDataCache saubDataCache, CacheDb cacheDb) @@ -24,9 +24,9 @@ namespace AsbCloudInfrastructure.Services this.db = db; this.telemetryService = telemetryService; this.saubDataCache = saubDataCache; - cacheOperations = cacheDb.GetCachedTable((AsbCloudDbContext)db); + cacheOperations = cacheDb.GetCachedTable((AsbCloudDbContext)db); operations = cacheOperations.Select(c => true); - operationDetectorService = new OperationDetectorService(operations); + operationDetectorService = new TelemetryOperationDetectorService(operations); } public IEnumerable GetWellDepthToDay(int wellId) @@ -83,7 +83,7 @@ namespace AsbCloudInfrastructure.Services return wellDepthToIntervalData; } - public PaginationContainer GetOperationsByWell(int wellId, + public PaginationContainer GetOperationsByWell(int wellId, IEnumerable categoryIds = default, DateTime begin = default, DateTime end = default, int skip = 0, int take = 32) { @@ -99,7 +99,7 @@ namespace AsbCloudInfrastructure.Services if ((categoryIds != default) && (categoryIds.Any())) operations = operations.Where(o => categoryIds.Contains(o.IdOperation)); - var result = new PaginationContainer + var result = new PaginationContainer { Skip = skip, Take = take @@ -131,7 +131,7 @@ namespace AsbCloudInfrastructure.Services foreach(var operation in operations) { - var operationDto = new OperationDto + var operationDto = new TelemetryOperationDto { Id = operation.Id, Name = operation.Operation.Name, @@ -147,7 +147,7 @@ namespace AsbCloudInfrastructure.Services return result; } - public IEnumerable GetOperationsSummary(int wellId, + public IEnumerable GetOperationsSummary(int wellId, DateTime begin = default, DateTime end = default) { var telemetry = telemetryService.GetTelemetryByWellId(wellId); @@ -163,7 +163,7 @@ namespace AsbCloudInfrastructure.Services a.UnixDate > unixBegin && a.UnixDate < unixEnd join o in db.Operations on a.IdOperation equals o.Id group a by new { a.IdOperation, o.Name } into g - select new OperationDurationDto + select new TelemetryOperationDurationDto { OperationName = g.Key.Name, Duration = g.Where(g => g.DurationSec > 0) @@ -173,7 +173,7 @@ namespace AsbCloudInfrastructure.Services return operations; } - public IEnumerable GetOperationsToInterval(int wellId, + public IEnumerable GetOperationsToInterval(int wellId, int intervalSeconds, int workBeginSeconds) { intervalSeconds = intervalSeconds == 0 ? 86400 : intervalSeconds; @@ -202,10 +202,10 @@ namespace AsbCloudInfrastructure.Services }).ToList(); var operationsGroupedByInterval = operations.GroupBy(op => op.IntervalStart) - .Select(o => new OperationInfoDto + .Select(o => new TelemetryOperationInfoDto { IntervalBegin = DateTimeOffset.FromUnixTimeSeconds(o.Key), - Operations = o.Select(opr => new OperationDetailsDto + Operations = o.Select(opr => new TelemetryOperationDetailsDto { OperationName = opr.OperationName, DurationSec = opr.OperationsDuration diff --git a/AsbCloudInfrastructure/Services/OperationDetector.cs b/AsbCloudInfrastructure/Services/TelemetryOperationDetector.cs similarity index 66% rename from AsbCloudInfrastructure/Services/OperationDetector.cs rename to AsbCloudInfrastructure/Services/TelemetryOperationDetector.cs index 469ddc2f..6a9af0b5 100644 --- a/AsbCloudInfrastructure/Services/OperationDetector.cs +++ b/AsbCloudInfrastructure/Services/TelemetryOperationDetector.cs @@ -3,10 +3,10 @@ using System; namespace AsbCloudInfrastructure.Services { - public class OperationDetector + public class TelemetryOperationDetector { public int Order { get; set; } - public Operation Operation { get; set; } + public TelemetryOperation Operation { get; set; } public Func Detect { get; set; } } } diff --git a/AsbCloudInfrastructure/Services/OperationDetectorService.cs b/AsbCloudInfrastructure/Services/TelemetryOperationDetectorService.cs similarity index 87% rename from AsbCloudInfrastructure/Services/OperationDetectorService.cs rename to AsbCloudInfrastructure/Services/TelemetryOperationDetectorService.cs index 4940c0e2..49ca1e90 100644 --- a/AsbCloudInfrastructure/Services/OperationDetectorService.cs +++ b/AsbCloudInfrastructure/Services/TelemetryOperationDetectorService.cs @@ -4,15 +4,15 @@ using System.Linq; namespace AsbCloudInfrastructure.Services { - public class OperationDetectorService + public class TelemetryOperationDetectorService { - private readonly IEnumerable detectors; + private readonly IEnumerable detectors; - public OperationDetectorService(IEnumerable operations) + public TelemetryOperationDetectorService(IEnumerable operations) { - detectors = new List() + detectors = new List() { - new OperationDetector + new TelemetryOperationDetector { Order = 1, Operation = operations.FirstOrDefault(o => o.Name.Equals("На поверхности")), @@ -22,7 +22,7 @@ namespace AsbCloudInfrastructure.Services && data.IsBitPositionLt20 && data.IsHookWeightLt3; } }, - new OperationDetector + new TelemetryOperationDetector { Order = 2, Operation = operations.FirstOrDefault(o => o.Name.Equals("Удержание в клиньях")), @@ -34,7 +34,7 @@ namespace AsbCloudInfrastructure.Services data.IsHookWeightLt3; } }, - new OperationDetector + new TelemetryOperationDetector { Order = 3, Operation = operations.FirstOrDefault(o => o.Name.Equals("Подъем с проработкой")), @@ -45,7 +45,7 @@ namespace AsbCloudInfrastructure.Services data.IsRotorSpeedGt3 && data.IsPressureGt20; } }, - new OperationDetector + new TelemetryOperationDetector { Order = 4, Operation = operations.FirstOrDefault(o => o.Name.Equals("Спуск с проработкой")), @@ -56,7 +56,7 @@ namespace AsbCloudInfrastructure.Services data.IsRotorSpeedGt3 && data.IsPressureGt20; } }, - new OperationDetector + new TelemetryOperationDetector { Order = 5, Operation = operations.FirstOrDefault(o => o.Name.Equals("Подъем с промывкой")), @@ -67,7 +67,7 @@ namespace AsbCloudInfrastructure.Services data.IsRotorSpeedLt3 && data.IsPressureGt20; } }, - new OperationDetector + new TelemetryOperationDetector { Order = 6, Operation = operations.FirstOrDefault(o => o.Name.Equals("Спуск с промывкой")), @@ -78,7 +78,7 @@ namespace AsbCloudInfrastructure.Services data.IsRotorSpeedLt3 && data.IsPressureGt20; } }, - new OperationDetector + new TelemetryOperationDetector { Order = 7, Operation = operations.FirstOrDefault(o => o.Name.Equals("Спуск в скважину")), @@ -89,7 +89,7 @@ namespace AsbCloudInfrastructure.Services data.IsRotorSpeedLt3 && data.IsPressureLt20; } }, - new OperationDetector + new TelemetryOperationDetector { Order = 8, Operation = operations.FirstOrDefault(o => o.Name.Equals("Спуск с вращением")), @@ -100,7 +100,7 @@ namespace AsbCloudInfrastructure.Services data.IsRotorSpeedGt3 && data.IsPressureLt20; } }, - new OperationDetector + new TelemetryOperationDetector { Order = 9, Operation = operations.FirstOrDefault(o => o.Name.Equals("Подъем из скважины")), @@ -111,7 +111,7 @@ namespace AsbCloudInfrastructure.Services data.IsRotorSpeedLt3 && data.IsPressureLt20; } }, - new OperationDetector + new TelemetryOperationDetector { Order = 10, Operation = operations.FirstOrDefault(o => o.Name.Equals("Подъем с вращением")), @@ -122,7 +122,7 @@ namespace AsbCloudInfrastructure.Services data.IsRotorSpeedGt3 && data.IsPressureLt20; } }, - new OperationDetector + new TelemetryOperationDetector { Order = 11, Operation = operations.FirstOrDefault(o => o.Name.Equals("Промывка в покое")), @@ -134,7 +134,7 @@ namespace AsbCloudInfrastructure.Services data.IsRotorSpeedLt3 && data.IsPressureGt20; } }, - new OperationDetector + new TelemetryOperationDetector { Order = 12, Operation = operations.FirstOrDefault(o => o.Name.Equals("Промывка с вращением")), @@ -146,7 +146,7 @@ namespace AsbCloudInfrastructure.Services data.IsRotorSpeedGt3 && data.IsPressureGt20; } }, - new OperationDetector + new TelemetryOperationDetector { Order = 13, Operation = operations.FirstOrDefault(o => o.Name.Equals("Неподвижное состояние")), @@ -158,7 +158,7 @@ namespace AsbCloudInfrastructure.Services data.IsRotorSpeedLt3 && data.IsPressureLt20 && data.IsHookWeightNotChanges; } }, - new OperationDetector + new TelemetryOperationDetector { Order = 14, Operation = operations.FirstOrDefault(o => o.Name.Equals("Вращение без циркуляции")), @@ -170,7 +170,7 @@ namespace AsbCloudInfrastructure.Services data.IsRotorSpeedGt3 && data.IsPressureLt20; } }, - new OperationDetector + new TelemetryOperationDetector { Order = 15, Operation = operations.FirstOrDefault(o => o.Name.Equals("Невозможно определить операцию")), @@ -179,8 +179,8 @@ namespace AsbCloudInfrastructure.Services }; } - public Operation DetectOperation(TelemetryAnalysis data) => + public TelemetryOperation DetectOperation(TelemetryAnalysis data) => detectors.OrderBy(d => d.Order).First(o => o.Detect(data)).Operation - ?? new Operation { Id = 1, Name = "Невозможно определить операцию" }; + ?? new TelemetryOperation { Id = 1, Name = "Невозможно определить операцию" }; } } diff --git a/AsbCloudInfrastructure/Services/WellService.cs b/AsbCloudInfrastructure/Services/WellService.cs index 388f54ab..4c1e2c8f 100644 --- a/AsbCloudInfrastructure/Services/WellService.cs +++ b/AsbCloudInfrastructure/Services/WellService.cs @@ -56,9 +56,14 @@ namespace AsbCloudInfrastructure.Services return wellDto; } - public IEnumerable GetStat(int wellId, int idCompany) + public IEnumerable GetSections(int wellId) { return null; } + + public object GetOperations(int wellId) + { + throw new NotImplementedException(); + } } } diff --git a/AsbCloudWebApi/Controllers/AnalyticsController.cs b/AsbCloudWebApi/Controllers/AnalyticsController.cs index 957dcad3..f580a0ca 100644 --- a/AsbCloudWebApi/Controllers/AnalyticsController.cs +++ b/AsbCloudWebApi/Controllers/AnalyticsController.cs @@ -34,7 +34,7 @@ namespace AsbCloudWebApi.Controllers /// Список операций на скважине за все время [HttpGet] [Route("{wellId}/operationsByWell")] - [ProducesResponseType(typeof(PaginationContainer), (int)System.Net.HttpStatusCode.OK)] + [ProducesResponseType(typeof(PaginationContainer), (int)System.Net.HttpStatusCode.OK)] public IActionResult GetOperationsByWell(int wellId, int skip = 0, int take = 32, [FromQuery] IEnumerable categoryIds = default, DateTime begin = default, DateTime end = default) { @@ -110,7 +110,7 @@ namespace AsbCloudWebApi.Controllers /// Коллекцию операций на скважине [HttpGet] [Route("{wellId}/operationsSummary")] - [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] + [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] public IActionResult GetOperationsSummary(int wellId, DateTime begin = default, DateTime end = default) { int? idCompany = User.GetCompanyId(); @@ -135,7 +135,7 @@ namespace AsbCloudWebApi.Controllers /// Коллекцию операций на скважине [HttpGet] [Route("{wellId}/operationsToInterval")] - [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] + [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] public IActionResult GetOperationsToInterval(int wellId, int intervalSeconds, int workBeginSeconds) { diff --git a/AsbCloudWebApi/Controllers/WellController.cs b/AsbCloudWebApi/Controllers/WellController.cs index 78dda83a..493b83f8 100644 --- a/AsbCloudWebApi/Controllers/WellController.cs +++ b/AsbCloudWebApi/Controllers/WellController.cs @@ -50,10 +50,26 @@ namespace AsbCloudWebApi.Controllers if (wellService.IsCompanyOwnsWell((int)idCompany, wellId)) return Forbid(); - var dto = wellService.GetStat(wellId, (int)idCompany); + var dto = wellService.GetSections(wellId); return Ok(dto); + } + [HttpGet("{wellId}/operations")] + [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] + public IActionResult GetOperations(int wellId) + { + var idCompany = User.GetCompanyId(); + + if (idCompany is null) + return NoContent(); + + if (wellService.IsCompanyOwnsWell((int)idCompany, wellId)) + return Forbid(); + + var dto = wellService.GetOperations(wellId); + + return Ok(dto); } [HttpGet("transmittingWells")]