Таблицы сырых данных АИХ ИТ

This commit is contained in:
Mikhail Kuznetsov
2023-08-11 09:21:54 +10:00
parent 2cc8af6af5
commit 23b9d5da56
4 changed files with 293 additions and 52 deletions

View File

@@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore;
using PARR.DAL.Contracts;
using PARR.DAL.Models.AIHIT;
using PARR.DAL.Models.V1;
namespace PARR.DAL.Context
@@ -18,6 +19,8 @@ namespace PARR.DAL.Context
public DbSet<V1_Application> Applications { get; set; }
public DbSet<V1_ApplicationType> ApplicationTypes { get; set; }
public DbSet<V1_ApplicationInHost> ApplicationsInHosts { get; set; }
public DbSet<Setting> Settings { get; set; }
public DbSet<RawDataEK> RawDataEKs { get; set; }
//public DbSet<Scheduler> Schedulers { get; set; }
//todo init application type+check migrations
@@ -54,6 +57,14 @@ namespace PARR.DAL.Context
);
});
modelBuilder.Entity<Models.AIHIT.Setting>(f =>
{
f.HasData(
new() { Id = new Guid("1AD12210-BE62-459A-AA6C-FDA7648503F7"), DateCreated = dateCreated, DateModified = null, Group = null, Name = "ConnectionString", Value = @"Data Source=10.248.19.97; Initial Catalog=mao2;User ID=awhit-ipp-parr;pwd=ET3h$9y1LH#D;TrustServerCertificate=true;", Description = "Строка подключения к базе данных АИХ ИТ" },
new() { Id = new Guid("50F66704-4D26-4587-BB1E-DCA70C8F4B89"), DateCreated = dateCreated, DateModified = null, Group = "ResponsibleArea", Name = "ZAB", Value = "94-ЗАБ", Description = "Зона ответственности" },
new() { Id = new Guid("1FD43634-4A06-4237-9727-EDFA6F3EEBE8"), DateCreated = dateCreated, DateModified = null, Group = "ResponsibleArea", Name = "DVS", Value = "96-ДВС", Description = "Зона ответственности" }
);
});
}

View File

@@ -22,7 +22,215 @@ namespace PARR.DAL.Migrations
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("PARR.DAL.Models.V1_Application", b =>
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<DateTime?>("CreateTime")
.HasColumnType("timestamp with time zone");
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<DateTime?>("EndExplotationDate")
.HasColumnType("timestamp with time zone");
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<DateTime?>("PlannedTimeToRepair")
.HasColumnType("timestamp with time zone");
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<DateTime?>("StartExplotationDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Status")
.HasColumnType("text");
b.Property<DateTime?>("SysModTime")
.HasColumnType("timestamp with time zone");
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-ДВС"
});
});
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Application", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -45,10 +253,10 @@ namespace PARR.DAL.Migrations
b.HasIndex("ApplicationTypeId");
b.ToTable("V1_Application");
b.ToTable("V1_Applications");
});
modelBuilder.Entity("PARR.DAL.Models.V1_ApplicationInHost", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationInHost", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -72,10 +280,10 @@ namespace PARR.DAL.Migrations
b.HasIndex("HostId");
b.ToTable("V1_ApplicationInHost");
b.ToTable("V1_ApplicationsInHost");
});
modelBuilder.Entity("PARR.DAL.Models.V1_ApplicationType", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationType", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -101,7 +309,7 @@ namespace PARR.DAL.Migrations
b.HasIndex("V1_ApplicationTypeId");
b.ToTable("V1_ApplicationType");
b.ToTable("V1_ApplicationTypes");
b.HasData(
new
@@ -127,7 +335,7 @@ namespace PARR.DAL.Migrations
});
});
modelBuilder.Entity("PARR.DAL.Models.V1_Host", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Host", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -163,10 +371,10 @@ namespace PARR.DAL.Migrations
b.HasKey("Id");
b.ToTable("V1_Host");
b.ToTable("V1_Hosts");
});
modelBuilder.Entity("PARR.DAL.Models.V1_Job", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Job", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -217,10 +425,10 @@ namespace PARR.DAL.Migrations
b.HasIndex("JobTypeId");
b.ToTable("V1_Job");
b.ToTable("V1_Jobs");
});
modelBuilder.Entity("PARR.DAL.Models.V1_JobCategory", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobCategory", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -241,10 +449,10 @@ namespace PARR.DAL.Migrations
b.HasKey("Id");
b.ToTable("V1_JobCategory");
b.ToTable("V1_JobCategorys");
});
modelBuilder.Entity("PARR.DAL.Models.V1_JobJournal", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobJournal", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -285,10 +493,10 @@ namespace PARR.DAL.Migrations
b.HasIndex("JobStatusId");
b.ToTable("V1_JobJournal");
b.ToTable("V1_JobJournals");
});
modelBuilder.Entity("PARR.DAL.Models.V1_JobMode", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobMode", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -306,7 +514,7 @@ namespace PARR.DAL.Migrations
b.HasKey("Id");
b.ToTable("V1_JobMode");
b.ToTable("V1_JobModes");
b.HasData(
new
@@ -323,7 +531,7 @@ namespace PARR.DAL.Migrations
});
});
modelBuilder.Entity("PARR.DAL.Models.V1_JobStatus", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobStatus", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -344,7 +552,7 @@ namespace PARR.DAL.Migrations
b.HasKey("Id");
b.ToTable("V1_JobStatus");
b.ToTable("V1_JobStatuses");
b.HasData(
new
@@ -363,7 +571,7 @@ namespace PARR.DAL.Migrations
});
});
modelBuilder.Entity("PARR.DAL.Models.V1_JobType", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobType", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -384,12 +592,12 @@ namespace PARR.DAL.Migrations
b.HasKey("Id");
b.ToTable("V1_JobType");
b.ToTable("V1_JobTypes");
});
modelBuilder.Entity("PARR.DAL.Models.V1_Application", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Application", b =>
{
b.HasOne("PARR.DAL.Models.V1_ApplicationType", "ApplicationType")
b.HasOne("PARR.DAL.Models.V1.V1_ApplicationType", "ApplicationType")
.WithMany()
.HasForeignKey("ApplicationTypeId")
.OnDelete(DeleteBehavior.Cascade)
@@ -398,15 +606,15 @@ namespace PARR.DAL.Migrations
b.Navigation("ApplicationType");
});
modelBuilder.Entity("PARR.DAL.Models.V1_ApplicationInHost", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationInHost", b =>
{
b.HasOne("PARR.DAL.Models.V1_Application", "Application")
b.HasOne("PARR.DAL.Models.V1.V1_Application", "Application")
.WithMany("ApplicationsInHosts")
.HasForeignKey("ApplicationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PARR.DAL.Models.V1_Host", "Host")
b.HasOne("PARR.DAL.Models.V1.V1_Host", "Host")
.WithMany("ApplicationsInHosts")
.HasForeignKey("HostId")
.OnDelete(DeleteBehavior.Cascade)
@@ -417,32 +625,32 @@ namespace PARR.DAL.Migrations
b.Navigation("Host");
});
modelBuilder.Entity("PARR.DAL.Models.V1_ApplicationType", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationType", b =>
{
b.HasOne("PARR.DAL.Models.V1_ApplicationType", null)
b.HasOne("PARR.DAL.Models.V1.V1_ApplicationType", null)
.WithMany("ApplicationTypes")
.HasForeignKey("V1_ApplicationTypeId");
});
modelBuilder.Entity("PARR.DAL.Models.V1_Job", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Job", b =>
{
b.HasOne("PARR.DAL.Models.V1_Application", "Application")
b.HasOne("PARR.DAL.Models.V1.V1_Application", "Application")
.WithMany()
.HasForeignKey("ApplicationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PARR.DAL.Models.V1_JobCategory", "JobCategorye")
b.HasOne("PARR.DAL.Models.V1.V1_JobCategory", "JobCategorye")
.WithMany("Jobs")
.HasForeignKey("JobCategoryId");
b.HasOne("PARR.DAL.Models.V1_JobMode", "JobMode")
b.HasOne("PARR.DAL.Models.V1.V1_JobMode", "JobMode")
.WithMany("Jobs")
.HasForeignKey("JobModeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PARR.DAL.Models.V1_JobType", "JobType")
b.HasOne("PARR.DAL.Models.V1.V1_JobType", "JobType")
.WithMany("Jobs")
.HasForeignKey("JobTypeId");
@@ -455,21 +663,21 @@ namespace PARR.DAL.Migrations
b.Navigation("JobType");
});
modelBuilder.Entity("PARR.DAL.Models.V1_JobJournal", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobJournal", b =>
{
b.HasOne("PARR.DAL.Models.V1_Host", "Host")
b.HasOne("PARR.DAL.Models.V1.V1_Host", "Host")
.WithMany("JobJournals")
.HasForeignKey("HostId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PARR.DAL.Models.V1_Job", "Job")
b.HasOne("PARR.DAL.Models.V1.V1_Job", "Job")
.WithMany("Journals")
.HasForeignKey("JobId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PARR.DAL.Models.V1_JobStatus", "Status")
b.HasOne("PARR.DAL.Models.V1.V1_JobStatus", "Status")
.WithMany("Journals")
.HasForeignKey("JobStatusId")
.OnDelete(DeleteBehavior.Cascade)
@@ -482,44 +690,44 @@ namespace PARR.DAL.Migrations
b.Navigation("Status");
});
modelBuilder.Entity("PARR.DAL.Models.V1_Application", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Application", b =>
{
b.Navigation("ApplicationsInHosts");
});
modelBuilder.Entity("PARR.DAL.Models.V1_ApplicationType", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_ApplicationType", b =>
{
b.Navigation("ApplicationTypes");
});
modelBuilder.Entity("PARR.DAL.Models.V1_Host", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Host", b =>
{
b.Navigation("ApplicationsInHosts");
b.Navigation("JobJournals");
});
modelBuilder.Entity("PARR.DAL.Models.V1_Job", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_Job", b =>
{
b.Navigation("Journals");
});
modelBuilder.Entity("PARR.DAL.Models.V1_JobCategory", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobCategory", b =>
{
b.Navigation("Jobs");
});
modelBuilder.Entity("PARR.DAL.Models.V1_JobMode", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobMode", b =>
{
b.Navigation("Jobs");
});
modelBuilder.Entity("PARR.DAL.Models.V1_JobStatus", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobStatus", b =>
{
b.Navigation("Journals");
});
modelBuilder.Entity("PARR.DAL.Models.V1_JobType", b =>
modelBuilder.Entity("PARR.DAL.Models.V1.V1_JobType", b =>
{
b.Navigation("Jobs");
});

View File

@@ -3,7 +3,9 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using PARR.DAL.Context;
using PARR.DAL.Services.Implementations;
using PARR.DAL.Services.Implementations.AIHIT;
using PARR.DAL.Services.Interfaces;
using PARR.DAL.Services.Interfaces.AIHIT;
namespace PARR.DAL
{
@@ -21,6 +23,7 @@ namespace PARR.DAL
services.AddTransient<IApplicationInHostService, ApplicationInHostService>();
services.AddTransient<IJobService, JobService>();
services.AddTransient<IJobJournalService, JobJournalService>();
services.AddTransient<IRawDataEKService, RawDataEKService>();
//services.AddTransient<ISchedulerService, SchedulerService>();
//services.AddTransient<IAreasInLayerService, AreasInLayerService>();