feat(esppTempateSync,esppSync): Нормализация перенесена в общий класс esppSync, так как появились шорткоды и они обрабатываются после преобразования данных в модель IEsppObject
This commit is contained in:
@@ -200,8 +200,8 @@ namespace PARR.EsppSync
|
||||
continue;
|
||||
|
||||
//Replace("\r","").Replace("\n","") - в подробном описании могут быть переносы строк, в Rabbit прилетает без переносов. Убираем переносы для стравнения
|
||||
var dbValueStr = dbValue!.ToString()!.ToLower().Replace("\r", "").Replace("\n", "");
|
||||
var esppValueStr = esppValue!.ToString()!.ToLower();
|
||||
var dbValueStr = Normalize(dbValue!.ToString()!);
|
||||
var esppValueStr = Normalize(esppValue!.ToString()!);
|
||||
|
||||
if (dbValueStr != esppValueStr)
|
||||
{
|
||||
@@ -214,5 +214,20 @@ namespace PARR.EsppSync
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Удаляет ненужные символы из строки
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <returns></returns>
|
||||
private string Normalize(string str)
|
||||
{
|
||||
str = str.Replace("\r", string.Empty);
|
||||
str = str.Replace("\n", string.Empty);
|
||||
str = str.Replace(" ", string.Empty);
|
||||
|
||||
return str.ToLower();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -89,14 +89,14 @@ namespace PARR.EsppTemplateSync
|
||||
//WorkGroup = template.Host!.WorkGroup!,
|
||||
WorkGroup = template.Unit!.BaseFields!.WorkGroup!,
|
||||
//ShortDescription = Normalize(template.Job.Group.ShortDescription.ApplyShortcode(Constants.Shortcodes.ShortcodeEnum.EK,template.Unit.Name)),
|
||||
ShortDescription = Normalize(template.Job!.Group!.ShortDescription),//TODO Вынести в переменную
|
||||
ShortDescription = template.Job!.Group!.ShortDescription,//TODO Вынести в переменную
|
||||
//ResponseArea = template.Host!.ResponseArea!.Name,
|
||||
//ЗО берем РГ а не хоста
|
||||
ResponseArea = template.Unit.BaseFields.ResponseArea!,
|
||||
Duration = template.Job.Group.TemplateDuration,
|
||||
EK = template.Unit.Name,
|
||||
FullDescription = Normalize(template.Job.Group.FullDescription),
|
||||
Solution = Normalize(template.Job.Group.Solution),
|
||||
FullDescription = template.Job.Group.FullDescription,
|
||||
Solution = template.Job.Group.Solution,
|
||||
Process = template.Job.Tnk!.Subprocess!.Process!.Name,
|
||||
SubProcess = template.Job.Tnk.Subprocess.Name,
|
||||
//TNK = template.Job.Tnk.Name.ApplyShortcode(Constants.Shortcodes.ShortcodeEnum.EK, template.Unit.Name),
|
||||
@@ -158,15 +158,15 @@ namespace PARR.EsppTemplateSync
|
||||
TemplateName = templateName,
|
||||
IsActive = isActive,
|
||||
WorkGroup = workGroup,
|
||||
ShortDescription = Normalize(shortDescription),
|
||||
ShortDescription = shortDescription,
|
||||
//Category = category,
|
||||
ResponseArea = responseArea,
|
||||
Duration = duration,
|
||||
EK = ek,
|
||||
Initiator = initiator,
|
||||
FullDescription = Normalize(fullDescription),
|
||||
FullDescription = fullDescription,
|
||||
//ClosingCode = closingCode,
|
||||
Solution = Normalize(solution),
|
||||
Solution = solution,
|
||||
Process = process,
|
||||
SubProcess = subProcess,
|
||||
TNK = tnk,
|
||||
@@ -176,21 +176,6 @@ namespace PARR.EsppTemplateSync
|
||||
|
||||
return templateFromEspp;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Удаляет ненужные символы из строки
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <returns></returns>
|
||||
private string Normalize(string str)
|
||||
{
|
||||
str = str.Replace("\r", string.Empty);
|
||||
str = str.Replace("\n", string.Empty);
|
||||
str = str.Replace(" ", string.Empty);
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user