feat(esppOrderLoader): добавлен рассчет поля GenerateDate (время создания наряда)

This commit is contained in:
Mikhail Trubnikov
2023-10-25 12:40:33 +10:00
parent 477b11708f
commit a4c299646a
8 changed files with 5459 additions and 34 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,30 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PARR.DAL.Migrations
{
/// <inheritdoc />
public partial class TblOrdersAddGenerateDate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTimeOffset>(
name: "GenerateDate",
table: "Orders",
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)));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "GenerateDate",
table: "Orders");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,37 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PARR.DAL.Migrations
{
/// <inheritdoc />
public partial class TblOrdersGenerateDateAllowNull : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTimeOffset>(
name: "GenerateDate",
table: "Orders",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTimeOffset),
oldType: "timestamp with time zone");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTimeOffset>(
name: "GenerateDate",
table: "Orders",
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)),
oldClrType: typeof(DateTimeOffset),
oldType: "timestamp with time zone",
oldNullable: true);
}
}
}

View File

@@ -398,7 +398,7 @@ namespace PARR.DAL.Migrations
b.HasIndex("TemplateId");
b.ToTable("AgentHistories", (string)null);
b.ToTable("AgentHistories");
});
modelBuilder.Entity("PARR.DAL.Models.AgentHistoryLevel", b =>
@@ -419,7 +419,7 @@ namespace PARR.DAL.Migrations
b.HasKey("Id");
b.ToTable("AgentHistoryLevels", (string)null);
b.ToTable("AgentHistoryLevels");
b.HasData(
new
@@ -459,7 +459,7 @@ namespace PARR.DAL.Migrations
b.HasIndex("ApplicationTypeId");
b.ToTable("Applications", (string)null);
b.ToTable("Applications");
});
modelBuilder.Entity("PARR.DAL.Models.ApplicationInHost", b =>
@@ -486,7 +486,7 @@ namespace PARR.DAL.Migrations
b.HasIndex("HostId");
b.ToTable("ApplicationsInHost", (string)null);
b.ToTable("ApplicationsInHost");
});
modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b =>
@@ -510,7 +510,7 @@ namespace PARR.DAL.Migrations
b.HasKey("Id");
b.ToTable("ApplicationTypes", (string)null);
b.ToTable("ApplicationTypes");
b.HasData(
new
@@ -595,7 +595,7 @@ namespace PARR.DAL.Migrations
b.HasIndex("WorkId", "ApplicationId")
.IsUnique();
b.ToTable("ApplicationsInWorks", (string)null);
b.ToTable("ApplicationsInWorks");
});
modelBuilder.Entity("PARR.DAL.Models.EkStatus", b =>
@@ -612,7 +612,7 @@ namespace PARR.DAL.Migrations
b.HasKey("Code");
b.ToTable("EkStatuses", (string)null);
b.ToTable("EkStatuses");
b.HasData(
new
@@ -675,7 +675,7 @@ namespace PARR.DAL.Migrations
b.HasKey("Id");
b.ToTable("EsppSchTypes", (string)null);
b.ToTable("EsppSchTypes");
b.HasData(
new
@@ -744,7 +744,7 @@ namespace PARR.DAL.Migrations
b.HasIndex("TypeScheduleId", "TypeId")
.IsUnique();
b.ToTable("EsppSchTypeConfigs", (string)null);
b.ToTable("EsppSchTypeConfigs");
b.HasData(
new
@@ -847,7 +847,7 @@ namespace PARR.DAL.Migrations
b.HasKey("Id");
b.ToTable("EsppSchTypeSchedules", (string)null);
b.ToTable("EsppSchTypeSchedules");
b.HasData(
new
@@ -908,7 +908,7 @@ namespace PARR.DAL.Migrations
b.HasIndex("TypeId");
b.ToTable("EsppSchTypeValues", (string)null);
b.ToTable("EsppSchTypeValues");
b.HasData(
new
@@ -1511,7 +1511,7 @@ namespace PARR.DAL.Migrations
b.HasIndex("TypeValueId");
b.ToTable("EsppSchValues", (string)null);
b.ToTable("EsppSchValues");
});
modelBuilder.Entity("PARR.DAL.Models.Host", b =>
@@ -1549,7 +1549,7 @@ namespace PARR.DAL.Migrations
b.HasIndex("ResponseAreaCode");
b.ToTable("Hosts", (string)null);
b.ToTable("Hosts");
});
modelBuilder.Entity("PARR.DAL.Models.Order", b =>
@@ -1564,6 +1564,9 @@ namespace PARR.DAL.Migrations
b.Property<DateTimeOffset?>("DateModified")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset?>("GenerateDate")
.HasColumnType("timestamp with time zone");
b.Property<int?>("NextStatusCode")
.HasColumnType("integer");
@@ -1592,7 +1595,7 @@ namespace PARR.DAL.Migrations
b.HasIndex("TemplateId");
b.ToTable("Orders", (string)null);
b.ToTable("Orders");
});
modelBuilder.Entity("PARR.DAL.Models.OrderStatus", b =>
@@ -1613,7 +1616,7 @@ namespace PARR.DAL.Migrations
b.HasKey("Code");
b.ToTable("OrderStatuses", (string)null);
b.ToTable("OrderStatuses");
b.HasData(
new
@@ -1669,7 +1672,7 @@ namespace PARR.DAL.Migrations
b.HasKey("Id");
b.ToTable("Processes", (string)null);
b.ToTable("Processes");
});
modelBuilder.Entity("PARR.DAL.Models.ResponseArea", b =>
@@ -1686,7 +1689,7 @@ namespace PARR.DAL.Migrations
b.HasKey("Code");
b.ToTable("ResponseAreas", (string)null);
b.ToTable("ResponseAreas");
b.HasData(
new
@@ -1797,7 +1800,7 @@ namespace PARR.DAL.Migrations
b.HasIndex("Name")
.IsUnique();
b.ToTable("Robots", (string)null);
b.ToTable("Robots");
b.HasData(
new
@@ -1852,7 +1855,7 @@ namespace PARR.DAL.Migrations
b.HasIndex("TemplateId", "RobotCode")
.IsUnique();
b.ToTable("RobotConfigurations", (string)null);
b.ToTable("RobotConfigurations");
});
modelBuilder.Entity("PARR.DAL.Models.RobotHistory", b =>
@@ -1887,7 +1890,7 @@ namespace PARR.DAL.Migrations
b.HasIndex("TaskStatusCode");
b.ToTable("RobotHistories", (string)null);
b.ToTable("RobotHistories");
});
modelBuilder.Entity("PARR.DAL.Models.RobotHistoryLevel", b =>
@@ -1908,7 +1911,7 @@ namespace PARR.DAL.Migrations
b.HasKey("Level");
b.ToTable("RobotHistoryLevels", (string)null);
b.ToTable("RobotHistoryLevels");
b.HasData(
new
@@ -1955,7 +1958,7 @@ namespace PARR.DAL.Migrations
b.HasKey("Code");
b.ToTable("RobotStatuses", (string)null);
b.ToTable("RobotStatuses");
b.HasData(
new
@@ -1999,7 +2002,7 @@ namespace PARR.DAL.Migrations
b.HasKey("Name");
b.ToTable("Settings", (string)null);
b.ToTable("Settings");
b.HasData(
new
@@ -2090,7 +2093,7 @@ namespace PARR.DAL.Migrations
b.HasIndex("ProcessId");
b.ToTable("Subprocesses", (string)null);
b.ToTable("Subprocesses");
});
modelBuilder.Entity("PARR.DAL.Models.TaskStatus", b =>
@@ -2111,7 +2114,7 @@ namespace PARR.DAL.Migrations
b.HasKey("Code");
b.ToTable("TaskStatuses", (string)null);
b.ToTable("TaskStatuses");
b.HasData(
new
@@ -2174,7 +2177,7 @@ namespace PARR.DAL.Migrations
b.HasIndex("Name")
.IsUnique();
b.ToTable("Templates", (string)null);
b.ToTable("Templates");
});
modelBuilder.Entity("PARR.DAL.Models.Tnk", b =>
@@ -2203,7 +2206,7 @@ namespace PARR.DAL.Migrations
b.HasIndex("SubprocessId");
b.ToTable("Tnks", (string)null);
b.ToTable("Tnks");
});
modelBuilder.Entity("PARR.DAL.Models.Work", b =>
@@ -2232,7 +2235,7 @@ namespace PARR.DAL.Migrations
b.HasIndex("TnkId");
b.ToTable("Works", (string)null);
b.ToTable("Works");
});
modelBuilder.Entity("PARR.DAL.Models.AgentHistory", b =>