fix(dal): в UnitFilter исправлена ошибка когда один ЭК попадал в несколько работ одной группы работ типа зонтик.

This commit is contained in:
Mikhail Kuznetsov
2026-02-19 17:28:12 +10:00
parent 6def0f200d
commit d056f8b0c9
11 changed files with 682 additions and 747 deletions

View File

@@ -0,0 +1,18 @@
using PARR.DAL.Cache.Models.Base;
namespace PARR.DAL.Cache.Models
{
public class UnitFilterIds : IBaseCache<UnitFilterIdsDto>
{
public required UnitFilterIdsDto Data { get; set; }
public DateTimeOffset Timestamp { get; set; }
public required string Source { get; set; }
}
public class UnitFilterIdsDto
{
public List<Guid> UnitIds { get; set; } = new();
}
}

View File

@@ -1,5 +1,4 @@
using Microsoft.Extensions.Caching.Distributed;
using PARR.DAL.Migrations;
using System.Text.Json;
namespace PARR.DAL.Cache.Services.Base

View File

@@ -11,9 +11,9 @@ namespace PARR.DAL.DomainServices.UnitFilterService
/// <param name="jobId">ID Job</param>
/// <param name="takeCount">Максимальное количество Unit'ов (опционально)</param>
/// <returns>Список ID Unit'ов или null, если Job не найден</returns>
Task<IEnumerable<Guid>?> GetUnitsIdByJobFilterAsync(
Guid jobId,
int? takeCount = null);
//Task<IEnumerable<Guid>?> GetUnitsIdByJobFilterAsync(
// Guid jobId,
// int? takeCount = null);
/// <summary>
/// Получает список ID Unit'ов, соответствующих фильтрам Job.

View File

@@ -0,0 +1,9 @@
namespace PARR.DAL.DomainServices.UnitFilterService.Models
{
internal class FilteredUnitContext
{
public Guid UnitId { get; set; }
public HashSet<Guid> ValidParentIds { get; set; } = new();
public HashSet<Guid> ValidChildIds { get; set; } = new();
}
}

View File

@@ -30,4 +30,4 @@
/// </summary>
public List<RelatedUnitDto> Children { get; set; } = new();
}
}
}

View File

@@ -0,0 +1,7 @@
namespace PARR.DAL.DomainServices.UnitFilterService.Models
{
internal class UnitFilterServiceOptions
{
public int LoadBatchSize { get; set; } = 1000;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -9,6 +9,7 @@ using PARR.DAL.DomainServices.Implementations;
using PARR.DAL.DomainServices.Interfaces;
using PARR.DAL.DomainServices.Shortcodes;
using PARR.DAL.DomainServices.UnitFilterService;
using PARR.DAL.DomainServices.UnitFilterService.Models;
using PARR.DAL.InfluxDbServices;
using PARR.DAL.NextRunServices;
using PARR.DAL.NextRunServices.Subservices;
@@ -22,7 +23,6 @@ using PARR.DAL.Services.Interfaces.Job;
using PARR.DAL.Services.Interfaces.Schedule;
using PARR.DAL.Services.Interfaces.Unit;
using PARR.DAL.Settings;
using PARR.DAL.TransformServices;
namespace PARR.DAL
{
@@ -149,6 +149,8 @@ namespace PARR.DAL
services.AddTransient<IShortcodesService, ShortcodesService>();
services.AddTransient<IUnitFilterService, UnitFilterService>();
services.AddTransient<IMatchingStatusService, MatchingStatusService>();
services.AddSingleton(new UnitFilterServiceOptions { LoadBatchSize = 1000 });
#endregion