From b0b7bdd1310f9f1052e8461800c6cf0c8aff0d67 Mon Sep 17 00:00:00 2001 From: Mikhail Kuznetsov Date: Thu, 21 Aug 2025 14:51:40 +1000 Subject: [PATCH] =?UTF-8?q?feat(esppTempateSync,esppSync):=20=D0=9D=D0=BE?= =?UTF-8?q?=D1=80=D0=BC=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=BD=D0=B5=D1=81=D0=B5=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=B2=20=D0=BE=D0=B1=D1=89=D0=B8=D0=B9=20=D0=BA=D0=BB=D0=B0?= =?UTF-8?q?=D1=81=D1=81=20esppSync,=20=D1=82=D0=B0=D0=BA=20=D0=BA=D0=B0?= =?UTF-8?q?=D0=BA=20=D0=BF=D0=BE=D1=8F=D0=B2=D0=B8=D0=BB=D0=B8=D1=81=D1=8C?= =?UTF-8?q?=20=D1=88=D0=BE=D1=80=D1=82=D0=BA=D0=BE=D0=B4=D1=8B=20=D0=B8=20?= =?UTF-8?q?=D0=BE=D0=BD=D0=B8=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=B0=D1=82?= =?UTF-8?q?=D1=8B=D0=B2=D0=B0=D1=8E=D1=82=D1=81=D1=8F=20=D0=BF=D0=BE=D1=81?= =?UTF-8?q?=D0=BB=D0=B5=20=D0=BF=D1=80=D0=B5=D0=BE=D0=B1=D1=80=D0=B0=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=B4=D0=B0=D0=BD=D0=BD?= =?UTF-8?q?=D1=8B=D1=85=20=D0=B2=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D1=8C=20?= =?UTF-8?q?IEsppObject?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PARR.EsppSync/SyncService.cs | 19 ++++++++++++++-- PARR.EsppTemplateSync/TemplateMQSyncer.cs | 27 +++++------------------ 2 files changed, 23 insertions(+), 23 deletions(-) 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; - } } }