feat(api,core,dal): Группы работ - управление автокнотролем

This commit is contained in:
Mikhail Trubnikov
2026-06-18 16:39:35 +10:00
parent 108eb05853
commit 8151ea89b9
18 changed files with 4326 additions and 186 deletions

View File

@@ -179,9 +179,9 @@ namespace PARR.DAL.Context
modelBuilder.Entity<JobGroupType>(f =>
{
f.HasData(
new() { Id = new Guid("4FA62E79-86BB-47C2-BE1A-72A716A170FA"), DateCreated = dateCreated, DateModified = null, Name = JobGroupTypesEnum.Simple.ToString(), Code = JobGroupTypesEnum.Simple, Description = "Обычный", IsAllowJobUnitFilter = true, IsJobGroupAutoControl = false },
new() { Id = new Guid("6EC58B1A-5C40-47B9-B036-4FA490E8D503"), DateCreated = dateCreated, DateModified = null, Name = JobGroupTypesEnum.Umbrella.ToString(), Code = JobGroupTypesEnum.Umbrella, Description = "Зонтик", IsAllowJobUnitFilter = false, IsJobGroupAutoControl = true },
new() { Id = new Guid("318625E5-F833-436A-99DF-2A382A1E71C7"), DateCreated = dateCreated, DateModified = null, Name = JobGroupTypesEnum.Group.ToString(), Code = JobGroupTypesEnum.Group, Description = "Сгруппированный", IsAllowJobUnitFilter = false, IsJobGroupAutoControl = true }
new() { Id = new Guid("4FA62E79-86BB-47C2-BE1A-72A716A170FA"), DateCreated = dateCreated, DateModified = null, Name = JobGroupTypesEnum.Simple.ToString(), Code = JobGroupTypesEnum.Simple, Description = "Обычный", IsAllowJobUnitFilter = true, IsJobGroupAutoControl = false, IsRelationshipsAllowed = false },
new() { Id = new Guid("6EC58B1A-5C40-47B9-B036-4FA490E8D503"), DateCreated = dateCreated, DateModified = null, Name = JobGroupTypesEnum.Umbrella.ToString(), Code = JobGroupTypesEnum.Umbrella, Description = "Зонтик", IsAllowJobUnitFilter = false, IsJobGroupAutoControl = true, IsRelationshipsAllowed = true },
new() { Id = new Guid("318625E5-F833-436A-99DF-2A382A1E71C7"), DateCreated = dateCreated, DateModified = null, Name = JobGroupTypesEnum.Group.ToString(), Code = JobGroupTypesEnum.Group, Description = "Сгруппированный", IsAllowJobUnitFilter = false, IsJobGroupAutoControl = true, IsRelationshipsAllowed = true }
);
});
#endregion

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,57 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PARR.DAL.Migrations
{
/// <inheritdoc />
public partial class tblGroupTypesAddRelationshipsSettings : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsRelationshipsAllowed",
schema: "jobGroup",
table: "GroupTypes",
type: "boolean",
nullable: false,
defaultValue: false,
comment: "Разрешена настройка кол-ва связей");
migrationBuilder.UpdateData(
schema: "jobGroup",
table: "GroupTypes",
keyColumn: "Id",
keyValue: new Guid("318625e5-f833-436a-99df-2a382a1e71c7"),
column: "IsRelationshipsAllowed",
value: true);
migrationBuilder.UpdateData(
schema: "jobGroup",
table: "GroupTypes",
keyColumn: "Id",
keyValue: new Guid("4fa62e79-86bb-47c2-be1a-72a716a170fa"),
column: "IsRelationshipsAllowed",
value: false);
migrationBuilder.UpdateData(
schema: "jobGroup",
table: "GroupTypes",
keyColumn: "Id",
keyValue: new Guid("6ec58b1a-5c40-47b9-b036-4fa490e8d503"),
column: "IsRelationshipsAllowed",
value: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsRelationshipsAllowed",
schema: "jobGroup",
table: "GroupTypes");
}
}
}

View File

@@ -599,6 +599,10 @@ namespace PARR.DAL.Migrations
.HasColumnType("boolean")
.HasComment("Автоконтролем управляет JobGroup? true - да JobGroup, false - Job. Влияет на интерфейс и на логику работы автоконтроля.");
b.Property<bool>("IsRelationshipsAllowed")
.HasColumnType("boolean")
.HasComment("Разрешена настройка кол-ва связей");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
@@ -619,6 +623,7 @@ namespace PARR.DAL.Migrations
Description = "Обычный",
IsAllowJobUnitFilter = true,
IsJobGroupAutoControl = false,
IsRelationshipsAllowed = false,
Name = "Simple"
},
new
@@ -629,6 +634,7 @@ namespace PARR.DAL.Migrations
Description = "Зонтик",
IsAllowJobUnitFilter = false,
IsJobGroupAutoControl = true,
IsRelationshipsAllowed = true,
Name = "Umbrella"
},
new
@@ -639,6 +645,7 @@ namespace PARR.DAL.Migrations
Description = "Сгруппированный",
IsAllowJobUnitFilter = false,
IsJobGroupAutoControl = true,
IsRelationshipsAllowed = true,
Name = "Group"
});
});

View File

@@ -17,5 +17,10 @@ namespace PARR.DAL.Repositories.Job
{
return dataContext.JobAutoControls;
}
public void RemoveRange(List<JobAutoControl> autoControlList)
{
dataContext.JobAutoControls.RemoveRange(autoControlList);
}
}
}