diff --git a/AsbCloudApp/Data/ProcessMaps/ProcessMapPlanOperationSwitchModeDto.cs b/AsbCloudApp/Data/ProcessMaps/ProcessMapPlanOperationSwitchModeDto.cs deleted file mode 100644 index 9f6a75e1..00000000 --- a/AsbCloudApp/Data/ProcessMaps/ProcessMapPlanOperationSwitchModeDto.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace AsbCloudApp.Data.ProcessMaps; - -/// -/// РТК план выход на режим -/// -public class ProcessMapPlanOperationSwitchModeDto : ProcessMapPlanBaseDto -{ - /// - /// Выход на плановый расход, время выхода буровых насосов на плановый расход, сек. - /// - [Range(0.0, 3600.0, ErrorMessage = "Выход на плановый расход, время выхода буровых насосов на плановый расход, сек., должно быть в пределах от 0 до 3600")] - public double ExitTimeConsumption { get; set; } - - /// - /// Выход на плановый расход, расход, л/с - /// - [Range(0.0, 100.0, ErrorMessage = "Выход на плановый расход, расход, л/с., должно быть в пределах от 0 до 100")] - public double ConsumptionFlowRate { get; set; } - - /// - /// Максимально допустимое давление, атм. - /// - [Range(0.0, 400.0, ErrorMessage = "Максимально допустимое давление, атм., должно быть в пределах от 0 до 400")] - public double PressureLimitMax { get; set; } - - /// - /// Комментарий - /// - public double Comment { get; set; } -} \ No newline at end of file diff --git a/AsbCloudDb/Model/AsbCloudDbContext.cs b/AsbCloudDb/Model/AsbCloudDbContext.cs index 1bd345c5..cc6098c9 100644 --- a/AsbCloudDb/Model/AsbCloudDbContext.cs +++ b/AsbCloudDb/Model/AsbCloudDbContext.cs @@ -30,7 +30,7 @@ namespace AsbCloudDb.Model public virtual DbSet ProcessMapPlanOperationDeterminationOfOscillationAngles => Set(); public virtual DbSet ProcessMapPlanOperationTFOrientation => Set(); public virtual DbSet ProcessMapPlanOperationSwitchPump => Set(); - public virtual DbSet ProcessMapPlanOperationSwitchMode => Set(); + public virtual DbSet ProcessMapPlanOperationSwitchMode => Set(); public virtual DbSet ProcessMapPlanFunctionsDrillTest => Set(); public virtual DbSet ProcessMapPlanFunctionsShockTest => Set(); public virtual DbSet ProcessMapPlanFunctionsDamper => Set(); @@ -513,7 +513,7 @@ namespace AsbCloudDb.Model .WithMany() .OnDelete(DeleteBehavior.Restrict); - modelBuilder.Entity() + modelBuilder.Entity() .HasOne(p => p.Author) .WithMany() .OnDelete(DeleteBehavior.Restrict); @@ -613,7 +613,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 1b7667d0..762fbb48 100644 --- a/AsbCloudDb/Model/IAsbCloudDbContext.cs +++ b/AsbCloudDb/Model/IAsbCloudDbContext.cs @@ -91,7 +91,7 @@ namespace AsbCloudDb.Model DbSet ProcessMapPlanOperationDeterminationOfOscillationAngles { get; } DbSet ProcessMapPlanOperationTFOrientation { get; } DbSet ProcessMapPlanOperationSwitchPump { get; } - DbSet ProcessMapPlanOperationSwitchMode { get; } + DbSet ProcessMapPlanOperationSwitchMode { get; } DbSet ProcessMapPlanFunctionsDrillTest { get; } DbSet ProcessMapPlanFunctionsShockTest { get; } DbSet ProcessMapPlanFunctionsDamper { get; } diff --git a/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanOperationSwitchMode.cs b/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanOperationSwitchMode.cs deleted file mode 100644 index e47c218b..00000000 --- a/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanOperationSwitchMode.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using AsbCloudDb.Model.ProcessMapPlan; -using Microsoft.EntityFrameworkCore; - -namespace AsbCloudDb.Model.ProcessMaps; - -[Table("t_process_map_plan_operation_switch_mode"), Comment("Выход на режим")] -public class ProcessMapPlanOperationSwitchMode : ProcessMapPlanBase -{ - [Column("exit_time_consumption"), Comment("Выход на плановый расход, время выхода буровых насосов на плановый расход, сек.")] - [Range(0.0, 3600.0)] - [Required] - public double ExitTimeConsumption { get; set; } - - [Column("consumption_flow_rate"), Comment("Выход на плановый расход, расход, л/с")] - [Range(0.0, 100.0)] - [Required] - public double ConsumptionFlowRate { get; set; } - - [Column("pressure_limit_Max"), Comment("Максимально допустимое давление, атм.")] - [Range(0.0, 400.0)] - [Required] - public double PressureLimitMax { get; set; } - - [Column("сomment"), Comment("Комментарий")] - public double Comment { get; set; } - - [ForeignKey(nameof(IdPrevious))] - public virtual ProcessMapPlanOperationSwitchMode? Previous { get; set; } -} \ No newline at end of file diff --git a/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanOperationSwitchingToTheMode.cs b/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanOperationSwitchingToTheMode.cs new file mode 100644 index 00000000..00572092 --- /dev/null +++ b/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanOperationSwitchingToTheMode.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using AsbCloudDb.Model.ProcessMapPlan; +using Microsoft.EntityFrameworkCore; + +namespace AsbCloudDb.Model.ProcessMaps; + +[Table("t_process_map_plan_operation_switch_mode"), Comment("Выход на плановый расход")] +public class ProcessMapPlanOperationSwitchingToTheMode : ProcessMapPlanBase +{ + [Column("ramp_time"), Comment("Время выхода буровых насосов на плановый расход, сек.")] + [Range(0.0, 3600.0)] + [Required] + public double RampTime { get; set; } + + [Column("flow_rate"), Comment("Расход, л/с")] + [Range(0.0, 100.0)] + [Required] + public double FlowRate { get; set; } + + [Column("pressure_limit"), Comment("Максимально допустимое давление, атм.")] + [Range(0.0, 400.0)] + [Required] + public double PressureMax { get; set; } + + [Column("note"), Comment("Примечание"), StringLength(1024)] + [Required] + public string Note { get; set; } = string.Empty; + + [ForeignKey(nameof(IdPrevious))] + public virtual ProcessMapPlanOperationSwitchingToTheMode? Previous { get; set; } +} \ No newline at end of file diff --git a/AsbCloudInfrastructure/DependencyInjection.cs b/AsbCloudInfrastructure/DependencyInjection.cs index d342492c..ae3a6ccd 100644 --- a/AsbCloudInfrastructure/DependencyInjection.cs +++ b/AsbCloudInfrastructure/DependencyInjection.cs @@ -202,22 +202,22 @@ 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() - .Include>() + .Include>() .Map(dest => dest, src => new ChangeLogDto() { Item = src.Adapt() }); TypeAdapterConfig>.NewConfig() - .Include>() + .Include>() .Map(dest => dest, src => new ChangeLogDto() { Item = src.Adapt() @@ -328,90 +328,6 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - - services.AddTransient< - IChangeLogRepository, - ProcessMapPlanBaseRepository>(); - services.AddTransient(); services.AddTransient(); @@ -456,27 +372,7 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); - services.AddTransient(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); - services.AddTransient>(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -541,7 +437,7 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -567,7 +463,7 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -583,5 +479,115 @@ namespace AsbCloudInfrastructure return services; } + + public static IServiceCollection AddProcessMaps(this IServiceCollection services, IConfiguration configuration) + { + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + services.AddTransient>(); + + return services; + } } } diff --git a/AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanOperationSwitchModeTemplate.cs b/AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanOperationSwitchingToTheModeTemplate.cs similarity index 50% rename from AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanOperationSwitchModeTemplate.cs rename to AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanOperationSwitchingToTheModeTemplate.cs index f902678a..5eb370ce 100644 --- a/AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanOperationSwitchModeTemplate.cs +++ b/AsbCloudInfrastructure/Services/ExcelServices/Templates/ProcessMapPlanTemplates/ProcessMapPlanOperationSwitchingToTheModeTemplate.cs @@ -2,13 +2,13 @@ using System.Collections.Generic; namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates; -public class ProcessMapPlanOperationSwitchModeTemplate : ITemplateParameters +public class ProcessMapPlanOperationSwitchingToTheModeTemplate : ITemplateParameters { - public string SheetName => "Выход на режим"; + public string SheetName => "Выход на плановый расход"; public int HeaderRowsCount => 2; - public string FileName => "ProcessMapPlanOperationSwitchModeTemplate.xlsx"; + public string FileName => "ProcessMapPlanOperationSwitchingToTheModeTemplate.xlsx"; public IDictionary Cells => new Dictionary { diff --git a/AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanOperationSwitchModeExportService.cs b/AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanOperationSwitchingToTheModeExportService.cs similarity index 61% rename from AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanOperationSwitchModeExportService.cs rename to AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanOperationSwitchingToTheModeExportService.cs index fbf81245..249af1c4 100644 --- a/AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanOperationSwitchModeExportService.cs +++ b/AsbCloudInfrastructure/Services/ProcessMapPlan/Export/ProcessMapPlanOperationSwitchingToTheModeExportService.cs @@ -10,21 +10,21 @@ using System.Threading.Tasks; namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export; -public class ProcessMapPlanOperationSwitchModeExportService : ProcessMapPlanExportService +public class ProcessMapPlanOperationSwitchingToTheModeExportService : ProcessMapPlanExportService { - public ProcessMapPlanOperationSwitchModeExportService( - IChangeLogRepository processMapPlanRepository, + public ProcessMapPlanOperationSwitchingToTheModeExportService( + IChangeLogRepository processMapPlanRepository, IWellService wellService) : base(processMapPlanRepository, wellService) { } - protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanOperationSwitchModeTemplate(); + protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanOperationSwitchingToTheModeTemplate(); protected override async Task BuildFileNameAsync(WellRelatedExportRequest options, CancellationToken token) { var caption = await wellService.GetWellCaptionByIdAsync(options.IdWell, token); - return $"{caption}_РТК_План_выход_на_режим.xlsx"; + return $"{caption}_РТК_План_выход_на_плановый_расход.xlsx"; } } \ No newline at end of file diff --git a/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanOperationSwitchModeParser.cs b/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanOperationSwitchingToTheModeParser.cs similarity index 71% rename from AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanOperationSwitchModeParser.cs rename to AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanOperationSwitchingToTheModeParser.cs index b7ba441c..2a5e7800 100644 --- a/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanOperationSwitchModeParser.cs +++ b/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanOperationSwitchingToTheModeParser.cs @@ -9,16 +9,16 @@ using AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemp namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Parser; -public class ProcessMapPlanOperationSwitchModeParser : ProcessMapPlanParser +public class ProcessMapPlanOperationSwitchingToTheModeParser : ProcessMapPlanParser { - public ProcessMapPlanOperationSwitchModeParser(IWellOperationRepository wellOperationRepository) + public ProcessMapPlanOperationSwitchingToTheModeParser(IWellOperationRepository wellOperationRepository) : base(wellOperationRepository) { } - protected override ITemplateParameters TemplateParameters => new ProcessMapPlanOperationSwitchModeTemplate(); + protected override ITemplateParameters TemplateParameters => new ProcessMapPlanOperationSwitchingToTheModeTemplate(); - protected override ProcessMapPlanOperationSwitchModeDto BuildDto(IDictionary row, int rowNumber) + protected override ProcessMapPlanOperationSwitchingToTheModeDto BuildDto(IDictionary row, int rowNumber) { var dto = base.BuildDto(row, rowNumber); diff --git a/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanOperationSwitchModeControllerTest.cs b/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanOperationSwitchModeControllerTest.cs deleted file mode 100644 index 34f0c43e..00000000 --- a/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanOperationSwitchModeControllerTest.cs +++ /dev/null @@ -1,73 +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.Controllers.ProcessMapPlan; -using AsbCloudWebApi.IntegrationTests; -using Microsoft.EntityFrameworkCore; -using Xunit; - -namespace AsbCloudWebApi.Controllers.ProcessMaps; - -/// -/// РТК план выход на режим -/// -public class ProcessMapPlanOperationSwitchModeControllerTest : - ProcessMapPlanBaseControllerTest -{ - public ProcessMapPlanOperationSwitchModeControllerTest(WebAppFactoryFixture factory) : base(factory, "ProcessMapPlanOperationSwitchMode") - { - } - private readonly ProcessMapPlanOperationSwitchModeDto dto = new ProcessMapPlanOperationSwitchModeDto() - { - IdWell = 1, - DepthStart = 1, - DepthEnd = 2, - Id = 0, - IdWellSectionType = 1, - Comment = 1, - ExitTimeConsumption = 2, - ConsumptionFlowRate = 3, - PressureLimitMax = 4, - }; - - private readonly ProcessMapPlanOperationSwitchMode entity = new ProcessMapPlanOperationSwitchMode() - { - IdWell = 1, - DepthEnd = 10, - DepthStart = 2, - Id = 0, - IdWellSectionType = 1, - IdAuthor = 1, - IdEditor = 1, - Creation = DateTimeOffset.UtcNow, - Comment = 1, - ExitTimeConsumption = 2, - ConsumptionFlowRate = 3, - PressureLimitMax = 4, - }; - - [Fact] - public async Task Get_actual_returns_success() - { - await Get(entity, dto); - } - - protected override ProcessMapPlanOperationSwitchMode GetByNote(DbSet dbSet, ProcessMapPlanOperationSwitchModeDto dto) - { - throw new NotImplementedException(); - } - - protected override ProcessMapPlanOperationSwitchModeDto GetByNote(IEnumerable dtos, ProcessMapPlanOperationSwitchModeDto dto) - { - throw new NotImplementedException(); - } - - protected override ProcessMapPlanOperationSwitchMode? GetByWellId() - { - throw new NotImplementedException(); - } -} \ No newline at end of file diff --git a/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanOperationSwitchingToTheModeControllerTest.cs b/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanOperationSwitchingToTheModeControllerTest.cs new file mode 100644 index 00000000..a66ee50e --- /dev/null +++ b/AsbCloudWebApi.IntegrationTests/Controllers/ProcessMapPlan/ProcessMapPlanOperationSwitchingToTheModeControllerTest.cs @@ -0,0 +1,65 @@ +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 ProcessMapPlanOperationSwitchingToTheModeControllerTest : + ProcessMapPlanBaseControllerTest +{ + public ProcessMapPlanOperationSwitchingToTheModeControllerTest(WebAppFactoryFixture factory) : base(factory, "ProcessMapPlanOperationSwitchMode") + { + } + private readonly ProcessMapPlanOperationSwitchingToTheModeDto dto = new ProcessMapPlanOperationSwitchingToTheModeDto() + { + IdWell = 1, + DepthStart = 1, + DepthEnd = 2, + Id = 0, + IdWellSectionType = 1, + Comment = 1, + ExitTimeConsumption = 2, + ConsumptionFlowRate = 3, + PressureLimitMax = 4, + }; + + private readonly ProcessMapPlanOperationSwitchingToTheMode entity = new ProcessMapPlanOperationSwitchingToTheMode() + { + IdWell = 1, + DepthEnd = 10, + DepthStart = 2, + Id = 0, + IdWellSectionType = 1, + IdAuthor = 1, + IdEditor = 1, + Creation = DateTimeOffset.UtcNow, + Comment = "1", + }; + + [Fact] + public async Task Get_actual_returns_success() + { + await Get(entity, dto); + } + + protected override ProcessMapPlanOperationSwitchingToTheMode GetByNote(DbSet dbSet, ProcessMapPlanOperationSwitchingToTheModeDto dto) + { + throw new NotImplementedException(); + } + + protected override ProcessMapPlanOperationSwitchingToTheModeDto GetByNote(IEnumerable dtos, ProcessMapPlanOperationSwitchingToTheModeDto dto) + { + throw new NotImplementedException(); + } + + protected override ProcessMapPlanOperationSwitchingToTheMode? GetByWellId() + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanOperationSwitchModeController.cs b/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanOperationSwitchModeController.cs deleted file mode 100644 index 91b5629f..00000000 --- a/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanOperationSwitchModeController.cs +++ /dev/null @@ -1,28 +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; - -namespace AsbCloudWebApi.Controllers.ProcessMaps; - -/// -/// РТК план выход на режим -/// -public class ProcessMapPlanOperationSwitchModeController : - ProcessMapPlanBaseController -{ - public ProcessMapPlanOperationSwitchModeController( - IChangeLogRepository repository, - IWellService wellService, - ProcessMapPlanOperationSwitchModeParser parserService, - ITelemetryService telemetryService, - ProcessMapPlanOperationSwitchModeExportService processMapPlanExportService) - : base(repository, wellService, parserService, processMapPlanExportService, telemetryService) - { - } - - protected override string TemplateFileName => "ЕЦП_шаблон_файла_РТК_план_выход_на_режим.xlsx"; -} \ No newline at end of file diff --git a/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanOperationSwitchingToTheModeController.cs b/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanOperationSwitchingToTheModeController.cs new file mode 100644 index 00000000..ada87bf5 --- /dev/null +++ b/AsbCloudWebApi/Controllers/ProcessMaps/ProcessMapPlanOperationSwitchingToTheModeController.cs @@ -0,0 +1,28 @@ +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; + +namespace AsbCloudWebApi.Controllers.ProcessMaps; + +/// +/// РТК план выход на плановый расход +/// +public class ProcessMapPlanOperationSwitchingToTheModeController : + ProcessMapPlanBaseController +{ + public ProcessMapPlanOperationSwitchingToTheModeController( + IChangeLogRepository repository, + IWellService wellService, + ProcessMapPlanOperationSwitchingToTheModeParser parserService, + ITelemetryService telemetryService, + ProcessMapPlanOperationSwitchingToTheModeExportService processMapPlanExportService) + : base(repository, wellService, parserService, processMapPlanExportService, telemetryService) + { + } + + protected override string TemplateFileName => "ЕЦП_шаблон_файла_РТК_план_выход_на_плановый_расход.xlsx"; +} \ No newline at end of file