From ff56ff6fd88d2fc5c153c3f0bf0e5b70613d183e Mon Sep 17 00:00:00 2001 From: Mikhail Kuznetsov Date: Thu, 8 Aug 2024 11:25:35 +1000 Subject: [PATCH] =?UTF-8?q?feat(esppScheduleSync):=20=D0=B4=D0=BE=D0=B1?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE=20=D0=B2=20=D1=81=D0=B8?= =?UTF-8?q?=D0=BD=D1=85=D1=80=D0=BE=D0=BD=D0=B8=D0=B7=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D1=8E=20=D0=BF=D0=BE=D0=BB=D0=B5=20BasisTime=20"=D0=92=D1=80?= =?UTF-8?q?=D0=B5=D0=BC=D1=8F=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BD=D0=B0=D1=80=D1=8F=D0=B4=D0=B0"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs | 5 +++++ PARR.EsppScheduleSync/ScheduleSyncher.cs | 10 +++++++--- PARR.EsppSync/SyncService.cs | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs b/PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs index 9b803478..419906a6 100644 --- a/PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs +++ b/PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs @@ -107,5 +107,10 @@ namespace PARR.EsppScheduleSync.Domain /// Рабочий график /// public string V60calendar { get; set; } = string.Empty; + + /// + /// Время создания наряда (чч:мм:сс) + /// + public string BasisTime { get; set; } } } diff --git a/PARR.EsppScheduleSync/ScheduleSyncher.cs b/PARR.EsppScheduleSync/ScheduleSyncher.cs index a9d66ea4..9e4238d6 100644 --- a/PARR.EsppScheduleSync/ScheduleSyncher.cs +++ b/PARR.EsppScheduleSync/ScheduleSyncher.cs @@ -93,6 +93,7 @@ namespace PARR.EsppScheduleSync TypeV60calendar = settingsFromDb.ScheduleExclude == "Нет исключений" ? "NONE" : "", //Scheduled = EsppScheduleHelpers.GetNextRun(template.NextRun), Scheduled = EsppScheduleHelpers.GetNextRun(nextRunModifierService.GetNextRunByAccountRobotTimeZone(template.NextRun)), + BasisTime = EsppScheduleHelpers.GetGenerationTime(nextRunModifierService.GetNextRunByAccountRobotTimeZone(template.NextRun)), Timezone = settingsFromDb.ScheduleTimezone, //Мы решили, что для всех расписаний "Отсутствует дата завершения", если что-то поменяется, тут нужно переделать TerminationType = settingsFromDb.ScheduleRepeatRange == "Отсутствует дата завершения" ? "forever" : "", @@ -168,6 +169,8 @@ namespace PARR.EsppScheduleSync esppObject.An3 = esppSchedule.Values.First(t => t.Order == 2).Value.EsppExportValue; break; } + + } } @@ -181,9 +184,9 @@ namespace PARR.EsppScheduleSync private EsppObjectSchedule? ParseStrToEsppObject(string str) { var splittedContent = str.Split(globalSettings.ParsingSeparator); - if (splittedContent.Length != 23) + if (splittedContent.Length != 24) { - logger.LogError($"Входная строка после сплита не содержит 23 объекта (факт: {splittedContent.Length})."); + logger.LogError($"Входная строка после сплита не содержит 24 объекта (факт: {splittedContent.Length})."); return null; } @@ -223,7 +226,8 @@ namespace PARR.EsppScheduleSync Timezone = splittedContent[18], TerminationType = splittedContent[19], CompleteAfter = splittedContent[20], - V60calendar = splittedContent[22] + V60calendar = splittedContent[22], + BasisTime = splittedContent[23] }; return ClearOptionalFields(esppObject); diff --git a/PARR.EsppSync/SyncService.cs b/PARR.EsppSync/SyncService.cs index f2ad77dc..f870594b 100644 --- a/PARR.EsppSync/SyncService.cs +++ b/PARR.EsppSync/SyncService.cs @@ -171,7 +171,7 @@ namespace PARR.EsppSync if (dbValueStr != esppValueStr) { - logger.LogDebug($"Не совпадают поля. dbValueStr: {dbValueStr}, esppValueStr: {esppValueStr}"); + logger.LogDebug($"Не совпадают поля({prop.Name}). dbValueStr: {dbValueStr}, esppValueStr: {esppValueStr}"); return true; }