refactor(unitFilterService): Этапы фильтрации вынесены в отдельные классы

This commit is contained in:
Mikhail Kuznetsov
2026-06-09 17:46:43 +10:00
parent 6f8d889680
commit 535e87ec21
15 changed files with 773 additions and 792 deletions

View File

@@ -1,6 +1,5 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json.Linq;
using PARR.Core.Common.Interfaces;
using PARR.Core.Repositories.Interfaces.Unit;
using PARR.Domain.Cache;
@@ -121,7 +120,7 @@ namespace PARR.Core.Services.UnitService.Implementations
//await redisCacheService.SetHashFieldAsync(hashKey, unitKey, unit, CacheTtl, true);
dataToCache.Add((hashKey, unitKey, unit));
}
}
if (dataToCache.Count > 0)
await redisCacheService.SetHashFieldsAsync<UnitInfo>(dataToCache, CacheTtl, true);
@@ -174,6 +173,7 @@ namespace PARR.Core.Services.UnitService.Implementations
{
var unit = await unitRepository.Get()
.AsNoTracking()
.AsSplitQuery()
.Select(t => new
{
Id = t.Id,
@@ -193,6 +193,7 @@ namespace PARR.Core.Services.UnitService.Implementations
// Получаем базовую инфу о родственниках
var relativesDictionary = await unitRepository.Get()
.AsNoTracking()
.AsSplitQuery()
.Where(t => relatives.Contains(t.Id))
.Select(t => new UnitInfoBase
{
@@ -240,6 +241,7 @@ namespace PARR.Core.Services.UnitService.Implementations
{
var chunkUnits = await unitRepository.Get()
.AsNoTracking()
.AsSplitQuery()
.Where(t => chank.Contains(t.Id))
.Select(t => new
{
@@ -275,6 +277,7 @@ namespace PARR.Core.Services.UnitService.Implementations
{
var chunkRelatives = await unitRepository.Get()
.AsNoTracking()
.AsSplitQuery()
.Where(t => chunk.Contains(t.Id))
.Select(t => new UnitInfoBase
{