feat(api,dal): исключения расписаний ЕСПП привязаны к JobGroup, удалены константы из настроек. Кол-во шаблонов в Job считается только used. В JobFieldFilter добавлено поле IsInverse.

This commit is contained in:
Mikhail Trubnikov
2025-12-26 11:21:45 +10:00
parent eb57f4b3cd
commit 61c46770e0
29 changed files with 8901 additions and 46 deletions

View File

@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using PARR.DAL.Context;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models
@@ -6,7 +7,7 @@ namespace PARR.DAL.Models
/// <summary>
/// Расписание ЕСПП: типы повторений
/// </summary>
[Table("EsppSchTypes")]
[Table("EsppSchTypes", Schema = DataContextSettings.Schedule)]
public class EsppSchType
{
[Key]

View File

@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
using PARR.DAL.Context;
using PARR.DAL.Models.Base;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -8,7 +9,7 @@ namespace PARR.DAL.Models
/// <summary>
/// Расписание ЕСПП: Конфигурация типов
/// </summary>
[Table("EsppSchTypeConfigs")]
[Table("EsppSchTypeConfigs", Schema = DataContextSettings.Schedule)]
[Index(nameof(TypeScheduleId), nameof(TypeId), IsUnique = true)]
public class EsppSchTypeConfig : IBase
{

View File

@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using PARR.DAL.Context;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models
@@ -6,7 +7,7 @@ namespace PARR.DAL.Models
/// <summary>
/// Расписание ЕСПП: Повторять задачу
/// </summary>
[Table("EsppSchTypeSchedules")]
[Table("EsppSchTypeSchedules", Schema = DataContextSettings.Schedule)]
public class EsppSchTypeSchedule
{
[Key]

View File

@@ -1,4 +1,5 @@
using PARR.DAL.Models.Base;
using PARR.DAL.Context;
using PARR.DAL.Models.Base;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -7,7 +8,7 @@ namespace PARR.DAL.Models
/// <summary>
/// Расписание ЕСПП: значения типов повторений
/// </summary>
[Table("EsppSchTypeValues")]
[Table("EsppSchTypeValues", Schema = DataContextSettings.Schedule)]
public class EsppSchTypeValue : IBase
{
[Key]

View File

@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;
using PARR.DAL.Context;
using PARR.DAL.Models.Job;
using PARR.DAL.Models.Schedule;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models
@@ -8,7 +8,7 @@ namespace PARR.DAL.Models
/// <summary>
/// Расписание ЕСПП: значения заданий для ApplicationsInWorks
/// </summary>
[Table("EsppSchValues")]
[Table("EsppSchValues", Schema = DataContextSettings.Schedule)]
//[Index(nameof(ApplicationsInWorkId), nameof(TypeValueId), nameof(TypeConfigId), IsUnique = true)]
//[PrimaryKey(nameof(ApplicationsInWorkId), nameof(TypeValueId), nameof(TypeConfigId))]
[PrimaryKey(nameof(JobGroupId), nameof(TypeValueId), nameof(TypeConfigId))]

View File

@@ -16,6 +16,7 @@ namespace PARR.DAL.Models.Job
public DateTimeOffset DateCreated { get; set; }
public DateTimeOffset? DateModified { get; set; }
public required string UnitFilter { get; set; }
public Guid JobId { get; set; }

View File

@@ -1,6 +1,7 @@
using Microsoft.EntityFrameworkCore;
using PARR.DAL.Context;
using PARR.DAL.Models.Base;
using PARR.DAL.Models.Job;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -33,6 +34,6 @@ namespace PARR.DAL.Models.Schedule
public required string Code { get; set; }
public ICollection<JobGroup> JobGroups { get; set; } = new HashSet<JobGroup>();
}
}

View File

@@ -1,6 +1,7 @@
using Microsoft.EntityFrameworkCore;
using PARR.DAL.Context;
using PARR.DAL.Models.Base;
using PARR.DAL.Models.Job;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -32,5 +33,7 @@ namespace PARR.DAL.Models.Schedule
public required string Code { get; set; }
public ICollection<JobGroup> JobGroups { get; set; } = new HashSet<JobGroup>();
}
}