fix(esppTemplateSyncer): добавлен Id Group для правильного формирования группированных значений %МАКС:...%
This commit is contained in:
@@ -365,6 +365,18 @@ namespace PARR.DAL.DomainServices.Shortcodes
|
||||
|
||||
private async Task<string> ReplaceMaxShortcodesAsync(Guid jobGroupId, Guid unitId, string input, MatchCollection maxShortcodes)
|
||||
{
|
||||
if (jobGroupId == Guid.Empty)
|
||||
{
|
||||
logger.LogWarning("jobGroupId не задан. Пропускаем обработку %МАКС:...%");
|
||||
return input;
|
||||
}
|
||||
|
||||
if (unitId == Guid.Empty)
|
||||
{
|
||||
logger.LogWarning("unitId не задан. Пропускаем обработку %МАКС:...%");
|
||||
return input;
|
||||
}
|
||||
|
||||
var shortcodeToMatches = maxShortcodes
|
||||
.Cast<Match>()
|
||||
.GroupBy(m => m.Value, StringComparer.OrdinalIgnoreCase)
|
||||
@@ -390,6 +402,18 @@ namespace PARR.DAL.DomainServices.Shortcodes
|
||||
|
||||
private async Task<string> GetMaxShortCodeFromCacheOrDbAsync(Guid jobGroupId, Guid unitId, string fullShortcode, string fieldName)
|
||||
{
|
||||
if (jobGroupId == Guid.Empty)
|
||||
{
|
||||
logger.LogWarning("jobGroupId не задан. Пропускаем обработку шорткода {Shortcode}", fullShortcode);
|
||||
return "Нет данных";
|
||||
}
|
||||
|
||||
if (unitId == Guid.Empty)
|
||||
{
|
||||
logger.LogWarning("unitId не задан. Пропускаем обработку шорткода {Shortcode}", fullShortcode);
|
||||
return "Нет данных";
|
||||
}
|
||||
|
||||
var cacheKey = $"gr_shcd_{jobGroupId:N}_{unitId:N}_{ComputeHash(fullShortcode)}";
|
||||
|
||||
var cachedData = await cacheService.GetCachedDataAsync<CachedGroupedShortCode>(cacheKey);
|
||||
|
||||
Reference in New Issue
Block a user