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