Запись статического замера

This commit is contained in:
Olga Nemt 2024-06-30 13:42:37 +05:00
parent 1093320f9c
commit 3ae3017b8d
12 changed files with 78 additions and 59 deletions

View File

@ -1,15 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace AsbCloudApp.Data.ProcessMaps;
/// <summary>
/// РТК план записи статического замера
/// </summary>
public class ProcessMapPlanSurveyDto : ProcessMapPlanBaseDto
{
/// <summary>
/// Время записи замера, сек
/// </summary>
[Range(0.0, 1800.0, ErrorMessage = "Время записи замера, сек., должно быть в пределах от 0 до 1800")]
public double MeasurementRecordingTime { get; set; }
}

View File

@ -0,0 +1,34 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AsbCloudApp.Data.ProcessMaps;
/// <summary>
/// РТК план выход на плановый расход
/// </summary>
public class ProcessMapPlanSwitchingToTheModeDto : ProcessMapPlanBaseDto
{
/// <summary>
/// Время выхода буровых насосов на плановый расход, сек.
/// </summary>
[Range(0.0, 3600.0, ErrorMessage = "Время выхода буровых насосов на плановый расход, сек., должно быть в пределах от 0 до 3600")]
public double RampTime { get; set; }
/// <summary>
/// Расход, л/с
/// </summary>
[Range(0.0, 100.0, ErrorMessage = "Расход, л/с., должно быть в пределах от 0 до 100")]
public double FlowRate { get; set; }
/// <summary>
/// Максимально допустимое давление, атм.
/// </summary>
[Range(0.0, 400.0, ErrorMessage = "Максимально допустимое давление, атм., должно быть в пределах от 0 до 400")]
public double PressureMax { get; set; }
/// <summary>
/// Примечание
/// </summary>
[StringLength(1024, ErrorMessage = "Примечание, должно быть не более 1024 символов")]
public string Note { get; set; } = string.Empty;
}

View File

@ -25,7 +25,7 @@ namespace AsbCloudDb.Model
public virtual DbSet<ProcessMapPlanReamingRotor> ProcessMapPlanOperationReamingRotor => Set<ProcessMapPlanReamingRotor>(); public virtual DbSet<ProcessMapPlanReamingRotor> ProcessMapPlanOperationReamingRotor => Set<ProcessMapPlanReamingRotor>();
public virtual DbSet<ProcessMapPlanReamingSlide> ProcessMapPlanOperationReamingSlide => Set<ProcessMapPlanReamingSlide>(); public virtual DbSet<ProcessMapPlanReamingSlide> ProcessMapPlanOperationReamingSlide => Set<ProcessMapPlanReamingSlide>();
public virtual DbSet<ProcessMapPlanLoadCapacity> ProcessMapPlanOperationLoadCapacity => Set<ProcessMapPlanLoadCapacity>(); public virtual DbSet<ProcessMapPlanLoadCapacity> ProcessMapPlanOperationLoadCapacity => Set<ProcessMapPlanLoadCapacity>();
public virtual DbSet<ProcessMapPlanSurvey> ProcessMapPlanSurvey => Set<ProcessMapPlanSurvey>(); public virtual DbSet<ProcessMapPlanRecordingStaticMeasurement> ProcessMapPlanSurvey => Set<ProcessMapPlanRecordingStaticMeasurement>();
public virtual DbSet<ProcessMapPlanPositioningOffTheBottom> ProcessMapPlanOperationPositioningOffTheBottom => Set<ProcessMapPlanPositioningOffTheBottom>(); public virtual DbSet<ProcessMapPlanPositioningOffTheBottom> ProcessMapPlanOperationPositioningOffTheBottom => Set<ProcessMapPlanPositioningOffTheBottom>();
public virtual DbSet<ProcessMapPlanOscillationAngles> ProcessMapPlanOperationDeterminationOfOscillationAngles => Set<ProcessMapPlanOscillationAngles>(); public virtual DbSet<ProcessMapPlanOscillationAngles> ProcessMapPlanOperationDeterminationOfOscillationAngles => Set<ProcessMapPlanOscillationAngles>();
public virtual DbSet<ProcessMapPlanTFOrientation> ProcessMapPlanOperationTFOrientation => Set<ProcessMapPlanTFOrientation>(); public virtual DbSet<ProcessMapPlanTFOrientation> ProcessMapPlanOperationTFOrientation => Set<ProcessMapPlanTFOrientation>();
@ -488,7 +488,7 @@ namespace AsbCloudDb.Model
.WithMany() .WithMany()
.OnDelete(DeleteBehavior.Restrict); .OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanSurvey>() modelBuilder.Entity<ProcessMapPlanRecordingStaticMeasurement>()
.HasOne(p => p.Author) .HasOne(p => p.Author)
.WithMany() .WithMany()
.OnDelete(DeleteBehavior.Restrict); .OnDelete(DeleteBehavior.Restrict);
@ -588,7 +588,7 @@ namespace AsbCloudDb.Model
.WithMany() .WithMany()
.OnDelete(DeleteBehavior.Restrict); .OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanSurvey>() modelBuilder.Entity<ProcessMapPlanRecordingStaticMeasurement>()
.HasOne(p => p.Editor) .HasOne(p => p.Editor)
.WithMany() .WithMany()
.OnDelete(DeleteBehavior.Restrict); .OnDelete(DeleteBehavior.Restrict);

View File

@ -86,7 +86,7 @@ namespace AsbCloudDb.Model
DbSet<ProcessMapPlanReamingRotor> ProcessMapPlanOperationReamingRotor { get; } DbSet<ProcessMapPlanReamingRotor> ProcessMapPlanOperationReamingRotor { get; }
DbSet<ProcessMapPlanReamingSlide> ProcessMapPlanOperationReamingSlide { get; } DbSet<ProcessMapPlanReamingSlide> ProcessMapPlanOperationReamingSlide { get; }
DbSet<ProcessMapPlanLoadCapacity> ProcessMapPlanOperationLoadCapacity { get; } DbSet<ProcessMapPlanLoadCapacity> ProcessMapPlanOperationLoadCapacity { get; }
DbSet<ProcessMapPlanSurvey> ProcessMapPlanSurvey { get; } DbSet<ProcessMapPlanRecordingStaticMeasurement> ProcessMapPlanSurvey { get; }
DbSet<ProcessMapPlanPositioningOffTheBottom> ProcessMapPlanOperationPositioningOffTheBottom { get; } DbSet<ProcessMapPlanPositioningOffTheBottom> ProcessMapPlanOperationPositioningOffTheBottom { get; }
DbSet<ProcessMapPlanOscillationAngles> ProcessMapPlanOperationDeterminationOfOscillationAngles { get; } DbSet<ProcessMapPlanOscillationAngles> ProcessMapPlanOperationDeterminationOfOscillationAngles { get; }
DbSet<ProcessMapPlanTFOrientation> ProcessMapPlanOperationTFOrientation { get; } DbSet<ProcessMapPlanTFOrientation> ProcessMapPlanOperationTFOrientation { get; }

View File

@ -5,8 +5,8 @@ using Microsoft.EntityFrameworkCore;
namespace AsbCloudDb.Model.ProcessMaps; namespace AsbCloudDb.Model.ProcessMaps;
[Table("t_process_map_plan_survey"), Comment("Запись статического замера")] [Table("t_process_map_plan_recording_static_measurement"), Comment("Запись статического замера")]
public class ProcessMapPlanSurvey : ProcessMapPlanBase public class ProcessMapPlanRecordingStaticMeasurement : ProcessMapPlanBase
{ {
[Column("measurement_recording_time"), Comment("Время записи замера, сек")] [Column("measurement_recording_time"), Comment("Время записи замера, сек")]
[Range(0.0, 1800.0)] [Range(0.0, 1800.0)]
@ -14,5 +14,5 @@ public class ProcessMapPlanSurvey : ProcessMapPlanBase
public double MeasurementRecordingTime { get; set; } public double MeasurementRecordingTime { get; set; }
[ForeignKey(nameof(IdPrevious))] [ForeignKey(nameof(IdPrevious))]
public virtual ProcessMapPlanSurvey? Previous { get; set; } public virtual ProcessMapPlanRecordingStaticMeasurement? Previous { get; set; }
} }

View File

@ -167,11 +167,11 @@ namespace AsbCloudInfrastructure
Item = src.Adapt<ProcessMapPlanLoadCapacityDto>() Item = src.Adapt<ProcessMapPlanLoadCapacityDto>()
}); });
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanSurveyDto>>.NewConfig() TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanRecordingStaticMeasurementDto>>.NewConfig()
.Include<ProcessMapPlanSurvey, ChangeLogDto<ProcessMapPlanSurveyDto>>() .Include<ProcessMapPlanRecordingStaticMeasurement, ChangeLogDto<ProcessMapPlanRecordingStaticMeasurementDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanSurveyDto>() .Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanRecordingStaticMeasurementDto>()
{ {
Item = src.Adapt<ProcessMapPlanSurveyDto>() Item = src.Adapt<ProcessMapPlanRecordingStaticMeasurementDto>()
}); });
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanPositioningOffTheBottomDto>>.NewConfig() TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanPositioningOffTheBottomDto>>.NewConfig()
@ -432,7 +432,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<ProcessMapPlanReamingRotorParser>(); services.AddTransient<ProcessMapPlanReamingRotorParser>();
services.AddTransient<ProcessMapPlanReamingSlideParser>(); services.AddTransient<ProcessMapPlanReamingSlideParser>();
services.AddTransient<ProcessMapPlanLoadCapacityParser>(); services.AddTransient<ProcessMapPlanLoadCapacityParser>();
services.AddTransient<ProcessMapPlanSurveyParser>(); services.AddTransient<ProcessMapPlanRecordingStaticMeasurementParser>();
services.AddTransient<ProcessMapPlanPositioningOffTheBottomParser>(); services.AddTransient<ProcessMapPlanPositioningOffTheBottomParser>();
services.AddTransient<ProcessMapPlanOscillationAnglesParser>(); services.AddTransient<ProcessMapPlanOscillationAnglesParser>();
services.AddTransient<ProcessMapPlanTFOrientationParser>(); services.AddTransient<ProcessMapPlanTFOrientationParser>();
@ -458,7 +458,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<ProcessMapPlanReamingRotorExportService>(); services.AddTransient<ProcessMapPlanReamingRotorExportService>();
services.AddTransient<ProcessMapPlanReamingSlideExportService>(); services.AddTransient<ProcessMapPlanReamingSlideExportService>();
services.AddTransient<ProcessMapPlanLoadCapacityExportService>(); services.AddTransient<ProcessMapPlanLoadCapacityExportService>();
services.AddTransient<ProcessMapPlanSurveyExportService>(); services.AddTransient<ProcessMapPlanRecordingStaticMeasurementExportService>();
services.AddTransient<ProcessMapPlanPositioningOffTheBottomExportService>(); services.AddTransient<ProcessMapPlanPositioningOffTheBottomExportService>();
services.AddTransient<ProcessMapPlanOscillationAnglesExportService>(); services.AddTransient<ProcessMapPlanOscillationAnglesExportService>();
services.AddTransient<ProcessMapPlanTFOrientationExportService>(); services.AddTransient<ProcessMapPlanTFOrientationExportService>();
@ -507,8 +507,8 @@ namespace AsbCloudInfrastructure
ProcessMapPlanBaseRepository<ProcessMapPlanLoadCapacity, ProcessMapPlanLoadCapacityDto>>(); ProcessMapPlanBaseRepository<ProcessMapPlanLoadCapacity, ProcessMapPlanLoadCapacityDto>>();
services.AddTransient< services.AddTransient<
IChangeLogRepository<ProcessMapPlanSurveyDto, ProcessMapPlanBaseRequestWithWell>, IChangeLogRepository<ProcessMapPlanRecordingStaticMeasurementDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanSurvey, ProcessMapPlanSurveyDto>>(); ProcessMapPlanBaseRepository<ProcessMapPlanRecordingStaticMeasurement, ProcessMapPlanRecordingStaticMeasurementDto>>();
services.AddTransient< services.AddTransient<
IChangeLogRepository<ProcessMapPlanPositioningOffTheBottomDto, ProcessMapPlanBaseRequestWithWell>, IChangeLogRepository<ProcessMapPlanPositioningOffTheBottomDto, ProcessMapPlanBaseRequestWithWell>,
@ -571,7 +571,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanReamingRotorDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanReamingRotorDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanReamingSlideDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanReamingSlideDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanLoadCapacityDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanLoadCapacityDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanSurveyDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanRecordingStaticMeasurementDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanPositioningOffTheBottomDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanPositioningOffTheBottomDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOscillationAnglesDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOscillationAnglesDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanTFOrientationDto>>(); services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanTFOrientationDto>>();

View File

@ -2,13 +2,13 @@ using System.Collections.Generic;
namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates; namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
public class ProcessMapPlanSurveyTemplate : ITemplateParameters public class ProcessMapPlanRecordingStaticMeasurementTemplate : ITemplateParameters
{ {
public string SheetName => "Запись статического замера"; public string SheetName => "Запись статического замера";
public int HeaderRowsCount => 2; public int HeaderRowsCount => 2;
public string FileName => "ProcessMapPlanSurveyTemplate.xlsx"; public string FileName => "ProcessMapPlanRecordingStaticMeasurementTemplate.xlsx";
public IDictionary<string, Cell> Cells => new Dictionary<string, Cell> public IDictionary<string, Cell> Cells => new Dictionary<string, Cell>
{ {

View File

@ -10,16 +10,16 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export; namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
public class ProcessMapPlanSurveyExportService : ProcessMapPlanExportService<ProcessMapPlanSurveyDto> public class ProcessMapPlanRecordingStaticMeasurementExportService : ProcessMapPlanExportService<ProcessMapPlanRecordingStaticMeasurementDto>
{ {
public ProcessMapPlanSurveyExportService( public ProcessMapPlanRecordingStaticMeasurementExportService(
IChangeLogRepository<ProcessMapPlanSurveyDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository, IChangeLogRepository<ProcessMapPlanRecordingStaticMeasurementDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
IWellService wellService) IWellService wellService)
: base(processMapPlanRepository, wellService) : base(processMapPlanRepository, wellService)
{ {
} }
protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanSurveyTemplate(); protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanRecordingStaticMeasurementTemplate();
protected override async Task<string> BuildFileNameAsync(WellRelatedExportRequest options, CancellationToken token) 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; namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
public class ProcessMapPlanSurveyParser : ProcessMapPlanParser<ProcessMapPlanSurveyDto> public class ProcessMapPlanRecordingStaticMeasurementParser : ProcessMapPlanParser<ProcessMapPlanRecordingStaticMeasurementDto>
{ {
public ProcessMapPlanSurveyParser(IWellOperationRepository wellOperationRepository) public ProcessMapPlanRecordingStaticMeasurementParser(IWellOperationRepository wellOperationRepository)
: base(wellOperationRepository) : base(wellOperationRepository)
{ {
} }
protected override ITemplateParameters TemplateParameters => new ProcessMapPlanSurveyTemplate(); protected override ITemplateParameters TemplateParameters => new ProcessMapPlanRecordingStaticMeasurementTemplate();
protected override ProcessMapPlanSurveyDto BuildDto(IDictionary<string, object?> row, int rowNumber) protected override ProcessMapPlanRecordingStaticMeasurementDto BuildDto(IDictionary<string, object?> row, int rowNumber)
{ {
var dto = base.BuildDto(row, rowNumber); var dto = base.BuildDto(row, rowNumber);

View File

@ -10,18 +10,18 @@ using AsbCloudWebApi.IntegrationTests;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Xunit; using Xunit;
namespace AsbCloudWebApi.Controllers.ProcessMaps; namespace AsbCloudWebApi.IntegrationTests.Controllers.ProcessMapPlan.Operations;
/// <summary> /// <summary>
/// РТК план записи статического замера /// РТК план записи статического замера
/// </summary> /// </summary>
public class ProcessMapPlanSurveyControllerTest : public class ProcessMapPlanRecordingStaticMeasurementControllerTest :
ProcessMapPlanBaseControllerTest<ProcessMapPlanSurvey, ProcessMapPlanSurveyDto> ProcessMapPlanBaseControllerTest<ProcessMapPlanRecordingStaticMeasurement, ProcessMapPlanRecordingStaticMeasurementDto>
{ {
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, IdWell = 1,
DepthStart = 1, DepthStart = 1,
@ -31,7 +31,7 @@ public class ProcessMapPlanSurveyControllerTest :
MeasurementRecordingTime = 1, MeasurementRecordingTime = 1,
}; };
private readonly ProcessMapPlanSurvey entity = new ProcessMapPlanSurvey() private readonly ProcessMapPlanRecordingStaticMeasurement entity = new ProcessMapPlanRecordingStaticMeasurement()
{ {
IdWell = 1, IdWell = 1,
DepthEnd = 10, DepthEnd = 10,
@ -50,17 +50,17 @@ public class ProcessMapPlanSurveyControllerTest :
await Get(entity, dto); await Get(entity, dto);
} }
protected override ProcessMapPlanSurvey GetByNote(DbSet<ProcessMapPlanSurvey> dbSet, ProcessMapPlanSurveyDto dto) protected override ProcessMapPlanRecordingStaticMeasurement GetByNote(DbSet<ProcessMapPlanRecordingStaticMeasurement> dbSet, ProcessMapPlanRecordingStaticMeasurementDto dto)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
protected override ProcessMapPlanSurveyDto GetByNote(IEnumerable<ProcessMapPlanSurveyDto> dtos, ProcessMapPlanSurveyDto dto) protected override ProcessMapPlanRecordingStaticMeasurementDto GetByNote(IEnumerable<ProcessMapPlanRecordingStaticMeasurementDto> dtos, ProcessMapPlanRecordingStaticMeasurementDto dto)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
protected override ProcessMapPlanSurvey? GetByWellId() protected override ProcessMapPlanRecordingStaticMeasurement? GetByWellId()
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

View File

@ -6,20 +6,20 @@ using AsbCloudDb.Model.ProcessMaps;
using AsbCloudInfrastructure.Services.ProcessMapPlan.Export; using AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
using AsbCloudInfrastructure.Services.ProcessMapPlan.Parser; using AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
namespace AsbCloudWebApi.Controllers.ProcessMaps; namespace AsbCloudWebApi.Controllers.ProcessMaps.Operations;
/// <summary> /// <summary>
/// РТК план записи статического замера /// РТК план записи статического замера
/// </summary> /// </summary>
public class ProcessMapPlanSurveyController : public class ProcessMapPlanRecordingStaticMeasurementController :
ProcessMapPlanBaseController<ProcessMapPlanSurvey, ProcessMapPlanSurveyDto> ProcessMapPlanBaseController<ProcessMapPlanRecordingStaticMeasurement, ProcessMapPlanRecordingStaticMeasurementDto>
{ {
public ProcessMapPlanSurveyController( public ProcessMapPlanRecordingStaticMeasurementController(
IChangeLogRepository<ProcessMapPlanSurveyDto, ProcessMapPlanBaseRequestWithWell> repository, IChangeLogRepository<ProcessMapPlanRecordingStaticMeasurementDto, ProcessMapPlanBaseRequestWithWell> repository,
IWellService wellService, IWellService wellService,
ProcessMapPlanSurveyParser parserService, ProcessMapPlanRecordingStaticMeasurementParser parserService,
ITelemetryService telemetryService, ITelemetryService telemetryService,
ProcessMapPlanSurveyExportService processMapPlanExportService) ProcessMapPlanRecordingStaticMeasurementExportService processMapPlanExportService)
: base(repository, wellService, parserService, processMapPlanExportService, telemetryService) : base(repository, wellService, parserService, processMapPlanExportService, telemetryService)
{ {
} }

View File

@ -6,7 +6,7 @@ using AsbCloudDb.Model.ProcessMaps;
using AsbCloudInfrastructure.Services.ProcessMapPlan.Export; using AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
using AsbCloudInfrastructure.Services.ProcessMapPlan.Parser; using AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
namespace AsbCloudWebApi.Controllers.ProcessMaps; namespace AsbCloudWebApi.Controllers.ProcessMaps.Operations;
/// <summary> /// <summary>
/// РТК план выключение насоса /// РТК план выключение насоса