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

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<ProcessMapPlanReamingSlide> ProcessMapPlanOperationReamingSlide => Set<ProcessMapPlanReamingSlide>();
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<ProcessMapPlanOscillationAngles> ProcessMapPlanOperationDeterminationOfOscillationAngles => Set<ProcessMapPlanOscillationAngles>();
public virtual DbSet<ProcessMapPlanTFOrientation> ProcessMapPlanOperationTFOrientation => Set<ProcessMapPlanTFOrientation>();
@ -488,7 +488,7 @@ namespace AsbCloudDb.Model
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanSurvey>()
modelBuilder.Entity<ProcessMapPlanRecordingStaticMeasurement>()
.HasOne(p => p.Author)
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
@ -588,7 +588,7 @@ namespace AsbCloudDb.Model
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanSurvey>()
modelBuilder.Entity<ProcessMapPlanRecordingStaticMeasurement>()
.HasOne(p => p.Editor)
.WithMany()
.OnDelete(DeleteBehavior.Restrict);

View File

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

View File

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

View File

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

View File

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

View File

@ -10,16 +10,16 @@ using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
public class ProcessMapPlanSurveyExportService : ProcessMapPlanExportService<ProcessMapPlanSurveyDto>
public class ProcessMapPlanRecordingStaticMeasurementExportService : ProcessMapPlanExportService<ProcessMapPlanRecordingStaticMeasurementDto>
{
public ProcessMapPlanSurveyExportService(
IChangeLogRepository<ProcessMapPlanSurveyDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
public ProcessMapPlanRecordingStaticMeasurementExportService(
IChangeLogRepository<ProcessMapPlanRecordingStaticMeasurementDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
IWellService 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)
{

View File

@ -9,16 +9,16 @@ using AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemp
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)
{
}
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);

View File

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

View File

@ -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;
/// <summary>
/// РТК план записи статического замера
/// </summary>
public class ProcessMapPlanSurveyController :
ProcessMapPlanBaseController<ProcessMapPlanSurvey, ProcessMapPlanSurveyDto>
public class ProcessMapPlanRecordingStaticMeasurementController :
ProcessMapPlanBaseController<ProcessMapPlanRecordingStaticMeasurement, ProcessMapPlanRecordingStaticMeasurementDto>
{
public ProcessMapPlanSurveyController(
IChangeLogRepository<ProcessMapPlanSurveyDto, ProcessMapPlanBaseRequestWithWell> repository,
public ProcessMapPlanRecordingStaticMeasurementController(
IChangeLogRepository<ProcessMapPlanRecordingStaticMeasurementDto, ProcessMapPlanBaseRequestWithWell> repository,
IWellService wellService,
ProcessMapPlanSurveyParser parserService,
ProcessMapPlanRecordingStaticMeasurementParser parserService,
ITelemetryService telemetryService,
ProcessMapPlanSurveyExportService processMapPlanExportService)
ProcessMapPlanRecordingStaticMeasurementExportService processMapPlanExportService)
: base(repository, wellService, parserService, processMapPlanExportService, telemetryService)
{
}

View File

@ -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;
/// <summary>
/// РТК план выключение насоса
/// </summary>
public class ProcessMapPlanSwitchingOffThePumpController :
public class ProcessMapPlanSwitchingOffThePumpController :
ProcessMapPlanBaseController<ProcessMapPlanSwitchingOffThePump, ProcessMapPlanSwitchingOffThePumpDto>
{
public ProcessMapPlanSwitchingOffThePumpController(