#7987467 Исправления

This commit is contained in:
ai.astrakhantsev 2022-12-06 10:41:13 +05:00
parent 4b9cd6694b
commit 4f100e6bc4
6 changed files with 6678 additions and 43 deletions

View File

@ -22,9 +22,9 @@ namespace AsbCloudApp.Data
public int IdWell { get; set; } public int IdWell { get; set; }
/// <summary> /// <summary>
/// Секция /// Тип секции
/// </summary> /// </summary>
public int Section { get; set; } public int IdWellSectionType { get; set; }
/// <summary> /// <summary>
/// Дата последнего изменения /// Дата последнего изменения
@ -54,12 +54,12 @@ namespace AsbCloudApp.Data
/// <summary> /// <summary>
/// Момент на ВСП /// Момент на ВСП
/// </summary> /// </summary>
public PlanFactDto? RotorTorque { get; set; } public PlanFactDto? TopDriveTorque { get; set; }
/// <summary> /// <summary>
/// Обороты на ВСП /// Обороты на ВСП
/// </summary> /// </summary>
public PlanFactDto? RotorSpeed { get; set; } public PlanFactDto? TopDriveSpeed { get; set; }
/// <summary> /// <summary>
/// Расход /// Расход
@ -69,7 +69,7 @@ namespace AsbCloudApp.Data
/// <summary> /// <summary>
/// Плановая механическая скорость, м/ч /// Плановая механическая скорость, м/ч
/// </summary> /// </summary>
public double MechanicalSpeedPlan { get; set; } public double RopPlan { get; set; }
} }
#nullable disable #nullable disable
} }

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,131 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class UpdateTable_t_process_map : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "section",
table: "t_process_map");
migrationBuilder.RenameColumn(
name: "rotor_torque_plan",
table: "t_process_map",
newName: "top_drive_torque_plan");
migrationBuilder.RenameColumn(
name: "rotor_torque_fact",
table: "t_process_map",
newName: "top_drive_torque_fact");
migrationBuilder.RenameColumn(
name: "rotor_speed_plan",
table: "t_process_map",
newName: "top_drive_speed_plan");
migrationBuilder.RenameColumn(
name: "rotor_speed_fact",
table: "t_process_map",
newName: "top_drive_speed_fact");
migrationBuilder.RenameColumn(
name: "mechanical_speed_plan",
table: "t_process_map",
newName: "rop_plan");
migrationBuilder.AddColumn<int>(
name: "id_wellsection_type",
table: "t_process_map",
type: "integer",
nullable: false,
defaultValue: 0,
comment: "Тип секции");
migrationBuilder.CreateIndex(
name: "IX_t_process_map_id_wellsection_type",
table: "t_process_map",
column: "id_wellsection_type");
migrationBuilder.CreateIndex(
name: "IX_t_process_map_well_id",
table: "t_process_map",
column: "well_id");
migrationBuilder.AddForeignKey(
name: "FK_t_process_map_t_well_section_type_id_wellsection_type",
table: "t_process_map",
column: "id_wellsection_type",
principalTable: "t_well_section_type",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_t_process_map_t_well_well_id",
table: "t_process_map",
column: "well_id",
principalTable: "t_well",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_t_process_map_t_well_section_type_id_wellsection_type",
table: "t_process_map");
migrationBuilder.DropForeignKey(
name: "FK_t_process_map_t_well_well_id",
table: "t_process_map");
migrationBuilder.DropIndex(
name: "IX_t_process_map_id_wellsection_type",
table: "t_process_map");
migrationBuilder.DropIndex(
name: "IX_t_process_map_well_id",
table: "t_process_map");
migrationBuilder.DropColumn(
name: "id_wellsection_type",
table: "t_process_map");
migrationBuilder.RenameColumn(
name: "top_drive_torque_plan",
table: "t_process_map",
newName: "rotor_torque_plan");
migrationBuilder.RenameColumn(
name: "top_drive_torque_fact",
table: "t_process_map",
newName: "rotor_torque_fact");
migrationBuilder.RenameColumn(
name: "top_drive_speed_plan",
table: "t_process_map",
newName: "rotor_speed_plan");
migrationBuilder.RenameColumn(
name: "top_drive_speed_fact",
table: "t_process_map",
newName: "rotor_speed_fact");
migrationBuilder.RenameColumn(
name: "rop_plan",
table: "t_process_map",
newName: "mechanical_speed_plan");
migrationBuilder.AddColumn<int>(
name: "section",
table: "t_process_map",
type: "integer",
nullable: false,
defaultValue: 0,
comment: "Секция");
}
}
}

View File

@ -1806,16 +1806,16 @@ namespace AsbCloudDb.Migrations
.HasColumnName("well_id") .HasColumnName("well_id")
.HasComment("Id скважины"); .HasComment("Id скважины");
b.Property<int>("IdWellSectionType")
.HasColumnType("integer")
.HasColumnName("id_wellsection_type")
.HasComment("Тип секции");
b.Property<DateTimeOffset>("LastUpdate") b.Property<DateTimeOffset>("LastUpdate")
.HasColumnType("timestamp with time zone") .HasColumnType("timestamp with time zone")
.HasColumnName("last_update") .HasColumnName("last_update")
.HasComment("Дата последнего изменения"); .HasComment("Дата последнего изменения");
b.Property<double>("MechanicalSpeedPlan")
.HasColumnType("double precision")
.HasColumnName("mechanical_speed_plan")
.HasComment("Плановая механическая скорость, м/ч");
b.Property<double?>("PressureFact") b.Property<double?>("PressureFact")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("pressure_fact") .HasColumnName("pressure_fact")
@ -1826,33 +1826,37 @@ namespace AsbCloudDb.Migrations
.HasColumnName("pressure_plan") .HasColumnName("pressure_plan")
.HasComment("Перепад давления, план"); .HasComment("Перепад давления, план");
b.Property<double?>("RotorSpeedFact") b.Property<double>("RopPlan")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("rotor_speed_fact") .HasColumnName("rop_plan")
.HasComment("Плановая механическая скорость, м/ч");
b.Property<double?>("TopDriveSpeedFact")
.HasColumnType("double precision")
.HasColumnName("top_drive_speed_fact")
.HasComment("Обороты на ВСП, факт"); .HasComment("Обороты на ВСП, факт");
b.Property<double>("RotorSpeedPlan") b.Property<double>("TopDriveSpeedPlan")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("rotor_speed_plan") .HasColumnName("top_drive_speed_plan")
.HasComment("Обороты на ВСП, план"); .HasComment("Обороты на ВСП, план");
b.Property<double?>("RotorTorqueFact") b.Property<double?>("TopDriveTorqueFact")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("rotor_torque_fact") .HasColumnName("top_drive_torque_fact")
.HasComment("Момент на ВСП, факт"); .HasComment("Момент на ВСП, факт");
b.Property<double>("RotorTorquePlan") b.Property<double>("TopDriveTorquePlan")
.HasColumnType("double precision") .HasColumnType("double precision")
.HasColumnName("rotor_torque_plan") .HasColumnName("top_drive_torque_plan")
.HasComment("Момент на ВСП, план"); .HasComment("Момент на ВСП, план");
b.Property<int>("Section")
.HasColumnType("integer")
.HasColumnName("section")
.HasComment("Секция");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("IdWell");
b.HasIndex("IdWellSectionType");
b.ToTable("t_process_map"); b.ToTable("t_process_map");
b.HasComment("Операции по скважине РТК"); b.HasComment("Операции по скважине РТК");
@ -5883,6 +5887,25 @@ namespace AsbCloudDb.Migrations
b.Navigation("Well"); b.Navigation("Well");
}); });
modelBuilder.Entity("AsbCloudDb.Model.ProcessMap", b =>
{
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("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

@ -2,6 +2,7 @@
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace AsbCloudDb.Model namespace AsbCloudDb.Model
{ {
@ -16,8 +17,8 @@ namespace AsbCloudDb.Model
[Column("well_id"), Comment("Id скважины")] [Column("well_id"), Comment("Id скважины")]
public int IdWell { get; set; } public int IdWell { get; set; }
[Column("section"), Comment("Секция")] [Column("id_wellsection_type"), Comment("Тип секции")]
public int Section { get; set; } public int IdWellSectionType { get; set; }
[Column("last_update", TypeName = "timestamp with time zone"), Comment("Дата последнего изменения")] [Column("last_update", TypeName = "timestamp with time zone"), Comment("Дата последнего изменения")]
public DateTimeOffset LastUpdate { get; set; } public DateTimeOffset LastUpdate { get; set; }
@ -40,17 +41,17 @@ namespace AsbCloudDb.Model
[Column("pressure_fact"), Comment("Перепад давления, факт")] [Column("pressure_fact"), Comment("Перепад давления, факт")]
public double? PressureFact { get; set; } public double? PressureFact { get; set; }
[Column("rotor_torque_plan"), Comment("Момент на ВСП, план")] [Column("top_drive_torque_plan"), Comment("Момент на ВСП, план")]
public double RotorTorquePlan { get; set; } public double TopDriveTorquePlan { get; set; }
[Column("rotor_torque_fact"), Comment("Момент на ВСП, факт")] [Column("top_drive_torque_fact"), Comment("Момент на ВСП, факт")]
public double? RotorTorqueFact { get; set; } public double? TopDriveTorqueFact { get; set; }
[Column("rotor_speed_plan"), Comment("Обороты на ВСП, план")] [Column("top_drive_speed_plan"), Comment("Обороты на ВСП, план")]
public double RotorSpeedPlan { get; set; } public double TopDriveSpeedPlan { get; set; }
[Column("rotor_speed_fact"), Comment("Обороты на ВСП, факт")] [Column("top_drive_speed_fact"), Comment("Обороты на ВСП, факт")]
public double? RotorSpeedFact { get; set; } public double? TopDriveSpeedFact { get; set; }
[Column("flow_plan"), Comment("Расход, план")] [Column("flow_plan"), Comment("Расход, план")]
public double FlowPlan { get; set; } public double FlowPlan { get; set; }
@ -58,8 +59,16 @@ namespace AsbCloudDb.Model
[Column("flow_fact"), Comment("Расход, факт")] [Column("flow_fact"), Comment("Расход, факт")]
public double? FlowFact { get; set; } public double? FlowFact { get; set; }
[Column("mechanical_speed_plan"), Comment("Плановая механическая скорость, м/ч")] [Column("rop_plan"), Comment("Плановая механическая скорость, м/ч")]
public double MechanicalSpeedPlan { get; set; } public double RopPlan { get; set; }
[JsonIgnore]
[ForeignKey(nameof(IdWell))]
public virtual Well? Well { get; set; }
[JsonIgnore]
[ForeignKey(nameof(IdWellSectionType))]
public virtual WellSectionType? WellSectionType { get; set; }
} }
#nullable disable #nullable disable
} }

View File

@ -66,7 +66,7 @@ namespace AsbCloudInfrastructure.Repository
Id = entity.Id, Id = entity.Id,
IdWell = entity.IdWell, IdWell = entity.IdWell,
LastUpdate = entity.LastUpdate, LastUpdate = entity.LastUpdate,
Section = entity.Section, IdWellSectionType = entity.IdWellSectionType,
DepthEnd = entity.DepthEnd, DepthEnd = entity.DepthEnd,
DepthStart = entity.DepthStart, DepthStart = entity.DepthStart,
AxialLoad = new PlanFactDto { AxialLoad = new PlanFactDto {
@ -81,15 +81,15 @@ namespace AsbCloudInfrastructure.Repository
Fact = entity.FlowFact, Fact = entity.FlowFact,
Plan = entity.FlowPlan Plan = entity.FlowPlan
}, },
RotorSpeed = new PlanFactDto { TopDriveSpeed = new PlanFactDto {
Fact = entity.RotorSpeedFact, Fact = entity.TopDriveSpeedFact,
Plan = entity.RotorSpeedPlan Plan = entity.TopDriveSpeedPlan
}, },
RotorTorque = new PlanFactDto { TopDriveTorque = new PlanFactDto {
Fact= entity.RotorTorqueFact, Fact= entity.TopDriveTorqueFact,
Plan = entity.RotorTorquePlan Plan = entity.TopDriveTorquePlan
}, },
MechanicalSpeedPlan = entity.MechanicalSpeedPlan RopPlan = entity.RopPlan
}; };
} }
} }