feat(templateMatcher): Убрана избыточная проверка связанных юнитов, теперь это выполняется в UnitFilter. Добавлена группировка по рабочей группе или ответственному за ЭК
This commit is contained in:
@@ -738,7 +738,8 @@ namespace PARR.DAL.DomainServices.Shortcodes
|
||||
return NoContent;
|
||||
}
|
||||
|
||||
var cacheKey = $"gr_shcd_{jobGroupId:N}_{unitId:N}_{ComputeHash(fullShortcode)}";
|
||||
//var cacheKey = $"gr_shcd_{jobGroupId:N}_{unitId:N}_{ComputeHash(fullShortcode)}";
|
||||
var cacheKey = cacheService.GetKey(new[] { "grouped", "shortcode", $"{jobGroupId:N}", $"{unitId:N}" }, new[] { fullShortcode });
|
||||
|
||||
var cachedData = await cacheService.GetCachedDataAsync<CachedGroupedShortCode>(cacheKey).ConfigureAwait(false);
|
||||
if (cachedData != null)
|
||||
@@ -872,12 +873,5 @@ namespace PARR.DAL.DomainServices.Shortcodes
|
||||
}
|
||||
return result.ToString();
|
||||
}
|
||||
|
||||
private static string ComputeHash(string input)
|
||||
{
|
||||
using var sha256 = System.Security.Cryptography.SHA256.Create();
|
||||
var hashedBytes = sha256.ComputeHash(System.Text.Encoding.UTF8.GetBytes(input));
|
||||
return Convert.ToBase64String(hashedBytes).Replace('+', '-').Replace('/', '_').Substring(0, 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -566,6 +566,7 @@ internal class UnitFilterService : IUnitFilterService
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Формируем итоговый результат
|
||||
/// </summary>
|
||||
@@ -781,6 +782,7 @@ internal class UnitFilterService : IUnitFilterService
|
||||
return result.ToList();
|
||||
}
|
||||
|
||||
|
||||
#region вспомогательные методы
|
||||
/// <summary>
|
||||
/// Применяет фильтры к связям (родителям или детям)
|
||||
@@ -959,7 +961,6 @@ internal class UnitFilterService : IUnitFilterService
|
||||
}
|
||||
|
||||
|
||||
|
||||
private async Task<List<Guid>> GetUnitIdsFromCacheOrDbAsync(JobUnitFilter filter, CancellationToken cancellationToken = default)
|
||||
{
|
||||
// var cacheKey = cacheService.GetKey(new[] { "uf_ids", filter.UnitFilter }, isUseHash: true);
|
||||
@@ -991,7 +992,6 @@ internal class UnitFilterService : IUnitFilterService
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Обрабатывает маску LIKE для корректной работы с SQL
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user