feat(dal,api): удалены таблицы которые относились к старому JobAutoControl. Добавлена новая таблица JobAutoControl
This commit is contained in:
@@ -34,9 +34,6 @@ namespace PARR.DAL.Context
|
||||
public DbSet<Work> Works { get; set; }
|
||||
|
||||
public DbSet<ApplicationsInWork> ApplicationsInWorks { get; set; }
|
||||
public DbSet<JobAutoControl> JobAutoControls { get; set; }
|
||||
public DbSet<JobEkMask> JobEkMasks { get; set; }
|
||||
public DbSet<JobAutoControlInEkStatus> JobAutoControlInEkStatuses { get; set; }
|
||||
|
||||
public DbSet<Models.Setting> Setting { get; set; }
|
||||
|
||||
|
||||
3897
PARR.DAL/Migrations/20251205012723_remOldJobAutoControl.Designer.cs
generated
Normal file
3897
PARR.DAL/Migrations/20251205012723_remOldJobAutoControl.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
116
PARR.DAL/Migrations/20251205012723_remOldJobAutoControl.cs
Normal file
116
PARR.DAL/Migrations/20251205012723_remOldJobAutoControl.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class remOldJobAutoControl : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "JobAutoControlInEkStatus");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "JobEkMasks");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "JobAutoControls");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "JobAutoControls",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ApplicationInWorkId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Activate = table.Column<bool>(type: "boolean", nullable: false),
|
||||
CreateNew = table.Column<bool>(type: "boolean", nullable: false),
|
||||
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||
DateModified = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
||||
Deactivate = table.Column<bool>(type: "boolean", nullable: false),
|
||||
OffScheduleIsActive = table.Column<bool>(type: "boolean", nullable: false),
|
||||
OffTemplateIsActive = table.Column<bool>(type: "boolean", nullable: false),
|
||||
OnScheduleIsActive = table.Column<bool>(type: "boolean", nullable: false),
|
||||
OnTemplateIsActive = table.Column<bool>(type: "boolean", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_JobAutoControls", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_JobAutoControls_ApplicationsInWorks_ApplicationInWorkId",
|
||||
column: x => x.ApplicationInWorkId,
|
||||
principalTable: "ApplicationsInWorks",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "JobAutoControlInEkStatus",
|
||||
columns: table => new
|
||||
{
|
||||
JobAutoControlId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
EkStatusCode = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_JobAutoControlInEkStatus", x => new { x.JobAutoControlId, x.EkStatusCode });
|
||||
table.ForeignKey(
|
||||
name: "FK_JobAutoControlInEkStatus_EkStatuses_EkStatusCode",
|
||||
column: x => x.EkStatusCode,
|
||||
principalTable: "EkStatuses",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_JobAutoControlInEkStatus_JobAutoControls_JobAutoControlId",
|
||||
column: x => x.JobAutoControlId,
|
||||
principalTable: "JobAutoControls",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "JobEkMasks",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
JobAutoControlId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_JobEkMasks", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_JobEkMasks_JobAutoControls_JobAutoControlId",
|
||||
column: x => x.JobAutoControlId,
|
||||
principalTable: "JobAutoControls",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JobAutoControlInEkStatus_EkStatusCode",
|
||||
table: "JobAutoControlInEkStatus",
|
||||
column: "EkStatusCode");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JobAutoControls_ApplicationInWorkId",
|
||||
table: "JobAutoControls",
|
||||
column: "ApplicationInWorkId",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JobEkMasks_JobAutoControlId_Name",
|
||||
table: "JobEkMasks",
|
||||
columns: new[] { "JobAutoControlId", "Name" },
|
||||
unique: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
3938
PARR.DAL/Migrations/20251205014424_tbjJobAutoControl.Designer.cs
generated
Normal file
3938
PARR.DAL/Migrations/20251205014424_tbjJobAutoControl.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
48
PARR.DAL/Migrations/20251205014424_tbjJobAutoControl.cs
Normal file
48
PARR.DAL/Migrations/20251205014424_tbjJobAutoControl.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class tbjJobAutoControl : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AutoControls",
|
||||
schema: "job",
|
||||
columns: table => new
|
||||
{
|
||||
JobId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
IsEnable = table.Column<bool>(type: "boolean", nullable: false),
|
||||
SyncIsActiveTemplate = table.Column<bool>(type: "boolean", nullable: false),
|
||||
SyncIsActiveSchedule = table.Column<bool>(type: "boolean", nullable: false),
|
||||
UpdateIsActiveTemplate = table.Column<bool>(type: "boolean", nullable: false),
|
||||
UpdateIsActiveSchedule = table.Column<bool>(type: "boolean", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AutoControls", x => x.JobId);
|
||||
table.ForeignKey(
|
||||
name: "FK_AutoControls_Jobs_JobId",
|
||||
column: x => x.JobId,
|
||||
principalSchema: "job",
|
||||
principalTable: "Jobs",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "Таблица управления автоконтролем для работ");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "AutoControls",
|
||||
schema: "job");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1597,6 +1597,34 @@ namespace PARR.DAL.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Job.JobAutoControl", b =>
|
||||
{
|
||||
b.Property<Guid>("JobId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<bool>("IsEnable")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("SyncIsActiveSchedule")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("SyncIsActiveTemplate")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("UpdateIsActiveSchedule")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("UpdateIsActiveTemplate")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.HasKey("JobId");
|
||||
|
||||
b.ToTable("AutoControls", "job", t =>
|
||||
{
|
||||
t.HasComment("Таблица управления автоконтролем для работ");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Job.JobFieldFilter", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -1808,89 +1836,6 @@ namespace PARR.DAL.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.JobAutoControl", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<bool>("Activate")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid>("ApplicationInWorkId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<bool>("CreateNew")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTimeOffset>("DateCreated")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTimeOffset?>("DateModified")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<bool>("Deactivate")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("OffScheduleIsActive")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("OffTemplateIsActive")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("OnScheduleIsActive")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("OnTemplateIsActive")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApplicationInWorkId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("JobAutoControls");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.JobAutoControlInEkStatus", b =>
|
||||
{
|
||||
b.Property<Guid>("JobAutoControlId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("EkStatusCode")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("JobAutoControlId", "EkStatusCode");
|
||||
|
||||
b.HasIndex("EkStatusCode");
|
||||
|
||||
b.ToTable("JobAutoControlInEkStatus");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.JobEkMask", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTimeOffset>("DateCreated")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<Guid>("JobAutoControlId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("JobAutoControlId", "Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("JobEkMasks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Order", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -3399,6 +3344,17 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("Tnk");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Job.JobAutoControl", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.Job.Job", "Job")
|
||||
.WithOne("AutoControl")
|
||||
.HasForeignKey("PARR.DAL.Models.Job.JobAutoControl", "JobId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Job");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Job.JobFieldFilter", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.Unit.UnitField", "UnitField")
|
||||
@@ -3459,47 +3415,6 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("Job");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.JobAutoControl", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.ApplicationsInWork", "ApplicationsInWork")
|
||||
.WithOne("JobAutoControl")
|
||||
.HasForeignKey("PARR.DAL.Models.JobAutoControl", "ApplicationInWorkId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ApplicationsInWork");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.JobAutoControlInEkStatus", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.EkStatus", "EkStatus")
|
||||
.WithMany("JobAutoControlInEkStatuses")
|
||||
.HasForeignKey("EkStatusCode")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("PARR.DAL.Models.JobAutoControl", "JobAutoControl")
|
||||
.WithMany("JobAutoControlInEkStatuses")
|
||||
.HasForeignKey("JobAutoControlId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("EkStatus");
|
||||
|
||||
b.Navigation("JobAutoControl");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.JobEkMask", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.JobAutoControl", "JobAutoControl")
|
||||
.WithMany("JobEkMasks")
|
||||
.HasForeignKey("JobAutoControlId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("JobAutoControl");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Order", b =>
|
||||
{
|
||||
b.HasOne("PARR.DAL.Models.OrderStatus", "NextStatus")
|
||||
@@ -3808,8 +3723,6 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.ApplicationsInWork", b =>
|
||||
{
|
||||
b.Navigation("JobAutoControl");
|
||||
|
||||
b.Navigation("WorkGroups");
|
||||
});
|
||||
|
||||
@@ -3826,8 +3739,6 @@ namespace PARR.DAL.Migrations
|
||||
modelBuilder.Entity("PARR.DAL.Models.EkStatus", b =>
|
||||
{
|
||||
b.Navigation("Hosts");
|
||||
|
||||
b.Navigation("JobAutoControlInEkStatuses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.EsppSchType", b =>
|
||||
@@ -3859,6 +3770,8 @@ namespace PARR.DAL.Migrations
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Job.Job", b =>
|
||||
{
|
||||
b.Navigation("AutoControl");
|
||||
|
||||
b.Navigation("Templates");
|
||||
|
||||
b.Navigation("UnitFilters");
|
||||
@@ -3883,13 +3796,6 @@ namespace PARR.DAL.Migrations
|
||||
b.Navigation("RelationshipFilters");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.JobAutoControl", b =>
|
||||
{
|
||||
b.Navigation("JobAutoControlInEkStatuses");
|
||||
|
||||
b.Navigation("JobEkMasks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("PARR.DAL.Models.Order", b =>
|
||||
{
|
||||
b.Navigation("AgentHistories");
|
||||
|
||||
@@ -117,6 +117,6 @@ namespace PARR.DAL.Models
|
||||
|
||||
public ICollection<AppInWorkInWorkGroup> WorkGroups { get; set; } = new HashSet<AppInWorkInWorkGroup>();
|
||||
|
||||
public JobAutoControl? JobAutoControl { get; set; }
|
||||
//public JobAutoControl? JobAutoControl { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,6 @@ namespace PARR.DAL.Models
|
||||
|
||||
public ICollection<Host> Hosts { get; set; } = new HashSet<Host>();
|
||||
|
||||
public ICollection<JobAutoControlInEkStatus> JobAutoControlInEkStatuses { get; set; } = new HashSet<JobAutoControlInEkStatus>();
|
||||
//public ICollection<JobAutoControlInEkStatus> JobAutoControlInEkStatuses { get; set; } = new HashSet<JobAutoControlInEkStatus>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,5 +71,8 @@ namespace PARR.DAL.Models.Job
|
||||
public ICollection<JobUnitFilter> UnitFilters { get; set; } = new HashSet<JobUnitFilter>();
|
||||
|
||||
public ICollection<Template> Templates { get; set; } = new HashSet<Template>();
|
||||
|
||||
|
||||
public JobAutoControl? AutoControl { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
43
PARR.DAL/Models/Job/JobAutoControl.cs
Normal file
43
PARR.DAL/Models/Job/JobAutoControl.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.DAL.Context;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.DAL.Models.Job
|
||||
{
|
||||
[Table("AutoControls", Schema = DataContextSettings.Job)]
|
||||
[Comment("Таблица управления автоконтролем для работ")]
|
||||
public class JobAutoControl
|
||||
{
|
||||
[Key]
|
||||
public Guid JobId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Включен автоконтроль
|
||||
/// </summary>
|
||||
public bool IsEnable { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Значение при синхронизации, статус шаблона
|
||||
/// </summary>
|
||||
public bool SyncIsActiveTemplate { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Значение при синхронизации, статус расписания
|
||||
/// </summary>
|
||||
public bool SyncIsActiveSchedule { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Значение при обновлении, статус шаблона
|
||||
/// </summary>
|
||||
public bool UpdateIsActiveTemplate { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Значение при обновлении, статус расписания
|
||||
/// </summary>
|
||||
public bool UpdateIsActiveSchedule { get; set; } = false;
|
||||
|
||||
[ForeignKey(nameof(JobId))]
|
||||
public Job? Job { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.DAL.Models.Base;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.DAL.Models
|
||||
{
|
||||
[Table("JobAutoControls")]
|
||||
[Index(nameof(ApplicationInWorkId), IsUnique = true)]
|
||||
public class JobAutoControl : IBase
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public DateTimeOffset DateCreated { get; set; }
|
||||
|
||||
public DateTimeOffset? DateModified { get; set; }
|
||||
|
||||
public Guid ApplicationInWorkId { get; set; }
|
||||
|
||||
[ForeignKey(nameof(ApplicationInWorkId))]
|
||||
public ApplicationsInWork? ApplicationsInWork { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Создавать новые РР (из настроке РР)
|
||||
/// </summary>
|
||||
public bool CreateNew { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Деактивировать не актуальные согласно ЭК (обратные статусы ЭК)
|
||||
/// </summary>
|
||||
public bool Deactivate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Активировать РР после смены ЭК (согласно настройкам статусов ЭК)
|
||||
/// </summary>
|
||||
public bool Activate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Состояние для активированных РР, шаблоны
|
||||
/// </summary>
|
||||
public bool OnTemplateIsActive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Состояние для активированных РР, расписания
|
||||
/// </summary>
|
||||
public bool OnScheduleIsActive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Состояние для деактивированных РР, шаблоны
|
||||
/// </summary>
|
||||
public bool OffTemplateIsActive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Состояние для деактивированных РР, расписания
|
||||
/// </summary>
|
||||
public bool OffScheduleIsActive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Список масок ЭК, или ЭК
|
||||
/// </summary>
|
||||
public ICollection<JobEkMask> JobEkMasks { get; set; } = new HashSet<JobEkMask>();
|
||||
|
||||
/// <summary>
|
||||
/// Список статусов ЭК для которых создавать/активировать шаблоны/расписания
|
||||
/// </summary>
|
||||
public ICollection<JobAutoControlInEkStatus> JobAutoControlInEkStatuses { get; set; } = new HashSet<JobAutoControlInEkStatus>();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.DAL.Models
|
||||
{
|
||||
[Table("JobAutoControlInEkStatus")]
|
||||
[PrimaryKey(nameof(JobAutoControlId), nameof(EkStatusCode))]
|
||||
public class JobAutoControlInEkStatus
|
||||
{
|
||||
public Guid JobAutoControlId { get; set; }
|
||||
|
||||
public int EkStatusCode { get; set; }
|
||||
|
||||
[ForeignKey(nameof(EkStatusCode))]
|
||||
public EkStatus? EkStatus { get; set; }
|
||||
|
||||
[ForeignKey(nameof(JobAutoControlId))]
|
||||
public JobAutoControl? JobAutoControl { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.DAL.Models.Base;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.DAL.Models
|
||||
{
|
||||
[Table("JobEkMasks")]
|
||||
[Index(nameof(JobAutoControlId), nameof(Name), IsUnique = true)]
|
||||
public class JobEkMask : IBase
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public DateTimeOffset DateCreated { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public DateTimeOffset? DateModified { get; set; }
|
||||
|
||||
public required string Name { get; set; }
|
||||
|
||||
public Guid JobAutoControlId { get; set; }
|
||||
|
||||
[ForeignKey(nameof(JobAutoControlId))]
|
||||
public JobAutoControl? JobAutoControl { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -90,8 +90,6 @@ namespace PARR.DAL
|
||||
services.AddTransient<IDistributionPeriodService, DistributionPeriodService>();
|
||||
services.AddTransient<IEsppSchTypeValueService, EsppSchTypeValueService>();
|
||||
services.AddTransient<IResponseAreaService, ResponseAreaService>();
|
||||
services.AddTransient<IJobAutoControlService, JobAutoControlService>();
|
||||
services.AddTransient<IJobEkMaskService, JobEkMaskService>();
|
||||
services.AddTransient<ITemplateHistoryService, TemplateHistoryService>();
|
||||
services.AddTransient<IParrComponentService, ParrComponentService>();
|
||||
services.AddTransient<ITemplateStatusTypeService, TemplateStatusTypeService>();
|
||||
|
||||
@@ -18,5 +18,31 @@ namespace PARR.DAL.Services.Implementations.Job
|
||||
protected override DbSet<Models.Job.Job> EntitySet => dataContext.Jobs;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
|
||||
public override Task<bool> CreateAsync(Models.Job.Job obj)
|
||||
{
|
||||
if (obj.AutoControl == null)
|
||||
obj.AutoControl = new Models.Job.JobAutoControl
|
||||
{
|
||||
JobId = obj.Id
|
||||
};
|
||||
|
||||
return base.CreateAsync(obj);
|
||||
}
|
||||
|
||||
|
||||
public override Task<bool> AddRangeAsync(List<Models.Job.Job> objs)
|
||||
{
|
||||
objs.ForEach(job =>
|
||||
{
|
||||
if (job.AutoControl == null)
|
||||
job.AutoControl = new Models.Job.JobAutoControl
|
||||
{
|
||||
JobId = job.Id
|
||||
};
|
||||
});
|
||||
|
||||
return base.AddRangeAsync(objs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations
|
||||
{
|
||||
internal class JobAutoControlService : BaseService<JobAutoControl>, IJobAutoControlService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
|
||||
protected override DbSet<JobAutoControl> EntitySet => dataContext.JobAutoControls;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
|
||||
public JobAutoControlService(DataContext dataContext, ILogger<JobAutoControlService> logger) : base(logger)
|
||||
{
|
||||
this.dataContext = dataContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations
|
||||
{
|
||||
internal class JobEkMaskService : BaseService<JobEkMask>, IJobEkMaskService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
|
||||
protected override DbSet<JobEkMask> EntitySet => dataContext.JobEkMasks;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
|
||||
public JobEkMaskService(DataContext dataContext, ILogger<JobEkMaskService> logger) : base(logger)
|
||||
{
|
||||
this.dataContext = dataContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Interfaces.Base;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces
|
||||
{
|
||||
public interface IJobAutoControlService : IBaseService<JobAutoControl>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Interfaces.Base;
|
||||
|
||||
namespace PARR.DAL.Services.Interfaces
|
||||
{
|
||||
public interface IJobEkMaskService : IBaseService<JobEkMask>
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user