diff --git a/AsbCloudApp/Data/ProcessMaps/ProcessMapPlanFunctionsAnticrashRotationDto.cs b/AsbCloudApp/Data/ProcessMaps/ProcessMapPlanFunctionsAnticrashRotationDto.cs deleted file mode 100644 index 60bee040..00000000 --- a/AsbCloudApp/Data/ProcessMaps/ProcessMapPlanFunctionsAnticrashRotationDto.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace AsbCloudApp.Data.ProcessMaps; - -/// -/// РТК план противоаварийное вращение -/// -public class ProcessMapPlanFunctionsAnticrashRotationDto : ProcessMapPlanBaseDto -{ - /// - /// Минимальные обороты ВСП, об/мин - /// - [Range(0.0, 250.0, ErrorMessage = "Минимальные обороты ВСП, об/мин., должно быть в пределах от 0 до 250")] - public double TopDriveRpmMin { get; set; } - - /// - /// Минимальный расход для запуска оборотов ВСП, л/сек - /// - [Range(0.0, 100.0, ErrorMessage = "Минимальный расход для запуска оборотов ВСП, л/сек., должно быть в пределах от 0 до 100")] - public double TopDriveStartMinFlowRate { get; set; } - - /// - /// Максимально допустимый момент на ВСП при противоаварийном вращении, кН*м - /// - [Range(1.0, 35.0, ErrorMessage = "Максимально допустимый момент на ВСП при противоаварийном вращении, кН*м., должно быть в пределах от 1 до 35")] - public double TopDriveTorqueMax { get; set; } -} \ No newline at end of file diff --git a/AsbCloudDb/Model/AsbCloudDbContext.cs b/AsbCloudDb/Model/AsbCloudDbContext.cs index d878d481..81510bbd 100644 --- a/AsbCloudDb/Model/AsbCloudDbContext.cs +++ b/AsbCloudDb/Model/AsbCloudDbContext.cs @@ -38,7 +38,7 @@ namespace AsbCloudDb.Model public virtual DbSet ProcessMapPlanFunctionsJarrDrillTool => Set(); public virtual DbSet ProcessMapPlanFunctionsUpgradeNoload => Set(); public virtual DbSet ProcessMapPlanFunctionsOscillation => Set(); - public virtual DbSet ProcessMapPlanFunctionsAnticrashRotation => Set(); + public virtual DbSet ProcessMapPlanFunctionsAnticrashRotation => Set(); public virtual DbSet ProcessMapPlanFunctionsStaticMeasure => Set(); public virtual DbSet DrillingProgramParts => Set(); @@ -553,7 +553,7 @@ namespace AsbCloudDb.Model .WithMany() .OnDelete(DeleteBehavior.Restrict); - modelBuilder.Entity() + modelBuilder.Entity() .HasOne(p => p.Author) .WithMany() .OnDelete(DeleteBehavior.Restrict); @@ -653,7 +653,7 @@ namespace AsbCloudDb.Model .WithMany() .OnDelete(DeleteBehavior.Restrict); - modelBuilder.Entity() + modelBuilder.Entity() .HasOne(p => p.Editor) .WithMany() .OnDelete(DeleteBehavior.Restrict); diff --git a/AsbCloudDb/Model/IAsbCloudDbContext.cs b/AsbCloudDb/Model/IAsbCloudDbContext.cs index c176e088..7afd557a 100644 --- a/AsbCloudDb/Model/IAsbCloudDbContext.cs +++ b/AsbCloudDb/Model/IAsbCloudDbContext.cs @@ -99,7 +99,7 @@ namespace AsbCloudDb.Model DbSet ProcessMapPlanFunctionsJarrDrillTool { get; } DbSet ProcessMapPlanFunctionsUpgradeNoload { get; } DbSet ProcessMapPlanFunctionsOscillation { get; } - DbSet ProcessMapPlanFunctionsAnticrashRotation { get; } + DbSet ProcessMapPlanFunctionsAnticrashRotation { get; } DbSet ProcessMapPlanFunctionsStaticMeasure { get; } Task RefreshMaterializedViewAsync(string mwName, CancellationToken token); diff --git a/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanFunctionsAnticrashRotation.cs b/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanAntiCrashRotation.cs similarity index 77% rename from AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanFunctionsAnticrashRotation.cs rename to AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanAntiCrashRotation.cs index b560cf31..c27903ef 100644 --- a/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanFunctionsAnticrashRotation.cs +++ b/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanAntiCrashRotation.cs @@ -5,8 +5,8 @@ using Microsoft.EntityFrameworkCore; namespace AsbCloudDb.Model.ProcessMaps; -[Table("t_process_map_plan_functions_anticrash_rotation"), Comment("Противоаварийное вращение")] -public class ProcessMapPlanFunctionsAnticrashRotation : ProcessMapPlanBase +[Table("t_process_map_plan_anti_crash_rotation"), Comment("Противоаварийное вращение")] +public class ProcessMapPlanAntiCrashRotation : ProcessMapPlanBase { [Column("top_drive_rpm_min"), Comment("Минимальные обороты ВСП, об/мин")] [Range(0.0, 250.0)] @@ -24,5 +24,5 @@ public class ProcessMapPlanFunctionsAnticrashRotation : ProcessMapPlanBase public double TopDriveTorqueMax { get; set; } [ForeignKey(nameof(IdPrevious))] - public virtual ProcessMapPlanFunctionsAnticrashRotation? Previous { get; set; } + public virtual ProcessMapPlanAntiCrashRotation? Previous { get; set; } } \ No newline at end of file diff --git a/AsbCloudInfrastructure/DependencyInjection.cs b/AsbCloudInfrastructure/DependencyInjection.cs index 08ded898..62172873 100644 --- a/AsbCloudInfrastructure/DependencyInjection.cs +++ b/AsbCloudInfrastructure/DependencyInjection.cs @@ -258,11 +258,11 @@ namespace AsbCloudInfrastructure Item = src.Adapt() }); - TypeAdapterConfig>.NewConfig() - .Include>() - .Map(dest => dest, src => new ChangeLogDto() + TypeAdapterConfig>.NewConfig() + .Include>() + .Map(dest => dest, src => new ChangeLogDto() { - Item = src.Adapt() + Item = src.Adapt() }); TypeAdapterConfig>.NewConfig() @@ -445,7 +445,7 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -471,7 +471,7 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -559,8 +559,8 @@ namespace AsbCloudInfrastructure ProcessMapPlanBaseRepository>(); services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); services.AddTransient< IChangeLogRepository, @@ -584,7 +584,7 @@ namespace AsbCloudInfrastructure services.AddTransient>(); services.AddTransient>(); services.AddTransient>(); - services.AddTransient>(); + services.AddTransient>(); services.AddTransient>(); return services; diff --git a/AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanFunctionsAnticrashRotationTemplate.cs b/AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanAntiCrashRotationTemplate.cs similarity index 66% rename from AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanFunctionsAnticrashRotationTemplate.cs rename to AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanAntiCrashRotationTemplate.cs index 6bdbde3a..c1d33c3f 100644 --- a/AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanFunctionsAnticrashRotationTemplate.cs +++ b/AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanAntiCrashRotationTemplate.cs @@ -2,13 +2,13 @@ using System.Collections.Generic; namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates; -public class ProcessMapPlanFunctionsAnticrashRotationTemplate : ITemplateParameters +public class ProcessMapPlanAntiCrashRotationTemplate : ITemplateParameters { public string SheetName => "Противоаварийное вращение"; public int HeaderRowsCount => 2; - public string FileName => "ProcessMapPlanFunctionsAnticrashRotationTemplate.xlsx"; + public string FileName => "ProcessMapPlanAntiCrashRotationTemplate.xlsx"; public IDictionary Cells => new Dictionary { diff --git a/AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanFunctionsAnticrashRotationExportService.cs b/AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanAntiCrashRotationExportService.cs similarity index 69% rename from AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanFunctionsAnticrashRotationExportService.cs rename to AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanAntiCrashRotationExportService.cs index 09b9b89d..fa784e16 100644 --- a/AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanFunctionsAnticrashRotationExportService.cs +++ b/AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanAntiCrashRotationExportService.cs @@ -10,16 +10,16 @@ using System.Threading.Tasks; namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export; -public class ProcessMapPlanFunctionsAnticrashRotationExportService : ProcessMapPlanExportService +public class ProcessMapPlanAntiCrashRotationExportService : ProcessMapPlanExportService { - public ProcessMapPlanFunctionsAnticrashRotationExportService( - IChangeLogRepository processMapPlanRepository, + public ProcessMapPlanAntiCrashRotationExportService( + IChangeLogRepository processMapPlanRepository, IWellService wellService) : base(processMapPlanRepository, wellService) { } - protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanFunctionsAnticrashRotationTemplate(); + protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanAntiCrashRotationTemplate(); protected override async Task BuildFileNameAsync(WellRelatedExportRequest options, CancellationToken token) { diff --git a/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanFunctionsAnticrashRotationParser.cs b/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanAntiCrashRotationParser.cs similarity index 71% rename from AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanFunctionsAnticrashRotationParser.cs rename to AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanAntiCrashRotationParser.cs index 9a159cbd..15cf7486 100644 --- a/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanFunctionsAnticrashRotationParser.cs +++ b/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanAntiCrashRotationParser.cs @@ -9,16 +9,16 @@ using AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemp namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Parser; -public class ProcessMapPlanFunctionsAnticrashRotationParser : ProcessMapPlanParser +public class ProcessMapPlanAntiCrashRotationParser : ProcessMapPlanParser { - public ProcessMapPlanFunctionsAnticrashRotationParser(IWellOperationRepository wellOperationRepository) + public ProcessMapPlanAntiCrashRotationParser(IWellOperationRepository wellOperationRepository) : base(wellOperationRepository) { } - protected override ITemplateParameters TemplateParameters => new ProcessMapPlanFunctionsAnticrashRotationTemplate(); + protected override ITemplateParameters TemplateParameters => new ProcessMapPlanAntiCrashRotationTemplate(); - protected override ProcessMapPlanFunctionsAnticrashRotationDto BuildDto(IDictionary row, int rowNumber) + protected override ProcessMapPlanAntiCrashRotationDto BuildDto(IDictionary row, int rowNumber) { var dto = base.BuildDto(row, rowNumber); diff --git a/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanAntiCrashRotationControllerTest.cs b/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanAntiCrashRotationControllerTest.cs new file mode 100644 index 00000000..4b7b79d1 --- /dev/null +++ b/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanAntiCrashRotationControllerTest.cs @@ -0,0 +1,60 @@ +using AsbCloudApp.Data.ProcessMaps; +using AsbCloudDb.Model.ProcessMaps; +using AsbCloudWebApi.IntegrationTests; +using AsbCloudWebApi.IntegrationTests.Controllers.ProcessMapPlan; +using Microsoft.EntityFrameworkCore; +using Xunit; + +namespace AsbCloudWebApi.Controllers.ProcessMaps; + +/// +/// РТК план противоаварийное вращение +/// +public class ProcessMapPlanAntiCrashRotationControllerTest : + ProcessMapPlanBaseControllerTest +{ + public ProcessMapPlanAntiCrashRotationControllerTest(WebAppFactoryFixture factory) : base(factory, "ProcessMapPlanFunctionsAnticrashRotation") + { + } + private readonly ProcessMapPlanAntiCrashRotationDto dto = new ProcessMapPlanAntiCrashRotationDto() + { + IdWell = 1, + DepthStart = 1, + DepthEnd = 2, + Id = 0, + IdWellSectionType = 1, + }; + + private readonly ProcessMapPlanAntiCrashRotation entity = new ProcessMapPlanAntiCrashRotation() + { + IdWell = 1, + DepthEnd = 10, + DepthStart = 2, + Id = 0, + IdWellSectionType = 1, + IdAuthor = 1, + IdEditor = 1, + Creation = DateTimeOffset.UtcNow + }; + + [Fact] + public async Task Get_actual_returns_success() + { + await Get(entity, dto); + } + + protected override ProcessMapPlanAntiCrashRotation GetByNote(DbSet dbSet, ProcessMapPlanAntiCrashRotationDto dto) + { + throw new NotImplementedException(); + } + + protected override ProcessMapPlanAntiCrashRotationDto GetByNote(IEnumerable dtos, ProcessMapPlanAntiCrashRotationDto dto) + { + throw new NotImplementedException(); + } + + protected override ProcessMapPlanAntiCrashRotation? GetByWellId() + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanFunctionsAnticrashRotationControllerTest.cs b/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanFunctionsAnticrashRotationControllerTest.cs deleted file mode 100644 index 23c282a1..00000000 --- a/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanFunctionsAnticrashRotationControllerTest.cs +++ /dev/null @@ -1,65 +0,0 @@ -using AsbCloudApp.Data.ProcessMaps; -using AsbCloudApp.Repositories; -using AsbCloudApp.Requests; -using AsbCloudApp.Services; -using AsbCloudDb.Model.ProcessMaps; -using AsbCloudInfrastructure.Services.ProcessMapPlan.Export; -using AsbCloudInfrastructure.Services.ProcessMapPlan.Parser; -using AsbCloudWebApi.IntegrationTests; -using AsbCloudWebApi.IntegrationTests.Controllers.ProcessMapPlan; -using Microsoft.EntityFrameworkCore; -using Xunit; - -namespace AsbCloudWebApi.Controllers.ProcessMaps; - -/// -/// РТК план противоаварийное вращение -/// -public class ProcessMapPlanFunctionsAnticrashRotationControllerTest : - ProcessMapPlanBaseControllerTest -{ - public ProcessMapPlanFunctionsAnticrashRotationControllerTest(WebAppFactoryFixture factory) : base(factory, "ProcessMapPlanFunctionsAnticrashRotation") - { - } - private readonly ProcessMapPlanFunctionsAnticrashRotationDto dto = new ProcessMapPlanFunctionsAnticrashRotationDto() - { - IdWell = 1, - DepthStart = 1, - DepthEnd = 2, - Id = 0, - IdWellSectionType = 1, - }; - - private readonly ProcessMapPlanFunctionsAnticrashRotation entity = new ProcessMapPlanFunctionsAnticrashRotation() - { - IdWell = 1, - DepthEnd = 10, - DepthStart = 2, - Id = 0, - IdWellSectionType = 1, - IdAuthor = 1, - IdEditor = 1, - Creation = DateTimeOffset.UtcNow - }; - - [Fact] - public async Task Get_actual_returns_success() - { - await Get(entity, dto); - } - - protected override ProcessMapPlanFunctionsAnticrashRotation GetByNote(DbSet dbSet, ProcessMapPlanFunctionsAnticrashRotationDto dto) - { - throw new NotImplementedException(); - } - - protected override ProcessMapPlanFunctionsAnticrashRotationDto GetByNote(IEnumerable dtos, ProcessMapPlanFunctionsAnticrashRotationDto dto) - { - throw new NotImplementedException(); - } - - protected override ProcessMapPlanFunctionsAnticrashRotation? GetByWellId() - { - throw new NotImplementedException(); - } -} \ No newline at end of file diff --git a/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanFunctionsAnticrashRotationController.cs b/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanAntiCrashRotationController.cs similarity index 59% rename from AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanFunctionsAnticrashRotationController.cs rename to AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanAntiCrashRotationController.cs index 2f17555f..259e7a06 100644 --- a/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanFunctionsAnticrashRotationController.cs +++ b/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanAntiCrashRotationController.cs @@ -11,15 +11,15 @@ namespace AsbCloudWebApi.Controllers.ProcessMaps; /// /// РТК план противоаварийное вращение /// -public class ProcessMapPlanFunctionsAnticrashRotationController : - ProcessMapPlanBaseController +public class ProcessMapPlanAntiCrashRotationController : + ProcessMapPlanBaseController { - public ProcessMapPlanFunctionsAnticrashRotationController( - IChangeLogRepository repository, + public ProcessMapPlanAntiCrashRotationController( + IChangeLogRepository repository, IWellService wellService, - ProcessMapPlanFunctionsAnticrashRotationParser parserService, + ProcessMapPlanAntiCrashRotationParser parserService, ITelemetryService telemetryService, - ProcessMapPlanFunctionsAnticrashRotationExportService processMapPlanExportService) + ProcessMapPlanAntiCrashRotationExportService processMapPlanExportService) : base(repository, wellService, parserService, processMapPlanExportService, telemetryService) { }