refactor(dal,api,templateMatcher,templateGenerator,templateActivator): Немного порядка в namespaceах
This commit is contained in:
84
PARR.Domain/Entities/JobEntities/Job.cs
Normal file
84
PARR.Domain/Entities/JobEntities/Job.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.Domain.Constants;
|
||||
using PARR.Domain.Entities.Base;
|
||||
using PARR.Domain.Entities.JobGroupEntities;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.Domain.Entities.JobEntities
|
||||
{
|
||||
[Table("Jobs", Schema = DatabaseSchemas.Job)]
|
||||
[Comment("Таблица видов работ")]
|
||||
public class Job : IBaseEntity
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public DateTimeOffset DateCreated { get; set; }
|
||||
|
||||
public DateTimeOffset? DateModified { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Наименование работ для интерфеса в ПАРР
|
||||
/// </summary>
|
||||
public required string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Наименование работ для поля Работа в шаблоне АСУ ЕСПП, может быть динамическое
|
||||
/// </summary>
|
||||
public required string WorkName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Минимальное значение дочерних или родительских связей группового ЭК
|
||||
/// </summary>
|
||||
public int? MinValueRelationships { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Максимальное значение дочерних или родительских связей группового ЭК
|
||||
/// </summary>
|
||||
public int? MaxValueRelationships { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Для подсчёта связей групового ЭК использовать родительсике или дочерние связи
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// true - диапазон связей относится к родительским связям<br/>
|
||||
/// false, null - диапазон относится к дочерним связям
|
||||
/// </value>
|
||||
public bool? IsParentRelationships { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Маска для динамического формирования имени шаблона
|
||||
/// </summary>
|
||||
public required string TemplateNameMask { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Маска для динамического формирования рабочей группы исполнителей шаблона
|
||||
/// </summary
|
||||
public required string WorkGroupMask { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Зона ответственности
|
||||
/// </summary>
|
||||
public required string ResponseAreaMask { get; set; }
|
||||
|
||||
public Guid TnkId { get; set; }
|
||||
|
||||
public Guid GroupId { get; set; }
|
||||
|
||||
|
||||
[ForeignKey(nameof(GroupId))]
|
||||
public JobGroup? Group { get; set; }
|
||||
|
||||
[ForeignKey(nameof(TnkId))]
|
||||
public Tnk? Tnk { get; set; }
|
||||
|
||||
|
||||
public ICollection<JobUnitFilter> UnitFilters { get; set; } = new HashSet<JobUnitFilter>();
|
||||
|
||||
public ICollection<Template> Templates { get; set; } = new HashSet<Template>();
|
||||
|
||||
|
||||
public JobAutoControl? AutoControl { get; set; }
|
||||
}
|
||||
}
|
||||
34
PARR.Domain/Entities/JobEntities/JobAutoControl.cs
Normal file
34
PARR.Domain/Entities/JobEntities/JobAutoControl.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.Domain.Constants;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.Domain.Entities.JobEntities
|
||||
{
|
||||
[Table("AutoControls", Schema = DatabaseSchemas.Job)]
|
||||
[Comment("Таблица управления автоконтролем для работ")]
|
||||
public class JobAutoControl
|
||||
{
|
||||
[Key]
|
||||
public Guid JobId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Включен автоконтроль
|
||||
/// </summary>
|
||||
public bool IsEnable { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Статус шаблона в момент привязки или создания нового шаблона к Job
|
||||
/// </summary>
|
||||
public bool InitUsedTemplateState { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Статус расписания в момент привязки или создания нового шаблона к Job
|
||||
/// </summary>
|
||||
public bool InitUsedScheduleState { get; set; } = false;
|
||||
|
||||
|
||||
[ForeignKey(nameof(JobId))]
|
||||
public Job? Job { get; set; }
|
||||
}
|
||||
}
|
||||
40
PARR.Domain/Entities/JobEntities/JobFieldFilter.cs
Normal file
40
PARR.Domain/Entities/JobEntities/JobFieldFilter.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.Domain.Constants;
|
||||
using PARR.Domain.Entities.Base;
|
||||
using PARR.Domain.Entities.Unit;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.Domain.Entities.JobEntities
|
||||
{
|
||||
[Table("FieldFilters", Schema = DatabaseSchemas.Job)]
|
||||
[Comment("Таблица описания критериев выборки аттрибутов ЭК")]
|
||||
public class JobFieldFilter : IBaseEntity
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public DateTimeOffset DateCreated { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public DateTimeOffset? DateModified { get; set; }
|
||||
|
||||
public Guid UnitFilterId { get; set; }
|
||||
|
||||
public Guid FieldId { get; set; }
|
||||
|
||||
public required string ValueMask { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Отсутствует
|
||||
/// </summary>
|
||||
public bool IsInverse { get; set; } = false;
|
||||
|
||||
|
||||
[ForeignKey(nameof(FieldId))]
|
||||
public UnitField? UnitField { get; set; }
|
||||
|
||||
[ForeignKey(nameof(UnitFilterId))]
|
||||
public JobUnitFilter? UnitFilter { get; set; }
|
||||
}
|
||||
}
|
||||
44
PARR.Domain/Entities/JobEntities/JobRelationshipFilter.cs
Normal file
44
PARR.Domain/Entities/JobEntities/JobRelationshipFilter.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.Domain.Constants;
|
||||
using PARR.Domain.Entities.Unit;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.Domain.Entities.JobEntities
|
||||
{
|
||||
[Table("RelationshipFilters", Schema = DatabaseSchemas.Job)]
|
||||
[Comment("Таблица фильтров связей ЭК")]
|
||||
[PrimaryKey(nameof(UnitFilterId), nameof(FieldId))]
|
||||
public class JobRelationshipFilter
|
||||
{
|
||||
public Guid UnitFilterId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Родительская связь - true,
|
||||
/// Дочерняя связь - false
|
||||
/// </summary>
|
||||
public bool IsParent { get; set; }
|
||||
|
||||
public Guid FieldId { get; set; }
|
||||
|
||||
public required string ValueMask { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Полное совпадение или хотябы одно
|
||||
/// true - list.All()
|
||||
/// false - list.Any()
|
||||
/// </summary>
|
||||
public bool IsFullMatch { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Обратный фильтр, что у связи нет таких значений
|
||||
/// </summary>
|
||||
public bool IsInverse { get; set; }
|
||||
|
||||
[ForeignKey(nameof(UnitFilterId))]
|
||||
public JobUnitFilter? UnitFilter { get; set; }
|
||||
|
||||
|
||||
[ForeignKey(nameof(FieldId))]
|
||||
public UnitField? UnitField { get; set; }
|
||||
}
|
||||
}
|
||||
33
PARR.Domain/Entities/JobEntities/JobUnitFilter.cs
Normal file
33
PARR.Domain/Entities/JobEntities/JobUnitFilter.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.Domain.Constants;
|
||||
using PARR.Domain.Entities.Base;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.Domain.Entities.JobEntities
|
||||
{
|
||||
[Table("UnitFilters", Schema = DatabaseSchemas.Job)]
|
||||
[Comment("Таблица описания критериев выборки ЭК, описание полей в АСУ ЕСПП")]
|
||||
public class JobUnitFilter : IBaseEntity
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public DateTimeOffset DateCreated { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public DateTimeOffset? DateModified { get; set; }
|
||||
|
||||
public required string UnitFilter { get; set; }
|
||||
|
||||
public Guid JobId { get; set; }
|
||||
|
||||
|
||||
[ForeignKey(nameof(JobId))]
|
||||
public Job? Job { get; set; }
|
||||
|
||||
public ICollection<JobFieldFilter> FieldFilters { get; set; } = new HashSet<JobFieldFilter>();
|
||||
|
||||
public ICollection<JobRelationshipFilter> RelationshipFilters { get; set; } = new HashSet<JobRelationshipFilter>();
|
||||
}
|
||||
}
|
||||
29
PARR.Domain/Entities/JobEntities/UnitsInTemplate.cs
Normal file
29
PARR.Domain/Entities/JobEntities/UnitsInTemplate.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.Domain.Constants;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.Domain.Entities.JobEntities
|
||||
{
|
||||
[Table("UnitsInTemplates", Schema = DatabaseSchemas.Job)]
|
||||
[Comment("Таблица связи ЭК в шаблонах")]
|
||||
public class UnitsInTemplate
|
||||
{
|
||||
public Guid TemplateId { get; set; }
|
||||
|
||||
public Guid UnitId { get; set; }
|
||||
|
||||
public DateTimeOffset DateCreated { get; set; }
|
||||
|
||||
public Guid UnitFieldValueId { get; set; }
|
||||
|
||||
[ForeignKey(nameof(TemplateId))]
|
||||
public Template? Template { get; set; }
|
||||
|
||||
[ForeignKey(nameof(UnitId))]
|
||||
public Unit.Unit? Unit { get; set; }
|
||||
|
||||
[ForeignKey(nameof(UnitFieldValueId))]
|
||||
public Unit.UnitFieldValue? UnitFieldValue { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user