forked from ddrilling/AsbCloudServer
Сбор, агрегирование данных из detectedOperations и telemetry_data_saub и запись их в t_data_saub_stat
This commit is contained in:
parent
f577adb1bc
commit
09d753555e
File diff suppressed because it is too large
Load Diff
@ -1,35 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace AsbCloudDb.Migrations
|
|
||||||
{
|
|
||||||
public partial class Add_ProcessMapDrillingCache : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "t_process_map_drilling_cache",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
date_from = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, comment: "Дата начала"),
|
|
||||||
date_to = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, comment: "Дата окончания")
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_t_process_map_drilling_cache", x => x.id);
|
|
||||||
},
|
|
||||||
comment: "Кеш-таблица для хранения данных для РТК-отчета");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "t_process_map_drilling_cache");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -1,236 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace AsbCloudDb.Migrations
|
|
||||||
{
|
|
||||||
public partial class Add_Fields_To_ProcessMapDrillingCache : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<double>(
|
|
||||||
name: "axial_load",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "double precision",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0.0,
|
|
||||||
comment: "Фактическая нагрузка");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<float>(
|
|
||||||
name: "axial_load_limit_max",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "real",
|
|
||||||
nullable: true,
|
|
||||||
comment: "Максимально допустимая нагрузка");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<float>(
|
|
||||||
name: "axial_load_sp",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "real",
|
|
||||||
nullable: true,
|
|
||||||
comment: "Ограничение факт. нагрузки");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<float>(
|
|
||||||
name: "block_speed_sp",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "real",
|
|
||||||
nullable: true,
|
|
||||||
comment: "Ограничение скорости блока");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<DateTimeOffset>(
|
|
||||||
name: "date_drilling_end",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "timestamp with time zone",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
|
||||||
comment: "Дата и время окончания бурения");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<DateTimeOffset>(
|
|
||||||
name: "date_drilling_start",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "timestamp with time zone",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
|
||||||
comment: "Дата и время начала бурения");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<double>(
|
|
||||||
name: "depth_end",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "double precision",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0.0,
|
|
||||||
comment: "Глубина забоя по стволу конечная");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<double>(
|
|
||||||
name: "depth_start",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "double precision",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0.0,
|
|
||||||
comment: "Глубина забоя по стволу начальная");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "detected_operation_category_id",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0,
|
|
||||||
comment: "Название автоопределённой операции");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "enabled_subsystems",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0,
|
|
||||||
comment: "Флаги подсистем");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<short>(
|
|
||||||
name: "id_feed_regulator",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "smallint",
|
|
||||||
nullable: true,
|
|
||||||
comment: "Работа при достижении ограничения");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<double>(
|
|
||||||
name: "pressure",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "double precision",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0.0,
|
|
||||||
comment: "Давление");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<float>(
|
|
||||||
name: "pressure_idle",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "real",
|
|
||||||
nullable: true,
|
|
||||||
comment: "Давление холостого хода");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<float>(
|
|
||||||
name: "pressure_sp",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "real",
|
|
||||||
nullable: true,
|
|
||||||
comment: "Ограничение фактического давления");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<double>(
|
|
||||||
name: "rotor_speed",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "double precision",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0.0,
|
|
||||||
comment: "Фактическая скорость оборотов ВСП");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<double>(
|
|
||||||
name: "rotor_torque",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "double precision",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0.0,
|
|
||||||
comment: "Фактический момент");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<float>(
|
|
||||||
name: "rotor_torque_limit_max",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "real",
|
|
||||||
nullable: true,
|
|
||||||
comment: "Максимально допустимый момент");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<float>(
|
|
||||||
name: "rotor_torque_sp",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "real",
|
|
||||||
nullable: true,
|
|
||||||
comment: "Ограничение факт. момента");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<double>(
|
|
||||||
name: "speed",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "double precision",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0.0,
|
|
||||||
comment: "Скорость бурения");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "axial_load",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "axial_load_limit_max",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "axial_load_sp",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "block_speed_sp",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "date_drilling_end",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "date_drilling_start",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "depth_end",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "depth_start",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "detected_operation_category_id",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "enabled_subsystems",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "id_feed_regulator",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "pressure",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "pressure_idle",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "pressure_sp",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "rotor_speed",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "rotor_torque",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "rotor_torque_limit_max",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "rotor_torque_sp",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "speed",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace AsbCloudDb.Migrations
|
|
||||||
{
|
|
||||||
public partial class Add_Fields2_To_ProcessMapDrillingCache : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<bool>(
|
|
||||||
name: "has_oscillation",
|
|
||||||
table: "t_process_map_drilling_cache",
|
|
||||||
type: "boolean",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: false,
|
|
||||||
comment: "Наличие или отсутствие осцилляции");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "has_oscillation",
|
|
||||||
table: "t_process_map_drilling_cache");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -13,8 +13,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
namespace AsbCloudDb.Migrations
|
namespace AsbCloudDb.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(AsbCloudDbContext))]
|
[DbContext(typeof(AsbCloudDbContext))]
|
||||||
[Migration("20240130094431_Add_Fields2_To_ProcessMapDrillingCache")]
|
[Migration("20240131074638_Add_Table_DataSaubStat")]
|
||||||
partial class Add_Fields2_To_ProcessMapDrillingCache
|
partial class Add_Table_DataSaubStat
|
||||||
{
|
{
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
@ -319,6 +319,129 @@ namespace AsbCloudDb.Migrations
|
|||||||
b.HasComment("Ежедневные отчёты");
|
b.HasComment("Ежедневные отчёты");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AsbCloudDb.Model.DataSaubStat", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasColumnName("id");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<double>("AxialLoad")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("axial_load")
|
||||||
|
.HasComment("Фактическая нагрузка");
|
||||||
|
|
||||||
|
b.Property<double?>("AxialLoadLimitMax")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("axial_load_limit_max")
|
||||||
|
.HasComment("Максимально допустимая нагрузка");
|
||||||
|
|
||||||
|
b.Property<double?>("AxialLoadSp")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("axial_load_sp")
|
||||||
|
.HasComment("Ограничение факт. нагрузки");
|
||||||
|
|
||||||
|
b.Property<double?>("BlockSpeedSp")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("block_speed_sp")
|
||||||
|
.HasComment("Ограничение скорости блока");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateEnd")
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("date_end")
|
||||||
|
.HasComment("Дата и время окончания");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateStart")
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("date_start")
|
||||||
|
.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>("DetectedOperationCategoryId")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasColumnName("detected_operation_category_id")
|
||||||
|
.HasComment("Название автоопределённой операции");
|
||||||
|
|
||||||
|
b.Property<int>("EnabledSubsystems")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasColumnName("enabled_subsystems")
|
||||||
|
.HasComment("Флаги подсистем");
|
||||||
|
|
||||||
|
b.Property<bool>("HasOscillation")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("has_oscillation")
|
||||||
|
.HasComment("Наличие или отсутствие осцилляции");
|
||||||
|
|
||||||
|
b.Property<short?>("IdFeedRegulator")
|
||||||
|
.HasColumnType("smallint")
|
||||||
|
.HasColumnName("id_feed_regulator")
|
||||||
|
.HasComment("Работа при достижении ограничения");
|
||||||
|
|
||||||
|
b.Property<int>("IdTelemetry")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasColumnName("id_telemetry")
|
||||||
|
.HasComment("Ключ телеметрии");
|
||||||
|
|
||||||
|
b.Property<double>("Pressure")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("pressure")
|
||||||
|
.HasComment("Давление");
|
||||||
|
|
||||||
|
b.Property<double?>("PressureIdle")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("pressure_idle")
|
||||||
|
.HasComment("Давление холостого хода");
|
||||||
|
|
||||||
|
b.Property<double?>("PressureSp")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("pressure_sp")
|
||||||
|
.HasComment("Ограничение фактического давления");
|
||||||
|
|
||||||
|
b.Property<double>("RotorSpeed")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("rotor_speed")
|
||||||
|
.HasComment("Фактическая скорость оборотов ВСП");
|
||||||
|
|
||||||
|
b.Property<double>("RotorTorque")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("rotor_torque")
|
||||||
|
.HasComment("Фактический момент");
|
||||||
|
|
||||||
|
b.Property<double?>("RotorTorqueLimitMax")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("rotor_torque_limit_max")
|
||||||
|
.HasComment("Максимально допустимый момент");
|
||||||
|
|
||||||
|
b.Property<double?>("RotorTorqueSp")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("rotor_torque_sp")
|
||||||
|
.HasComment("Ограничение факт. момента");
|
||||||
|
|
||||||
|
b.Property<double>("Speed")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("speed")
|
||||||
|
.HasComment("Скорость бурения");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("IdTelemetry");
|
||||||
|
|
||||||
|
b.ToTable("t_data_saub_stat");
|
||||||
|
|
||||||
|
b.HasComment("Кеш-таблица для хранения данных для РТК-отчета");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("AsbCloudDb.Model.Deposit", b =>
|
modelBuilder.Entity("AsbCloudDb.Model.Deposit", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
@ -2465,132 +2588,6 @@ namespace AsbCloudDb.Migrations
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("AsbCloudDb.Model.ProcessMapDrillingCache", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer")
|
|
||||||
.HasColumnName("id");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<double>("AxialLoad")
|
|
||||||
.HasColumnType("double precision")
|
|
||||||
.HasColumnName("axial_load")
|
|
||||||
.HasComment("Фактическая нагрузка");
|
|
||||||
|
|
||||||
b.Property<float?>("AxialLoadLimitMax")
|
|
||||||
.HasColumnType("real")
|
|
||||||
.HasColumnName("axial_load_limit_max")
|
|
||||||
.HasComment("Максимально допустимая нагрузка");
|
|
||||||
|
|
||||||
b.Property<float?>("AxialLoadSp")
|
|
||||||
.HasColumnType("real")
|
|
||||||
.HasColumnName("axial_load_sp")
|
|
||||||
.HasComment("Ограничение факт. нагрузки");
|
|
||||||
|
|
||||||
b.Property<float?>("BlockSpeedSp")
|
|
||||||
.HasColumnType("real")
|
|
||||||
.HasColumnName("block_speed_sp")
|
|
||||||
.HasComment("Ограничение скорости блока");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateDrillingEnd")
|
|
||||||
.HasColumnType("timestamp with time zone")
|
|
||||||
.HasColumnName("date_drilling_end")
|
|
||||||
.HasComment("Дата и время окончания бурения");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateDrillingStart")
|
|
||||||
.HasColumnType("timestamp with time zone")
|
|
||||||
.HasColumnName("date_drilling_start")
|
|
||||||
.HasComment("Дата и время начала бурения");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateFrom")
|
|
||||||
.HasColumnType("timestamp with time zone")
|
|
||||||
.HasColumnName("date_from")
|
|
||||||
.HasComment("Дата начала");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateTo")
|
|
||||||
.HasColumnType("timestamp with time zone")
|
|
||||||
.HasColumnName("date_to")
|
|
||||||
.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>("DetectedOperationCategoryId")
|
|
||||||
.HasColumnType("integer")
|
|
||||||
.HasColumnName("detected_operation_category_id")
|
|
||||||
.HasComment("Название автоопределённой операции");
|
|
||||||
|
|
||||||
b.Property<int>("EnabledSubsystems")
|
|
||||||
.HasColumnType("integer")
|
|
||||||
.HasColumnName("enabled_subsystems")
|
|
||||||
.HasComment("Флаги подсистем");
|
|
||||||
|
|
||||||
b.Property<bool>("HasOscillation")
|
|
||||||
.HasColumnType("boolean")
|
|
||||||
.HasColumnName("has_oscillation")
|
|
||||||
.HasComment("Наличие или отсутствие осцилляции");
|
|
||||||
|
|
||||||
b.Property<short?>("IdFeedRegulator")
|
|
||||||
.HasColumnType("smallint")
|
|
||||||
.HasColumnName("id_feed_regulator")
|
|
||||||
.HasComment("Работа при достижении ограничения");
|
|
||||||
|
|
||||||
b.Property<double>("Pressure")
|
|
||||||
.HasColumnType("double precision")
|
|
||||||
.HasColumnName("pressure")
|
|
||||||
.HasComment("Давление");
|
|
||||||
|
|
||||||
b.Property<float?>("PressureIdle")
|
|
||||||
.HasColumnType("real")
|
|
||||||
.HasColumnName("pressure_idle")
|
|
||||||
.HasComment("Давление холостого хода");
|
|
||||||
|
|
||||||
b.Property<float?>("PressureSp")
|
|
||||||
.HasColumnType("real")
|
|
||||||
.HasColumnName("pressure_sp")
|
|
||||||
.HasComment("Ограничение фактического давления");
|
|
||||||
|
|
||||||
b.Property<double>("RotorSpeed")
|
|
||||||
.HasColumnType("double precision")
|
|
||||||
.HasColumnName("rotor_speed")
|
|
||||||
.HasComment("Фактическая скорость оборотов ВСП");
|
|
||||||
|
|
||||||
b.Property<double>("RotorTorque")
|
|
||||||
.HasColumnType("double precision")
|
|
||||||
.HasColumnName("rotor_torque")
|
|
||||||
.HasComment("Фактический момент");
|
|
||||||
|
|
||||||
b.Property<float?>("RotorTorqueLimitMax")
|
|
||||||
.HasColumnType("real")
|
|
||||||
.HasColumnName("rotor_torque_limit_max")
|
|
||||||
.HasComment("Максимально допустимый момент");
|
|
||||||
|
|
||||||
b.Property<float?>("RotorTorqueSp")
|
|
||||||
.HasColumnType("real")
|
|
||||||
.HasColumnName("rotor_torque_sp")
|
|
||||||
.HasComment("Ограничение факт. момента");
|
|
||||||
|
|
||||||
b.Property<double>("Speed")
|
|
||||||
.HasColumnType("double precision")
|
|
||||||
.HasColumnName("speed")
|
|
||||||
.HasComment("Скорость бурения");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
b.HasComment("Кеш-таблица для хранения данных для РТК-отчета");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapPlanDrilling", b =>
|
modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapPlanDrilling", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
@ -8420,6 +8417,17 @@ namespace AsbCloudDb.Migrations
|
|||||||
b.Navigation("Well");
|
b.Navigation("Well");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AsbCloudDb.Model.DataSaubStat", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("IdTelemetry")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Telemetry");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("AsbCloudDb.Model.DetectedOperation", b =>
|
modelBuilder.Entity("AsbCloudDb.Model.DetectedOperation", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("AsbCloudDb.Model.WellOperationCategory", "OperationCategory")
|
b.HasOne("AsbCloudDb.Model.WellOperationCategory", "OperationCategory")
|
@ -0,0 +1,65 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace AsbCloudDb.Migrations
|
||||||
|
{
|
||||||
|
public partial class Add_Table_DataSaubStat : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "t_data_saub_stat",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<int>(type: "integer", nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
date_start = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, comment: "Дата и время начала"),
|
||||||
|
date_end = table.Column<DateTimeOffset>(type: "timestamp with time zone", 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: "Глубина забоя по стволу конечная"),
|
||||||
|
speed = table.Column<double>(type: "double precision", nullable: false, comment: "Скорость бурения"),
|
||||||
|
block_speed_sp = table.Column<double>(type: "double precision", nullable: true, comment: "Ограничение скорости блока"),
|
||||||
|
pressure = table.Column<double>(type: "double precision", nullable: false, comment: "Давление"),
|
||||||
|
pressure_idle = table.Column<double>(type: "double precision", nullable: true, comment: "Давление холостого хода"),
|
||||||
|
pressure_sp = table.Column<double>(type: "double precision", nullable: true, comment: "Ограничение фактического давления"),
|
||||||
|
axial_load = table.Column<double>(type: "double precision", nullable: false, comment: "Фактическая нагрузка"),
|
||||||
|
axial_load_sp = table.Column<double>(type: "double precision", nullable: true, comment: "Ограничение факт. нагрузки"),
|
||||||
|
axial_load_limit_max = table.Column<double>(type: "double precision", nullable: true, comment: "Максимально допустимая нагрузка"),
|
||||||
|
rotor_torque = table.Column<double>(type: "double precision", nullable: false, comment: "Фактический момент"),
|
||||||
|
rotor_torque_sp = table.Column<double>(type: "double precision", nullable: true, comment: "Ограничение факт. момента"),
|
||||||
|
rotor_torque_limit_max = table.Column<double>(type: "double precision", nullable: true, comment: "Максимально допустимый момент"),
|
||||||
|
id_feed_regulator = table.Column<short>(type: "smallint", nullable: true, comment: "Работа при достижении ограничения"),
|
||||||
|
rotor_speed = table.Column<double>(type: "double precision", nullable: false, comment: "Фактическая скорость оборотов ВСП"),
|
||||||
|
detected_operation_category_id = table.Column<int>(type: "integer", nullable: false, comment: "Название автоопределённой операции"),
|
||||||
|
enabled_subsystems = table.Column<int>(type: "integer", nullable: false, comment: "Флаги подсистем"),
|
||||||
|
has_oscillation = table.Column<bool>(type: "boolean", nullable: false, comment: "Наличие или отсутствие осцилляции"),
|
||||||
|
id_telemetry = table.Column<int>(type: "integer", nullable: false, comment: "Ключ телеметрии")
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_t_data_saub_stat", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_t_data_saub_stat_t_telemetry_id_telemetry",
|
||||||
|
column: x => x.id_telemetry,
|
||||||
|
principalTable: "t_telemetry",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
},
|
||||||
|
comment: "Кеш-таблица для хранения данных для РТК-отчета");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_t_data_saub_stat_id_telemetry",
|
||||||
|
table: "t_data_saub_stat",
|
||||||
|
column: "id_telemetry");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "t_data_saub_stat");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -317,6 +317,129 @@ namespace AsbCloudDb.Migrations
|
|||||||
b.HasComment("Ежедневные отчёты");
|
b.HasComment("Ежедневные отчёты");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AsbCloudDb.Model.DataSaubStat", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasColumnName("id");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<double>("AxialLoad")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("axial_load")
|
||||||
|
.HasComment("Фактическая нагрузка");
|
||||||
|
|
||||||
|
b.Property<double?>("AxialLoadLimitMax")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("axial_load_limit_max")
|
||||||
|
.HasComment("Максимально допустимая нагрузка");
|
||||||
|
|
||||||
|
b.Property<double?>("AxialLoadSp")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("axial_load_sp")
|
||||||
|
.HasComment("Ограничение факт. нагрузки");
|
||||||
|
|
||||||
|
b.Property<double?>("BlockSpeedSp")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("block_speed_sp")
|
||||||
|
.HasComment("Ограничение скорости блока");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateEnd")
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("date_end")
|
||||||
|
.HasComment("Дата и время окончания");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateStart")
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("date_start")
|
||||||
|
.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>("DetectedOperationCategoryId")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasColumnName("detected_operation_category_id")
|
||||||
|
.HasComment("Название автоопределённой операции");
|
||||||
|
|
||||||
|
b.Property<int>("EnabledSubsystems")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasColumnName("enabled_subsystems")
|
||||||
|
.HasComment("Флаги подсистем");
|
||||||
|
|
||||||
|
b.Property<bool>("HasOscillation")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("has_oscillation")
|
||||||
|
.HasComment("Наличие или отсутствие осцилляции");
|
||||||
|
|
||||||
|
b.Property<short?>("IdFeedRegulator")
|
||||||
|
.HasColumnType("smallint")
|
||||||
|
.HasColumnName("id_feed_regulator")
|
||||||
|
.HasComment("Работа при достижении ограничения");
|
||||||
|
|
||||||
|
b.Property<int>("IdTelemetry")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasColumnName("id_telemetry")
|
||||||
|
.HasComment("Ключ телеметрии");
|
||||||
|
|
||||||
|
b.Property<double>("Pressure")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("pressure")
|
||||||
|
.HasComment("Давление");
|
||||||
|
|
||||||
|
b.Property<double?>("PressureIdle")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("pressure_idle")
|
||||||
|
.HasComment("Давление холостого хода");
|
||||||
|
|
||||||
|
b.Property<double?>("PressureSp")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("pressure_sp")
|
||||||
|
.HasComment("Ограничение фактического давления");
|
||||||
|
|
||||||
|
b.Property<double>("RotorSpeed")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("rotor_speed")
|
||||||
|
.HasComment("Фактическая скорость оборотов ВСП");
|
||||||
|
|
||||||
|
b.Property<double>("RotorTorque")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("rotor_torque")
|
||||||
|
.HasComment("Фактический момент");
|
||||||
|
|
||||||
|
b.Property<double?>("RotorTorqueLimitMax")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("rotor_torque_limit_max")
|
||||||
|
.HasComment("Максимально допустимый момент");
|
||||||
|
|
||||||
|
b.Property<double?>("RotorTorqueSp")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("rotor_torque_sp")
|
||||||
|
.HasComment("Ограничение факт. момента");
|
||||||
|
|
||||||
|
b.Property<double>("Speed")
|
||||||
|
.HasColumnType("double precision")
|
||||||
|
.HasColumnName("speed")
|
||||||
|
.HasComment("Скорость бурения");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("IdTelemetry");
|
||||||
|
|
||||||
|
b.ToTable("t_data_saub_stat");
|
||||||
|
|
||||||
|
b.HasComment("Кеш-таблица для хранения данных для РТК-отчета");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("AsbCloudDb.Model.Deposit", b =>
|
modelBuilder.Entity("AsbCloudDb.Model.Deposit", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
@ -2463,132 +2586,6 @@ namespace AsbCloudDb.Migrations
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("AsbCloudDb.Model.ProcessMapDrillingCache", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer")
|
|
||||||
.HasColumnName("id");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<double>("AxialLoad")
|
|
||||||
.HasColumnType("double precision")
|
|
||||||
.HasColumnName("axial_load")
|
|
||||||
.HasComment("Фактическая нагрузка");
|
|
||||||
|
|
||||||
b.Property<float?>("AxialLoadLimitMax")
|
|
||||||
.HasColumnType("real")
|
|
||||||
.HasColumnName("axial_load_limit_max")
|
|
||||||
.HasComment("Максимально допустимая нагрузка");
|
|
||||||
|
|
||||||
b.Property<float?>("AxialLoadSp")
|
|
||||||
.HasColumnType("real")
|
|
||||||
.HasColumnName("axial_load_sp")
|
|
||||||
.HasComment("Ограничение факт. нагрузки");
|
|
||||||
|
|
||||||
b.Property<float?>("BlockSpeedSp")
|
|
||||||
.HasColumnType("real")
|
|
||||||
.HasColumnName("block_speed_sp")
|
|
||||||
.HasComment("Ограничение скорости блока");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateDrillingEnd")
|
|
||||||
.HasColumnType("timestamp with time zone")
|
|
||||||
.HasColumnName("date_drilling_end")
|
|
||||||
.HasComment("Дата и время окончания бурения");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateDrillingStart")
|
|
||||||
.HasColumnType("timestamp with time zone")
|
|
||||||
.HasColumnName("date_drilling_start")
|
|
||||||
.HasComment("Дата и время начала бурения");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateFrom")
|
|
||||||
.HasColumnType("timestamp with time zone")
|
|
||||||
.HasColumnName("date_from")
|
|
||||||
.HasComment("Дата начала");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateTo")
|
|
||||||
.HasColumnType("timestamp with time zone")
|
|
||||||
.HasColumnName("date_to")
|
|
||||||
.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>("DetectedOperationCategoryId")
|
|
||||||
.HasColumnType("integer")
|
|
||||||
.HasColumnName("detected_operation_category_id")
|
|
||||||
.HasComment("Название автоопределённой операции");
|
|
||||||
|
|
||||||
b.Property<int>("EnabledSubsystems")
|
|
||||||
.HasColumnType("integer")
|
|
||||||
.HasColumnName("enabled_subsystems")
|
|
||||||
.HasComment("Флаги подсистем");
|
|
||||||
|
|
||||||
b.Property<bool>("HasOscillation")
|
|
||||||
.HasColumnType("boolean")
|
|
||||||
.HasColumnName("has_oscillation")
|
|
||||||
.HasComment("Наличие или отсутствие осцилляции");
|
|
||||||
|
|
||||||
b.Property<short?>("IdFeedRegulator")
|
|
||||||
.HasColumnType("smallint")
|
|
||||||
.HasColumnName("id_feed_regulator")
|
|
||||||
.HasComment("Работа при достижении ограничения");
|
|
||||||
|
|
||||||
b.Property<double>("Pressure")
|
|
||||||
.HasColumnType("double precision")
|
|
||||||
.HasColumnName("pressure")
|
|
||||||
.HasComment("Давление");
|
|
||||||
|
|
||||||
b.Property<float?>("PressureIdle")
|
|
||||||
.HasColumnType("real")
|
|
||||||
.HasColumnName("pressure_idle")
|
|
||||||
.HasComment("Давление холостого хода");
|
|
||||||
|
|
||||||
b.Property<float?>("PressureSp")
|
|
||||||
.HasColumnType("real")
|
|
||||||
.HasColumnName("pressure_sp")
|
|
||||||
.HasComment("Ограничение фактического давления");
|
|
||||||
|
|
||||||
b.Property<double>("RotorSpeed")
|
|
||||||
.HasColumnType("double precision")
|
|
||||||
.HasColumnName("rotor_speed")
|
|
||||||
.HasComment("Фактическая скорость оборотов ВСП");
|
|
||||||
|
|
||||||
b.Property<double>("RotorTorque")
|
|
||||||
.HasColumnType("double precision")
|
|
||||||
.HasColumnName("rotor_torque")
|
|
||||||
.HasComment("Фактический момент");
|
|
||||||
|
|
||||||
b.Property<float?>("RotorTorqueLimitMax")
|
|
||||||
.HasColumnType("real")
|
|
||||||
.HasColumnName("rotor_torque_limit_max")
|
|
||||||
.HasComment("Максимально допустимый момент");
|
|
||||||
|
|
||||||
b.Property<float?>("RotorTorqueSp")
|
|
||||||
.HasColumnType("real")
|
|
||||||
.HasColumnName("rotor_torque_sp")
|
|
||||||
.HasComment("Ограничение факт. момента");
|
|
||||||
|
|
||||||
b.Property<double>("Speed")
|
|
||||||
.HasColumnType("double precision")
|
|
||||||
.HasColumnName("speed")
|
|
||||||
.HasComment("Скорость бурения");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("t_process_map_drilling_cache");
|
|
||||||
|
|
||||||
b.HasComment("Кеш-таблица для хранения данных для РТК-отчета");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapPlanDrilling", b =>
|
modelBuilder.Entity("AsbCloudDb.Model.ProcessMaps.ProcessMapPlanDrilling", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
@ -8418,6 +8415,17 @@ namespace AsbCloudDb.Migrations
|
|||||||
b.Navigation("Well");
|
b.Navigation("Well");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("AsbCloudDb.Model.DataSaubStat", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("AsbCloudDb.Model.Telemetry", "Telemetry")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("IdTelemetry")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Telemetry");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("AsbCloudDb.Model.DetectedOperation", b =>
|
modelBuilder.Entity("AsbCloudDb.Model.DetectedOperation", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("AsbCloudDb.Model.WellOperationCategory", "OperationCategory")
|
b.HasOne("AsbCloudDb.Model.WellOperationCategory", "OperationCategory")
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
using AsbCloudDb.Model;
|
using AsbCloudDb.Model;
|
||||||
using AsbCloudInfrastructure.Services.DetectOperations.Detectors;
|
using AsbCloudInfrastructure.Services.DetectOperations.Detectors;
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace AsbCloudInfrastructure.Background.PeriodicWorks
|
namespace AsbCloudInfrastructure.Background.PeriodicWorks
|
||||||
{
|
{
|
||||||
internal class WorkProcessMapDrillingCache : Work
|
/// <summary>
|
||||||
|
/// задача по добавлению данных в таблицу DataSaubStat, которая используется дл построения РТК-отчета
|
||||||
|
/// </summary>
|
||||||
|
internal class WorkDataSaubStat : Work
|
||||||
{
|
{
|
||||||
private int MechanicalDrillingCategoryId = 4001;
|
private int MechanicalDrillingCategoryId = 4001;
|
||||||
public WorkProcessMapDrillingCache() : base("Generate process map drilling cache table")
|
|
||||||
|
public WorkDataSaubStat() : base("Generate process map drilling cache table")
|
||||||
{
|
{
|
||||||
Timeout = TimeSpan.FromMinutes(10);
|
Timeout = TimeSpan.FromMinutes(10);
|
||||||
}
|
}
|
||||||
@ -43,8 +43,6 @@ namespace AsbCloudInfrastructure.Background.PeriodicWorks
|
|||||||
.FirstOrDefault()?.DateEnd
|
.FirstOrDefault()?.DateEnd
|
||||||
?? DateTimeOffset.MinValue;
|
?? DateTimeOffset.MinValue;
|
||||||
|
|
||||||
|
|
||||||
//а остальные операции, которые не вошли в 500 первых?
|
|
||||||
var detectedOperations = db.Set<DetectedOperation>()
|
var detectedOperations = db.Set<DetectedOperation>()
|
||||||
.Where(o => o.DateStart > dateEnd)
|
.Where(o => o.DateStart > dateEnd)
|
||||||
.Where(o => o.OperationCategory.IdParent == MechanicalDrillingCategoryId)
|
.Where(o => o.OperationCategory.IdParent == MechanicalDrillingCategoryId)
|
||||||
@ -53,7 +51,7 @@ namespace AsbCloudInfrastructure.Background.PeriodicWorks
|
|||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
var minDate = detectedOperations.FirstOrDefault()?.DateStart;
|
var minDate = detectedOperations.FirstOrDefault()?.DateStart;
|
||||||
var maxDate = detectedOperations.OrderByDescending(d =>d.DateEnd).FirstOrDefault()?.DateEnd;
|
var maxDate = detectedOperations.OrderByDescending(d => d.DateEnd).FirstOrDefault()?.DateEnd;
|
||||||
|
|
||||||
var telemetryDataSaub = db.Set<TelemetryDataSaub>()
|
var telemetryDataSaub = db.Set<TelemetryDataSaub>()
|
||||||
.Where(t => t.DateTime >= minDate)
|
.Where(t => t.DateTime >= minDate)
|
||||||
@ -74,15 +72,14 @@ namespace AsbCloudInfrastructure.Background.PeriodicWorks
|
|||||||
var length = indexEnd - indexStart;
|
var length = indexEnd - indexStart;
|
||||||
|
|
||||||
var subset = telemetryDataSaub.AsSpan(indexStart, length + 1);
|
var subset = telemetryDataSaub.AsSpan(indexStart, length + 1);
|
||||||
var result = CalcStats(operation, subset);
|
var result = CalcStats(operation, subset, db);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
private object CalcStats(DetectedOperation operation, Span<TelemetryDataSaub> telemetryDataSaub)
|
private int CalcStats(DetectedOperation operation, Span<TelemetryDataSaub> telemetryDataSaub, IAsbCloudDbContext db)
|
||||||
{
|
{
|
||||||
var indexStart = 0;
|
var indexStart = 0;
|
||||||
for (var i = 1; i < telemetryDataSaub.Length; i++)
|
for (var i = 1; i < telemetryDataSaub.Length; i++)
|
||||||
@ -90,34 +87,31 @@ namespace AsbCloudInfrastructure.Background.PeriodicWorks
|
|||||||
var previous = telemetryDataSaub[i - 1];
|
var previous = telemetryDataSaub[i - 1];
|
||||||
var current = telemetryDataSaub[i];
|
var current = telemetryDataSaub[i];
|
||||||
|
|
||||||
if(IsNewCacheItem(previous, current) || i == telemetryDataSaub.Length)
|
if (IsNewCacheItem(previous, current) || i == telemetryDataSaub.Length - 1)
|
||||||
{
|
{
|
||||||
var length = i - indexStart;
|
var length = i - indexStart;
|
||||||
var span = telemetryDataSaub.Slice(indexStart, length);
|
var span = telemetryDataSaub.Slice(indexStart, length);
|
||||||
indexStart = i;
|
indexStart = i;
|
||||||
var processMapDrillingCacheItem = CalcStat(operation, span);
|
var dataSaubStatItem = CalcStat(operation, span);
|
||||||
|
db.Set<DataSaubStat>().Add(dataSaubStatItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return db.SaveChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
private DataSaubStat CalcStat(DetectedOperation operation, Span<TelemetryDataSaub> span)
|
private DataSaubStat CalcStat(DetectedOperation operation, Span<TelemetryDataSaub> span)
|
||||||
{
|
{
|
||||||
var depthStart = span[0].WellDepth;
|
var hasOscillation = operation.ExtraData.TryGetValue(DetectorDrilling.ExtraDataKeyHasOscillation, out object? hasOscillationObject)
|
||||||
var depthEnd = span[^1].WellDepth;
|
&& hasOscillationObject is true;
|
||||||
|
|
||||||
var hasOscillation = false;
|
|
||||||
if (operation.ExtraData.TryGetValue(DetectorDrilling.ExtraDataKeyHasOscillation, out object? HasOscillation))
|
|
||||||
hasOscillation = Convert.ToBoolean(HasOscillation);
|
|
||||||
|
|
||||||
var wavg = CalcWavg(span);
|
var wavg = CalcWavg(span);
|
||||||
var processMapDrillingCacheItem = new DataSaubStat
|
var processMapDrillingCacheItem = new DataSaubStat
|
||||||
{
|
{
|
||||||
DateStart = operation.DateStart,
|
DateStart = operation.DateStart,
|
||||||
DateEnd = operation.DateEnd,
|
DateEnd = operation.DateEnd,
|
||||||
DepthStart = depthStart,
|
DepthStart = operation.DepthStart,
|
||||||
DepthEnd = depthEnd,
|
DepthEnd = operation.DepthEnd,
|
||||||
Speed = (depthEnd - depthStart) / ((operation.DateEnd - operation.DateStart).TotalHours),
|
Speed = (operation.DepthEnd - operation.DepthStart) / ((operation.DateEnd - operation.DateStart).TotalHours),
|
||||||
BlockSpeedSp = span[0].BlockSpeedSp,
|
BlockSpeedSp = span[0].BlockSpeedSp,
|
||||||
Pressure = wavg.Pressure,
|
Pressure = wavg.Pressure,
|
||||||
PressureIdle = span[0].PressureIdle,
|
PressureIdle = span[0].PressureIdle,
|
||||||
@ -168,17 +162,17 @@ namespace AsbCloudInfrastructure.Background.PeriodicWorks
|
|||||||
|
|
||||||
private bool IsNewCacheItem(TelemetryDataSaub previous, TelemetryDataSaub current)
|
private bool IsNewCacheItem(TelemetryDataSaub previous, TelemetryDataSaub current)
|
||||||
{
|
{
|
||||||
return !(current.Mode == previous.Mode)
|
return !(current.Mode == previous.Mode)
|
||||||
|| !(current.BlockSpeedSp == previous.BlockSpeedSp)
|
|| !(current.BlockSpeedSp == previous.BlockSpeedSp)
|
||||||
|| !(current.PressureIdle == previous.PressureIdle)
|
|| !(current.PressureIdle == previous.PressureIdle)
|
||||||
|| !(current.PressureSp == previous.PressureSp)
|
|| !(current.PressureSp == previous.PressureSp)
|
||||||
|| !(current.AxialLoadSp == previous.AxialLoadSp)
|
|| !(current.AxialLoadSp == previous.AxialLoadSp)
|
||||||
|| !(current.AxialLoadLimitMax == previous.AxialLoadLimitMax)
|
|| !(current.AxialLoadLimitMax == previous.AxialLoadLimitMax)
|
||||||
|| !(current.HookWeightIdle == previous.HookWeightIdle)
|
|| !(current.HookWeightIdle == previous.HookWeightIdle)
|
||||||
|| !(current.RotorTorqueIdle == previous.RotorTorqueIdle)
|
|| !(current.RotorTorqueIdle == previous.RotorTorqueIdle)
|
||||||
|| !(current.RotorTorqueSp == previous.RotorTorqueSp)
|
|| !(current.RotorTorqueSp == previous.RotorTorqueSp)
|
||||||
|| !(current.RotorTorqueLimitMax == previous.RotorTorqueLimitMax)
|
|| !(current.RotorTorqueLimitMax == previous.RotorTorqueLimitMax)
|
||||||
|| !(current.IdFeedRegulator == previous.IdFeedRegulator);
|
|| !(current.IdFeedRegulator == previous.IdFeedRegulator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -29,10 +29,10 @@ namespace AsbCloudInfrastructure
|
|||||||
_ = provider.GetRequiredService<ITelemetryDataCache<TelemetryDataSpinDto>>();
|
_ = provider.GetRequiredService<ITelemetryDataCache<TelemetryDataSpinDto>>();
|
||||||
|
|
||||||
var backgroundWorker = provider.GetRequiredService<PeriodicBackgroundWorker>();
|
var backgroundWorker = provider.GetRequiredService<PeriodicBackgroundWorker>();
|
||||||
backgroundWorker.Add<WorkProcessMapDrillingCache>(TimeSpan.FromMinutes(15));
|
|
||||||
backgroundWorker.Add<WorkToDeleteOldReports>(TimeSpan.FromDays(1));
|
backgroundWorker.Add<WorkToDeleteOldReports>(TimeSpan.FromDays(1));
|
||||||
backgroundWorker.Add<WellInfoService.WorkWellInfoUpdate>(TimeSpan.FromMinutes(30));
|
backgroundWorker.Add<WellInfoService.WorkWellInfoUpdate>(TimeSpan.FromMinutes(30));
|
||||||
backgroundWorker.Add<WorkOperationDetection>(TimeSpan.FromMinutes(15));
|
backgroundWorker.Add<WorkOperationDetection>(TimeSpan.FromMinutes(15));
|
||||||
|
backgroundWorker.Add<WorkDataSaubStat>(TimeSpan.FromMinutes(15));
|
||||||
backgroundWorker.Add<WorkLimitingParameterCalc>(TimeSpan.FromMinutes(30));
|
backgroundWorker.Add<WorkLimitingParameterCalc>(TimeSpan.FromMinutes(30));
|
||||||
backgroundWorker.Add(MakeMemoryMonitoringWork(), TimeSpan.FromMinutes(1));
|
backgroundWorker.Add(MakeMemoryMonitoringWork(), TimeSpan.FromMinutes(1));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user