feat(templateMatcher): Убрана избыточная проверка связанных юнитов, теперь это выполняется в UnitFilter. Добавлена группировка по рабочей группе или ответственному за ЭК

This commit is contained in:
Mikhail Kuznetsov
2026-03-26 18:08:13 +10:00
parent 4864b9b343
commit 73d7f4b200
7 changed files with 368 additions and 429 deletions

View File

@@ -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);
}
}
}