РТК план проработка для ротора

This commit is contained in:
Olga Nemt 2024-06-24 15:06:50 +05:00
parent 07be69a368
commit 814515d8ac
9 changed files with 495 additions and 0 deletions

View File

@ -0,0 +1,210 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AsbCloudApp.Data.ProcessMaps;
/// <summary>
/// РТК план проработка для ротора
/// </summary>
public class ProcessMapPlanOperationReamingRotorDto : 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

@ -22,6 +22,7 @@ namespace AsbCloudDb.Model
public virtual DbSet<ProcessMapPlanRotor> ProcessMapPlanRotor => Set<ProcessMapPlanRotor>();
public virtual DbSet<ProcessMapPlanSlide> ProcessMapPlanSlide => Set<ProcessMapPlanSlide>();
public virtual DbSet<ProcessMapPlanReam> ProcessMapPlanReams => Set<ProcessMapPlanReam>();
public virtual DbSet<ProcessMapPlanOperationReamingRotor> ProcessMapPlanOperationReamingRotor => Set<ProcessMapPlanOperationReamingRotor>();
public virtual DbSet<DrillingProgramPart> DrillingProgramParts => Set<DrillingProgramPart>();
public virtual DbSet<FileCategory> FileCategories => Set<FileCategory>();
public virtual DbSet<FileInfo> Files => Set<FileInfo>();

View File

@ -81,6 +81,7 @@ namespace AsbCloudDb.Model
DbSet<DataSaubStat> DataSaubStat { get; }
DatabaseFacade Database { get; }
DbSet<ProcessMapPlanReam> ProcessMapPlanReams { get; }
DbSet<ProcessMapPlanOperationReamingRotor> ProcessMapPlanOperationReamingRotor { get; }
Task<int> RefreshMaterializedViewAsync(string mwName, CancellationToken token);
Task<int> RefreshMaterializedViewAsync<TEntity>(CancellationToken token) where TEntity : class;

View File

@ -0,0 +1,158 @@
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_reaming_rotor"), Comment("РТК проработка ротор")]
public class ProcessMapPlanOperationReamingRotor : ProcessMapPlanBase
{
[Column("max_pressure"), Comment("Максимальное давление, атм")]
[Range(0.0, 400.0)]
[Required]
public double MaxPressure { get; set; }
[Column("differential_pressure"), Comment("Перепад давления, атм.")]
[Range(0.0, 60.0)]
[Required]
public double DifferentialPressure { get; set; }
[Column("setpoints_tight"), Comment("Уставки, т., затяжка")]
[Range(0.0, 20.0)]
[Required]
public double SetpointsTight { get; set; }
[Column("setpoints_slacking_off"), Comment("Уставки, т., посадка")]
[Range(0.0, 20.0)]
[Required]
public double SetpointsSlackingOff { get; set; }
[Column("max_torque"), Comment("Максимально допустимый момент, кН*м.")]
[Range(0.0, 35.0)]
[Required]
public double MaxTorque { get; set; }
[Column("reaming1_number_of_ repetitions"), Comment("Проработка 1, Количество повторений, шт.")]
[Range(0.0, 99.0)]
[Required]
public double Reaming1NumberOfRepetitions { get; set; }
[Column("reaming1_rop_up"), Comment("Проработка 1, Скорость, м/ч., Вверх")]
[Range(0.0, 999.0)]
[Required]
public double Reaming1ROPUp { get; set; }
[Column("reaming1_rop_down"), Comment("Проработка 1, Скорость, м/ч., Вниз")]
[Range(0.0, 999.0)]
[Required]
public double Reaming1ROPDown { get; set; }
[Column("reaming1_rpm_up"), Comment("Проработка 1, Обороты, об/мин., Вверх")]
[Range(0.0, 270.0)]
[Required]
public double Reaming1RPMUp { get; set; }
[Column("reaming1_rpm_down"), Comment("Проработка 1, Обороты, об/мин., Вниз")]
[Range(0.0, 270.0)]
[Required]
public double Reaming1RPMDown { get; set; }
[Column("reaming1_flow_rate_up"), Comment("Проработка 1, Расход, л/с., Вверх")]
[Range(0.0, 100.0)]
[Required]
public double Reaming1FlowRateUp { get; set; }
[Column("reaming1_flow_rate_down"), Comment("Проработка 1, Расход, л/с., Вниз")]
[Range(0.0, 100.0)]
[Required]
public double Reaming1FlowRateDown { get; set; }
[Column("reaming1_interval"), Comment("Проработка 1, Интервал проработки, м.")]
[Range(0.0, 30.0)]
[Required]
public double Reaming1Interval { get; set; }
[Column("reaming1_stop_point_off_bottom"), Comment("Остановка над забоем, м.")]
[Range(0.0, 10.0)]
[Required]
public double Reaming1StopPointOffBottom { get; set; }
[Column("reaming2_number_of_ repetitions"), Comment("Проработка 2, Количество повторений, шт.")]
[Range(0.0, 99.0)]
public double Reaming2NumberOfRepetitions { get; set; }
[Column("reaming2_rop_up"), Comment("Проработка 2, Скорость, м/ч., Вверх")]
[Range(0.0, 999.0)]
public double Reaming2ROPUp { get; set; }
[Column("reaming2_rop_down"), Comment("Проработка 2, Скорость, м/ч., Вниз")]
[Range(0.0, 999.0)]
public double Reaming2ROPDown { get; set; }
[Column("reaming2_rpm_up"), Comment("Проработка 2, Обороты, об/мин., Вверх")]
[Range(0.0, 270.0)]
public double Reaming2RPMUp { get; set; }
[Column("reaming2_rpm_down"), Comment("Проработка 2, Обороты, об/мин., Вниз")]
[Range(0.0, 270.0)]
public double Reaming2RPMDown { get; set; }
[Column("reaming2_flow_rate_up"), Comment("Проработка 2, Расход, л/с., Вверх")]
[Range(0.0, 100.0)]
public double Reaming2FlowRateUp { get; set; }
[Column("reaming2_flow_rate_down"), Comment("Проработка 2, Расход, л/с., Вниз")]
[Range(0.0, 100.0)]
public double Reaming2FlowRateDown { get; set; }
[Column("reaming2_interval"), Comment("Проработка 2, Интервал проработки, м.")]
[Range(0.0, 30.0)]
public double Reaming2Interval { get; set; }
[Column("reaming2_stop_point_off_bottom"), Comment("Остановка над забоем, м.")]
[Range(0.0, 10.0)]
public double Reaming2StopPointOffBottom { get; set; }
[Column("reaming3_number_of_ repetitions"), Comment("Проработка 3, Количество повторений, шт.")]
[Range(0.0, 99.0)]
public double Reaming3NumberOfRepetitions { get; set; }
[Column("reaming3_rop_up"), Comment("Проработка 3, Скорость, м/ч., Вверх")]
[Range(0.0, 999.0)]
public double Reaming3ROPUp { get; set; }
[Column("reaming3_rop_down"), Comment("Проработка 3, Скорость, м/ч., Вниз")]
[Range(0.0, 999.0)]
public double Reaming3ROPDown { get; set; }
[Column("reaming3_rpm_up"), Comment("Проработка 3, Обороты, об/мин., Вверх")]
[Range(0.0, 270.0)]
public double Reaming3RPMUp { get; set; }
[Column("reaming3_rpm_down"), Comment("Проработка 3, Обороты, об/мин., Вниз")]
[Range(0.0, 270.0)]
public double Reaming3RPMDown { get; set; }
[Column("reaming3_flow_rate_up"), Comment("Проработка 3, Расход, л/с., Вверх")]
[Range(0.0, 100.0)]
public double Reaming3FlowRateUp { get; set; }
[Column("reaming3_flow_rate_down"), Comment("Проработка 3, Расход, л/с., Вниз")]
[Range(0.0, 100.0)]
public double Reaming3FlowRateDown { get; set; }
[Column("reaming3_interval"), Comment("Проработка 3, Интервал проработки, м.")]
[Range(0.0, 30.0)]
public double Reaming3Interval { get; set; }
[Column("reaming3_stop_point_off_bottom"), Comment("Остановка над забоем, м.")]
[Range(0.0, 10.0)]
public double Reaming3StopPointOffBottom { get; set; }
[Column("note"), Comment("Примечание"), StringLength(1024)]
public string Note { get; set; } = string.Empty;
[ForeignKey(nameof(IdPrevious))]
public virtual ProcessMapPlanOperationReamingRotor? Previous { get; set; }
}

View File

@ -214,6 +214,10 @@ namespace AsbCloudInfrastructure
IChangeLogRepository<ProcessMapPlanReamDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanReam, ProcessMapPlanReamDto>>();
services.AddTransient<
IChangeLogRepository<ProcessMapPlanOperationReamingRotorDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanOperationReamingRotor, ProcessMapPlanOperationReamingRotorDto>>();
services.AddTransient<IProcessMapReportDrillingService, ProcessMapReportDrillingService>();
services.AddTransient<TrajectoryService>();
@ -261,6 +265,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<IFileStorageRepository, FileStorageRepository>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanRotorDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanSlideDto>>();
services.AddTransient<IWellCompositeRepository, WellCompositeRepository<ProcessMapPlanOperationReamingRotorDto>>();
services.AddTransient<IUserRoleRepository, UserRoleRepository>();
services.AddTransient<IUserRepository, UserRepository>();
services.AddTransient<ILimitingParameterRepository, LimitingParameterRepository>();
@ -317,6 +322,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<ProcessMapPlanRotorParser>();
services.AddTransient<ProcessMapPlanSlideParser>();
services.AddTransient<ProcessMapPlanReamParser>();
services.AddTransient<ProcessMapPlanOperationReamingRotorParser>();
services.AddTransient<TrajectoryPlanExportService>();
services.AddTransient<TrajectoryFactManualExportService>();
@ -325,6 +331,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<ProcessMapPlanRotorExportService>();
services.AddTransient<ProcessMapPlanSlideExportService>();
services.AddTransient<ProcessMapPlanReamExportService>();
services.AddTransient<ProcessMapPlanOperationReamingRotorExportService>();
services.AddTransient<WellOperationParserFactory>();
services.AddTransient<WellOperationExportServiceFactory>();

View File

@ -0,0 +1,18 @@
using System.Collections.Generic;
using AsbCloudApp.Data.ProcessMaps;
namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
public class ProcessMapPlanOperationReamingRotorTemplate : ITemplateParameters
{
public string SheetName => "Проработка ротор";
public int HeaderRowsCount => 2;
public string FileName => "ProcessMapPlanOperationReamingRotorTemplate.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 ProcessMapPlanOperationReamingRotorExportService : ProcessMapPlanExportService<ProcessMapPlanOperationReamingRotorDto>
{
public ProcessMapPlanOperationReamingRotorExportService(
IChangeLogRepository<ProcessMapPlanOperationReamingRotorDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
IWellService wellService)
: base(processMapPlanRepository, wellService)
{
}
protected override ITemplateParameters TemplateParameters { get; } = new ProcessMapPlanOperationReamingRotorTemplate();
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 ProcessMapPlanOperationReamingRotorParser : ProcessMapPlanParser<ProcessMapPlanOperationReamingRotorDto>
{
public ProcessMapPlanOperationReamingRotorParser(IWellOperationRepository wellOperationRepository)
: base(wellOperationRepository)
{
}
protected override ITemplateParameters TemplateParameters => new ProcessMapPlanOperationReamingRotorTemplate();
protected override ProcessMapPlanOperationReamingRotorDto 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 ProcessMapPlanOperationReamingRotorController :
ProcessMapPlanBaseController<ProcessMapPlanSlide, ProcessMapPlanOperationReamingRotorDto>
{
public ProcessMapPlanOperationReamingRotorController(
IChangeLogRepository<ProcessMapPlanOperationReamingRotorDto, ProcessMapPlanBaseRequestWithWell> repository,
IWellService wellService,
ProcessMapPlanOperationReamingRotorParser parserService,
ITelemetryService telemetryService,
ProcessMapPlanOperationReamingRotorExportService processMapPlanExportService)
: base(repository, wellService, parserService, processMapPlanExportService, telemetryService)
{
}
protected override string TemplateFileName => "ЕЦП_шаблон_файла_РТК_план_проработка_ротор.xlsx";
}