Позиционирование над забоем

This commit is contained in:
Olga Nemt 2024-06-25 10:19:47 +05:00
parent 5171eed3a7
commit 4b155cb893
12 changed files with 439 additions and 0 deletions

View File

@ -0,0 +1,36 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AsbCloudApp.Data.ProcessMaps;
/// <summary>
/// РТК план выработка нагрузки
/// </summary>
public class ProcessMapPlanOperationLoadCapacityDto : ProcessMapPlanBaseDto
{
/// <summary>
/// Время выработки минимальное, сек
/// </summary>
[Range(0.0, 800.0)]
public double TimeLoadCapacityMin { get; set; }
/// <summary>
/// Перепад давления минимальный, атм
/// </summary>
[Range(0.1, 400.0)]
public double DifferentialPressureMin { get; set; }
/// <summary>
/// Нагрузка минимальная, т
/// </summary>
[Range(0.1, 99.0)]
public double WeightOnBitMin { get; set; }
/// <summary>
/// Примечание
/// </summary>
[StringLength(1024)]
public string Note { get; set; } = string.Empty;
}

View File

@ -0,0 +1,16 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AsbCloudApp.Data.ProcessMaps;
/// <summary>
/// РТК план позиционирования над забоем
/// </summary>
public class ProcessMapPlanOperationPositioningOffTheBottomDto : ProcessMapPlanBaseDto
{
/// <summary>
/// Остановка над забоем, м
/// </summary>
[Range(0.0, 30.0)]
public double StopOffTheBottom { get; set; }
}

View File

@ -0,0 +1,210 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AsbCloudApp.Data.ProcessMaps;
/// <summary>
/// РТК план проработка для слайда
/// </summary>
public class ProcessMapPlanOperationReamingSlideDto : ProcessMapPlanBaseDto
{
/// <summary>
/// Максимальное давление, атм
/// </summary>
[Range(0.0, 400.0)]
public double MaxPressure { get; set; }
/// <summary>
/// Перепад давления, атм.
/// </summary>
[Range(0.0, 60.0)]
public double DifferentialPressure { get; set; }
/// <summary>
/// Уставки, т., затяжка
/// </summary>
[Range(0.0, 20.0)]
public double SetpointsTight { get; set; }
/// <summary>
/// Уставки, т., посадка
/// </summary>
[Range(0.0, 20.0)]
public double SetpointsSlackingOff { get; set; }
/// <summary>
/// Максимально допустимый момент, кН*м.
/// </summary>
[Range(0.0, 35.0)]
public double MaxTorque { get; set; }
/// <summary>
/// Проработка 1, Количество повторений, шт.
/// </summary>
[Range(0.0, 99.0)]
public double Reaming1NumberOfRepetitions { get; set; }
/// <summary>
/// Проработка 1, Скорость, м/ч., Вверх
/// </summary>
[Range(0.0, 999.0)]
public double Reaming1ROPUp { get; set; }
/// <summary>
/// Проработка 1, Скорость, м/ч., Вниз
/// </summary>
[Range(0.0, 999.0)]
public double Reaming1ROPDown { get; set; }
/// <summary>
/// Проработка 1, Обороты, об/мин., Вверх
/// </summary>
[Range(0.0, 270.0)]
public double Reaming1RPMUp { get; set; }
/// <summary>
/// Проработка 1, Обороты, об/мин., Вниз
/// </summary>
[Range(0.0, 270.0)]
public double Reaming1RPMDown { get; set; }
/// <summary>
/// Проработка 1, Расход, л/с., Вверх
/// </summary>
[Range(0.0, 100.0)]
public double Reaming1FlowRateUp { get; set; }
/// <summary>
/// Проработка 1, Расход, л/с., Вниз
/// </summary>
[Range(0.0, 100.0)]
public double Reaming1FlowRateDown { get; set; }
/// <summary>
/// Проработка 1, Интервал проработки, м.
/// </summary>
[Range(0.0, 30.0)]
public double Reaming1Interval { get; set; }
/// <summary>
/// Остановка над забоем, м.
/// </summary>
[Range(0.0, 10.0)]
public double Reaming1StopPointOffBottom { get; set; }
/// <summary>
/// Проработка 2, Количество повторений, шт.
/// </summary>
[Range(0.0, 99.0)]
public double Reaming2NumberOfRepetitions { get; set; }
/// <summary>
/// Проработка 2, Скорость, м/ч., Вверх
/// </summary>
[Range(0.0, 999.0)]
public double Reaming2ROPUp { get; set; }
/// <summary>
/// Проработка 2, Скорость, м/ч., Вниз
/// </summary>
[Range(0.0, 999.0)]
public double Reaming2ROPDown { get; set; }
/// <summary>
/// Проработка 2, Обороты, об/мин., Вверх
/// </summary>
[Range(0.0, 270.0)]
public double Reaming2RPMUp { get; set; }
/// <summary>
/// Проработка 2, Обороты, об/мин., Вниз
/// </summary>
[Range(0.0, 270.0)]
public double Reaming2RPMDown { get; set; }
/// <summary>
/// Проработка 2, Расход, л/с., Вверх
/// </summary>
[Range(0.0, 100.0)]
public double Reaming2FlowRateUp { get; set; }
/// <summary>
/// Проработка 2, Расход, л/с., Вниз
/// </summary>
[Range(0.0, 100.0)]
public double Reaming2FlowRateDown { get; set; }
/// <summary>
/// Проработка 2, Интервал проработки, м.
/// </summary>
[Range(0.0, 30.0)]
public double Reaming2Interval { get; set; }
/// <summary>
/// Остановка над забоем, м.
/// </summary>
[Range(0.0, 10.0)]
public double Reaming2StopPointOffBottom { get; set; }
/// <summary>
/// Проработка 3, Количество повторений, шт.
/// </summary>
[Range(0.0, 99.0)]
public double Reaming3NumberOfRepetitions { get; set; }
/// <summary>
/// Проработка 3, Скорость, м/ч., Вверх
/// </summary>
[Range(0.0, 999.0)]
public double Reaming3ROPUp { get; set; }
/// <summary>
/// Проработка 3, Скорость, м/ч., Вниз
/// </summary>
[Range(0.0, 999.0)]
public double Reaming3ROPDown { get; set; }
/// <summary>
/// Проработка 3, Обороты, об/мин., Вверх
/// </summary>
[Range(0.0, 270.0)]
public double Reaming3RPMUp { get; set; }
/// <summary>
/// Проработка 3, Обороты, об/мин., Вниз
/// </summary>
[Range(0.0, 270.0)]
public double Reaming3RPMDown { get; set; }
/// <summary>
/// Проработка 3, Расход, л/с., Вверх
/// </summary>
[Range(0.0, 100.0)]
public double Reaming3FlowRateUp { get; set; }
/// <summary>
/// Проработка 3, Расход, л/с., Вниз
/// </summary>
[Range(0.0, 100.0)]
public double Reaming3FlowRateDown { get; set; }
/// <summary>
/// Проработка 3, Интервал проработки, м.
/// </summary>
[Range(0.0, 30.0)]
public double Reaming3Interval { get; set; }
/// <summary>
/// Остановка над забоем, м.
/// </summary>
[Range(0.0, 10.0)]
public double Reaming3StopPointOffBottom { get; set; }
/// <summary>
/// Примечание
/// </summary>
[StringLength(1024)]
public string Note { get; set; } = string.Empty;
}

View File

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

View File

@ -26,6 +26,7 @@ namespace AsbCloudDb.Model
public virtual DbSet<ProcessMapPlanOperationReamingSlide> ProcessMapPlanOperationReamingSlide => Set<ProcessMapPlanOperationReamingSlide>();
public virtual DbSet<ProcessMapPlanOperationLoadCapacity> ProcessMapPlanOperationLoadCapacity => Set<ProcessMapPlanOperationLoadCapacity>();
public virtual DbSet<ProcessMapPlanSurvey> ProcessMapPlanSurvey => Set<ProcessMapPlanSurvey>();
public virtual DbSet<ProcessMapPlanOperationPositioningOffTheBottom> ProcessMapPlanOperationPositioningOffTheBottom => Set<ProcessMapPlanOperationPositioningOffTheBottom>();
public virtual DbSet<DrillingProgramPart> DrillingProgramParts => Set<DrillingProgramPart>();
public virtual DbSet<FileCategory> FileCategories => Set<FileCategory>();
public virtual DbSet<FileInfo> Files => Set<FileInfo>();
@ -477,6 +478,11 @@ namespace AsbCloudDb.Model
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanOperationPositioningOffTheBottom>()
.HasOne(p => p.Author)
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanRotor>()
.HasOne(p => p.Editor)
.WithMany()
@ -507,6 +513,11 @@ namespace AsbCloudDb.Model
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanOperationPositioningOffTheBottom>()
.HasOne(p => p.Editor)
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
DefaultData.DefaultContextData.Fill(modelBuilder);
}

View File

@ -87,6 +87,7 @@ namespace AsbCloudDb.Model
DbSet<ProcessMapPlanOperationReamingSlide> ProcessMapPlanOperationReamingSlide { get; }
DbSet<ProcessMapPlanOperationLoadCapacity> ProcessMapPlanOperationLoadCapacity { get; }
DbSet<ProcessMapPlanSurvey> ProcessMapPlanSurvey { get; }
DbSet<ProcessMapPlanOperationPositioningOffTheBottom> ProcessMapPlanOperationPositioningOffTheBottom { get; }
Task<int> RefreshMaterializedViewAsync(string mwName, CancellationToken token);
Task<int> RefreshMaterializedViewAsync<TEntity>(CancellationToken token) where TEntity : class;

View File

@ -0,0 +1,18 @@
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_positioning_off_the_bottom"), Comment("Позиционирование над забоем")]
public class ProcessMapPlanOperationPositioningOffTheBottom : ProcessMapPlanBase
{
[Column("stop_off_the_bottom"), Comment("Остановка над забоем, м")]
[Range(0.0, 30.0)]
[Required]
public double StopOffTheBottom { get; set; }
[ForeignKey(nameof(IdPrevious))]
public virtual ProcessMapPlanOperationPositioningOffTheBottom? Previous { get; set; }
}

View File

@ -173,6 +173,13 @@ namespace AsbCloudInfrastructure
{
Item = src.Adapt<ProcessMapPlanSurveyDto>()
});
TypeAdapterConfig<ChangeLogAbstract, ChangeLogDto<ProcessMapPlanOperationPositioningOffTheBottomDto>>.NewConfig()
.Include<ProcessMapPlanOperationPositioningOffTheBottom, ChangeLogDto<ProcessMapPlanOperationPositioningOffTheBottomDto>>()
.Map(dest => dest, src => new ChangeLogDto<ProcessMapPlanOperationPositioningOffTheBottomDto>()
{
Item = src.Adapt<ProcessMapPlanOperationPositioningOffTheBottomDto>()
});
}
public static IServiceCollection AddInfrastructure(this IServiceCollection services, IConfiguration configuration)
@ -258,6 +265,10 @@ namespace AsbCloudInfrastructure
IChangeLogRepository<ProcessMapPlanSurveyDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanSurvey, ProcessMapPlanSurveyDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanOperationPositioningOffTheBottomDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanOperationPositioningOffTheBottom, ProcessMapPlanOperationPositioningOffTheBottomDto>>();
services.AddTransient<IProcessMapReportDrillingService, ProcessMapReportDrillingService>();
services.AddTransient<TrajectoryService>();
@ -309,6 +320,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOperationReamingSlideDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOperationLoadCapacityDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanSurveyDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOperationPositioningOffTheBottomDto>>();
services.AddTransient<IUserRoleRepository, UserRoleRepository>();
services.AddTransient<IUserRepository, UserRepository>();
services.AddTransient<ILimitingParameterRepository, LimitingParameterRepository>();
@ -369,6 +381,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<ProcessMapPlanOperationReamingSlideParser>();
services.AddTransient<ProcessMapPlanOperationLoadCapacityParser>();
services.AddTransient<ProcessMapPlanSurveyParser>();
services.AddTransient<ProcessMapPlanOperationPositioningOffTheBottomParser>();
services.AddTransient<TrajectoryPlanExportService>();
services.AddTransient<TrajectoryFactManualExportService>();
@ -381,6 +394,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<ProcessMapPlanOperationReamingSlideExportService>();
services.AddTransient<ProcessMapPlanOperationLoadCapacityExportService>();
services.AddTransient<ProcessMapPlanSurveyExportService>();
services.AddTransient<ProcessMapPlanOperationPositioningOffTheBottomExportService>();
services.AddTransient<WellOperationParserFactory>();
services.AddTransient<WellOperationExportServiceFactory>();

View File

@ -0,0 +1,17 @@
using System.Collections.Generic;
namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
public class ProcessMapPlanOperationPositioningOffTheBottomTemplate : ITemplateParameters
{
public string SheetName => "Позиционирование над забоем";
public int HeaderRowsCount => 2;
public string FileName => "ProcessMapPlanOperationPositioningOffTheBottomTemplate.xlsx";
public IDictionary<string, Cell> Cells => new Dictionary<string, Cell>
{
};
}

View File

@ -0,0 +1,30 @@
using AsbCloudApp.Data.ProcessMaps;
using AsbCloudApp.Repositories;
using AsbCloudApp.Requests;
using AsbCloudApp.Requests.ExportOptions;
using AsbCloudApp.Services;
using AsbCloudInfrastructure.Services.ExcelServices.Templates;
using AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
public class ProcessMapPlanOperationPositioningOffTheBottomExportService : ProcessMapPlanExportService<ProcessMapPlanOperationPositioningOffTheBottomDto>
{
public ProcessMapPlanOperationPositioningOffTheBottomExportService(
IChangeLogRepository<ProcessMapPlanOperationPositioningOffTheBottomDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
IWellService wellService)
: base(processMapPlanRepository, wellService)
{
}
protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanOperationPositioningOffTheBottomTemplate();
protected override async Task<string> BuildFileNameAsync(WellRelatedExportRequest options, CancellationToken token)
{
var caption = await wellService.GetWellCaptionByIdAsync(options.IdWell, token);
return $"{caption}_РТК_План_позиционированиеад_забоем.xlsx";
}
}

View File

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using AsbCloudApp.Data.ProcessMaps;
using AsbCloudApp.Repositories;
using AsbCloudInfrastructure.Services.ExcelServices.Templates;
using AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
public class ProcessMapPlanOperationPositioningOffTheBottomParser : ProcessMapPlanParser<ProcessMapPlanOperationPositioningOffTheBottomDto>
{
public ProcessMapPlanOperationPositioningOffTheBottomParser(IWellOperationRepository wellOperationRepository)
: base(wellOperationRepository)
{
}
protected override ITemplateParameters TemplateParameters => new ProcessMapPlanOperationPositioningOffTheBottomTemplate();
protected override ProcessMapPlanOperationPositioningOffTheBottomDto BuildDto(IDictionary<string, object?> row, int rowNumber)
{
var dto = base.BuildDto(row, rowNumber);
var section = sections.FirstOrDefault(s =>
string.Equals(s.Caption.Trim(), dto.Section?.Trim(), StringComparison.CurrentCultureIgnoreCase));
if (section is null)
{
var message = string.Format(XLExtentions.ProblemDetailsTemplate,
TemplateParameters.SheetName,
rowNumber,
TemplateParameters.Cells[nameof(ProcessMapPlanBaseDto.Section)],
"Указана некорректная секция");
throw new FileFormatException(message);
}
dto.IdWellSectionType = section.Id;
return dto;
}
}

View File

@ -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;
/// <summary>
/// РТК план позиционирование над забоем
/// </summary>
public class ProcessMapPlanOperationPositioningOffTheBottomController :
ProcessMapPlanBaseController<ProcessMapPlanOperationPositioningOffTheBottom, ProcessMapPlanOperationPositioningOffTheBottomDto>
{
public ProcessMapPlanOperationPositioningOffTheBottomController(
IChangeLogRepository<ProcessMapPlanOperationPositioningOffTheBottomDto, ProcessMapPlanBaseRequestWithWell> repository,
IWellService wellService,
ProcessMapPlanOperationPositioningOffTheBottomParser parserService,
ITelemetryService telemetryService,
ProcessMapPlanOperationPositioningOffTheBottomExportService processMapPlanExportService)
: base(repository, wellService, parserService, processMapPlanExportService, telemetryService)
{
}
protected override string TemplateFileName => "ЕЦП_шаблон_файла_РТК_план_позиционированиеад_забоем.xlsx";
}