Противоаварийное вращение

This commit is contained in:
Olga Nemt 2024-06-29 21:10:12 +05:00
parent 65f2f77459
commit cf1f8f305b
11 changed files with 92 additions and 124 deletions

View File

@ -1,27 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace AsbCloudApp.Data.ProcessMaps;
/// <summary>
/// РТК план противоаварийное вращение
/// </summary>
public class ProcessMapPlanFunctionsAnticrashRotationDto : ProcessMapPlanBaseDto
{
/// <summary>
/// Минимальные обороты ВСП, об/мин
/// </summary>
[Range(0.0, 250.0, ErrorMessage = "Минимальные обороты ВСП, об/мин., должно быть в пределах от 0 до 250")]
public double TopDriveRpmMin { get; set; }
/// <summary>
/// Минимальный расход для запуска оборотов ВСП, л/сек
/// </summary>
[Range(0.0, 100.0, ErrorMessage = "Минимальный расход для запуска оборотов ВСП, л/сек., должно быть в пределах от 0 до 100")]
public double TopDriveStartMinFlowRate { get; set; }
/// <summary>
/// Максимально допустимый момент на ВСП при противоаварийном вращении, кН*м
/// </summary>
[Range(1.0, 35.0, ErrorMessage = "Максимально допустимый момент на ВСП при противоаварийном вращении, кН*м., должно быть в пределах от 1 до 35")]
public double TopDriveTorqueMax { get; set; }
}

View File

@ -38,7 +38,7 @@ namespace AsbCloudDb.Model
public virtual DbSet<ProcessMapPlanFunctionsJarrDrillTool> ProcessMapPlanFunctionsJarrDrillTool => Set<ProcessMapPlanFunctionsJarrDrillTool>();
public virtual DbSet<ProcessMapPlanFunctionsUpgradeNoload> ProcessMapPlanFunctionsUpgradeNoload => Set<ProcessMapPlanFunctionsUpgradeNoload>();
public virtual DbSet<ProcessMapPlanFunctionsOscillation> ProcessMapPlanFunctionsOscillation => Set<ProcessMapPlanFunctionsOscillation>();
public virtual DbSet<ProcessMapPlanFunctionsAnticrashRotation> ProcessMapPlanFunctionsAnticrashRotation => Set<ProcessMapPlanFunctionsAnticrashRotation>();
public virtual DbSet<ProcessMapPlanAntiCrashRotation> ProcessMapPlanFunctionsAnticrashRotation => Set<ProcessMapPlanAntiCrashRotation>();
public virtual DbSet<ProcessMapPlanFunctionsStaticMeasure> ProcessMapPlanFunctionsStaticMeasure => Set<ProcessMapPlanFunctionsStaticMeasure>();
public virtual DbSet<DrillingProgramPart> DrillingProgramParts => Set<DrillingProgramPart>();
@ -553,7 +553,7 @@ namespace AsbCloudDb.Model
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanFunctionsAnticrashRotation>()
modelBuilder.Entity<ProcessMapPlanAntiCrashRotation>()
.HasOne(p => p.Author)
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
@ -653,7 +653,7 @@ namespace AsbCloudDb.Model
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanFunctionsAnticrashRotation>()
modelBuilder.Entity<ProcessMapPlanAntiCrashRotation>()
.HasOne(p => p.Editor)
.WithMany()
.OnDelete(DeleteBehavior.Restrict);

View File

@ -99,7 +99,7 @@ namespace AsbCloudDb.Model
DbSet<ProcessMapPlanFunctionsJarrDrillTool> ProcessMapPlanFunctionsJarrDrillTool { get; }
DbSet<ProcessMapPlanFunctionsUpgradeNoload> ProcessMapPlanFunctionsUpgradeNoload { get; }
DbSet<ProcessMapPlanFunctionsOscillation> ProcessMapPlanFunctionsOscillation { get; }
DbSet<ProcessMapPlanFunctionsAnticrashRotation> ProcessMapPlanFunctionsAnticrashRotation { get; }
DbSet<ProcessMapPlanAntiCrashRotation> ProcessMapPlanFunctionsAnticrashRotation { get; }
DbSet<ProcessMapPlanFunctionsStaticMeasure> ProcessMapPlanFunctionsStaticMeasure { get; }
Task<int> RefreshMaterializedViewAsync(string mwName, CancellationToken token);

View File

@ -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; }
}

View File

@ -258,11 +258,11 @@ namespace AsbCloudInfrastructure
Item = src.Adapt<ProcessMapPlanFunctionsOscillationDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanFunctionsAnticrashRotationDto>>.NewConfig()
.Include<ProcessMapPlanFunctionsAnticrashRotation, ChangeLogDto<ProcessMapPlanFunctionsAnticrashRotationDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanFunctionsAnticrashRotationDto>()
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanAntiCrashRotationDto>>.NewConfig()
.Include<ProcessMapPlanAntiCrashRotation, ChangeLogDto<ProcessMapPlanAntiCrashRotationDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanAntiCrashRotationDto>()
{
Item = src.Adapt<ProcessMapPlanFunctionsAnticrashRotationDto>()
Item = src.Adapt<ProcessMapPlanAntiCrashRotationDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanFunctionsStaticMeasureDto>>.NewConfig()
@ -445,7 +445,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<ProcessMapPlanFunctionsJarrDrillToolParser>();
services.AddTransient<ProcessMapPlanFunctionsUpgradeNoloadParser>();
services.AddTransient<ProcessMapPlanFunctionsOscillationParser>();
services.AddTransient<ProcessMapPlanFunctionsAnticrashRotationParser>();
services.AddTransient<ProcessMapPlanAntiCrashRotationParser>();
services.AddTransient<ProcessMapPlanFunctionsStaticMeasureParser>();
services.AddTransient<TrajectoryPlanExportService>();
@ -471,7 +471,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<ProcessMapPlanFunctionsJarrDrillToolExportService>();
services.AddTransient<ProcessMapPlanFunctionsUpgradeNoloadExportService>();
services.AddTransient<ProcessMapPlanFunctionsOscillationExportService>();
services.AddTransient<ProcessMapPlanFunctionsAnticrashRotationExportService>();
services.AddTransient<ProcessMapPlanAntiCrashRotationExportService>();
services.AddTransient<ProcessMapPlanFunctionsStaticMeasureExportService>();
services.AddTransient<WellOperationParserFactory>();
@ -559,8 +559,8 @@ namespace AsbCloudInfrastructure
ProcessMapPlanBaseRepository<ProcessMapPlanFunctionsOscillation, ProcessMapPlanFunctionsOscillationDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanFunctionsAnticrashRotationDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanFunctionsAnticrashRotation, ProcessMapPlanFunctionsAnticrashRotationDto>>();
IChangeLogRepository<ProcessMapPlanAntiCrashRotationDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanAntiCrashRotation, ProcessMapPlanAntiCrashRotationDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanFunctionsStaticMeasureDto, ProcessMapPlanBaseRequestWithWell>,
@ -584,7 +584,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanFunctionsJarrDrillToolDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanFunctionsUpgradeNoloadDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanFunctionsOscillationDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanFunctionsAnticrashRotationDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanAntiCrashRotationDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanFunctionsStaticMeasureDto>>();
return services;

View File

@ -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<string, Cell> Cells => new Dictionary<string, Cell>
{

View File

@ -10,16 +10,16 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
public class ProcessMapPlanFunctionsAnticrashRotationExportService : ProcessMapPlanExportService<ProcessMapPlanFunctionsAnticrashRotationDto>
public class ProcessMapPlanAntiCrashRotationExportService : ProcessMapPlanExportService<ProcessMapPlanAntiCrashRotationDto>
{
public ProcessMapPlanFunctionsAnticrashRotationExportService(
IChangeLogRepository<ProcessMapPlanFunctionsAnticrashRotationDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
public ProcessMapPlanAntiCrashRotationExportService(
IChangeLogRepository<ProcessMapPlanAntiCrashRotationDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
IWellService wellService)
: base(processMapPlanRepository, wellService)
{
}
protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanFunctionsAnticrashRotationTemplate();
protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanAntiCrashRotationTemplate();
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 ProcessMapPlanFunctionsAnticrashRotationParser : ProcessMapPlanParser<ProcessMapPlanFunctionsAnticrashRotationDto>
public class ProcessMapPlanAntiCrashRotationParser : ProcessMapPlanParser<ProcessMapPlanAntiCrashRotationDto>
{
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<string, object?> row, int rowNumber)
protected override ProcessMapPlanAntiCrashRotationDto BuildDto(IDictionary<string, object?> row, int rowNumber)
{
var dto = base.BuildDto(row, rowNumber);

View File

@ -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;
/// <summary>
/// РТК план противоаварийное вращение
/// </summary>
public class ProcessMapPlanAntiCrashRotationControllerTest :
ProcessMapPlanBaseControllerTest<ProcessMapPlanAntiCrashRotation, ProcessMapPlanAntiCrashRotationDto>
{
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<ProcessMapPlanAntiCrashRotation> dbSet, ProcessMapPlanAntiCrashRotationDto dto)
{
throw new NotImplementedException();
}
protected override ProcessMapPlanAntiCrashRotationDto GetByNote(IEnumerable<ProcessMapPlanAntiCrashRotationDto> dtos, ProcessMapPlanAntiCrashRotationDto dto)
{
throw new NotImplementedException();
}
protected override ProcessMapPlanAntiCrashRotation? GetByWellId()
{
throw new NotImplementedException();
}
}

View File

@ -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;
/// <summary>
/// РТК план противоаварийное вращение
/// </summary>
public class ProcessMapPlanFunctionsAnticrashRotationControllerTest :
ProcessMapPlanBaseControllerTest<ProcessMapPlanFunctionsAnticrashRotation, ProcessMapPlanFunctionsAnticrashRotationDto>
{
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<ProcessMapPlanFunctionsAnticrashRotation> dbSet, ProcessMapPlanFunctionsAnticrashRotationDto dto)
{
throw new NotImplementedException();
}
protected override ProcessMapPlanFunctionsAnticrashRotationDto GetByNote(IEnumerable<ProcessMapPlanFunctionsAnticrashRotationDto> dtos, ProcessMapPlanFunctionsAnticrashRotationDto dto)
{
throw new NotImplementedException();
}
protected override ProcessMapPlanFunctionsAnticrashRotation? GetByWellId()
{
throw new NotImplementedException();
}
}

View File

@ -11,15 +11,15 @@ namespace AsbCloudWebApi.Controllers.ProcessMaps;
/// <summary>
/// РТК план противоаварийное вращение
/// </summary>
public class ProcessMapPlanFunctionsAnticrashRotationController :
ProcessMapPlanBaseController<ProcessMapPlanFunctionsAnticrashRotation, ProcessMapPlanFunctionsAnticrashRotationDto>
public class ProcessMapPlanAntiCrashRotationController :
ProcessMapPlanBaseController<ProcessMapPlanAntiCrashRotation, ProcessMapPlanAntiCrashRotationDto>
{
public ProcessMapPlanFunctionsAnticrashRotationController(
IChangeLogRepository<ProcessMapPlanFunctionsAnticrashRotationDto, ProcessMapPlanBaseRequestWithWell> repository,
public ProcessMapPlanAntiCrashRotationController(
IChangeLogRepository<ProcessMapPlanAntiCrashRotationDto, ProcessMapPlanBaseRequestWithWell> repository,
IWellService wellService,
ProcessMapPlanFunctionsAnticrashRotationParser parserService,
ProcessMapPlanAntiCrashRotationParser parserService,
ITelemetryService telemetryService,
ProcessMapPlanFunctionsAnticrashRotationExportService processMapPlanExportService)
ProcessMapPlanAntiCrashRotationExportService processMapPlanExportService)
: base(repository, wellService, parserService, processMapPlanExportService, telemetryService)
{
}