fix(dal): из таблицы JobGroup удалено поле IsUmbrella
This commit is contained in:
@@ -78,7 +78,7 @@ namespace PARR.API.Controllers.V1
|
|||||||
{
|
{
|
||||||
query = query
|
query = query
|
||||||
.Include(t => t.Tnk)
|
.Include(t => t.Tnk)
|
||||||
.Include(t => t.Group).ThenInclude(t=>t.GroupType);
|
.Include(t => t.Group).ThenInclude(t => t.GroupType);
|
||||||
|
|
||||||
query = query
|
query = query
|
||||||
.Include(t => t.UnitFilters)
|
.Include(t => t.UnitFilters)
|
||||||
@@ -117,7 +117,7 @@ namespace PARR.API.Controllers.V1
|
|||||||
{
|
{
|
||||||
var job = await jobService.Get()
|
var job = await jobService.Get()
|
||||||
.Include(t => t.Tnk)
|
.Include(t => t.Tnk)
|
||||||
.Include(t => t.Group).ThenInclude(t=>t.GroupType)
|
.Include(t => t.Group).ThenInclude(t => t.GroupType)
|
||||||
.Include(t => t.UnitFilters)
|
.Include(t => t.UnitFilters)
|
||||||
.ThenInclude(t => t.FieldFilters)
|
.ThenInclude(t => t.FieldFilters)
|
||||||
.ThenInclude(t => t.UnitField)
|
.ThenInclude(t => t.UnitField)
|
||||||
@@ -158,12 +158,15 @@ namespace PARR.API.Controllers.V1
|
|||||||
|
|
||||||
#region Проверка существования работы с такими же параметрами
|
#region Проверка существования работы с такими же параметрами
|
||||||
var isExistTheSameLinks = await jobService.Get()
|
var isExistTheSameLinks = await jobService.Get()
|
||||||
|
.Include(t => t.Group).ThenInclude(t => t.GroupType)
|
||||||
.CountAsync(t =>
|
.CountAsync(t =>
|
||||||
t.Group!.IsUmbrella == true &&
|
//t.Group!.IsUmbrella == true &&
|
||||||
|
t.Group!.GroupType!.Code == JobGroupTypesEnum.Umbrella &&
|
||||||
t.GroupId == request.GroupId &&
|
t.GroupId == request.GroupId &&
|
||||||
(t.MinValueRelationships == request.MinValueRelationships ||
|
(t.MinValueRelationships == request.MinValueRelationships ||
|
||||||
t.MaxValueRelationships == request.MaxValueRelationships)
|
t.MaxValueRelationships == request.MaxValueRelationships)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isExistTheSameLinks > 0)
|
if (isExistTheSameLinks > 0)
|
||||||
return BadRequest(new Response(false, new List<ErrorModel> { new ErrorModel { FieldName = nameof(request.Name), Message = $"Работа с указанным диапазоном связей пересекается с уже имеющейся в базе данных({request.MinValueRelationships}-{request.MaxValueRelationships})" } }));
|
return BadRequest(new Response(false, new List<ErrorModel> { new ErrorModel { FieldName = nameof(request.Name), Message = $"Работа с указанным диапазоном связей пересекается с уже имеющейся в базе данных({request.MinValueRelationships}-{request.MaxValueRelationships})" } }));
|
||||||
#endregion
|
#endregion
|
||||||
@@ -178,7 +181,7 @@ namespace PARR.API.Controllers.V1
|
|||||||
|
|
||||||
var createdJob = await jobService.Get()
|
var createdJob = await jobService.Get()
|
||||||
.Include(t => t.Tnk)
|
.Include(t => t.Tnk)
|
||||||
.Include(t => t.Group).ThenInclude(t=>t.GroupType)
|
.Include(t => t.Group).ThenInclude(t => t.GroupType)
|
||||||
.Include(t => t.UnitFilters)
|
.Include(t => t.UnitFilters)
|
||||||
.ThenInclude(t => t.FieldFilters)
|
.ThenInclude(t => t.FieldFilters)
|
||||||
.ThenInclude(t => t.UnitField)
|
.ThenInclude(t => t.UnitField)
|
||||||
@@ -211,7 +214,7 @@ namespace PARR.API.Controllers.V1
|
|||||||
|
|
||||||
var orig = await jobService.Get()
|
var orig = await jobService.Get()
|
||||||
.Include(t => t.Tnk)
|
.Include(t => t.Tnk)
|
||||||
.Include(t => t.Group).ThenInclude(t=>t.GroupType)
|
.Include(t => t.Group).ThenInclude(t => t.GroupType)
|
||||||
.Include(t => t.UnitFilters)
|
.Include(t => t.UnitFilters)
|
||||||
.ThenInclude(t => t.FieldFilters)
|
.ThenInclude(t => t.FieldFilters)
|
||||||
.Include(t => t.UnitFilters)
|
.Include(t => t.UnitFilters)
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ namespace PARR.API.Controllers.V1
|
|||||||
return BadRequest(new Response(false, new List<ErrorModel> { new ErrorModel { Message = "Ошибка при изменении группы заданий на выполнение работ." } }));
|
return BadRequest(new Response(false, new List<ErrorModel> { new ErrorModel { Message = "Ошибка при изменении группы заданий на выполнение работ." } }));
|
||||||
|
|
||||||
logger.LogInformation($"Пользователь {User.Identity?.Name} обновил группу заданий на выполнение работ: {orig.Id}," +
|
logger.LogInformation($"Пользователь {User.Identity?.Name} обновил группу заданий на выполнение работ: {orig.Id}," +
|
||||||
$" {orig.GroupName}, {orig.IsUmbrella}, {orig.ShortDescription}, {orig.FullDescription}," +
|
$" {orig.GroupName}, {orig.ShortDescription}, {orig.FullDescription}," +
|
||||||
$" {orig.Solution}, {orig.TemplateDuration}, {orig.ReferenceDate}, {orig.IsAutoDistributionEnabled}" +
|
$" {orig.Solution}, {orig.TemplateDuration}, {orig.ReferenceDate}, {orig.IsAutoDistributionEnabled}" +
|
||||||
$", {orig.IsAgent}, {orig.AgentName}, {orig.AgentTimeOutSec}, {orig.AgentScript}");
|
$", {orig.IsAgent}, {orig.AgentName}, {orig.AgentTimeOutSec}, {orig.AgentScript}");
|
||||||
|
|
||||||
@@ -299,10 +299,10 @@ namespace PARR.API.Controllers.V1
|
|||||||
} }));
|
} }));
|
||||||
|
|
||||||
logger.LogInformation($"Пользователь {User.Identity?.Name} удалил группу заданий на выполнение работ: {jobGroup.Id},{jobGroup.GroupName}," +
|
logger.LogInformation($"Пользователь {User.Identity?.Name} удалил группу заданий на выполнение работ: {jobGroup.Id},{jobGroup.GroupName}," +
|
||||||
$" {jobGroup.IsUmbrella}, {jobGroup.ShortDescription}, {jobGroup.FullDescription}," +
|
$" {jobGroup.ShortDescription}, {jobGroup.FullDescription}," +
|
||||||
$" {jobGroup.Solution}, {jobGroup.TemplateDuration}, {jobGroup.ReferenceDate}" +
|
$" {jobGroup.Solution}, {jobGroup.TemplateDuration}, {jobGroup.ReferenceDate}," +
|
||||||
$"{jobGroup.IsAutoDistributionEnabled}, {jobGroup.IsAgent}, {jobGroup.AgentName}" +
|
$" {jobGroup.IsAutoDistributionEnabled}, {jobGroup.IsAgent}, {jobGroup.AgentName}," +
|
||||||
$"{jobGroup.AgentTimeOutSec}, {jobGroup.AgentScript}");
|
$" {jobGroup.AgentTimeOutSec}, {jobGroup.AgentScript}");
|
||||||
|
|
||||||
return NoContent();
|
return NoContent();
|
||||||
}
|
}
|
||||||
|
|||||||
3964
PARR.DAL/Migrations/20251125022359_tblGroupRemoveIsUmbrella.Designer.cs
generated
Normal file
3964
PARR.DAL/Migrations/20251125022359_tblGroupRemoveIsUmbrella.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace PARR.DAL.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class tblGroupRemoveIsUmbrella : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "IsUmbrella",
|
||||||
|
schema: "job",
|
||||||
|
table: "Groups");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "IsUmbrella",
|
||||||
|
schema: "job",
|
||||||
|
table: "Groups",
|
||||||
|
type: "boolean",
|
||||||
|
nullable: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1669,9 +1669,6 @@ namespace PARR.DAL.Migrations
|
|||||||
b.Property<bool>("IsAutoDistributionEnabled")
|
b.Property<bool>("IsAutoDistributionEnabled")
|
||||||
.HasColumnType("boolean");
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
b.Property<bool?>("IsUmbrella")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("ReferenceDate")
|
b.Property<DateTimeOffset>("ReferenceDate")
|
||||||
.HasColumnType("timestamp with time zone");
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ namespace PARR.DAL.Models.Job
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public required string GroupName { get; set; }
|
public required string GroupName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// Связана ли работа с групповыми ЭК(зонтами)
|
///// Связана ли работа с групповыми ЭК(зонтами)
|
||||||
/// </summary>
|
///// </summary>
|
||||||
public bool? IsUmbrella { get; set; }
|
//public bool? IsUmbrella { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Поле Короткое описания шаблона АСУ ЕСПП
|
/// Поле Короткое описания шаблона АСУ ЕСПП
|
||||||
@@ -89,6 +89,7 @@ namespace PARR.DAL.Models.Job
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTimeOffset ReferenceDate { get; set; }
|
public DateTimeOffset ReferenceDate { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Включить автораспределение
|
/// Включить автораспределение
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user