feat(dal): создана таблица GroupDistributionConfigs
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using PARR.Constants;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models.Base;
|
||||
using PARR.DAL.Models.Job;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
@@ -8,7 +10,7 @@ namespace PARR.DAL.Models
|
||||
/// <summary>
|
||||
/// Период автоматического распеделения РР
|
||||
/// </summary>
|
||||
[Table("DistributionPeriods")]
|
||||
[Table("DistributionPeriods", Schema = DataContextSettings.Schedule)]
|
||||
public class DistributionPeriod : IBase
|
||||
{
|
||||
[Key]
|
||||
@@ -58,7 +60,9 @@ namespace PARR.DAL.Models
|
||||
[ForeignKey(nameof(Type))]
|
||||
public DistributionPeriodType? DistributionPeriodType { get; set; }
|
||||
|
||||
public ICollection<EsppSchTypeValue> EsppSchTypeValues { get; set; } = new HashSet<EsppSchTypeValue>();
|
||||
public ICollection<JobGroupDistributionConfig> GroupDistributionConfig { get; set; } = new HashSet<JobGroupDistributionConfig>();
|
||||
|
||||
//public ICollection<EsppSchTypeValue> EsppSchTypeValues { get; set; } = new HashSet<EsppSchTypeValue>();
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using PARR.DAL.Context;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.DAL.Models
|
||||
{
|
||||
[Table("DistributionPeriodTypes")]
|
||||
[Table("DistributionPeriodTypes", Schema = DataContextSettings.Schedule)]
|
||||
public class DistributionPeriodType
|
||||
{
|
||||
[Key]
|
||||
|
||||
@@ -37,14 +37,14 @@ namespace PARR.DAL.Models
|
||||
public int Order { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Если есть связь с периодом, то есть функция автораспределения
|
||||
/// </summary>
|
||||
public Guid? DistributionPeriodId { get; set; }
|
||||
///// <summary>
|
||||
///// Если есть связь с периодом, то есть функция автораспределения
|
||||
///// </summary>
|
||||
//public Guid? DistributionPeriodId { get; set; }
|
||||
|
||||
|
||||
[ForeignKey(nameof(DistributionPeriodId))]
|
||||
public DistributionPeriod? DistributionPeriod { get; set; }
|
||||
//[ForeignKey(nameof(DistributionPeriodId))]
|
||||
//public DistributionPeriod? DistributionPeriod { get; set; }
|
||||
|
||||
|
||||
[ForeignKey(nameof(TypeId))]
|
||||
|
||||
@@ -160,5 +160,7 @@ namespace PARR.DAL.Models.Job
|
||||
|
||||
[ForeignKey(nameof(ScheduleExcludeTypeCalendarId))]
|
||||
public ScheduleExcludeTypeCalendar? ScheduleExcludeTypeCalendar { get; set; }
|
||||
|
||||
public JobGroupDistributionConfig? DistributionConfig { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
36
PARR.DAL/Models/Job/JobGroupDistributionConfig.cs
Normal file
36
PARR.DAL/Models/Job/JobGroupDistributionConfig.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.DAL.Context;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.DAL.Models.Job
|
||||
{
|
||||
/// <summary>
|
||||
/// Настройки автораспределения для JobGroup
|
||||
/// </summary>
|
||||
[Table("GroupDistributionConfigs", Schema = DataContextSettings.Job)]
|
||||
[Comment("Настройки автораспределения для группы работ")]
|
||||
public class JobGroupDistributionConfig
|
||||
{
|
||||
[Key]
|
||||
public Guid GroupId { get; set; }
|
||||
|
||||
public Guid DistributionPeriodId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Исключать выходные и праздничные дни
|
||||
/// </summary>
|
||||
public bool IsExcludeWeekends { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Группировать по рабочей группе
|
||||
/// </summary>
|
||||
public bool IsGroupingByWorkGroup { get; set; }
|
||||
|
||||
[ForeignKey(nameof(GroupId))]
|
||||
public JobGroup? Group { get; set; }
|
||||
|
||||
[ForeignKey(nameof(DistributionPeriodId))]
|
||||
public DistributionPeriod? DistributionPeriod { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models.Base;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.DAL.Models
|
||||
{
|
||||
[Table("WeekendDays")]
|
||||
[Table("WeekendDays", Schema = DataContextSettings.Schedule)]
|
||||
[Index(nameof(Date), IsUnique = true)]
|
||||
public class WeekendDay : IBase
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user