forked from ddrilling/AsbCloudServer
Вернул пользователя для авто определённых операций
This commit is contained in:
parent
53715dfaaa
commit
3e84b1591f
@ -30,6 +30,11 @@ public class DetectedOperationDto: IId
|
||||
/// </summary>
|
||||
[Required]
|
||||
public int IdUserAtStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Пользователь панели оператора
|
||||
/// </summary>
|
||||
public string? TelemetryUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Дата завершения операции в часовом поясе скважины
|
||||
|
@ -13,6 +13,11 @@ namespace AsbCloudApp.Data.SAUB
|
||||
/// </summary>
|
||||
[Required]
|
||||
public DateTime DateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Пользователь САУБ
|
||||
/// </summary>
|
||||
public int? IdUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Режим работы САУБ:
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,27 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace AsbCloudDb.Migrations
|
||||
{
|
||||
public partial class DetectedOperateion_Remove_IdUser : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "id_user",
|
||||
table: "t_detected_operation");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "id_user",
|
||||
table: "t_detected_operation",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
comment: "Id пользователя по телеметрии на момент начала операции");
|
||||
}
|
||||
}
|
||||
}
|
@ -532,6 +532,11 @@ namespace AsbCloudDb.Migrations
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("id_telemetry");
|
||||
|
||||
b.Property<int>("IdUsersAtStart")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("id_user")
|
||||
.HasComment("Id пользователя по телеметрии на момент начала операции");
|
||||
|
||||
b.Property<double>("Value")
|
||||
.HasColumnType("double precision")
|
||||
.HasColumnName("value")
|
||||
|
@ -25,6 +25,9 @@ namespace AsbCloudDb.Model
|
||||
|
||||
[Column("date_end", TypeName = "timestamp with time zone"), Comment("Дата начала операции")]
|
||||
public DateTimeOffset DateEnd { get; set; }
|
||||
|
||||
[Column("id_user"), Comment("Id пользователя по телеметрии на момент начала операции")]
|
||||
public int IdUsersAtStart { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public double DurationMinutes => (DateEnd - DateStart).TotalMinutes;
|
||||
|
@ -6,6 +6,7 @@ public class DetectableTelemetry
|
||||
{
|
||||
public DateTimeOffset DateTime { get; set; }
|
||||
public int Mode { get; set; }
|
||||
public int? IdUser { get; set; }
|
||||
public float WellDepth { get; set; }
|
||||
public float Pressure { get; set; }
|
||||
public float HookWeight { get; set; }
|
||||
|
@ -156,6 +156,7 @@ public class DetectedOperationService : IDetectedOperationService
|
||||
.Select(t => new DetectableTelemetry
|
||||
{
|
||||
DateTime = t.DateTime,
|
||||
IdUser = t.IdUser,
|
||||
Mode = t.Mode,
|
||||
WellDepth = t.WellDepth,
|
||||
Pressure = t.Pressure,
|
||||
|
@ -119,6 +119,7 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
||||
{
|
||||
IdCategory = IdCategory,
|
||||
IdTelemetry = idTelemetry,
|
||||
IdUserAtStart = pBegin.IdUser ?? -1,
|
||||
DateStart = pBegin.DateTime,
|
||||
DateEnd = pEnd.DateTime,
|
||||
DepthStart = (double)pBegin.WellDepth,
|
||||
|
Loading…
Reference in New Issue
Block a user