Merge pull request 'РТК План "Использование систем"' (#311) from feature/ProcessMapPlanSubsystem into dev

Reviewed-on: https://test.digitaldrilling.ru:8443/DDrilling/AsbCloudServer/pulls/311
This commit is contained in:
Никита Фролов 2024-08-21 10:00:30 +05:00
commit cd5cc378f7
14 changed files with 12793 additions and 4 deletions

View File

@ -0,0 +1,36 @@
using System.ComponentModel.DataAnnotations;
namespace AsbCloudApp.Data.ProcessMaps;
/// <summary>
/// РКТ план использование подсистем
/// </summary>
public class ProcessMapPlanSubsystemsDto : ProcessMapPlanBaseDto
{
/// <summary>
/// Использование ротора
/// </summary>
[Range(0.0, 100)]
[Required(ErrorMessage = "Процент использования ротора, должен быть в пределах от 0 до 100")]
public double AutoRotor { get; set; }
/// <summary>
/// Использование слайда
/// </summary>
[Range(0.0, 100)]
[Required(ErrorMessage = "Процент использования слайда, должен быть в пределах от 0 до 100")]
public double AutoSlide { get; set; }
/// <summary>
/// Использование слайда с осцилляцией
/// </summary>
[Range(0.0, 100)]
[Required(ErrorMessage = "Процент использования слайда с осцилляцией, должен быть в пределах от 0 до 100")]
public double AutoOscillation { get; set; }
/// <summary>
/// Примечание
/// </summary>
[StringLength(1024, ErrorMessage = "Примечание, должно быть не более 1024 символов")]
public string? Note { get; set; }
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,93 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace AsbCloudDb.Migrations
{
/// <inheritdoc />
public partial class Add_ProcessMapPlanSubsystems : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "t_process_map_plan_subsystems",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
auto_rotor = table.Column<double>(type: "double precision", nullable: false, comment: "Процент использования ротора"),
auto_slide = table.Column<double>(type: "double precision", nullable: false, comment: "Процент использования слайда"),
auto_oscillation = table.Column<double>(type: "double precision", nullable: false, comment: "Процент использования слайда с осцилляцией"),
note = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true, comment: "Примечание"),
id_author = table.Column<int>(type: "integer", nullable: false, comment: "Автор"),
id_editor = table.Column<int>(type: "integer", nullable: true, comment: "Редактор"),
creation = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, comment: "дата создания"),
obsolete = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true, comment: "дата устаревания"),
id_state = table.Column<int>(type: "integer", nullable: false, comment: "ИД состояния записи: \n0 - актуальная\n1 - замененная\n2 - удаленная"),
id_previous = table.Column<int>(type: "integer", nullable: true, comment: "ИД состояния записи: \n0 - актуальная\n1 - замененная\n2 - удаленная"),
id_well = table.Column<int>(type: "integer", nullable: false, comment: "Id скважины"),
id_wellsection_type = table.Column<int>(type: "integer", nullable: false, comment: "Тип секции"),
depth_start = table.Column<double>(type: "double precision", nullable: false, comment: "Глубина по стволу от, м"),
depth_end = table.Column<double>(type: "double precision", nullable: false, comment: "Глубина по стволу до, м")
},
constraints: table =>
{
table.PrimaryKey("PK_t_process_map_plan_subsystems", x => x.id);
table.ForeignKey(
name: "FK_t_process_map_plan_subsystems_t_user_id_author",
column: x => x.id_author,
principalTable: "t_user",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_t_process_map_plan_subsystems_t_user_id_editor",
column: x => x.id_editor,
principalTable: "t_user",
principalColumn: "id");
table.ForeignKey(
name: "FK_t_process_map_plan_subsystems_t_well_id_well",
column: x => x.id_well,
principalTable: "t_well",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_t_process_map_plan_subsystems_t_well_section_type_id_wellse~",
column: x => x.id_wellsection_type,
principalTable: "t_well_section_type",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
},
comment: "РТК план использование подсистем");
migrationBuilder.CreateIndex(
name: "IX_t_process_map_plan_subsystems_id_author",
table: "t_process_map_plan_subsystems",
column: "id_author");
migrationBuilder.CreateIndex(
name: "IX_t_process_map_plan_subsystems_id_editor",
table: "t_process_map_plan_subsystems",
column: "id_editor");
migrationBuilder.CreateIndex(
name: "IX_t_process_map_plan_subsystems_id_well",
table: "t_process_map_plan_subsystems",
column: "id_well");
migrationBuilder.CreateIndex(
name: "IX_t_process_map_plan_subsystems_id_wellsection_type",
table: "t_process_map_plan_subsystems",
column: "id_wellsection_type");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "t_process_map_plan_subsystems");
}
}
}

View File

@ -19,7 +19,7 @@ namespace AsbCloudDb.Migrations
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.UseCollation("Russian_Russia.1251") .UseCollation("Russian_Russia.1251")
.HasAnnotation("ProductVersion", "8.0.4") .HasAnnotation("ProductVersion", "8.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 63); .HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack"); NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack");
@ -4892,6 +4892,103 @@ namespace AsbCloudDb.Migrations
}); });
}); });
modelBuilder.Entity("AsbCloudDb.Model.ProcessMapPlan.ProcessMapPlanSubsystems", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id")
.HasComment("Идентификатор");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<double>("AutoOscillation")
.HasColumnType("double precision")
.HasColumnName("auto_oscillation")
.HasComment("Процент использования слайда с осцилляцией");
b.Property<double>("AutoRotor")
.HasColumnType("double precision")
.HasColumnName("auto_rotor")
.HasComment("Процент использования ротора");
b.Property<double>("AutoSlide")
.HasColumnType("double precision")
.HasColumnName("auto_slide")
.HasComment("Процент использования слайда");
b.Property<DateTimeOffset>("Creation")
.HasColumnType("timestamp with time zone")
.HasColumnName("creation")
.HasComment("дата создания");
b.Property<double>("DepthEnd")
.HasColumnType("double precision")
.HasColumnName("depth_end")
.HasComment("Глубина по стволу до, м");
b.Property<double>("DepthStart")
.HasColumnType("double precision")
.HasColumnName("depth_start")
.HasComment("Глубина по стволу от, м");
b.Property<int>("IdAuthor")
.HasColumnType("integer")
.HasColumnName("id_author")
.HasComment("Автор");
b.Property<int?>("IdEditor")
.HasColumnType("integer")
.HasColumnName("id_editor")
.HasComment("Редактор");
b.Property<int?>("IdPrevious")
.HasColumnType("integer")
.HasColumnName("id_previous")
.HasComment("ИД состояния записи: \n0 - актуальная\n1 - замененная\n2 - удаленная");
b.Property<int>("IdState")
.HasColumnType("integer")
.HasColumnName("id_state")
.HasComment("ИД состояния записи: \n0 - актуальная\n1 - замененная\n2 - удаленная");
b.Property<int>("IdWell")
.HasColumnType("integer")
.HasColumnName("id_well")
.HasComment("Id скважины");
b.Property<int>("IdWellSectionType")
.HasColumnType("integer")
.HasColumnName("id_wellsection_type")
.HasComment("Тип секции");
b.Property<string>("Note")
.HasMaxLength(1024)
.HasColumnType("character varying(1024)")
.HasColumnName("note")
.HasComment("Примечание");
b.Property<DateTimeOffset?>("Obsolete")
.HasColumnType("timestamp with time zone")
.HasColumnName("obsolete")
.HasComment("дата устаревания");
b.HasKey("Id");
b.HasIndex("IdAuthor");
b.HasIndex("IdEditor");
b.HasIndex("IdWell");
b.HasIndex("IdWellSectionType");
b.ToTable("t_process_map_plan_subsystems", t =>
{
t.HasComment("РТК план использование подсистем");
});
});
modelBuilder.Entity("AsbCloudDb.Model.RelationCompanyWell", b => modelBuilder.Entity("AsbCloudDb.Model.RelationCompanyWell", b =>
{ {
b.Property<int>("IdCompany") b.Property<int>("IdCompany")
@ -11573,6 +11670,39 @@ namespace AsbCloudDb.Migrations
b.Navigation("WellSectionType"); b.Navigation("WellSectionType");
}); });
modelBuilder.Entity("AsbCloudDb.Model.ProcessMapPlan.ProcessMapPlanSubsystems", b =>
{
b.HasOne("AsbCloudDb.Model.User", "Author")
.WithMany()
.HasForeignKey("IdAuthor")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AsbCloudDb.Model.User", "Editor")
.WithMany()
.HasForeignKey("IdEditor");
b.HasOne("AsbCloudDb.Model.Well", "Well")
.WithMany()
.HasForeignKey("IdWell")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("AsbCloudDb.Model.WellSectionType", "WellSectionType")
.WithMany()
.HasForeignKey("IdWellSectionType")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Author");
b.Navigation("Editor");
b.Navigation("Well");
b.Navigation("WellSectionType");
});
modelBuilder.Entity("AsbCloudDb.Model.RelationCompanyWell", b => modelBuilder.Entity("AsbCloudDb.Model.RelationCompanyWell", b =>
{ {
b.HasOne("AsbCloudDb.Model.Company", "Company") b.HasOne("AsbCloudDb.Model.Company", "Company")

View File

@ -4,6 +4,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using AsbCloudDb.Model.DailyReports; using AsbCloudDb.Model.DailyReports;
using AsbCloudDb.Model.Manuals; using AsbCloudDb.Model.Manuals;
using AsbCloudDb.Model.ProcessMapPlan;
using AsbCloudDb.Model.WellSections; using AsbCloudDb.Model.WellSections;
using AsbCloudDb.Model.Trajectory; using AsbCloudDb.Model.Trajectory;
using AsbCloudDb.Model.ProcessMapPlan.Functions; using AsbCloudDb.Model.ProcessMapPlan.Functions;
@ -38,6 +39,7 @@ namespace AsbCloudDb.Model
public virtual DbSet<ProcessMapPlanOscillation> ProcessMapPlanOscillation => Set<ProcessMapPlanOscillation>(); public virtual DbSet<ProcessMapPlanOscillation> ProcessMapPlanOscillation => Set<ProcessMapPlanOscillation>();
public virtual DbSet<ProcessMapPlanAntiCrashRotation> ProcessMapPlanAntiCrashRotation => Set<ProcessMapPlanAntiCrashRotation>(); public virtual DbSet<ProcessMapPlanAntiCrashRotation> ProcessMapPlanAntiCrashRotation => Set<ProcessMapPlanAntiCrashRotation>();
public virtual DbSet<ProcessMapPlanStaticMeasurementOutput> ProcessMapPlanStaticMeasurementOutput => Set<ProcessMapPlanStaticMeasurementOutput>(); public virtual DbSet<ProcessMapPlanStaticMeasurementOutput> ProcessMapPlanStaticMeasurementOutput => Set<ProcessMapPlanStaticMeasurementOutput>();
public virtual DbSet<ProcessMapPlanSubsystems> ProcessMapPlanSubsystems => Set<ProcessMapPlanSubsystems>();
public virtual DbSet<DrillingProgramPart> DrillingProgramParts => Set<DrillingProgramPart>(); public virtual DbSet<DrillingProgramPart> DrillingProgramParts => Set<DrillingProgramPart>();
public virtual DbSet<FileCategory> FileCategories => Set<FileCategory>(); public virtual DbSet<FileCategory> FileCategories => Set<FileCategory>();
public virtual DbSet<FileInfo> Files => Set<FileInfo>(); public virtual DbSet<FileInfo> Files => Set<FileInfo>();

View File

@ -8,6 +8,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using AsbCloudDb.Model.DailyReports; using AsbCloudDb.Model.DailyReports;
using AsbCloudDb.Model.Manuals; using AsbCloudDb.Model.Manuals;
using AsbCloudDb.Model.ProcessMapPlan;
using AsbCloudDb.Model.WellSections; using AsbCloudDb.Model.WellSections;
using AsbCloudDb.Model.Trajectory; using AsbCloudDb.Model.Trajectory;
using AsbCloudDb.Model.ProcessMapPlan.Functions; using AsbCloudDb.Model.ProcessMapPlan.Functions;
@ -99,7 +100,8 @@ namespace AsbCloudDb.Model
DbSet<ProcessMapPlanOscillation> ProcessMapPlanOscillation { get; } DbSet<ProcessMapPlanOscillation> ProcessMapPlanOscillation { get; }
DbSet<ProcessMapPlanAntiCrashRotation> ProcessMapPlanAntiCrashRotation { get; } DbSet<ProcessMapPlanAntiCrashRotation> ProcessMapPlanAntiCrashRotation { get; }
DbSet<ProcessMapPlanStaticMeasurementOutput> ProcessMapPlanStaticMeasurementOutput { get; } DbSet<ProcessMapPlanStaticMeasurementOutput> ProcessMapPlanStaticMeasurementOutput { get; }
DbSet<ProcessMapPlanSubsystems> ProcessMapPlanSubsystems { get; }
Task<int> RefreshMaterializedViewAsync(string mwName, CancellationToken token); Task<int> RefreshMaterializedViewAsync(string mwName, CancellationToken token);
Task<int> RefreshMaterializedViewAsync<TEntity>(CancellationToken token) where TEntity : class; Task<int> RefreshMaterializedViewAsync<TEntity>(CancellationToken token) where TEntity : class;
int SaveChanges(); int SaveChanges();

View File

@ -0,0 +1,24 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace AsbCloudDb.Model.ProcessMapPlan;
[Table("t_process_map_plan_subsystems"), Comment("РТК план использование подсистем")]
public class ProcessMapPlanSubsystems : ProcessMapPlanBase
{
[Range(0.0, 100)]
[Column("auto_rotor"), Comment("Процент использования ротора")]
public double AutoRotor { get; set; }
[Range(0.0, 100)]
[Column("auto_slide"), Comment("Процент использования слайда")]
public double AutoSlide { get; set; }
[Range(0.0, 100)]
[Column("auto_oscillation"), Comment("Процент использования слайда с осцилляцией")]
public double AutoOscillation { get; set; }
[Column("note"), Comment("Примечание"), StringLength(1024)]
public string? Note { get; set; }
}

View File

@ -44,6 +44,7 @@
<EmbeddedResource Include="Services\ProcessMapPlan\Templates\ProcessMapPlanSwitchingOffThePump.xlsx" /> <EmbeddedResource Include="Services\ProcessMapPlan\Templates\ProcessMapPlanSwitchingOffThePump.xlsx" />
<EmbeddedResource Include="Services\ProcessMapPlan\Templates\ProcessMapPlanSwitchingToTheMode.xlsx" /> <EmbeddedResource Include="Services\ProcessMapPlan\Templates\ProcessMapPlanSwitchingToTheMode.xlsx" />
<EmbeddedResource Include="Services\ProcessMapPlan\Templates\ProcessMapPlanTFOrientation.xlsx" /> <EmbeddedResource Include="Services\ProcessMapPlan\Templates\ProcessMapPlanTFOrientation.xlsx" />
<EmbeddedResource Include="Services\ProcessMapPlan\Templates\ProcessMapPlanSubsystems.xlsx" />
<EmbeddedResource Include="Services\ProcessMaps\Report\ProcessMapReportDataSaubStatTemplate.xlsx" /> <EmbeddedResource Include="Services\ProcessMaps\Report\ProcessMapReportDataSaubStatTemplate.xlsx" />
<EmbeddedResource Include="Services\Trajectory\Templates\TrajectoryFactNnbTemplate.xlsx" /> <EmbeddedResource Include="Services\Trajectory\Templates\TrajectoryFactNnbTemplate.xlsx" />
<EmbeddedResource Include="Services\Trajectory\Templates\TrajectoryFactManualTemplate.xlsx" /> <EmbeddedResource Include="Services\Trajectory\Templates\TrajectoryFactManualTemplate.xlsx" />

View File

@ -392,7 +392,11 @@ public static class DependencyInjection
IChangeLogRepository<ProcessMapPlanStaticMeasurementOutputDto, ProcessMapPlanBaseRequestWithWell>, IChangeLogRepository<ProcessMapPlanStaticMeasurementOutputDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanStaticMeasurementOutput, ProcessMapPlanStaticMeasurementOutputDto>>(); ProcessMapPlanBaseRepository<ProcessMapPlanStaticMeasurementOutput, ProcessMapPlanStaticMeasurementOutputDto>>();
services.AddTransient<IProcessMapReportDrillingService, ProcessMapReportDrillingService>(); services.AddTransient<
IChangeLogRepository<ProcessMapPlanSubsystemsDto, ProcessMapPlanBaseRequestWithWell>,
ProcessMapPlanBaseRepository<ProcessMapPlanSubsystems, ProcessMapPlanSubsystemsDto>>();
services.AddTransient<IProcessMapReportDrillingService, ProcessMapReportDrillingService>();
services.AddTransient<TrajectoryService>(); services.AddTransient<TrajectoryService>();
@ -530,6 +534,7 @@ public static class DependencyInjection
services.AddTransient<ProcessMapPlanOscillationParser>(); services.AddTransient<ProcessMapPlanOscillationParser>();
services.AddTransient<ProcessMapPlanAntiCrashRotationParser>(); services.AddTransient<ProcessMapPlanAntiCrashRotationParser>();
services.AddTransient<ProcessMapPlanStaticMeasurementOutputParser>(); services.AddTransient<ProcessMapPlanStaticMeasurementOutputParser>();
services.AddTransient<ProcessMapPlanSubsystemsParser>();
services.AddTransient<TrajectoryPlanExportService>(); services.AddTransient<TrajectoryPlanExportService>();
services.AddTransient<TrajectoryFactManualExportService>(); services.AddTransient<TrajectoryFactManualExportService>();
@ -553,8 +558,9 @@ public static class DependencyInjection
services.AddTransient<ProcessMapPlanOscillationExportService>(); services.AddTransient<ProcessMapPlanOscillationExportService>();
services.AddTransient<ProcessMapPlanAntiCrashRotationExportService>(); services.AddTransient<ProcessMapPlanAntiCrashRotationExportService>();
services.AddTransient<ProcessMapPlanStaticMeasurementOutputExportService>(); services.AddTransient<ProcessMapPlanStaticMeasurementOutputExportService>();
services.AddTransient<ProcessMapPlanSubsystemsExportService>();
services.AddTransient<WellOperationParserFactory>(); services.AddTransient<WellOperationParserFactory>();
services.AddTransient<WellOperationExportServiceFactory>(); services.AddTransient<WellOperationExportServiceFactory>();
return services; return services;

View File

@ -0,0 +1,22 @@
using System.Collections.Generic;
using AsbCloudApp.Data.ProcessMaps;
namespace AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
public class ProcessMapPlanSubsystemsTemplate : ITemplateParameters
{
public string SheetName => "Использование систем";
public int HeaderRowsCount => 2;
public string FileName => "ProcessMapPlanSubsystems.xlsx";
public IDictionary<string, Cell> Cells => new Dictionary<string, Cell>
{
{ nameof(ProcessMapPlanSubsystemsDto.Section), new Cell(1, typeof(string)) },
{ nameof(ProcessMapPlanSubsystemsDto.DepthStart), new Cell(2, typeof(double)) },
{ nameof(ProcessMapPlanSubsystemsDto.DepthEnd), new Cell(3, typeof(double)) },
{ nameof(ProcessMapPlanSubsystemsDto.AutoRotor), new Cell(4, typeof(double)) },
{ nameof(ProcessMapPlanSubsystemsDto.AutoSlide), new Cell(5, typeof(double)) },
{ nameof(ProcessMapPlanSubsystemsDto.AutoOscillation), new Cell(6, typeof(double)) },
{ nameof(ProcessMapPlanSubsystemsDto.Note), new Cell(7, typeof(string)) }
};
}

View File

@ -0,0 +1,30 @@
using System.Threading;
using System.Threading.Tasks;
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;
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
public class ProcessMapPlanSubsystemsExportService : ProcessMapPlanExportService<ProcessMapPlanSubsystemsDto>
{
public ProcessMapPlanSubsystemsExportService(
IChangeLogRepository<ProcessMapPlanSubsystemsDto, ProcessMapPlanBaseRequestWithWell> processMapPlanRepository,
IWellService wellService)
: base(processMapPlanRepository, wellService)
{
}
protected override ITemplateParameters TemplateParameters => new ProcessMapPlanSubsystemsTemplate();
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,44 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using AsbCloudApp.Data.ProcessMaps;
using AsbCloudApp.Data.ProcessMaps.Functions;
using AsbCloudApp.Repositories;
using AsbCloudInfrastructure.Services.ExcelServices.Templates;
using AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemplates;
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
public class ProcessMapPlanSubsystemsParser : ProcessMapPlanParser<ProcessMapPlanSubsystemsDto>
{
public ProcessMapPlanSubsystemsParser(IWellOperationRepository wellOperationRepository)
: base(wellOperationRepository)
{
}
protected override ITemplateParameters TemplateParameters => new ProcessMapPlanSubsystemsTemplate();
protected override ProcessMapPlanSubsystemsDto BuildDto(IDictionary<string, object?> row, int rowNumber)
{
var dto = base.BuildDto(row, rowNumber);
//TODO: при парсинге всех РТК шаблонов этот код повторяется, нужно поправить
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,33 @@
using AsbCloudApp.Data.ProcessMaps;
using AsbCloudApp.Repositories;
using AsbCloudApp.Requests;
using AsbCloudApp.Services;
using AsbCloudDb.Model.ProcessMapPlan;
using AsbCloudInfrastructure.Services.ProcessMapPlan.Export;
using AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace AsbCloudWebApi.Controllers.ProcessMaps;
/// <summary>
/// РТК план использование подсистем
/// </summary>
[ApiController]
[Route("api/well/{idWell}/[controller]")]
[Authorize]
public class ProcessMapPlanSubsystemsController
: ProcessMapPlanBaseController<ProcessMapPlanSubsystems, ProcessMapPlanSubsystemsDto>
{
public ProcessMapPlanSubsystemsController(
IChangeLogRepository<ProcessMapPlanSubsystemsDto, ProcessMapPlanBaseRequestWithWell> repository,
IWellService wellService,
ProcessMapPlanSubsystemsParser parserService,
ProcessMapPlanSubsystemsExportService processMapPlanExportService,
ITelemetryService telemetryService)
: base(repository, wellService, parserService, processMapPlanExportService, telemetryService)
{
}
protected override string TemplateFileName => "ЕЦП_шаблон_файла_РТК_план_использование_систем.xlsx";
}