fix(dal): из таблицы JobGroup удалено поле IsUmbrella

This commit is contained in:
Mikhail Trubnikov
2025-11-25 12:26:24 +10:00
parent 1aabd3a844
commit ce12f1b5fe
6 changed files with 4013 additions and 18 deletions

View File

@@ -78,7 +78,7 @@ namespace PARR.API.Controllers.V1
{
query = query
.Include(t => t.Tnk)
.Include(t => t.Group).ThenInclude(t=>t.GroupType);
.Include(t => t.Group).ThenInclude(t => t.GroupType);
query = query
.Include(t => t.UnitFilters)
@@ -117,7 +117,7 @@ namespace PARR.API.Controllers.V1
{
var job = await jobService.Get()
.Include(t => t.Tnk)
.Include(t => t.Group).ThenInclude(t=>t.GroupType)
.Include(t => t.Group).ThenInclude(t => t.GroupType)
.Include(t => t.UnitFilters)
.ThenInclude(t => t.FieldFilters)
.ThenInclude(t => t.UnitField)
@@ -158,12 +158,15 @@ namespace PARR.API.Controllers.V1
#region Проверка существования работы с такими же параметрами
var isExistTheSameLinks = await jobService.Get()
.Include(t => t.Group).ThenInclude(t => t.GroupType)
.CountAsync(t =>
t.Group!.IsUmbrella == true &&
//t.Group!.IsUmbrella == true &&
t.Group!.GroupType!.Code == JobGroupTypesEnum.Umbrella &&
t.GroupId == request.GroupId &&
(t.MinValueRelationships == request.MinValueRelationships ||
t.MaxValueRelationships == request.MaxValueRelationships)
);
);
if (isExistTheSameLinks > 0)
return BadRequest(new Response(false, new List<ErrorModel> { new ErrorModel { FieldName = nameof(request.Name), Message = $"Работа с указанным диапазоном связей пересекается с уже имеющейся в базе данных({request.MinValueRelationships}-{request.MaxValueRelationships})" } }));
#endregion
@@ -178,7 +181,7 @@ namespace PARR.API.Controllers.V1
var createdJob = await jobService.Get()
.Include(t => t.Tnk)
.Include(t => t.Group).ThenInclude(t=>t.GroupType)
.Include(t => t.Group).ThenInclude(t => t.GroupType)
.Include(t => t.UnitFilters)
.ThenInclude(t => t.FieldFilters)
.ThenInclude(t => t.UnitField)
@@ -211,7 +214,7 @@ namespace PARR.API.Controllers.V1
var orig = await jobService.Get()
.Include(t => t.Tnk)
.Include(t => t.Group).ThenInclude(t=>t.GroupType)
.Include(t => t.Group).ThenInclude(t => t.GroupType)
.Include(t => t.UnitFilters)
.ThenInclude(t => t.FieldFilters)
.Include(t => t.UnitFilters)