TemplateService. !!!Ошибка записи в БД
This commit is contained in:
@@ -6,7 +6,7 @@ using PARR.DAL.Models.V1;
|
|||||||
|
|
||||||
namespace PARR.DAL.Context
|
namespace PARR.DAL.Context
|
||||||
{
|
{
|
||||||
internal class DataContext : DbContext
|
public class DataContext : DbContext
|
||||||
{
|
{
|
||||||
public DataContext(DbContextOptions<DataContext> options) : base(options) { }
|
public DataContext(DbContextOptions<DataContext> options) : base(options) { }
|
||||||
|
|
||||||
|
|||||||
973
PARR.DAL/Migrations/20230901033940_TblTemplatesUpd.Designer.cs
generated
Normal file
973
PARR.DAL/Migrations/20230901033940_TblTemplatesUpd.Designer.cs
generated
Normal file
@@ -0,0 +1,973 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
using PARR.DAL.Context;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace PARR.DAL.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(DataContext))]
|
||||||
|
[Migration("20230901033940_TblTemplatesUpd")]
|
||||||
|
partial class TblTemplatesUpd
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "7.0.5")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.AIHIT.RawDataEK", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<int?>("AIHID")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("APPType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("AdditionalInfo")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("CKBSServerType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("CTSDirection")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ClientOS")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ClientSoftware")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Company")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("CreateTime")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("DBType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("EKCategory")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("EKFindCode")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("EKRegister")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("EKRevizor")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("EKSubCategory")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("EKType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("EndExplotationDate")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("FullName")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("IBServerType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("IP")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("InfrastructureServerType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("IsActive")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("IsImportant")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<char?>("IsUnreliableData")
|
||||||
|
.HasColumnType("character(1)");
|
||||||
|
|
||||||
|
b.Property<string>("Location")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Metka")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("MonitoringServerType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("NetworkName")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("NewEKFindCode")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("OldEKFindCode")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("PlannedTimeToRepair")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Prescription")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ProductCode")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ResponseArea")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ResponsibleByEK")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ServiceCode")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ShiftWorkGroup")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ShortName")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("StartExplotationDate")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Status")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("SysModTime")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("SysModUser")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("TargetRepairTime")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("WorkGroup")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("RawDataEKs", "AIHIT");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.AIHIT.Setting", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Group")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Value")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Settings", "AIHIT");
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = new Guid("1ad12210-be62-459a-aa6c-fda7648503f7"),
|
||||||
|
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
||||||
|
Description = "Строка подключения к базе данных АИХ ИТ",
|
||||||
|
Name = "ConnectionString",
|
||||||
|
Value = "Data Source=10.248.19.97; Initial Catalog=mao2;User ID=awhit-ipp-parr;pwd=ET3h$9y1LH#D;TrustServerCertificate=true;"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = new Guid("50f66704-4d26-4587-bb1e-dca70c8f4b89"),
|
||||||
|
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
||||||
|
Description = "Зона ответственности",
|
||||||
|
Group = "ResponsibleArea",
|
||||||
|
Name = "ZAB",
|
||||||
|
Value = "94-ЗАБ"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = new Guid("1fd43634-4a06-4237-9727-edfa6f3eebe8"),
|
||||||
|
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
||||||
|
Description = "Зона ответственности",
|
||||||
|
Group = "ResponsibleArea",
|
||||||
|
Name = "DVS",
|
||||||
|
Value = "96-ДВС"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = new Guid("77c73c0a-8e4d-4676-b6e2-6a112f20e346"),
|
||||||
|
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
||||||
|
Description = "Статус актуальных ЭК",
|
||||||
|
Group = "Status",
|
||||||
|
Name = "Exploitation",
|
||||||
|
Value = "3-В эксплуатации"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid>("ApplicationTypeId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ApplicationTypeId");
|
||||||
|
|
||||||
|
b.ToTable("Applications");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.ApplicationInHost", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid>("ApplicationId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<Guid>("HostId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ApplicationId");
|
||||||
|
|
||||||
|
b.HasIndex("HostId");
|
||||||
|
|
||||||
|
b.ToTable("ApplicationsInHost");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ApplicationTypeId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ApplicationTypeId");
|
||||||
|
|
||||||
|
b.ToTable("ApplicationTypes");
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = new Guid("32c28386-6f13-4f7b-8508-be165b7fabdb"),
|
||||||
|
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
||||||
|
Description = "Поле СП xml АИХ ИТ",
|
||||||
|
Name = "APP"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = new Guid("7848a96c-cdee-48c1-a786-de9cb889723a"),
|
||||||
|
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
||||||
|
Description = "Поле ОС xml АИХ ИТ",
|
||||||
|
Name = "OS"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = new Guid("aae2636f-b93a-42dc-873e-0764a90a0a40"),
|
||||||
|
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
||||||
|
Description = "Поле СУБД xml АИХ ИТ",
|
||||||
|
Name = "DB"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.Host", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("HostName")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("IP")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Status")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("WorkGroup")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Hosts");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.Template", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("Category")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("EK")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("EKDateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Process")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ShortDescription")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Status")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("SubProcess")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("WorkGroup")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("isActive")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Templates");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Application", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid>("ApplicationTypeId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ApplicationTypeId");
|
||||||
|
|
||||||
|
b.ToTable("V1_Applications");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationInHost", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid>("ApplicationId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<Guid>("HostId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid?>("V1_ApplicationId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ApplicationId");
|
||||||
|
|
||||||
|
b.HasIndex("HostId");
|
||||||
|
|
||||||
|
b.HasIndex("V1_ApplicationId");
|
||||||
|
|
||||||
|
b.ToTable("V1_ApplicationsInHost");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationType", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid?>("V1_ApplicationTypeId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("V1_ApplicationTypeId");
|
||||||
|
|
||||||
|
b.ToTable("V1_ApplicationTypes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Host", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("HostName")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("IP")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("LinkEK")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("RegionalEK")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Responsible")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Status")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("WorkGroup")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("V1_Hosts");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Job", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid>("ApplicationId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<int>("Frequency")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<bool>("IsEnabled")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<Guid?>("JobCategoryId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid>("JobModeId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid?>("JobTypeId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ScriptName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("StartAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ApplicationId");
|
||||||
|
|
||||||
|
b.HasIndex("JobCategoryId");
|
||||||
|
|
||||||
|
b.HasIndex("JobModeId");
|
||||||
|
|
||||||
|
b.HasIndex("JobTypeId");
|
||||||
|
|
||||||
|
b.ToTable("V1_Jobs");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobCategory", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("V1_JobCategorys");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobJournal", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateOper")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<Guid>("HostId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("Info")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("JobId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid>("JobStatusId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("Other")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int?>("TimeOut")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("HostId");
|
||||||
|
|
||||||
|
b.HasIndex("JobId");
|
||||||
|
|
||||||
|
b.HasIndex("JobStatusId");
|
||||||
|
|
||||||
|
b.ToTable("V1_JobJournals");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobMode", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("V1_JobModes");
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = new Guid("fba4202c-5bad-49c4-b076-d1ca6e1fb158"),
|
||||||
|
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
||||||
|
Name = "auto"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = new Guid("7516b952-510d-4aaa-971c-a14b184fc1d5"),
|
||||||
|
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
||||||
|
Name = "manual"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobStatus", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("V1_JobStatuses");
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = new Guid("edef6dc3-adad-4c77-8ad1-63bb9052355a"),
|
||||||
|
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
||||||
|
Description = "Задание запущено",
|
||||||
|
Name = "started"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = new Guid("7b945eb6-d885-4570-aff5-8866f1f75ff2"),
|
||||||
|
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
||||||
|
Description = "Задание выполнено",
|
||||||
|
Name = "finished"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobType", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("V1_JobTypes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("PARR.DAL.Models.ApplicationType", "ApplicationType")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ApplicationTypeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ApplicationType");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.ApplicationInHost", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("PARR.DAL.Models.Application", "Application")
|
||||||
|
.WithMany("ApplicationsInHosts")
|
||||||
|
.HasForeignKey("ApplicationId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("PARR.DAL.Models.Host", "Host")
|
||||||
|
.WithMany("ApplicationsInHosts")
|
||||||
|
.HasForeignKey("HostId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Application");
|
||||||
|
|
||||||
|
b.Navigation("Host");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("PARR.DAL.Models.ApplicationType", null)
|
||||||
|
.WithMany("ApplicationTypes")
|
||||||
|
.HasForeignKey("ApplicationTypeId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Application", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("PARR.DAL.Models.V1.V1_ApplicationType", "ApplicationType")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ApplicationTypeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ApplicationType");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationInHost", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("PARR.DAL.Models.Application", "Application")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ApplicationId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("PARR.DAL.Models.V1.V1_Host", "Host")
|
||||||
|
.WithMany("ApplicationsInHosts")
|
||||||
|
.HasForeignKey("HostId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("PARR.DAL.Models.V1.V1_Application", null)
|
||||||
|
.WithMany("V1_ApplicationsInHosts")
|
||||||
|
.HasForeignKey("V1_ApplicationId");
|
||||||
|
|
||||||
|
b.Navigation("Application");
|
||||||
|
|
||||||
|
b.Navigation("Host");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationType", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("PARR.DAL.Models.V1.V1_ApplicationType", null)
|
||||||
|
.WithMany("V1_ApplicationTypes")
|
||||||
|
.HasForeignKey("V1_ApplicationTypeId");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Job", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("PARR.DAL.Models.Application", "Application")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ApplicationId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("PARR.DAL.Models.V1.V1_JobCategory", "JobCategorye")
|
||||||
|
.WithMany("Jobs")
|
||||||
|
.HasForeignKey("JobCategoryId");
|
||||||
|
|
||||||
|
b.HasOne("PARR.DAL.Models.V1.V1_JobMode", "JobMode")
|
||||||
|
.WithMany("Jobs")
|
||||||
|
.HasForeignKey("JobModeId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("PARR.DAL.Models.V1.V1_JobType", "JobType")
|
||||||
|
.WithMany("Jobs")
|
||||||
|
.HasForeignKey("JobTypeId");
|
||||||
|
|
||||||
|
b.Navigation("Application");
|
||||||
|
|
||||||
|
b.Navigation("JobCategorye");
|
||||||
|
|
||||||
|
b.Navigation("JobMode");
|
||||||
|
|
||||||
|
b.Navigation("JobType");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobJournal", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("PARR.DAL.Models.V1.V1_Host", "Host")
|
||||||
|
.WithMany("JobJournals")
|
||||||
|
.HasForeignKey("HostId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("PARR.DAL.Models.V1.V1_Job", "Job")
|
||||||
|
.WithMany("Journals")
|
||||||
|
.HasForeignKey("JobId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("PARR.DAL.Models.V1.V1_JobStatus", "Status")
|
||||||
|
.WithMany("Journals")
|
||||||
|
.HasForeignKey("JobStatusId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Host");
|
||||||
|
|
||||||
|
b.Navigation("Job");
|
||||||
|
|
||||||
|
b.Navigation("Status");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("ApplicationsInHosts");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("ApplicationTypes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.Host", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("ApplicationsInHosts");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Application", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("V1_ApplicationsInHosts");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationType", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("V1_ApplicationTypes");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Host", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("ApplicationsInHosts");
|
||||||
|
|
||||||
|
b.Navigation("JobJournals");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Job", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Journals");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobCategory", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Jobs");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobMode", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Jobs");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobStatus", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Journals");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobType", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Jobs");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
29
PARR.DAL/Migrations/20230901033940_TblTemplatesUpd.cs
Normal file
29
PARR.DAL/Migrations/20230901033940_TblTemplatesUpd.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace PARR.DAL.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class TblTemplatesUpd : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "Status",
|
||||||
|
table: "Templates",
|
||||||
|
type: "text",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Status",
|
||||||
|
table: "Templates");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -405,6 +405,10 @@ namespace PARR.DAL.Migrations
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Status")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("SubProcess")
|
b.Property<string>("SubProcess")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using PARR.DAL.Models.Base;
|
using PARR.DAL.Models.Base;
|
||||||
using PARR.DAL.Models.V1;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
|||||||
@@ -19,5 +19,6 @@ namespace PARR.DAL.Models
|
|||||||
public DateTimeOffset? EKDateCreated { get; set; }
|
public DateTimeOffset? EKDateCreated { get; set; }
|
||||||
public required string Process { get; set; }
|
public required string Process { get; set; }
|
||||||
public required string SubProcess { get; set; }
|
public required string SubProcess { get; set; }
|
||||||
|
public required string Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,9 +32,7 @@ namespace PARR.DAL
|
|||||||
services.AddTransient<V1_IJobJournalService, V1_JobJournalService>();
|
services.AddTransient<V1_IJobJournalService, V1_JobJournalService>();
|
||||||
services.AddTransient<IRawDataEKService, RawDataEKService>();
|
services.AddTransient<IRawDataEKService, RawDataEKService>();
|
||||||
services.AddTransient<ISettingService, SettingService>();
|
services.AddTransient<ISettingService, SettingService>();
|
||||||
//services.AddTransient<ISchedulerService, SchedulerService>();
|
services.AddTransient<ITemplateService, TemplateService>();
|
||||||
|
|
||||||
//services.AddTransient<IAreasInLayerService, AreasInLayerService>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,5 +21,10 @@ namespace PARR.DAL.Services.Implementations
|
|||||||
this.dataContext = dataContext;
|
this.dataContext = dataContext;
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<Template?> GetTemplateByNameAsync(string name)
|
||||||
|
{
|
||||||
|
return await EntitySet.FirstOrDefaultAsync(t => t.EK == name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,5 +5,6 @@ namespace PARR.DAL.Services.Interfaces
|
|||||||
{
|
{
|
||||||
public interface ITemplateService : IBaseService<Template>
|
public interface ITemplateService : IBaseService<Template>
|
||||||
{
|
{
|
||||||
|
Task<Template?> GetTemplateByNameAsync(string name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.4" />
|
||||||
<PackageReference Include="RabbitMQ.Client" Version="6.5.0" />
|
<PackageReference Include="RabbitMQ.Client" Version="6.5.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,34 @@
|
|||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using PARR.DAL.Context;
|
||||||
using PARR.DAL.Models;
|
using PARR.DAL.Models;
|
||||||
|
using PARR.DAL.Services.Interfaces;
|
||||||
|
|
||||||
namespace PARR.EsppTemplateSync.Services
|
namespace PARR.EsppTemplateSync.Services
|
||||||
{
|
{
|
||||||
internal class Manager : IManager
|
internal class Manager : IManager
|
||||||
{
|
{
|
||||||
private readonly ILogger<Manager> logger;
|
private readonly ILogger<Manager> logger;
|
||||||
|
private readonly IServiceProvider serviceProvider;
|
||||||
private readonly IParserService parserService;
|
private readonly IParserService parserService;
|
||||||
|
// private readonly ITemplateService templateService;
|
||||||
|
|
||||||
public Manager(ILogger<Manager> logger, IParserService parserService)
|
public Manager(
|
||||||
|
ILogger<Manager> logger,
|
||||||
|
IServiceProvider serviceProvider,
|
||||||
|
IParserService parserService//,
|
||||||
|
// ITemplateService templateService
|
||||||
|
)
|
||||||
{
|
{
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
|
this.serviceProvider = serviceProvider;
|
||||||
this.parserService = parserService;
|
this.parserService = parserService;
|
||||||
|
// this.templateService = templateService;
|
||||||
|
|
||||||
|
|
||||||
|
//using var scope = serviceProvider.CreateScope();
|
||||||
|
//var services = scope.ServiceProvider;
|
||||||
|
//var templateService = services.GetService<ITemplateService>();
|
||||||
}
|
}
|
||||||
public Task<bool> ManageFileAsync(string path)
|
public Task<bool> ManageFileAsync(string path)
|
||||||
{
|
{
|
||||||
@@ -20,17 +37,58 @@ namespace PARR.EsppTemplateSync.Services
|
|||||||
|
|
||||||
public async Task<bool> ManageStringAsync(string str)
|
public async Task<bool> ManageStringAsync(string str)
|
||||||
{
|
{
|
||||||
|
|
||||||
bool isSuccess = true;
|
bool isSuccess = true;
|
||||||
//TOD if (str == null || str.Length <= 2)
|
//TOD if (str == null || str.Length <= 2)
|
||||||
var template = await parserService.ParseStringAsync(str);
|
var template = await parserService.ParseStringAsync(str);
|
||||||
CheckChanges(template);
|
await CheckChangesAsync(template);
|
||||||
|
|
||||||
|
|
||||||
return isSuccess;
|
return isSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckChanges(Template template)
|
private async Task CheckChangesAsync(Template esppTemplate)
|
||||||
{
|
{
|
||||||
|
//if (!await templateService.CreateAsync(esppTemplate) || !await templateService.CommitAsync())
|
||||||
|
//{
|
||||||
|
// logger.LogError($"Не удалось создать запись Template {esppTemplate.EK}({esppTemplate.ShortDescription})");
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
// logger.LogInformation($"----- Создана запись Template {esppTemplate.EK}({esppTemplate.ShortDescription}) -----");
|
||||||
|
|
||||||
|
|
||||||
|
// -----------------
|
||||||
|
|
||||||
|
//using var dataContext = new DataContext(new Microsoft.EntityFrameworkCore.DbContextOptions<DataContext> { });
|
||||||
|
|
||||||
|
////using var dataContext = new DataContext(opt =>
|
||||||
|
//// opt.UseNpgsql("Server=10.99.253.184;Database=parr;User Id=app_parr; Password=PosdfkhT&)%sdfligL&%5546;"));
|
||||||
|
//dataContext.Templates.Add(esppTemplate);
|
||||||
|
//await dataContext.SaveChangesAsync();
|
||||||
|
// -----------------
|
||||||
|
|
||||||
|
|
||||||
|
using (var scope = serviceProvider.CreateScope())
|
||||||
|
{
|
||||||
|
var services = scope.ServiceProvider;
|
||||||
|
var templateService = services.GetService<ITemplateService>();
|
||||||
|
|
||||||
|
if (templateService == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var template = await templateService.GetTemplateByNameAsync(esppTemplate.EK);
|
||||||
|
if (template == null)
|
||||||
|
{
|
||||||
|
esppTemplate.Status = "New";
|
||||||
|
logger.LogInformation($"В ЕСПП активирован неизвестной шаблон: {esppTemplate.EK} секунд. краткое описание: {esppTemplate.ShortDescription}");
|
||||||
|
if (!await templateService.CreateAsync(esppTemplate) || !await templateService.CommitAsync())
|
||||||
|
{
|
||||||
|
logger.LogError($"Не удалось создать запись Template {esppTemplate.EK}({esppTemplate.ShortDescription})");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
logger.LogInformation($"----- Создана запись Template {esppTemplate.EK}({esppTemplate.ShortDescription}) -----");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ namespace PARR.EsppTemplateSync.Services
|
|||||||
Category = category,
|
Category = category,
|
||||||
EKDateCreated = ConvertDateFromStr(ekDateCreatedStr+ " +03:00"),
|
EKDateCreated = ConvertDateFromStr(ekDateCreatedStr+ " +03:00"),
|
||||||
Process = process,
|
Process = process,
|
||||||
SubProcess = subProcess
|
SubProcess = subProcess,
|
||||||
|
Status = "Checking"
|
||||||
};
|
};
|
||||||
|
|
||||||
//bool isSuccess = true;
|
//bool isSuccess = true;
|
||||||
@@ -63,12 +64,12 @@ namespace PARR.EsppTemplateSync.Services
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var result = DateTimeOffset.ParseExact(dateString, format, provider);
|
var result = DateTimeOffset.ParseExact(dateString, format, provider);
|
||||||
Console.WriteLine("{0} было преобразовано в {1}.", dateString, result.ToString());
|
logger.LogInformation($"{dateString} было преобразовано в {result.ToString()}.");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
catch (FormatException)
|
catch (FormatException)
|
||||||
{
|
{
|
||||||
Console.WriteLine("{0} имеет некоррктный формат для преобразование в DateTimeOffset", dateString);
|
logger.LogWarning($"{dateString} имеет некоррктный формат для преобразование в DateTimeOffset");
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using PARR.DAL.Context;
|
||||||
using PARR.EsppTemplateSync.Services;
|
using PARR.EsppTemplateSync.Services;
|
||||||
using PARR.EsppTemplateSync.Settings;
|
using PARR.EsppTemplateSync.Settings;
|
||||||
using RabbitMQ.Client;
|
using RabbitMQ.Client;
|
||||||
using RabbitMQ.Client.Events;
|
using RabbitMQ.Client.Events;
|
||||||
|
using System.Runtime.Serialization.DataContracts;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace PARR.EsppTemplateSync
|
namespace PARR.EsppTemplateSync
|
||||||
@@ -12,18 +15,21 @@ namespace PARR.EsppTemplateSync
|
|||||||
private readonly ILogger<TemplateMQSyncer> logger;
|
private readonly ILogger<TemplateMQSyncer> logger;
|
||||||
private readonly IManager manager;
|
private readonly IManager manager;
|
||||||
private readonly GlobalSettings globalSettings;
|
private readonly GlobalSettings globalSettings;
|
||||||
|
private readonly IServiceProvider serviceProvider;
|
||||||
private IConnection connection;
|
private IConnection connection;
|
||||||
private RabbitMQ.Client.IModel channel;
|
private RabbitMQ.Client.IModel channel;
|
||||||
|
|
||||||
public TemplateMQSyncer(
|
public TemplateMQSyncer(
|
||||||
ILogger<TemplateMQSyncer> logger,
|
ILogger<TemplateMQSyncer> logger,
|
||||||
IManager manager,
|
IManager manager,
|
||||||
GlobalSettings globalSettings
|
GlobalSettings globalSettings,
|
||||||
|
IServiceProvider serviceProvider
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
this.globalSettings = globalSettings;
|
this.globalSettings = globalSettings;
|
||||||
|
this.serviceProvider = serviceProvider;
|
||||||
if (globalSettings.MqSettings == null)
|
if (globalSettings.MqSettings == null)
|
||||||
{
|
{
|
||||||
logger.LogError("Нет секции настроек хранилища. MqSettings, EsppTemplates");
|
logger.LogError("Нет секции настроек хранилища. MqSettings, EsppTemplates");
|
||||||
@@ -49,11 +55,12 @@ namespace PARR.EsppTemplateSync
|
|||||||
{
|
{
|
||||||
logger.LogInformation($"Запущена проверка очереди {globalSettings.MqSettings!.QueueName}. Интервал: {globalSettings.MqSettings!.CheckIntervalSeconds} секунд.");
|
logger.LogInformation($"Запущена проверка очереди {globalSettings.MqSettings!.QueueName}. Интервал: {globalSettings.MqSettings!.CheckIntervalSeconds} секунд.");
|
||||||
|
|
||||||
CancellationTokenSource cancelTokenSource = new CancellationTokenSource();
|
// CancellationTokenSource cancelTokenSource = new CancellationTokenSource();
|
||||||
CancellationToken token = cancelTokenSource.Token;
|
// CancellationToken token = cancelTokenSource.Token;
|
||||||
Task task = new Task(() => { GetMessages(); }, token);
|
// Task task = new Task(() => { GetMessages(); }, token);
|
||||||
task.Start();
|
// task.Start();
|
||||||
await task.WaitAsync(token);
|
// await task.WaitAsync(token);
|
||||||
|
GetMessages();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GetMessages()
|
private void GetMessages()
|
||||||
@@ -67,6 +74,17 @@ namespace PARR.EsppTemplateSync
|
|||||||
// Обрабатываем полученное сообщение
|
// Обрабатываем полученное сообщение
|
||||||
await manager.ManageStringAsync(content);
|
await manager.ManageStringAsync(content);
|
||||||
|
|
||||||
|
// ------------
|
||||||
|
|
||||||
|
//using var scope = serviceProvider.CreateScope();
|
||||||
|
//var services = scope.ServiceProvider;
|
||||||
|
//var manager = services.GetRequiredService<IManager>();
|
||||||
|
|
||||||
|
//// ------------
|
||||||
|
|
||||||
|
|
||||||
|
//if (manager != null) await manager.ManageStringAsync(content);
|
||||||
|
|
||||||
channel.BasicAck(ea.DeliveryTag, false);
|
channel.BasicAck(ea.DeliveryTag, false);
|
||||||
await Task.Yield();
|
await Task.Yield();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using PARR.DAL;
|
||||||
using PARR.EsppTemplateSync;
|
using PARR.EsppTemplateSync;
|
||||||
using PARR.EsppTemplateSyncWorker;
|
using PARR.EsppTemplateSyncWorker;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
@@ -5,6 +6,7 @@ using Serilog;
|
|||||||
IHost host = Host.CreateDefaultBuilder(args)
|
IHost host = Host.CreateDefaultBuilder(args)
|
||||||
.ConfigureServices((hostContext, services) =>
|
.ConfigureServices((hostContext, services) =>
|
||||||
{
|
{
|
||||||
|
services.InstallDalServices(hostContext.Configuration);
|
||||||
services.InstallEsppTemplateSyncServices(hostContext.Configuration);
|
services.InstallEsppTemplateSyncServices(hostContext.Configuration);
|
||||||
|
|
||||||
services.AddHostedService<Worker>();
|
services.AddHostedService<Worker>();
|
||||||
|
|||||||
@@ -5,30 +5,30 @@ namespace PARR.EsppTemplateSyncWorker
|
|||||||
public class Worker : BackgroundService
|
public class Worker : BackgroundService
|
||||||
{
|
{
|
||||||
private readonly ILogger<Worker> _logger;
|
private readonly ILogger<Worker> _logger;
|
||||||
private readonly ITemplateSyncer templateSyncer;
|
private ITemplateSyncer? templateSyncer;
|
||||||
|
private readonly IServiceProvider serviceProvider;
|
||||||
|
|
||||||
public Worker(ILogger<Worker> logger, ITemplateSyncer templateSyncer)
|
public Worker(
|
||||||
|
ILogger<Worker> logger,
|
||||||
|
IServiceProvider serviceProvider
|
||||||
|
)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
this.templateSyncer = templateSyncer;
|
this.serviceProvider = serviceProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||||
{
|
{
|
||||||
|
using var scope = serviceProvider.CreateScope();
|
||||||
|
var services = scope.ServiceProvider;
|
||||||
|
templateSyncer = services.GetService<ITemplateSyncer>();
|
||||||
|
|
||||||
await templateSyncer.StartAsync();
|
if (templateSyncer != null) await templateSyncer.StartAsync();
|
||||||
|
|
||||||
|
|
||||||
//while (!stoppingToken.IsCancellationRequested)
|
|
||||||
//{
|
|
||||||
// _logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
|
|
||||||
// await Task.Delay(1 * 1000, stoppingToken);
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Task StopAsync(CancellationToken cancellationToken)
|
public override Task StopAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
templateSyncer.Stop();
|
templateSyncer?.Stop();
|
||||||
|
|
||||||
return base.StopAsync(cancellationToken);
|
return base.StopAsync(cancellationToken);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user