diff --git a/PARR.EsppSync/SyncService.cs b/PARR.EsppSync/SyncService.cs index 3d38ac66..0c01164d 100644 --- a/PARR.EsppSync/SyncService.cs +++ b/PARR.EsppSync/SyncService.cs @@ -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) { @@ -213,6 +213,21 @@ namespace PARR.EsppSync return false; } + + + /// + /// Удаляет ненужные символы из строки + /// + /// + /// + 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(); + } } + } diff --git a/PARR.EsppTemplateSync/TemplateMQSyncer.cs b/PARR.EsppTemplateSync/TemplateMQSyncer.cs index 7588870f..2d327b14 100644 --- a/PARR.EsppTemplateSync/TemplateMQSyncer.cs +++ b/PARR.EsppTemplateSync/TemplateMQSyncer.cs @@ -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; } - - - /// - /// Удаляет ненужные символы из строки - /// - /// - /// - private string Normalize(string str) - { - str = str.Replace("\r", string.Empty); - str = str.Replace("\n", string.Empty); - str = str.Replace(" ", string.Empty); - - return str; - } } }