ShockTest

This commit is contained in:
Olga Nemt 2024-06-29 23:24:53 +05:00
parent e501a24875
commit e71b59a1ed
11 changed files with 89 additions and 109 deletions

View File

@ -0,0 +1,45 @@
using System.ComponentModel.DataAnnotations;
namespace AsbCloudApp.Data.ProcessMaps;
/// <summary>
/// РТК план дрилтест
/// </summary>
public class ProcessMapPlanDrillTestDto : ProcessMapPlanBaseDto
{
/// <summary>
/// Нагрузка минимальная, т
/// </summary>
[Range(1.0, 30.0, ErrorMessage = "Нагрузка минимальная, т., должно быть в пределах от 1 до 30")]
public double WeightOnBitMin { get; set; }
/// <summary>
/// Количество шагов по нагрузке
/// </summary>
[Range(1, 5, ErrorMessage = "Количество шагов по нагрузке, должно быть в пределах от 1 до 5")]
public int WeightOnBitStepsCount { get; set; }
/// <summary>
/// Минимальные обороты на ВСП, об/мин.
/// </summary>
[Range(5, 200, ErrorMessage = "Минимальные обороты на ВСП, об/мин., должно быть в пределах от 5 до 200")]
public int RpmMin { get; set; }
/// <summary>
/// Количество шагов оборотов на ВСП, шт.
/// </summary>
[Range(1, 5, ErrorMessage = "Количество шагов оборотов на ВСП, шт., должно быть в пределах от 1 до 5")]
public int RpmStepsCount { get; set; }
/// <summary>
/// Величина проходки шага, м.
/// </summary>
[Range(0.1, 2.0, ErrorMessage = "Величина проходки шага, м., должно быть в пределах от 0.1 до 2")]
public double LengthStep { get; set; }
/// <summary>
/// Примечание
/// </summary>
[StringLength(1024, ErrorMessage = "Примечание, должно быть не более 1024 символа")]
public string Note { get; set; } = string.Empty;
}

View File

@ -1,57 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace AsbCloudApp.Data.ProcessMaps;
/// <summary>
/// РТК план shocktest
/// </summary>
public class ProcessMapPlanFunctionsShockTestDto : ProcessMapPlanBaseDto
{
/// <summary>
/// StickSlip
/// </summary>
[Range(0.0, 1000.0, ErrorMessage = "StickSlip, должно быть в пределах от 0 до 1000")]
public double StickSlip { get; set; }
/// <summary>
/// Whirl
/// </summary>
[Range(0.0, 1000.0, ErrorMessage = "Whirl, должно быть в пределах от 0 до 1000")]
public double Whirl { get; set; }
/// <summary>
/// Осевые вибрации
/// </summary>
[Range(0.0, 1000.0, ErrorMessage = "Осевые вибрации, должно быть в пределах от 0 до 1000")]
public double AxialVibrations { get; set; }
/// <summary>
/// Комбинированные вибрации
/// </summary>
[Range(0.0, 1000.0, ErrorMessage = "Комбинированные вибрации, должно быть в пределах от 0 до 1000")]
public double CombinedVibrations { get; set; }
/// <summary>
/// Нагрузка минимальная, т
/// </summary>
[Range(1.0, 30.0, ErrorMessage = "Комбинированные вибрации, должно быть в пределах от 1 до 30")]
public double WeightOnBitMin { get; set; }
/// <summary>
/// Минимальные обороты на ВСП, об/мин.
/// </summary>
[Range(5, 200, ErrorMessage = "Минимальные обороты на ВСП, об/мин., должно быть в пределах от 5 до 200")]
public int RevolutionPerMinuteMin { get; set; }
/// <summary>
/// Автозапуск или Предупреждение
/// </summary>
[Required]
public bool IdAutostartOrWarning { get; set; }
/// <summary>
/// Примечание
/// </summary>
[StringLength(1024, ErrorMessage = "Примечание, должно быть не более 1024 символов")]
public string Note { get; set; } = string.Empty;
}

View File

@ -32,7 +32,7 @@ namespace AsbCloudDb.Model
public virtual DbSet<ProcessMapPlanOperationSwitchPump> ProcessMapPlanOperationSwitchPump => Set<ProcessMapPlanOperationSwitchPump>();
public virtual DbSet<ProcessMapPlanOperationSwitchingToTheMode> ProcessMapPlanOperationSwitchMode => Set<ProcessMapPlanOperationSwitchingToTheMode>();
public virtual DbSet<ProcessMapPlanDrillTest> ProcessMapPlanFunctionsDrillTest => Set<ProcessMapPlanDrillTest>();
public virtual DbSet<ProcessMapPlanFunctionsShockTest> ProcessMapPlanFunctionsShockTest => Set<ProcessMapPlanFunctionsShockTest>();
public virtual DbSet<ProcessMapPlanShockTest> ProcessMapPlanFunctionsShockTest => Set<ProcessMapPlanShockTest>();
public virtual DbSet<ProcessMapPlanFunctionsDamper> ProcessMapPlanFunctionsDamper => Set<ProcessMapPlanFunctionsDamper>();
public virtual DbSet<ProcessMapPlanAutoHoldTF> ProcessMapPlanFunctionsAutoHold => Set<ProcessMapPlanAutoHoldTF>();
public virtual DbSet<ProcessMapPlanFunctionsJarrDrillTool> ProcessMapPlanFunctionsJarrDrillTool => Set<ProcessMapPlanFunctionsJarrDrillTool>();
@ -523,7 +523,7 @@ namespace AsbCloudDb.Model
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanFunctionsShockTest>()
modelBuilder.Entity<ProcessMapPlanShockTest>()
.HasOne(p => p.Author)
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
@ -623,7 +623,7 @@ namespace AsbCloudDb.Model
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanFunctionsShockTest>()
modelBuilder.Entity<ProcessMapPlanShockTest>()
.HasOne(p => p.Editor)
.WithMany()
.OnDelete(DeleteBehavior.Restrict);

View File

@ -93,7 +93,7 @@ namespace AsbCloudDb.Model
DbSet<ProcessMapPlanOperationSwitchPump> ProcessMapPlanOperationSwitchPump { get; }
DbSet<ProcessMapPlanOperationSwitchingToTheMode> ProcessMapPlanOperationSwitchMode { get; }
DbSet<ProcessMapPlanDrillTest> ProcessMapPlanFunctionsDrillTest { get; }
DbSet<ProcessMapPlanFunctionsShockTest> ProcessMapPlanFunctionsShockTest { get; }
DbSet<ProcessMapPlanShockTest> ProcessMapPlanFunctionsShockTest { get; }
DbSet<ProcessMapPlanFunctionsDamper> ProcessMapPlanFunctionsDamper { get; }
DbSet<ProcessMapPlanAutoHoldTF> ProcessMapPlanFunctionsAutoHold { get; }
DbSet<ProcessMapPlanFunctionsJarrDrillTool> ProcessMapPlanFunctionsJarrDrillTool { get; }

View File

@ -5,10 +5,10 @@ using Microsoft.EntityFrameworkCore;
namespace AsbCloudDb.Model.ProcessMaps;
[Table("t_process_map_functions_shock_test"), Comment("ShockTest")]
public class ProcessMapPlanFunctionsShockTest : ProcessMapPlanBase
[Table("t_process_map_shock_test"), Comment("ShockTest")]
public class ProcessMapPlanShockTest : ProcessMapPlanBase
{
[Column("stickslip"), Comment("StickSlip")]
[Column("stickSlip"), Comment("stickSlip")]
[Range(0.0, 1000.0)]
[Required]
public double StickSlip { get; set; }
@ -29,22 +29,18 @@ public class ProcessMapPlanFunctionsShockTest : ProcessMapPlanBase
public double CombinedVibrations { get; set; }
[Column("weight_on_bit_min"), Comment("Нагрузка минимальная, т")]
[Range(1.0, 30.0)]
[Range(0.0, 30.0)]
[Required]
public double WeightOnBitMin { get; set; }
[Column("revolution_per_minute_min"), Comment("Минимальные обороты на ВСП, об/мин.")]
[Column("rpm_min"), Comment("Минимальные обороты на ВСП, об/мин.")]
[Range(5, 200)]
[Required]
public int RevolutionPerMinuteMin { get; set; }
[Column("id_autostart_or_warning"), Comment("Автозапуск или Предупреждение")]
[Required]
public bool IdAutostartOrWarning { get; set; }
public double RpmMin { get; set; }
[Column("note"), Comment("Примечание"), StringLength(1024)]
public string Note { get; set; } = string.Empty;
[ForeignKey(nameof(IdPrevious))]
public virtual ProcessMapPlanFunctionsShockTest? Previous { get; set; }
public virtual ProcessMapPlanShockTest? Previous { get; set; }
}

View File

@ -216,11 +216,11 @@ namespace AsbCloudInfrastructure
Item = src.Adapt<ProcessMapPlanDrillTestDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanFunctionsShockTestDto>>.NewConfig()
.Include<ProcessMapPlanOperationSwitchingToTheMode, ChangeLogDto<ProcessMapPlanFunctionsShockTestDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanFunctionsShockTestDto>()
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanShockTestDto>>.NewConfig()
.Include<ProcessMapPlanOperationSwitchingToTheMode, ChangeLogDto<ProcessMapPlanShockTestDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanShockTestDto>()
{
Item = src.Adapt<ProcessMapPlanFunctionsShockTestDto>()
Item = src.Adapt<ProcessMapPlanShockTestDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanFunctionsDamperDto>>.NewConfig()
@ -439,7 +439,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<ProcessMapPlanOperationSwitchPumpParser>();
services.AddTransient<ProcessMapPlanOperationSwitchingToTheModeParser>();
services.AddTransient<ProcessMapPlanDrillTestParser>();
services.AddTransient<ProcessMapPlanFunctionsShockTestParser>();
services.AddTransient<ProcessMapPlanShockTestParser>();
services.AddTransient<ProcessMapPlanFunctionsDamperParser>();
services.AddTransient<ProcessMapPlanAutoHoldTFParser>();
services.AddTransient<ProcessMapPlanFunctionsJarrDrillToolParser>();
@ -465,7 +465,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<ProcessMapPlanOperationSwitchPumpExportService>();
services.AddTransient<ProcessMapPlanOperationSwitchingToTheModeExportService>();
services.AddTransient<ProcessMapPlanDrillTestExportService>();
services.AddTransient<ProcessMapPlanFunctionsShockTestExportService>();
services.AddTransient<ProcessMapPlanShockTestExportService>();
services.AddTransient<ProcessMapPlanFunctionsDamperExportService>();
services.AddTransient<ProcessMapPlanAutoHoldTFExportService>();
services.AddTransient<ProcessMapPlanFunctionsJarrDrillToolExportService>();
@ -535,8 +535,8 @@ namespace AsbCloudInfrastructure
ProcessMapPlanBaseRepository<ProcessMapPlanDrillTest, ProcessMapPlanDrillTestDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanFunctionsShockTestDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanFunctionsShockTest, ProcessMapPlanFunctionsShockTestDto>>();
IChangeLogRepository<ProcessMapPlanShockTestDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanShockTest, ProcessMapPlanShockTestDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanFunctionsDamperDto, ProcessMapPlanBaseRequestWithWell>,
@ -578,7 +578,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOperationSwitchPumpDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOperationSwitchingToTheModeDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanDrillTestDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanFunctionsShockTestDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanShockTestDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanFunctionsDamperDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanAutoHoldTFDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanFunctionsJarrDrillToolDto>>();

View File

@ -2,13 +2,13 @@ using System.Collections.Generic;
namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
public class ProcessMapPlanFunctionsShockTestTemplate : ITemplateParameters
public class ProcessMapPlanShockTestTemplate : ITemplateParameters
{
public string SheetName => "Запись shock test";
public int HeaderRowsCount => 2;
public string FileName => "ProcessMapPlanFunctionsShockTestTemplate.xlsx";
public string FileName => "ProcessMapPlanShockTestTemplate.xlsx";
public IDictionary<string, Cell> Cells => new Dictionary<string, Cell>
{

View File

@ -10,16 +10,16 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
public class ProcessMapPlanFunctionsShockTestExportService : ProcessMapPlanExportService<ProcessMapPlanFunctionsShockTestDto>
public class ProcessMapPlanShockTestExportService : ProcessMapPlanExportService<ProcessMapPlanShockTestDto>
{
public ProcessMapPlanFunctionsShockTestExportService(
IChangeLogRepository<ProcessMapPlanFunctionsShockTestDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
public ProcessMapPlanShockTestExportService(
IChangeLogRepository<ProcessMapPlanShockTestDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
IWellService wellService)
: base(processMapPlanRepository, wellService)
{
}
protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanFunctionsShockTestTemplate();
protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanShockTestTemplate();
protected override async Task<string> BuildFileNameAsync(WellRelatedExportRequest options, CancellationToken token)
{

View File

@ -9,16 +9,16 @@ using AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemp
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
public class ProcessMapPlanFunctionsShockTestParser : ProcessMapPlanParser<ProcessMapPlanFunctionsShockTestDto>
public class ProcessMapPlanShockTestParser : ProcessMapPlanParser<ProcessMapPlanShockTestDto>
{
public ProcessMapPlanFunctionsShockTestParser(IWellOperationRepository wellOperationRepository)
public ProcessMapPlanShockTestParser(IWellOperationRepository wellOperationRepository)
: base(wellOperationRepository)
{
}
protected override ITemplateParameters TemplateParameters => new ProcessMapPlanFunctionsShockTestTemplate();
protected override ITemplateParameters TemplateParameters => new ProcessMapPlanShockTestTemplate();
protected override ProcessMapPlanFunctionsShockTestDto BuildDto(IDictionary<string, object?> row, int rowNumber)
protected override ProcessMapPlanShockTestDto BuildDto(IDictionary<string, object?> row, int rowNumber)
{
var dto = base.BuildDto(row, rowNumber);

View File

@ -15,13 +15,13 @@ namespace AsbCloudWebApi.Controllers.ProcessMaps;
/// <summary>
/// РТК план shock test
/// </summary>
public class ProcessMapPlanFunctionsShockTestControllerTest :
ProcessMapPlanBaseControllerTest<ProcessMapPlanFunctionsShockTest, ProcessMapPlanFunctionsShockTestDto>
public class ProcessMapPlanShockTestControllerTest :
ProcessMapPlanBaseControllerTest<ProcessMapPlanShockTest, ProcessMapPlanShockTestDto>
{
public ProcessMapPlanFunctionsShockTestControllerTest(WebAppFactoryFixture factory) : base(factory, "ProcessMapPlanFunctionsShockTest")
public ProcessMapPlanShockTestControllerTest(WebAppFactoryFixture factory) : base(factory, "ProcessMapPlanFunctionsShockTest")
{
}
private readonly ProcessMapPlanFunctionsShockTestDto dto = new ProcessMapPlanFunctionsShockTestDto()
private readonly ProcessMapPlanShockTestDto dto = new ProcessMapPlanShockTestDto()
{
IdWell = 1,
DepthStart = 1,
@ -30,15 +30,13 @@ public class ProcessMapPlanFunctionsShockTestControllerTest :
IdWellSectionType = 1,
AxialVibrations = 1,
CombinedVibrations = 2,
IdAutostartOrWarning = true,
Note = "1",
RevolutionPerMinuteMin = 1,
StickSlip = 1,
WeightOnBitMin = 1,
Whirl = 1
};
private readonly ProcessMapPlanFunctionsShockTest entity = new ProcessMapPlanFunctionsShockTest()
private readonly ProcessMapPlanShockTest entity = new ProcessMapPlanShockTest()
{
IdWell = 1,
DepthEnd = 10,
@ -50,9 +48,7 @@ public class ProcessMapPlanFunctionsShockTestControllerTest :
Creation = DateTimeOffset.UtcNow,
AxialVibrations = 1,
CombinedVibrations = 2,
IdAutostartOrWarning = true,
Note = "1",
RevolutionPerMinuteMin = 1,
StickSlip = 1,
WeightOnBitMin = 1,
Whirl = 1
@ -64,17 +60,17 @@ public class ProcessMapPlanFunctionsShockTestControllerTest :
await Get(entity, dto);
}
protected override ProcessMapPlanFunctionsShockTest GetByNote(DbSet<ProcessMapPlanFunctionsShockTest> dbSet, ProcessMapPlanFunctionsShockTestDto dto)
protected override ProcessMapPlanShockTest GetByNote(DbSet<ProcessMapPlanShockTest> dbSet, ProcessMapPlanShockTestDto dto)
{
throw new NotImplementedException();
}
protected override ProcessMapPlanFunctionsShockTestDto GetByNote(IEnumerable<ProcessMapPlanFunctionsShockTestDto> dtos, ProcessMapPlanFunctionsShockTestDto dto)
protected override ProcessMapPlanShockTestDto GetByNote(IEnumerable<ProcessMapPlanShockTestDto> dtos, ProcessMapPlanShockTestDto dto)
{
throw new NotImplementedException();
}
protected override ProcessMapPlanFunctionsShockTest? GetByWellId()
protected override ProcessMapPlanShockTest? GetByWellId()
{
throw new NotImplementedException();
}

View File

@ -11,15 +11,15 @@ namespace AsbCloudWebApi.Controllers.ProcessMaps;
/// <summary>
/// РТК план shock test
/// </summary>
public class ProcessMapPlanFunctionsShockTestController :
ProcessMapPlanBaseController<ProcessMapPlanFunctionsShockTest, ProcessMapPlanFunctionsShockTestDto>
public class ProcessMapPlanShockTestController :
ProcessMapPlanBaseController<ProcessMapPlanShockTest, ProcessMapPlanShockTestDto>
{
public ProcessMapPlanFunctionsShockTestController(
IChangeLogRepository<ProcessMapPlanFunctionsShockTestDto, ProcessMapPlanBaseRequestWithWell> repository,
public ProcessMapPlanShockTestController(
IChangeLogRepository<ProcessMapPlanShockTestDto, ProcessMapPlanBaseRequestWithWell> repository,
IWellService wellService,
ProcessMapPlanFunctionsShockTestParser parserService,
ProcessMapPlanShockTestParser parserService,
ITelemetryService telemetryService,
ProcessMapPlanFunctionsShockTestExportService processMapPlanExportService)
ProcessMapPlanShockTestExportService processMapPlanExportService)
: base(repository, wellService, parserService, processMapPlanExportService, telemetryService)
{
}