Обновление моделей Templates, Works, Hosts, Settings
This commit is contained in:
@@ -4,6 +4,7 @@ using PARR.DAL.Models;
|
||||
using PARR.DAL.Models.AIHIT;
|
||||
using PARR.DAL.Models.V1;
|
||||
using System.ComponentModel;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace PARR.DAL.Context
|
||||
{
|
||||
@@ -29,7 +30,7 @@ namespace PARR.DAL.Context
|
||||
public DbSet<ApplicationType> ApplicationTypes { get; set; }
|
||||
public DbSet<ApplicationInHost> ApplicationsInHosts { get; set; }
|
||||
|
||||
public DbSet<Setting> Settings { get; set; }
|
||||
public DbSet<Models.AIHIT.Setting> Settings { get; set; }
|
||||
public DbSet<RawDataEK> RawDataEKs { get; set; }
|
||||
public DbSet<Template> Templates { get; set; }
|
||||
public DbSet<StatusTemplate> StatusTemplates { get; set; }
|
||||
@@ -41,6 +42,7 @@ namespace PARR.DAL.Context
|
||||
|
||||
public DbSet<ApplicationsInWork> ApplicationsInWorks { get; set; }
|
||||
|
||||
public DbSet<Models.Setting> Setting { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
@@ -95,6 +97,15 @@ namespace PARR.DAL.Context
|
||||
);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Models.Setting>(f =>
|
||||
{
|
||||
f.HasData(
|
||||
new { Name = SettingsEnum.Initiator.ToString(), Description = "Инициатор регламентной работы, указывается при создании шаблона в ЕСПП.", Type = SettingsTypesEnum.String.ToString(), Value = "" },
|
||||
new { Name = SettingsEnum.ClosingCode.ToString(), Description = "Код закрытия регламентной работы, указывается при создании шаблона в ЕСПП.", Type = SettingsTypesEnum.String.ToString(), Value = "выполнен" },
|
||||
new { Name = SettingsEnum.Category.ToString(), Description = "Категория создаваемого объекта в ЕСПП", Type = SettingsTypesEnum.String.ToString(), Value = "регламентная работа" }
|
||||
);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
9
PARR.DAL/Contracts/SettingsEnum.cs
Normal file
9
PARR.DAL/Contracts/SettingsEnum.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace PARR.DAL.Contracts
|
||||
{
|
||||
public enum SettingsEnum
|
||||
{
|
||||
Initiator,
|
||||
ClosingCode,
|
||||
Category
|
||||
}
|
||||
}
|
||||
10
PARR.DAL/Contracts/SettingsTypesEnum.cs
Normal file
10
PARR.DAL/Contracts/SettingsTypesEnum.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace PARR.DAL.Contracts
|
||||
{
|
||||
public enum SettingsTypesEnum
|
||||
{
|
||||
Int,
|
||||
Decimal,
|
||||
String,
|
||||
Bool
|
||||
}
|
||||
}
|
||||
1310
PARR.DAL/Migrations/20230919020903_TblTemplWorks.Designer.cs
generated
Normal file
1310
PARR.DAL/Migrations/20230919020903_TblTemplWorks.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
277
PARR.DAL/Migrations/20230919020903_TblTemplWorks.cs
Normal file
277
PARR.DAL/Migrations/20230919020903_TblTemplWorks.cs
Normal file
@@ -0,0 +1,277 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class TblTemplWorks : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Category",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ClosingCode",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Duration",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "EK",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "FullDescription",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Initiator",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Process",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ResponseArea",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ShortDescription",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Solution",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SubProcess",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TNK",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Work",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "WorkGroup",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Worker",
|
||||
table: "Templates");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "HostName",
|
||||
table: "Hosts",
|
||||
newName: "ResponseArea");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "FullDescription",
|
||||
table: "Works",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ShortDescription",
|
||||
table: "Works",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Solution",
|
||||
table: "Works",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "TemplateDuration",
|
||||
table: "Works",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Ek",
|
||||
table: "Hosts",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Setting",
|
||||
columns: table => new
|
||||
{
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Description = table.Column<string>(type: "text", nullable: false),
|
||||
Type = table.Column<string>(type: "text", nullable: false),
|
||||
Value = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Setting", x => x.Name);
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Setting",
|
||||
columns: new[] { "Name", "Description", "Type", "Value" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ "Category", "Категория создаваемого объекта в ЕСПП", "String", "регламентная работа" },
|
||||
{ "ClosingCode", "Код закрытия регламентной работы, указывается при создании шаблона в ЕСПП.", "String", "выполнен" },
|
||||
{ "Initiator", "Инициатор регламентной работы, указывается при создании шаблона в ЕСПП.", "String", "" }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Setting");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "FullDescription",
|
||||
table: "Works");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ShortDescription",
|
||||
table: "Works");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Solution",
|
||||
table: "Works");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TemplateDuration",
|
||||
table: "Works");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Ek",
|
||||
table: "Hosts");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "ResponseArea",
|
||||
table: "Hosts",
|
||||
newName: "HostName");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Category",
|
||||
table: "Templates",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ClosingCode",
|
||||
table: "Templates",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Duration",
|
||||
table: "Templates",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "EK",
|
||||
table: "Templates",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "FullDescription",
|
||||
table: "Templates",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Initiator",
|
||||
table: "Templates",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Process",
|
||||
table: "Templates",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ResponseArea",
|
||||
table: "Templates",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ShortDescription",
|
||||
table: "Templates",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Solution",
|
||||
table: "Templates",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "SubProcess",
|
||||
table: "Templates",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "TNK",
|
||||
table: "Templates",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Work",
|
||||
table: "Templates",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "WorkGroup",
|
||||
table: "Templates",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Worker",
|
||||
table: "Templates",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -387,13 +387,17 @@ namespace PARR.DAL.Migrations
|
||||
b.Property<DateTimeOffset?>("DateModified")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("HostName")
|
||||
b.Property<string>("Ek")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("IP")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ResponseArea")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.HasColumnType("text");
|
||||
|
||||
@@ -429,6 +433,51 @@ namespace PARR.DAL.Migrations
|
||||
b.ToTable("Processes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Setting", b =>
|
||||
{
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Name");
|
||||
|
||||
b.ToTable("Setting");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Name = "Initiator",
|
||||
Description = "Инициатор регламентной работы, указывается при создании шаблона в ЕСПП.",
|
||||
Type = "String",
|
||||
Value = ""
|
||||
},
|
||||
new
|
||||
{
|
||||
Name = "ClosingCode",
|
||||
Description = "Код закрытия регламентной работы, указывается при создании шаблона в ЕСПП.",
|
||||
Type = "String",
|
||||
Value = "выполнен"
|
||||
},
|
||||
new
|
||||
{
|
||||
Name = "Category",
|
||||
Description = "Категория создаваемого объекта в ЕСПП",
|
||||
Type = "String",
|
||||
Value = "регламентная работа"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.StatusTemplate", b =>
|
||||
{
|
||||
b.Property<int>("Code")
|
||||
@@ -508,36 +557,12 @@ namespace PARR.DAL.Migrations
|
||||
b.Property<Guid>("ApplicationInWorkId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Category")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ClosingCode")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTimeOffset>("DateCreated")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTimeOffset?>("DateModified")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Duration")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EK")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FullDescription")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Initiator")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
@@ -545,45 +570,9 @@ namespace PARR.DAL.Migrations
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Process")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ResponseArea")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ShortDescription")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Solution")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("StatusCode")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("SubProcess")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("TNK")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Work")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("WorkGroup")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Worker")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApplicationInWorkId");
|
||||
@@ -987,10 +976,26 @@ namespace PARR.DAL.Migrations
|
||||
b.Property<int>("EsppId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("FullDescription")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ShortDescription")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Solution")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("TemplateDuration")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("TnkId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
|
||||
@@ -9,14 +9,22 @@ namespace PARR.DAL.Models
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public DateTimeOffset DateCreated { get; set; }
|
||||
|
||||
public DateTimeOffset? DateModified { get; set; }
|
||||
public string? Ek { get; set; }
|
||||
|
||||
public string Ek { get; set; }
|
||||
|
||||
public required string IP { get; set; }
|
||||
|
||||
//public string? RegionalEK { get; set; }
|
||||
//public string? LinkEK { get; set; }
|
||||
|
||||
public string? Status { get; set; }
|
||||
|
||||
public string? WorkGroup { get; set; }
|
||||
|
||||
public string? ResponseArea { get; set; }
|
||||
|
||||
|
||||
|
||||
19
PARR.DAL/Models/Setting.cs
Normal file
19
PARR.DAL/Models/Setting.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.DAL.Models
|
||||
{
|
||||
[Table("Setting")]
|
||||
public class Setting
|
||||
{
|
||||
[Key]
|
||||
public required string Name { get; set; }
|
||||
|
||||
public required string Description { get; set; }
|
||||
|
||||
//SettingsTypesEnum
|
||||
public required string Type { get; set; }
|
||||
|
||||
public required string Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -20,47 +20,6 @@ namespace PARR.DAL.Models
|
||||
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
//Рабочая группа из Host
|
||||
public required string WorkGroup { get; set; }
|
||||
|
||||
// settings из Work
|
||||
public required string ShortDescription { get; set; }
|
||||
|
||||
//settings регламентная работа. не меняется
|
||||
public required string Category { get; set; }
|
||||
|
||||
// из Host
|
||||
public required string ResponseArea { get; set; }
|
||||
|
||||
//works
|
||||
public required string EsppDuration { get; set; }
|
||||
//works
|
||||
public required string EsppStartAt { get; set; }
|
||||
|
||||
//public required string EK { get; set; }
|
||||
|
||||
// settings. Возможно руководитель повыше
|
||||
public required string Initiator { get; set; }
|
||||
// settings из Work
|
||||
public required string FullDescription { get; set; }
|
||||
|
||||
// settings
|
||||
public required string ClosingCode { get; set; }
|
||||
|
||||
// settings из Work
|
||||
public required string Solution { get; set; }
|
||||
|
||||
//public required string Process { get; set; }
|
||||
|
||||
//public required string SubProcess { get; set; }
|
||||
|
||||
//public required string TNK { get; set; }
|
||||
|
||||
//public required string Work { get; set; }
|
||||
|
||||
// исполнитель??
|
||||
public required string Worker { get; set; }
|
||||
|
||||
public int StatusCode { get; set; }
|
||||
|
||||
|
||||
|
||||
@@ -20,6 +20,14 @@ namespace PARR.DAL.Models
|
||||
|
||||
public Guid TnkId { get; set; }
|
||||
|
||||
public required string TemplateDuration { get; set; }
|
||||
|
||||
public required string ShortDescription { get; set; }
|
||||
|
||||
public required string FullDescription { get; set; }
|
||||
|
||||
public required string Solution { get; set; }
|
||||
|
||||
[ForeignKey(nameof(TnkId))]
|
||||
public Tnk? Tnk { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user