Разделение таблицы РТК-план-бурение на Ротор и Слайд.

Разделение ProcessMaplPlanDrillingController на Ротор и Слайд.
Добавлены 2 Dto для Ротора и Слайда
This commit is contained in:
Olga Nemt 2024-06-11 10:31:03 +05:00
parent e6fdc56750
commit 089ce64e65
11 changed files with 10752 additions and 22 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,228 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace AsbCloudDb.Migrations
{
/// <inheritdoc />
public partial class Add_ProcessMapPlanRotor_And_Slide : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "t_process_map_plan_rotor",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
rop_plan = table.Column<double>(type: "double precision", nullable: false, comment: "Максимально допустимая скорость, м/ч"),
max_allowable_pressure = table.Column<double>(type: "double precision", nullable: false, comment: "Максимально допустимое давление, атм"),
differential_pressure_plan = table.Column<double>(type: "double precision", nullable: false, comment: "Перепад давления, атм. Уставка"),
differential_pressure_limit_max = table.Column<double>(type: "double precision", nullable: false, comment: "Перепад давления, атм. Ограничение"),
weight_on_bit_plan = table.Column<double>(type: "double precision", nullable: false, comment: "Нагрузка, т. Уставка"),
weight_on_bit_limit_max = table.Column<double>(type: "double precision", nullable: false, comment: "Нагрузка, т. Ограничение"),
top_drive_torque_plan = table.Column<double>(type: "double precision", nullable: false, comment: "Момент на ВСП, кН*м. Уставка"),
top_drive_torque_limit_max = table.Column<double>(type: "double precision", nullable: false, comment: "Момент на ВСП, кН*м. Ограничение"),
revolution_per_minute_plan = table.Column<double>(type: "double precision", nullable: false, comment: "Обороты на ВСП, об/мин. Уставка"),
revolutions_per_minute_limit_max = table.Column<double>(type: "double precision", nullable: false, comment: "Обороты на ВСП, об/мин. Ограничение"),
flow_rate_plan = table.Column<double>(type: "double precision", nullable: false, comment: "Расход л/с. Уставка"),
flow_rate_limit_max = table.Column<double>(type: "double precision", nullable: false, comment: "Расход л/с. Ограничение"),
note = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false, 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_rotor", x => x.id);
table.ForeignKey(
name: "FK_t_process_map_plan_rotor_t_process_map_plan_rotor_id_previo~",
column: x => x.id_previous,
principalTable: "t_process_map_plan_rotor",
principalColumn: "id");
table.ForeignKey(
name: "FK_t_process_map_plan_rotor_t_user_id_author",
column: x => x.id_author,
principalTable: "t_user",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_t_process_map_plan_rotor_t_user_id_editor",
column: x => x.id_editor,
principalTable: "t_user",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_t_process_map_plan_rotor_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_rotor_t_well_section_type_id_wellsection~",
column: x => x.id_wellsection_type,
principalTable: "t_well_section_type",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
},
comment: "РТК план бурение ротор");
migrationBuilder.CreateTable(
name: "t_process_map_plan_slide",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
rop_plan = table.Column<double>(type: "double precision", nullable: false, comment: "Максимально допустимая скорость, м/ч"),
max_allowable_pressure = table.Column<double>(type: "double precision", nullable: false, comment: "Максимально допустимое давление, атм"),
differential_pressure_plan = table.Column<double>(type: "double precision", nullable: false, comment: "Перепад давления, атм. Уставка"),
differential_pressure_limit_max = table.Column<double>(type: "double precision", nullable: false, comment: "Перепад давления, атм. Ограничение"),
weight_on_bit_plan = table.Column<double>(type: "double precision", nullable: false, comment: "Нагрузка, т. Уставка"),
weight_on_bit_limit_max = table.Column<double>(type: "double precision", nullable: false, comment: "Нагрузка, т. Ограничение"),
flow_rate_plan = table.Column<double>(type: "double precision", nullable: false, comment: "Расход л/с. Уставка"),
flow_rate_limit_max = table.Column<double>(type: "double precision", nullable: false, comment: "Расход л/с. Ограничение"),
design_spring = table.Column<double>(type: "double precision", nullable: false, comment: "Расчётная пружина, градус"),
tool_buckling = table.Column<double>(type: "double precision", nullable: false, comment: "Складывание инструмента, м"),
note = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false, 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_slide", x => x.id);
table.ForeignKey(
name: "FK_t_process_map_plan_slide_t_process_map_plan_drilling_id_pre~",
column: x => x.id_previous,
principalTable: "t_process_map_plan_drilling",
principalColumn: "id");
table.ForeignKey(
name: "FK_t_process_map_plan_slide_t_user_id_author",
column: x => x.id_author,
principalTable: "t_user",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_t_process_map_plan_slide_t_user_id_editor",
column: x => x.id_editor,
principalTable: "t_user",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_t_process_map_plan_slide_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_slide_t_well_section_type_id_wellsection~",
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_rotor_id_author",
table: "t_process_map_plan_rotor",
column: "id_author");
migrationBuilder.CreateIndex(
name: "IX_t_process_map_plan_rotor_id_editor",
table: "t_process_map_plan_rotor",
column: "id_editor");
migrationBuilder.CreateIndex(
name: "IX_t_process_map_plan_rotor_id_previous",
table: "t_process_map_plan_rotor",
column: "id_previous");
migrationBuilder.CreateIndex(
name: "IX_t_process_map_plan_rotor_id_well",
table: "t_process_map_plan_rotor",
column: "id_well");
migrationBuilder.CreateIndex(
name: "IX_t_process_map_plan_rotor_id_wellsection_type",
table: "t_process_map_plan_rotor",
column: "id_wellsection_type");
migrationBuilder.CreateIndex(
name: "IX_t_process_map_plan_slide_id_author",
table: "t_process_map_plan_slide",
column: "id_author");
migrationBuilder.CreateIndex(
name: "IX_t_process_map_plan_slide_id_editor",
table: "t_process_map_plan_slide",
column: "id_editor");
migrationBuilder.CreateIndex(
name: "IX_t_process_map_plan_slide_id_previous",
table: "t_process_map_plan_slide",
column: "id_previous");
migrationBuilder.CreateIndex(
name: "IX_t_process_map_plan_slide_id_well",
table: "t_process_map_plan_slide",
column: "id_well");
migrationBuilder.CreateIndex(
name: "IX_t_process_map_plan_slide_id_wellsection_type",
table: "t_process_map_plan_slide",
column: "id_wellsection_type");
migrationBuilder.Sql(@"INSERT INTO public.t_process_map_plan_rotor
(id, id_wellsection_type, rop_plan, depth_start, depth_end, differential_pressure_plan,
differential_pressure_limit_max, weight_on_bit_plan, weight_on_bit_limit_max,
top_drive_torque_plan, top_drive_torque_limit_max, revolution_per_minute_plan,
revolutions_per_minute_limit_max, flow_rate_plan, flow_rate_limit_max, note,
max_allowable_pressure, id_author, creation, id_state, id_well, id_editor, obsolete, id_previous)
SELECT id, id_wellsection_type, rop_plan, depth_start, depth_end, delta_pressure_plan,
delta_pressure_limit_max, axial_load_plan, axial_load_limit_max,
top_drive_torque_plan, top_drive_torque_limit_max, top_drive_speed_plan,
top_drive_speed_limit_max, flow_plan, flow_limit_max, comment, 0, id_author, creation, id_state, id_well,
id_editor, obsolete, id_previous
FROM public.t_process_map_plan_drilling WHERE id_mode = 1");
migrationBuilder.Sql(@"INSERT INTO public.t_process_map_plan_slide
(id, id_wellsection_type, rop_plan, depth_start, depth_end, differential_pressure_plan,
differential_pressure_limit_max, weight_on_bit_plan, weight_on_bit_limit_max,
flow_rate_plan, flow_rate_limit_max, note, max_allowable_pressure, id_author, creation,
id_state, id_well, design_spring, tool_buckling, id_editor, obsolete, id_previous)
SELECT id, id_wellsection_type, rop_plan, depth_start, depth_end, delta_pressure_plan,
delta_pressure_limit_max, axial_load_plan, axial_load_limit_max,
flow_plan, flow_limit_max, comment, 0, id_author, creation, id_state, id_well, 0, 0, id_editor, obsolete, id_previous
FROM public.t_process_map_plan_drilling
WHERE id_mode = 2");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "t_process_map_plan_rotor");
migrationBuilder.DropTable(
name: "t_process_map_plan_slide");
}
}
}

View File

@ -2905,6 +2905,286 @@ namespace AsbCloudDb.Migrations
});
});
modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapPlanRotor", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id")
.HasComment("Идентификатор");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
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<double>("DifferentialPressureLimitMax")
.HasColumnType("double precision")
.HasColumnName("differential_pressure_limit_max")
.HasComment("Перепад давления, атм. Ограничение");
b.Property<double>("DifferentialPressurePlan")
.HasColumnType("double precision")
.HasColumnName("differential_pressure_plan")
.HasComment("Перепад давления, атм. Уставка");
b.Property<double>("FlowRateLimitMax")
.HasColumnType("double precision")
.HasColumnName("flow_rate_limit_max")
.HasComment("Расход л/с. Ограничение");
b.Property<double>("FlowRatePlan")
.HasColumnType("double precision")
.HasColumnName("flow_rate_plan")
.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<double>("MaxAllowablePressure")
.HasColumnType("double precision")
.HasColumnName("max_allowable_pressure")
.HasComment("Максимально допустимое давление, атм");
b.Property<string>("Note")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)")
.HasColumnName("note")
.HasComment("Примечание");
b.Property<DateTimeOffset?>("Obsolete")
.HasColumnType("timestamp with time zone")
.HasColumnName("obsolete")
.HasComment("дата устаревания");
b.Property<double>("RevolutionsPerMinuteLimitMax")
.HasColumnType("double precision")
.HasColumnName("revolutions_per_minute_limit_max")
.HasComment("Обороты на ВСП, об/мин. Ограничение");
b.Property<double>("RevolutionsPerMinutePlan")
.HasColumnType("double precision")
.HasColumnName("revolution_per_minute_plan")
.HasComment("Обороты на ВСП, об/мин. Уставка");
b.Property<double>("RopPlan")
.HasColumnType("double precision")
.HasColumnName("rop_plan")
.HasComment("Максимально допустимая скорость, м/ч");
b.Property<double>("TopDriveTorquePlan")
.HasColumnType("double precision")
.HasColumnName("top_drive_torque_plan")
.HasComment("Момент на ВСП, кН*м. Уставка");
b.Property<double>("TopDriveTorquetLimit")
.HasColumnType("double precision")
.HasColumnName("top_drive_torque_limit_max")
.HasComment("Момент на ВСП, кН*м. Ограничение");
b.Property<double>("WeightOnBitLimitMax")
.HasColumnType("double precision")
.HasColumnName("weight_on_bit_limit_max")
.HasComment("Нагрузка, т. Ограничение");
b.Property<double>("WeightOnBitPlan")
.HasColumnType("double precision")
.HasColumnName("weight_on_bit_plan")
.HasComment("Нагрузка, т. Уставка");
b.HasKey("Id");
b.HasIndex("IdAuthor");
b.HasIndex("IdEditor");
b.HasIndex("IdPrevious");
b.HasIndex("IdWell");
b.HasIndex("IdWellSectionType");
b.ToTable("t_process_map_plan_rotor", t =>
{
t.HasComment("РТК план бурение ротор");
});
});
modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapPlanSlide", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id")
.HasComment("Идентификатор");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
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<double>("DesignSpring")
.HasColumnType("double precision")
.HasColumnName("design_spring")
.HasComment("Расчётная пружина, градус");
b.Property<double>("DifferentialPressureLimitMax")
.HasColumnType("double precision")
.HasColumnName("differential_pressure_limit_max")
.HasComment("Перепад давления, атм. Ограничение");
b.Property<double>("DifferentialPressurePlan")
.HasColumnType("double precision")
.HasColumnName("differential_pressure_plan")
.HasComment("Перепад давления, атм. Уставка");
b.Property<double>("FlowRateLimitMax")
.HasColumnType("double precision")
.HasColumnName("flow_rate_limit_max")
.HasComment("Расход л/с. Ограничение");
b.Property<double>("FlowRatePlan")
.HasColumnType("double precision")
.HasColumnName("flow_rate_plan")
.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<double>("MaxAllowablePressure")
.HasColumnType("double precision")
.HasColumnName("max_allowable_pressure")
.HasComment("Максимально допустимое давление, атм");
b.Property<string>("Note")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)")
.HasColumnName("note")
.HasComment("Примечание");
b.Property<DateTimeOffset?>("Obsolete")
.HasColumnType("timestamp with time zone")
.HasColumnName("obsolete")
.HasComment("дата устаревания");
b.Property<double>("RopPlan")
.HasColumnType("double precision")
.HasColumnName("rop_plan")
.HasComment("Максимально допустимая скорость, м/ч");
b.Property<double>("ToolBuckling")
.HasColumnType("double precision")
.HasColumnName("tool_buckling")
.HasComment("Складывание инструмента, м");
b.Property<double>("WeightOnBitLimitMax")
.HasColumnType("double precision")
.HasColumnName("weight_on_bit_limit_max")
.HasComment("Нагрузка, т. Ограничение");
b.Property<double>("WeightOnBitPlan")
.HasColumnType("double precision")
.HasColumnName("weight_on_bit_plan")
.HasComment("Нагрузка, т. Уставка");
b.HasKey("Id");
b.HasIndex("IdAuthor");
b.HasIndex("IdEditor");
b.HasIndex("IdPrevious");
b.HasIndex("IdWell");
b.HasIndex("IdWellSectionType");
b.ToTable("t_process_map_plan_slide", t =>
{
t.HasComment("РТК план бурение слайд");
});
});
modelBuilder.Entity("AsbCloudDb.Model.RelationCompanyWell", b =>
{
b.Property<int>("IdCompany")
@ -8937,6 +9217,86 @@ namespace AsbCloudDb.Migrations
b.Navigation("WellSectionType");
});
modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapPlanRotor", b =>
{
b.HasOne("AsbCloudDb.Model.User", "Author")
.WithMany()
.HasForeignKey("IdAuthor")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("AsbCloudDb.Model.User", "Editor")
.WithMany()
.HasForeignKey("IdEditor")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("AsbCloudDb.Model.ProcessMaps.ProcessMapPlanRotor", "Previous")
.WithMany()
.HasForeignKey("IdPrevious");
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("Previous");
b.Navigation("Well");
b.Navigation("WellSectionType");
});
modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapPlanSlide", b =>
{
b.HasOne("AsbCloudDb.Model.User", "Author")
.WithMany()
.HasForeignKey("IdAuthor")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("AsbCloudDb.Model.User", "Editor")
.WithMany()
.HasForeignKey("IdEditor")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("AsbCloudDb.Model.ProcessMaps.ProcessMapPlanDrilling", "Previous")
.WithMany()
.HasForeignKey("IdPrevious");
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("Previous");
b.Navigation("Well");
b.Navigation("WellSectionType");
});
modelBuilder.Entity("AsbCloudDb.Model.RelationCompanyWell", b =>
{
b.HasOne("AsbCloudDb.Model.Company", "Company")

View File

@ -20,6 +20,8 @@ namespace AsbCloudDb.Model
public virtual DbSet<DetectedOperation> DetectedOperations => Set<DetectedOperation>();
public virtual DbSet<TrajectoryPlan> TrajectoriesPlan => Set<TrajectoryPlan>();
public virtual DbSet<ProcessMapPlanDrilling> ProcessMapPlanDrilling => Set<ProcessMapPlanDrilling>();
public virtual DbSet<ProcessMapPlanRotor> ProcessMapPlanRotor => Set<ProcessMapPlanRotor>();
public virtual DbSet<ProcessMapPlanSlide> ProcessMapPlanSlide => Set<ProcessMapPlanSlide>();
public virtual DbSet<ProcessMapPlanReam> ProcessMapPlanReams => Set<ProcessMapPlanReam>();
public virtual DbSet<DrillingProgramPart> DrillingProgramParts => Set<DrillingProgramPart>();
public virtual DbSet<FileCategory> FileCategories => Set<FileCategory>();
@ -447,11 +449,31 @@ namespace AsbCloudDb.Model
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanRotor>()
.HasOne(p => p.Author)
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanSlide>()
.HasOne(p => p.Author)
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanDrilling>()
.HasOne(p => p.Editor)
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanRotor>()
.HasOne(p => p.Editor)
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
modelBuilder.Entity<ProcessMapPlanSlide>()
.HasOne(p => p.Editor)
.WithMany()
.OnDelete(DeleteBehavior.Restrict);
DefaultData.DefaultContextData.Fill(modelBuilder);
}

View File

@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AsbCloudDb.Model.ProcessMapPlan;
@ -12,9 +13,11 @@ public abstract class ProcessMapPlanBase : ChangeLogAbstract, IId, IWellRelated
public int IdWellSectionType { get; set; }
[Column("depth_start"), Comment("Глубина по стволу от, м")]
[Range(0.0, 9999.9)]
public double DepthStart { get; set; }
[Column("depth_end"), Comment("Глубина по стволу до, м")]
[Range(0.0, 9999.9)]
public double DepthEnd { get; set; }
[ForeignKey(nameof(IdWell))]

View File

@ -0,0 +1,76 @@
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_rotor"), Comment("РТК план бурение ротор")]
public class ProcessMapPlanRotor : ProcessMapPlanBase
{
[Column("rop_plan"), Comment("Максимально допустимая скорость, м/ч")]
[Range(0, 800.0)]
[Required]
public double RopPlan { get; set; }
[Column("max_allowable_pressure"), Comment("Максимально допустимое давление, атм")]
[Range(0.0, 400.0)]
[Required]
public double MaxAllowablePressure { get; set; }
[Column("differential_pressure_plan"), Comment("Перепад давления, атм. Уставка")]
[Range(0.0, 60.0)]
[Required]
public double DifferentialPressurePlan { get; set; }
[Column("differential_pressure_limit_max"), Comment("Перепад давления, атм. Ограничение")]
[Range(0.0, 60.0)]
[Required]
public double DifferentialPressureLimitMax { get; set; }
[Column("weight_on_bit_plan"), Comment("Нагрузка, т. Уставка")]
[Range(0.0, 99.0)]
[Required]
public double WeightOnBitPlan { get; set; }
[Column("weight_on_bit_limit_max"), Comment("Нагрузка, т. Ограничение")]
[Range(0.0, 99.0)]
[Required]
public double WeightOnBitLimitMax { get; set; }
[Column("top_drive_torque_plan"), Comment("Момент на ВСП, кН*м. Уставка")]
[Range(0.0, 35.0)]
[Required]
public double TopDriveTorquePlan { get; set; }
[Column("top_drive_torque_limit_max"), Comment("Момент на ВСП, кН*м. Ограничение")]
[Range(0.0, 35.0)]
[Required]
public double TopDriveTorquetLimit { get; set; }
[Column("revolution_per_minute_plan"), Comment("Обороты на ВСП, об/мин. Уставка")]
[Range(0.0, 270.0)]
[Required]
public double RevolutionsPerMinutePlan { get; set; }
[Column("revolutions_per_minute_limit_max"), Comment("Обороты на ВСП, об/мин. Ограничение")]
[Range(0.0, 270.0)]
[Required]
public double RevolutionsPerMinuteLimitMax { get; set; }
[Column("flow_rate_plan"), Comment("Расход л/с. Уставка")]
[Range(0.0, 100.0)]
[Required]
public double FlowRatePlan { get; set; }
[Column("flow_rate_limit_max"), Comment("Расход л/с. Ограничение")]
[Range(0.0, 100.0)]
[Required]
public double FlowRateLimitMax { get; set; }
[Column("note"), Comment("Примечание"), StringLength(1024)]
public string Note { get; set; } = string.Empty;
[ForeignKey(nameof(IdPrevious))]
public virtual ProcessMapPlanRotor? Previous { get; set; }
}

View File

@ -0,0 +1,66 @@
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_slide"), Comment("РТК план бурение слайд")]
public class ProcessMapPlanSlide : ProcessMapPlanBase
{
[Column("rop_plan"), Comment("Максимально допустимая скорость, м/ч")]
[Range(0, 800.0)]
[Required]
public double RopPlan { get; set; }
[Column("max_allowable_pressure"), Comment("Максимально допустимое давление, атм")]
[Range(0, 400.0)]
[Required]
public double MaxAllowablePressure { get; set; }
[Column("differential_pressure_plan"), Comment("Перепад давления, атм. Уставка")]
[Range(0, 60.0)]
[Required]
public double DifferentialPressurePlan { get; set; }
[Column("differential_pressure_limit_max"), Comment("Перепад давления, атм. Ограничение")]
[Range(0, 60.0)]
[Required]
public double DifferentialPressureLimitMax { get; set; }
[Column("weight_on_bit_plan"), Comment("Нагрузка, т. Уставка")]
[Range(0, 50.0)]
[Required]
public double WeightOnBitPlan { get; set; }
[Column("weight_on_bit_limit_max"), Comment("Нагрузка, т. Ограничение")]
[Range(0, 50.0)]
[Required]
public double WeightOnBitLimitMax { get; set; }
[Column("flow_rate_plan"), Comment("Расход л/с. Уставка")]
[Range(0, 100.0)]
[Required]
public double FlowRatePlan { get; set; }
[Column("flow_rate_limit_max"), Comment("Расход л/с. Ограничение")]
[Range(0, 100.0)]
[Required]
public double FlowRateLimitMax { get; set; }
[Column("design_spring"), Comment("Расчётная пружина, градус")]
[Range(0, 9999.9)]
[Required]
public double DesignSpring { get; set; }
[Column("tool_buckling"), Comment("Складывание инструмента, м")]
[Range(0, 9999.9)]
[Required]
public double ToolBuckling { get; set; }
[Column("note"), Comment("Примечание"), StringLength(1024)]
public string Note { get; set; } = string.Empty;
[ForeignKey(nameof(IdPrevious))]
public virtual ProcessMapPlanDrilling? Previous { get; set; }
}

View File

@ -302,7 +302,8 @@ namespace AsbCloudInfrastructure
services.AddTransient<TrajectoryPlanParser>();
services.AddTransient<TrajectoryFactManualParser>();
services.AddTransient<ProcessMapPlanDrillingParser>();
services.AddTransient<ProcessMapPlanDrillingParser<ProcessMapPlanRotorDto>>();
services.AddTransient<ProcessMapPlanDrillingParser<ProcessMapPlanSlideDto>>();
services.AddTransient<ProcessMapPlanReamParser>();
services.AddTransient<TrajectoryPlanExportService>();

View File

@ -9,7 +9,8 @@ using AsbCloudInfrastructure.Services.ExcelServices.Templates.ProcessMapPlanTemp
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
public class ProcessMapPlanDrillingParser : ProcessMapPlanParser<ProcessMapPlanDrillingDto>
public class ProcessMapPlanDrillingParser<TDto> : ProcessMapPlanParser<TDto>
where TDto : ProcessMapPlanBaseDto
{
public ProcessMapPlanDrillingParser(IWellOperationRepository wellOperationRepository)
: base(wellOperationRepository)
@ -18,7 +19,7 @@ public class ProcessMapPlanDrillingParser : ProcessMapPlanParser<ProcessMapPlanD
protected override ITemplateParameters TemplateParameters => new ProcessMapPlanDrillingTemplate();
protected override ProcessMapPlanDrillingDto BuildDto(IDictionary<string, object?> row, int rowNumber)
protected override TDto BuildDto(IDictionary<string, object?> row, int rowNumber)
{
var dto = base.BuildDto(row, rowNumber);
@ -30,25 +31,12 @@ public class ProcessMapPlanDrillingParser : ProcessMapPlanParser<ProcessMapPlanD
var message = string.Format(XLExtentions.ProblemDetailsTemplate,
TemplateParameters.SheetName,
rowNumber,
TemplateParameters.Cells[nameof(ProcessMapPlanDrillingDto.Section)],
TemplateParameters.Cells[nameof(ProcessMapPlanBaseDto.Section)],
"Указана некорректная секция");
throw new FileFormatException(message);
}
var idMode = GetIdMode(dto.Mode);
if (idMode is null)
{
var message = string.Format(XLExtentions.ProblemDetailsTemplate,
TemplateParameters.SheetName,
rowNumber,
TemplateParameters.Cells[nameof(ProcessMapPlanDrillingDto.Mode)],
"Указан некорректный режим бурения");
throw new FileFormatException(message);
}
dto.IdWellSectionType = section.Id;
dto.IdMode = idMode.Value;
return dto;
}

View File

@ -9,18 +9,18 @@ using AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
namespace AsbCloudWebApi.Controllers.ProcessMaps;
/// <summary>
/// РТК план бурения
/// РТК план бурения (ротор)
/// </summary>
public class ProcessMapPlanDrillingController : ProcessMapPlanBaseController<ProcessMapPlanDrilling, ProcessMapPlanDrillingDto>
public class ProcessMapPlanRotorController : ProcessMapPlanBaseController<ProcessMapPlanRotor, ProcessMapPlanRotorDto>
{
public ProcessMapPlanDrillingController(IChangeLogRepository<ProcessMapPlanDrillingDto, ProcessMapPlanBaseRequestWithWell> repository,
public ProcessMapPlanRotorController(IChangeLogRepository<ProcessMapPlanRotorDto, ProcessMapPlanBaseRequestWithWell> repository,
IWellService wellService,
ProcessMapPlanDrillingParser parserService,
ProcessMapPlanDrillingParser<ProcessMapPlanRotorDto> parserService,
ITelemetryService telemetryService,
ProcessMapPlanDrillingExportService processMapPlanExportService)
: base(repository, wellService, parserService, processMapPlanExportService, telemetryService)
{
}
protected override string TemplateFileName => "ЕЦП_шаблон_файла_РТК_план_бурение.xlsx";
protected override string TemplateFileName => "ЕЦП_шаблон_файла_РТК_план_бурение_ротор.xlsx";
}

View File

@ -0,0 +1,26 @@
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 ProcessMapPlanSlideController : ProcessMapPlanBaseController<ProcessMapPlanSlide, ProcessMapPlanSlideDto>
{
public ProcessMapPlanSlideController(IChangeLogRepository<ProcessMapPlanSlideDto, ProcessMapPlanBaseRequestWithWell> repository,
IWellService wellService,
ProcessMapPlanDrillingParser<ProcessMapPlanSlideDto> parserService,
ITelemetryService telemetryService,
ProcessMapPlanDrillingExportService processMapPlanExportService)
: base(repository, wellService, parserService, processMapPlanExportService, telemetryService)
{
}
protected override string TemplateFileName => "ЕЦП_шаблон_файла_РТК_план_бурение_слайд.xlsx";
}