From 3ae3017b8d6167b1eb64954dc70174f3533fc264 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Sun, 30 Jun 2024 13:42:37 +0500 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=BF=D0=B8=D1=81=D1=8C=20=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D1=82=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=BE=D0=B3?= =?UTF-8?q?=D0=BE=20=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 --- .../ProcessMaps/ProcessMapPlanSurveyDto.cs | 15 -------- .../ProcessMapPlanSwitchingToTheModeDto.cs | 34 +++++++++++++++++++ AsbCloudDb/Model/AsbCloudDbContext.cs | 6 ++-- AsbCloudDb/Model/IAsbCloudDbContext.cs | 2 +- ...ocessMapPlanRecordingStaticMeasurement.cs} | 6 ++-- AsbCloudInfrastructure/DependencyInjection.cs | 18 +++++----- ...PlanRecordingStaticMeasurementTemplate.cs} | 4 +-- ...ecordingStaticMeasurementExportService.cs} | 8 ++--- ...apPlanRecordingStaticMeasurementParser.cs} | 8 ++--- ...cordingStaticMeasurementControllerTest.cs} | 18 +++++----- ...anRecordingStaticMeasurementController.cs} | 14 ++++---- ...essMapPlanSwitchingOffThePumpController.cs | 4 +-- 12 files changed, 78 insertions(+), 59 deletions(-) delete mode 100644 AsbCloudApp/Data/ProcessMaps/ProcessMapPlanSurveyDto.cs create mode 100644 AsbCloudApp/Data/ProcessMaps/ProcessMapPlanSwitchingToTheModeDto.cs rename AsbCloudDb/Model/ProcessMapPlan/{ProcessMapPlanSurvey.cs => ProcessMapPlanRecordingStaticMeasurement.cs} (61%) rename AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/{ProcessMapPlanSurveyTemplate.cs => ProcessMapPlanRecordingStaticMeasurementTemplate.cs} (66%) rename AsbCloudInfrastructure/Services/ProcessMapPlan/Export/{ProcessMapPlanSurveyExportService.cs => ProcessMapPlanRecordingStaticMeasurementExportService.cs} (69%) rename AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/{ProcessMapPlanSurveyParser.cs => ProcessMapPlanRecordingStaticMeasurementParser.cs} (71%) rename AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/{ProcessMapPlanSurveyControllerTest.cs => Operations/ProcessMapPlanRecordingStaticMeasurementControllerTest.cs} (53%) rename AsbCloudWebApi/Controllers/ProcessMaps/{ProcessMapPlanSurveyController.cs => Operations/ProcessMapPlanRecordingStaticMeasurementController.cs} (55%) rename AsbCloudWebApi/Controllers/ProcessMaps/{ => Operations}/ProcessMapPlanSwitchingOffThePumpController.cs (90%) diff --git a/AsbCloudApp/Data/ProcessMaps/ProcessMapPlanSurveyDto.cs b/AsbCloudApp/Data/ProcessMaps/ProcessMapPlanSurveyDto.cs deleted file mode 100644 index 9dc58b91..00000000 --- a/AsbCloudApp/Data/ProcessMaps/ProcessMapPlanSurveyDto.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace AsbCloudApp.Data.ProcessMaps; - -/// -/// РТК план записи статического замера -/// -public class ProcessMapPlanSurveyDto : ProcessMapPlanBaseDto -{ - /// - /// Время записи замера, сек - /// - [Range(0.0, 1800.0, ErrorMessage = "Время записи замера, сек., должно быть в пределах от 0 до 1800")] - public double MeasurementRecordingTime { get; set; } -} \ No newline at end of file diff --git a/AsbCloudApp/Data/ProcessMaps/ProcessMapPlanSwitchingToTheModeDto.cs b/AsbCloudApp/Data/ProcessMaps/ProcessMapPlanSwitchingToTheModeDto.cs new file mode 100644 index 00000000..930c8475 --- /dev/null +++ b/AsbCloudApp/Data/ProcessMaps/ProcessMapPlanSwitchingToTheModeDto.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace AsbCloudApp.Data.ProcessMaps; + +/// +/// РТК план выход на плановый расход +/// +public class ProcessMapPlanSwitchingToTheModeDto : ProcessMapPlanBaseDto +{ + /// + /// Время выхода буровых насосов на плановый расход, сек. + /// + [Range(0.0, 3600.0, ErrorMessage = "Время выхода буровых насосов на плановый расход, сек., должно быть в пределах от 0 до 3600")] + public double RampTime { get; set; } + + /// + /// Расход, л/с + /// + [Range(0.0, 100.0, ErrorMessage = "Расход, л/с., должно быть в пределах от 0 до 100")] + public double FlowRate { get; set; } + + /// + /// Максимально допустимое давление, атм. + /// + [Range(0.0, 400.0, ErrorMessage = "Максимально допустимое давление, атм., должно быть в пределах от 0 до 400")] + public double PressureMax { get; set; } + + /// + /// Примечание + /// + [StringLength(1024, ErrorMessage = "Примечание, должно быть не более 1024 символов")] + public string Note { get; set; } = string.Empty; +} \ No newline at end of file diff --git a/AsbCloudDb/Model/AsbCloudDbContext.cs b/AsbCloudDb/Model/AsbCloudDbContext.cs index d762f7cc..e15bb310 100644 --- a/AsbCloudDb/Model/AsbCloudDbContext.cs +++ b/AsbCloudDb/Model/AsbCloudDbContext.cs @@ -25,7 +25,7 @@ namespace AsbCloudDb.Model public virtual DbSet ProcessMapPlanOperationReamingRotor => Set(); public virtual DbSet ProcessMapPlanOperationReamingSlide => Set(); public virtual DbSet ProcessMapPlanOperationLoadCapacity => Set(); - public virtual DbSet ProcessMapPlanSurvey => Set(); + public virtual DbSet ProcessMapPlanSurvey => Set(); public virtual DbSet ProcessMapPlanOperationPositioningOffTheBottom => Set(); public virtual DbSet ProcessMapPlanOperationDeterminationOfOscillationAngles => Set(); public virtual DbSet ProcessMapPlanOperationTFOrientation => Set(); @@ -488,7 +488,7 @@ namespace AsbCloudDb.Model .WithMany() .OnDelete(DeleteBehavior.Restrict); - modelBuilder.Entity() + modelBuilder.Entity() .HasOne(p => p.Author) .WithMany() .OnDelete(DeleteBehavior.Restrict); @@ -588,7 +588,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 e5ba56de..e3cd4e21 100644 --- a/AsbCloudDb/Model/IAsbCloudDbContext.cs +++ b/AsbCloudDb/Model/IAsbCloudDbContext.cs @@ -86,7 +86,7 @@ namespace AsbCloudDb.Model DbSet ProcessMapPlanOperationReamingRotor { get; } DbSet ProcessMapPlanOperationReamingSlide { get; } DbSet ProcessMapPlanOperationLoadCapacity { get; } - DbSet ProcessMapPlanSurvey { get; } + DbSet ProcessMapPlanSurvey { get; } DbSet ProcessMapPlanOperationPositioningOffTheBottom { get; } DbSet ProcessMapPlanOperationDeterminationOfOscillationAngles { get; } DbSet ProcessMapPlanOperationTFOrientation { get; } diff --git a/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanSurvey.cs b/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanRecordingStaticMeasurement.cs similarity index 61% rename from AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanSurvey.cs rename to AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanRecordingStaticMeasurement.cs index 3667bcf9..0cfd503f 100644 --- a/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanSurvey.cs +++ b/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanRecordingStaticMeasurement.cs @@ -5,8 +5,8 @@ using Microsoft.EntityFrameworkCore; namespace AsbCloudDb.Model.ProcessMaps; -[Table("t_process_map_plan_survey"), Comment("Запись статического замера")] -public class ProcessMapPlanSurvey : ProcessMapPlanBase +[Table("t_process_map_plan_recording_static_measurement"), Comment("Запись статического замера")] +public class ProcessMapPlanRecordingStaticMeasurement : ProcessMapPlanBase { [Column("measurement_recording_time"), Comment("Время записи замера, сек")] [Range(0.0, 1800.0)] @@ -14,5 +14,5 @@ public class ProcessMapPlanSurvey : ProcessMapPlanBase public double MeasurementRecordingTime { get; set; } [ForeignKey(nameof(IdPrevious))] - public virtual ProcessMapPlanSurvey? Previous { get; set; } + public virtual ProcessMapPlanRecordingStaticMeasurement? Previous { get; set; } } \ No newline at end of file diff --git a/AsbCloudInfrastructure/DependencyInjection.cs b/AsbCloudInfrastructure/DependencyInjection.cs index f1b7dc6a..7500d2d3 100644 --- a/AsbCloudInfrastructure/DependencyInjection.cs +++ b/AsbCloudInfrastructure/DependencyInjection.cs @@ -167,11 +167,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() @@ -432,7 +432,7 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -458,7 +458,7 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -507,8 +507,8 @@ namespace AsbCloudInfrastructure ProcessMapPlanBaseRepository>(); services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); services.AddTransient< IChangeLogRepository, @@ -571,7 +571,7 @@ namespace AsbCloudInfrastructure services.AddTransient>(); services.AddTransient>(); services.AddTransient>(); - services.AddTransient>(); + services.AddTransient>(); services.AddTransient>(); services.AddTransient>(); services.AddTransient>(); diff --git a/AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanSurveyTemplate.cs b/AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanRecordingStaticMeasurementTemplate.cs similarity index 66% rename from AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanSurveyTemplate.cs rename to AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanRecordingStaticMeasurementTemplate.cs index 8b8d9ad2..ca9e1d10 100644 --- a/AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanSurveyTemplate.cs +++ b/AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanRecordingStaticMeasurementTemplate.cs @@ -2,13 +2,13 @@ using System.Collections.Generic; namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates; -public class ProcessMapPlanSurveyTemplate : ITemplateParameters +public class ProcessMapPlanRecordingStaticMeasurementTemplate : ITemplateParameters { public string SheetName => "Запись статического замера"; public int HeaderRowsCount => 2; - public string FileName => "ProcessMapPlanSurveyTemplate.xlsx"; + public string FileName => "ProcessMapPlanRecordingStaticMeasurementTemplate.xlsx"; public IDictionary Cells => new Dictionary { diff --git a/AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanSurveyExportService.cs b/AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanRecordingStaticMeasurementExportService.cs similarity index 69% rename from AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanSurveyExportService.cs rename to AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanRecordingStaticMeasurementExportService.cs index d74ba725..baa26db4 100644 --- a/AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanSurveyExportService.cs +++ b/AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanRecordingStaticMeasurementExportService.cs @@ -10,16 +10,16 @@ using System.Threading.Tasks; namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export; -public class ProcessMapPlanSurveyExportService : ProcessMapPlanExportService +public class ProcessMapPlanRecordingStaticMeasurementExportService : ProcessMapPlanExportService { - public ProcessMapPlanSurveyExportService( - IChangeLogRepository processMapPlanRepository, + public ProcessMapPlanRecordingStaticMeasurementExportService( + IChangeLogRepository processMapPlanRepository, IWellService wellService) : base(processMapPlanRepository, wellService) { } - protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanSurveyTemplate(); + protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanRecordingStaticMeasurementTemplate(); protected override async Task BuildFileNameAsync(WellRelatedExportRequest options, CancellationToken token) { diff --git a/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanSurveyParser.cs b/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanRecordingStaticMeasurementParser.cs similarity index 71% rename from AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanSurveyParser.cs rename to AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanRecordingStaticMeasurementParser.cs index c17eff10..3e88edd1 100644 --- a/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanSurveyParser.cs +++ b/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanRecordingStaticMeasurementParser.cs @@ -9,16 +9,16 @@ using AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemp namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Parser; -public class ProcessMapPlanSurveyParser : ProcessMapPlanParser +public class ProcessMapPlanRecordingStaticMeasurementParser : ProcessMapPlanParser { - public ProcessMapPlanSurveyParser(IWellOperationRepository wellOperationRepository) + public ProcessMapPlanRecordingStaticMeasurementParser(IWellOperationRepository wellOperationRepository) : base(wellOperationRepository) { } - protected override ITemplateParameters TemplateParameters => new ProcessMapPlanSurveyTemplate(); + protected override ITemplateParameters TemplateParameters => new ProcessMapPlanRecordingStaticMeasurementTemplate(); - protected override ProcessMapPlanSurveyDto BuildDto(IDictionary row, int rowNumber) + protected override ProcessMapPlanRecordingStaticMeasurementDto BuildDto(IDictionary row, int rowNumber) { var dto = base.BuildDto(row, rowNumber); diff --git a/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanSurveyControllerTest.cs b/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/Operations/ProcessMapPlanRecordingStaticMeasurementControllerTest.cs similarity index 53% rename from AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanSurveyControllerTest.cs rename to AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/Operations/ProcessMapPlanRecordingStaticMeasurementControllerTest.cs index aeb1585f..a40ce381 100644 --- a/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanSurveyControllerTest.cs +++ b/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/Operations/ProcessMapPlanRecordingStaticMeasurementControllerTest.cs @@ -10,18 +10,18 @@ using AsbCloudWebApi.IntegrationTests; using Microsoft.EntityFrameworkCore; using Xunit; -namespace AsbCloudWebApi.Controllers.ProcessMaps; +namespace AsbCloudWebApi.IntegrationTests.Controllers.ProcessMapPlan.Operations; /// /// РТК план записи статического замера /// -public class ProcessMapPlanSurveyControllerTest : - ProcessMapPlanBaseControllerTest +public class ProcessMapPlanRecordingStaticMeasurementControllerTest : + ProcessMapPlanBaseControllerTest { - public ProcessMapPlanSurveyControllerTest(WebAppFactoryFixture factory) : base(factory, "ProcessMapPlanSurvey") + public ProcessMapPlanRecordingStaticMeasurementControllerTest(WebAppFactoryFixture factory) : base(factory, "ProcessMapPlanSurvey") { } - private readonly ProcessMapPlanSurveyDto dto = new ProcessMapPlanSurveyDto() + private readonly ProcessMapPlanRecordingStaticMeasurementDto dto = new ProcessMapPlanRecordingStaticMeasurementDto() { IdWell = 1, DepthStart = 1, @@ -31,7 +31,7 @@ public class ProcessMapPlanSurveyControllerTest : MeasurementRecordingTime = 1, }; - private readonly ProcessMapPlanSurvey entity = new ProcessMapPlanSurvey() + private readonly ProcessMapPlanRecordingStaticMeasurement entity = new ProcessMapPlanRecordingStaticMeasurement() { IdWell = 1, DepthEnd = 10, @@ -50,17 +50,17 @@ public class ProcessMapPlanSurveyControllerTest : await Get(entity, dto); } - protected override ProcessMapPlanSurvey GetByNote(DbSet dbSet, ProcessMapPlanSurveyDto dto) + protected override ProcessMapPlanRecordingStaticMeasurement GetByNote(DbSet dbSet, ProcessMapPlanRecordingStaticMeasurementDto dto) { throw new NotImplementedException(); } - protected override ProcessMapPlanSurveyDto GetByNote(IEnumerable dtos, ProcessMapPlanSurveyDto dto) + protected override ProcessMapPlanRecordingStaticMeasurementDto GetByNote(IEnumerable dtos, ProcessMapPlanRecordingStaticMeasurementDto dto) { throw new NotImplementedException(); } - protected override ProcessMapPlanSurvey? GetByWellId() + protected override ProcessMapPlanRecordingStaticMeasurement? GetByWellId() { throw new NotImplementedException(); } diff --git a/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanSurveyController.cs b/AsbCloudWebApi/Controllers/ProcessMaps/Operations/ProcessMapPlanRecordingStaticMeasurementController.cs similarity index 55% rename from AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanSurveyController.cs rename to AsbCloudWebApi/Controllers/ProcessMaps/Operations/ProcessMapPlanRecordingStaticMeasurementController.cs index 8e896694..98c8b0ee 100644 --- a/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanSurveyController.cs +++ b/AsbCloudWebApi/Controllers/ProcessMaps/Operations/ProcessMapPlanRecordingStaticMeasurementController.cs @@ -6,20 +6,20 @@ using AsbCloudDb.Model.ProcessMaps; using AsbCloudInfrastructure.Services.ProcessMapPlan.Export; using AsbCloudInfrastructure.Services.ProcessMapPlan.Parser; -namespace AsbCloudWebApi.Controllers.ProcessMaps; +namespace AsbCloudWebApi.Controllers.ProcessMaps.Operations; /// /// РТК план записи статического замера /// -public class ProcessMapPlanSurveyController : - ProcessMapPlanBaseController +public class ProcessMapPlanRecordingStaticMeasurementController : + ProcessMapPlanBaseController { - public ProcessMapPlanSurveyController( - IChangeLogRepository repository, + public ProcessMapPlanRecordingStaticMeasurementController( + IChangeLogRepository repository, IWellService wellService, - ProcessMapPlanSurveyParser parserService, + ProcessMapPlanRecordingStaticMeasurementParser parserService, ITelemetryService telemetryService, - ProcessMapPlanSurveyExportService processMapPlanExportService) + ProcessMapPlanRecordingStaticMeasurementExportService processMapPlanExportService) : base(repository, wellService, parserService, processMapPlanExportService, telemetryService) { } diff --git a/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanSwitchingOffThePumpController.cs b/AsbCloudWebApi/Controllers/ProcessMaps/Operations/ProcessMapPlanSwitchingOffThePumpController.cs similarity index 90% rename from AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanSwitchingOffThePumpController.cs rename to AsbCloudWebApi/Controllers/ProcessMaps/Operations/ProcessMapPlanSwitchingOffThePumpController.cs index 71f226f3..c6407531 100644 --- a/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanSwitchingOffThePumpController.cs +++ b/AsbCloudWebApi/Controllers/ProcessMaps/Operations/ProcessMapPlanSwitchingOffThePumpController.cs @@ -6,12 +6,12 @@ using AsbCloudDb.Model.ProcessMaps; using AsbCloudInfrastructure.Services.ProcessMapPlan.Export; using AsbCloudInfrastructure.Services.ProcessMapPlan.Parser; -namespace AsbCloudWebApi.Controllers.ProcessMaps; +namespace AsbCloudWebApi.Controllers.ProcessMaps.Operations; /// /// РТК план выключение насоса /// -public class ProcessMapPlanSwitchingOffThePumpController : +public class ProcessMapPlanSwitchingOffThePumpController : ProcessMapPlanBaseController { public ProcessMapPlanSwitchingOffThePumpController(