From 35698ca9098220616f39543e21029c36e012d60d Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Sat, 29 Jun 2024 21:39:18 +0500 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D1=85=D0=BE=D0=B4=20=D1=81=D1=82?= =?UTF-8?q?=D0=B0=D1=82=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=BE=D0=B3=D0=BE=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=BC=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProcessMapPlanFunctionsStaticMeasureDto.cs | 15 --------------- AsbCloudDb/Model/AsbCloudDbContext.cs | 6 +++--- AsbCloudDb/Model/IAsbCloudDbContext.cs | 2 +- ...> ProcessMapPlanStaticMeasurementOutput.cs} | 6 +++--- AsbCloudInfrastructure/DependencyInjection.cs | 18 +++++++++--------- ...sMapPlanStaticMeasurementOutputTemplate.cs} | 4 ++-- ...lanStaticMeasurementOutputExportService.cs} | 8 ++++---- ...essMapPlanStaticMeasurementOutputParser.cs} | 8 ++++---- ...anStaticMeasurementOutputControllerTest.cs} | 16 ++++++++-------- ...apPlanStaticMeasurementOutputController.cs} | 12 ++++++------ 10 files changed, 40 insertions(+), 55 deletions(-) delete mode 100644 AsbCloudApp/Data/ProcessMaps/ProcessMapPlanFunctionsStaticMeasureDto.cs rename AsbCloudDb/Model/ProcessMapPlan/{ProcessMapPlanFunctionsStaticMeasure.cs => ProcessMapPlanStaticMeasurementOutput.cs} (63%) rename AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/{ProcessMapPlanFunctionsStaticMeasureTemplate.cs => ProcessMapPlanStaticMeasurementOutputTemplate.cs} (67%) rename AsbCloudInfrastructure/Services/ProcessMapPlan/Export/{ProcessMapPlanFunctionsStaticMeasureExportService.cs => ProcessMapPlanStaticMeasurementOutputExportService.cs} (70%) rename AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/{ProcessMapPlanFunctionsStaticMeasureParser.cs => ProcessMapPlanStaticMeasurementOutputParser.cs} (72%) rename AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/{ProcessMapPlanFunctionsStaticMeasureControllerTest.cs => ProcessMapPlanStaticMeasurementOutputControllerTest.cs} (56%) rename AsbCloudWebApi/Controllers/ProcessMaps/{ProcessMapPlanFunctionsStaticMeasureController.cs => ProcessMapPlanStaticMeasurementOutputController.cs} (60%) diff --git a/AsbCloudApp/Data/ProcessMaps/ProcessMapPlanFunctionsStaticMeasureDto.cs b/AsbCloudApp/Data/ProcessMaps/ProcessMapPlanFunctionsStaticMeasureDto.cs deleted file mode 100644 index b56bb52c..00000000 --- a/AsbCloudApp/Data/ProcessMaps/ProcessMapPlanFunctionsStaticMeasureDto.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace AsbCloudApp.Data.ProcessMaps; - -/// -/// РТК план выход статического замера -/// -public class ProcessMapPlanFunctionsStaticMeasureDto : ProcessMapPlanBaseDto -{ - /// - /// Время ожидания выхода сигнала с ТМС, сек. - /// - [Range(0.0, 1800.0, ErrorMessage = "Время ожидания выхода сигнала с ТМС, сек., должно быть в пределах от 0 до 1800")] - public double SignalWaitingTime { get; set; } -} \ No newline at end of file diff --git a/AsbCloudDb/Model/AsbCloudDbContext.cs b/AsbCloudDb/Model/AsbCloudDbContext.cs index 038301da..0b5f0870 100644 --- a/AsbCloudDb/Model/AsbCloudDbContext.cs +++ b/AsbCloudDb/Model/AsbCloudDbContext.cs @@ -39,7 +39,7 @@ namespace AsbCloudDb.Model public virtual DbSet ProcessMapPlanFunctionsUpgradeNoload => Set(); public virtual DbSet ProcessMapPlanFunctionsOscillation => Set(); public virtual DbSet ProcessMapPlanFunctionsAnticrashRotation => Set(); - public virtual DbSet ProcessMapPlanFunctionsStaticMeasure => Set(); + public virtual DbSet ProcessMapPlanFunctionsStaticMeasure => Set(); public virtual DbSet DrillingProgramParts => Set(); public virtual DbSet FileCategories => Set(); @@ -558,7 +558,7 @@ namespace AsbCloudDb.Model .WithMany() .OnDelete(DeleteBehavior.Restrict); - modelBuilder.Entity() + modelBuilder.Entity() .HasOne(p => p.Author) .WithMany() .OnDelete(DeleteBehavior.Restrict); @@ -658,7 +658,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 24a46649..d58f878a 100644 --- a/AsbCloudDb/Model/IAsbCloudDbContext.cs +++ b/AsbCloudDb/Model/IAsbCloudDbContext.cs @@ -100,7 +100,7 @@ namespace AsbCloudDb.Model DbSet ProcessMapPlanFunctionsUpgradeNoload { get; } DbSet ProcessMapPlanFunctionsOscillation { get; } DbSet ProcessMapPlanFunctionsAnticrashRotation { get; } - DbSet ProcessMapPlanFunctionsStaticMeasure { get; } + DbSet ProcessMapPlanFunctionsStaticMeasure { get; } Task RefreshMaterializedViewAsync(string mwName, CancellationToken token); Task RefreshMaterializedViewAsync(CancellationToken token) where TEntity : class; diff --git a/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanFunctionsStaticMeasure.cs b/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanStaticMeasurementOutput.cs similarity index 63% rename from AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanFunctionsStaticMeasure.cs rename to AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanStaticMeasurementOutput.cs index c4dca7ef..aebd1171 100644 --- a/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanFunctionsStaticMeasure.cs +++ b/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanStaticMeasurementOutput.cs @@ -5,8 +5,8 @@ using Microsoft.EntityFrameworkCore; namespace AsbCloudDb.Model.ProcessMaps; -[Table("t_process_map_plan_functions_static_measure"), Comment("Выход статического замера")] -public class ProcessMapPlanFunctionsStaticMeasure : ProcessMapPlanBase +[Table("t_process_map_plan_static_measurement_output"), Comment("Выход статического замера")] +public class ProcessMapPlanStaticMeasurementOutput : ProcessMapPlanBase { [Column("signal_waiting_time"), Comment("Время ожидания выхода сигнала с ТМС, сек.")] [Range(0.0, 1800.0)] @@ -14,5 +14,5 @@ public class ProcessMapPlanFunctionsStaticMeasure : ProcessMapPlanBase public double SignalWaitingTime { get; set; } [ForeignKey(nameof(IdPrevious))] - public virtual ProcessMapPlanFunctionsStaticMeasure? Previous { get; set; } + public virtual ProcessMapPlanStaticMeasurementOutput? Previous { get; set; } } \ No newline at end of file diff --git a/AsbCloudInfrastructure/DependencyInjection.cs b/AsbCloudInfrastructure/DependencyInjection.cs index bc48b3d5..9ed9a456 100644 --- a/AsbCloudInfrastructure/DependencyInjection.cs +++ b/AsbCloudInfrastructure/DependencyInjection.cs @@ -265,11 +265,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() }); } @@ -446,7 +446,7 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -472,7 +472,7 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -563,8 +563,8 @@ namespace AsbCloudInfrastructure ProcessMapPlanBaseRepository>(); services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); services.AddTransient>(); services.AddTransient>(); @@ -585,7 +585,7 @@ namespace AsbCloudInfrastructure services.AddTransient>(); services.AddTransient>(); services.AddTransient>(); - services.AddTransient>(); + services.AddTransient>(); return services; } diff --git a/AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanFunctionsStaticMeasureTemplate.cs b/AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanStaticMeasurementOutputTemplate.cs similarity index 67% rename from AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanFunctionsStaticMeasureTemplate.cs rename to AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanStaticMeasurementOutputTemplate.cs index 4bdd00eb..3866a839 100644 --- a/AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanFunctionsStaticMeasureTemplate.cs +++ b/AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanStaticMeasurementOutputTemplate.cs @@ -2,13 +2,13 @@ using System.Collections.Generic; namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates; -public class ProcessMapPlanFunctionsStaticMeasureTemplate : ITemplateParameters +public class ProcessMapPlanStaticMeasurementOutputTemplate : ITemplateParameters { public string SheetName => "Выход статического замера"; public int HeaderRowsCount => 2; - public string FileName => "ProcessMapPlanFunctionsStaticMeasureTemplate.xlsx"; + public string FileName => "ProcessMapPlanStaticMeasurementOutputTemplate.xlsx"; public IDictionary Cells => new Dictionary { diff --git a/AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanFunctionsStaticMeasureExportService.cs b/AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanStaticMeasurementOutputExportService.cs similarity index 70% rename from AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanFunctionsStaticMeasureExportService.cs rename to AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanStaticMeasurementOutputExportService.cs index 7dda5fa1..62c021ca 100644 --- a/AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanFunctionsStaticMeasureExportService.cs +++ b/AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanStaticMeasurementOutputExportService.cs @@ -10,16 +10,16 @@ using System.Threading.Tasks; namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export; -public class ProcessMapPlanFunctionsStaticMeasureExportService : ProcessMapPlanExportService +public class ProcessMapPlanStaticMeasurementOutputExportService : ProcessMapPlanExportService { - public ProcessMapPlanFunctionsStaticMeasureExportService( - IChangeLogRepository processMapPlanRepository, + public ProcessMapPlanStaticMeasurementOutputExportService( + IChangeLogRepository processMapPlanRepository, IWellService wellService) : base(processMapPlanRepository, wellService) { } - protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanFunctionsStaticMeasureTemplate(); + protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanStaticMeasurementOutputTemplate(); protected override async Task BuildFileNameAsync(WellRelatedExportRequest options, CancellationToken token) { diff --git a/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanFunctionsStaticMeasureParser.cs b/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanStaticMeasurementOutputParser.cs similarity index 72% rename from AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanFunctionsStaticMeasureParser.cs rename to AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanStaticMeasurementOutputParser.cs index c286f7cc..cd7b7d00 100644 --- a/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanFunctionsStaticMeasureParser.cs +++ b/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanStaticMeasurementOutputParser.cs @@ -9,16 +9,16 @@ using AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemp namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Parser; -public class ProcessMapPlanFunctionsStaticMeasureParser : ProcessMapPlanParser +public class ProcessMapPlanStaticMeasurementOutputParser : ProcessMapPlanParser { - public ProcessMapPlanFunctionsStaticMeasureParser(IWellOperationRepository wellOperationRepository) + public ProcessMapPlanStaticMeasurementOutputParser(IWellOperationRepository wellOperationRepository) : base(wellOperationRepository) { } - protected override ITemplateParameters TemplateParameters => new ProcessMapPlanFunctionsStaticMeasureTemplate(); + protected override ITemplateParameters TemplateParameters => new ProcessMapPlanStaticMeasurementOutputTemplate(); - protected override ProcessMapPlanFunctionsStaticMeasureDto BuildDto(IDictionary row, int rowNumber) + protected override ProcessMapPlanStaticMeasurementOutputDto BuildDto(IDictionary row, int rowNumber) { var dto = base.BuildDto(row, rowNumber); diff --git a/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanFunctionsStaticMeasureControllerTest.cs b/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanStaticMeasurementOutputControllerTest.cs similarity index 56% rename from AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanFunctionsStaticMeasureControllerTest.cs rename to AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanStaticMeasurementOutputControllerTest.cs index c7013953..01323043 100644 --- a/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanFunctionsStaticMeasureControllerTest.cs +++ b/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanStaticMeasurementOutputControllerTest.cs @@ -15,13 +15,13 @@ namespace AsbCloudWebApi.Controllers.ProcessMaps; /// /// РТК план выход статического замера /// -public class ProcessMapPlanFunctionsStaticMeasureControllerTest : - ProcessMapPlanBaseControllerTest +public class ProcessMapPlanStaticMeasurementOutputControllerTest : + ProcessMapPlanBaseControllerTest { - public ProcessMapPlanFunctionsStaticMeasureControllerTest(WebAppFactoryFixture factory) : base(factory, "ProcessMapPlanFunctionsStaticMeasure") + public ProcessMapPlanStaticMeasurementOutputControllerTest(WebAppFactoryFixture factory) : base(factory, "ProcessMapPlanFunctionsStaticMeasure") { } - private readonly ProcessMapPlanFunctionsStaticMeasureDto dto = new ProcessMapPlanFunctionsStaticMeasureDto() + private readonly ProcessMapPlanStaticMeasurementOutputDto dto = new ProcessMapPlanStaticMeasurementOutputDto() { IdWell = 1, DepthStart = 1, @@ -31,7 +31,7 @@ public class ProcessMapPlanFunctionsStaticMeasureControllerTest : SignalWaitingTime = 1, }; - private readonly ProcessMapPlanFunctionsStaticMeasure entity = new ProcessMapPlanFunctionsStaticMeasure() + private readonly ProcessMapPlanStaticMeasurementOutput entity = new ProcessMapPlanStaticMeasurementOutput() { IdWell = 1, DepthEnd = 10, @@ -50,17 +50,17 @@ public class ProcessMapPlanFunctionsStaticMeasureControllerTest : await Get(entity, dto); } - protected override ProcessMapPlanFunctionsStaticMeasure GetByNote(DbSet dbSet, ProcessMapPlanFunctionsStaticMeasureDto dto) + protected override ProcessMapPlanStaticMeasurementOutput GetByNote(DbSet dbSet, ProcessMapPlanStaticMeasurementOutputDto dto) { throw new NotImplementedException(); } - protected override ProcessMapPlanFunctionsStaticMeasureDto GetByNote(IEnumerable dtos, ProcessMapPlanFunctionsStaticMeasureDto dto) + protected override ProcessMapPlanStaticMeasurementOutputDto GetByNote(IEnumerable dtos, ProcessMapPlanStaticMeasurementOutputDto dto) { throw new NotImplementedException(); } - protected override ProcessMapPlanFunctionsStaticMeasure? GetByWellId() + protected override ProcessMapPlanStaticMeasurementOutput? GetByWellId() { throw new NotImplementedException(); } diff --git a/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanFunctionsStaticMeasureController.cs b/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanStaticMeasurementOutputController.cs similarity index 60% rename from AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanFunctionsStaticMeasureController.cs rename to AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanStaticMeasurementOutputController.cs index 8d1e29b0..431b8cb9 100644 --- a/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanFunctionsStaticMeasureController.cs +++ b/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanStaticMeasurementOutputController.cs @@ -11,15 +11,15 @@ namespace AsbCloudWebApi.Controllers.ProcessMaps; /// /// РТК план выход статического замера /// -public class ProcessMapPlanFunctionsStaticMeasureController : - ProcessMapPlanBaseController +public class ProcessMapPlanStaticMeasurementOutputController : + ProcessMapPlanBaseController { - public ProcessMapPlanFunctionsStaticMeasureController( - IChangeLogRepository repository, + public ProcessMapPlanStaticMeasurementOutputController( + IChangeLogRepository repository, IWellService wellService, - ProcessMapPlanFunctionsStaticMeasureParser parserService, + ProcessMapPlanStaticMeasurementOutputParser parserService, ITelemetryService telemetryService, - ProcessMapPlanFunctionsStaticMeasureExportService processMapPlanExportService) + ProcessMapPlanStaticMeasurementOutputExportService processMapPlanExportService) : base(repository, wellService, parserService, processMapPlanExportService, telemetryService) { }