From fffdb134c620398d3a182d42530e85ac52a2bd3b Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Wed, 22 Nov 2023 11:37:22 +1000 Subject: [PATCH 1/7] =?UTF-8?q?feat(EsppSync):=20=D0=BE=D0=B1=D1=89=D0=B0?= =?UTF-8?q?=D1=8F=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA=D0=B0=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D1=81=D0=B8=D0=BD=D1=85=D1=80=D0=BE=D0=BD=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D0=B8=20=D1=88=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=20=D0=B8=20=D1=80=D0=B0=D1=81=D0=BF=D0=B8=D1=81?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PARR.API.sln | 8 +- PARR.EsppSync/IEsppObject.cs | 7 + PARR.EsppSync/ISyncService.cs | 26 ++++ PARR.EsppSync/PARR.EsppSync.csproj | 17 +++ PARR.EsppSync/SyncService.cs | 140 ++++++++++++++++++ PARR.EsppTemplateSync/Services/Manager.cs | 10 +- .../Services/ParserService.cs | 4 +- README.md | 1 + 8 files changed, 206 insertions(+), 7 deletions(-) create mode 100644 PARR.EsppSync/IEsppObject.cs create mode 100644 PARR.EsppSync/ISyncService.cs create mode 100644 PARR.EsppSync/PARR.EsppSync.csproj create mode 100644 PARR.EsppSync/SyncService.cs diff --git a/PARR.API.sln b/PARR.API.sln index 547d9e78..2abc5c3e 100644 --- a/PARR.API.sln +++ b/PARR.API.sln @@ -51,7 +51,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PARR.EsppApi", "PARR.EsppAp EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PARR.Test", "PARR.Test\PARR.Test.csproj", "{CFE2A198-67BF-4828-8E8D-31A01858FDA7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PARR.Constants", "PARR.Constants\PARR.Constants.csproj", "{46B09885-C9FB-449C-ACAA-24C671194C4D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PARR.Constants", "PARR.Constants\PARR.Constants.csproj", "{46B09885-C9FB-449C-ACAA-24C671194C4D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PARR.EsppSync", "PARR.EsppSync\PARR.EsppSync.csproj", "{71121EF7-D4C1-43A4-9243-EF5C4C82030F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -141,6 +143,10 @@ Global {46B09885-C9FB-449C-ACAA-24C671194C4D}.Debug|Any CPU.Build.0 = Debug|Any CPU {46B09885-C9FB-449C-ACAA-24C671194C4D}.Release|Any CPU.ActiveCfg = Release|Any CPU {46B09885-C9FB-449C-ACAA-24C671194C4D}.Release|Any CPU.Build.0 = Release|Any CPU + {71121EF7-D4C1-43A4-9243-EF5C4C82030F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {71121EF7-D4C1-43A4-9243-EF5C4C82030F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {71121EF7-D4C1-43A4-9243-EF5C4C82030F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {71121EF7-D4C1-43A4-9243-EF5C4C82030F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/PARR.EsppSync/IEsppObject.cs b/PARR.EsppSync/IEsppObject.cs new file mode 100644 index 00000000..c1f410fc --- /dev/null +++ b/PARR.EsppSync/IEsppObject.cs @@ -0,0 +1,7 @@ +namespace PARR.EsppSync +{ + public interface IEsppObject + { + public string TemplateName { get; set; } + } +} diff --git a/PARR.EsppSync/ISyncService.cs b/PARR.EsppSync/ISyncService.cs new file mode 100644 index 00000000..f8a092a7 --- /dev/null +++ b/PARR.EsppSync/ISyncService.cs @@ -0,0 +1,26 @@ +using PARR.DAL.Contracts; +using PARR.DAL.Models; + +namespace PARR.EsppSync +{ + /// + /// Делегат парсинга из строки в модель EsppObject + /// + /// + /// + /// + public delegate EsppObject ParserHandlerDelegate(string str) where EsppObject : class, IEsppObject; + + /// + /// Конвертирует Template в модель для сравнения + /// + /// + /// + /// + public delegate EsppObject ConvertDbObjToComparisonObjHandlerDelegate(Template template) where EsppObject : class, IEsppObject; + + public interface ISyncService where EsppObject : class, IEsppObject + { + Task SyncEsppObjectAsync(string str, ParserHandlerDelegate parser, ConvertDbObjToComparisonObjHandlerDelegate converterToEsppObject, RobotsEnum robot); + } +} \ No newline at end of file diff --git a/PARR.EsppSync/PARR.EsppSync.csproj b/PARR.EsppSync/PARR.EsppSync.csproj new file mode 100644 index 00000000..52abd3ef --- /dev/null +++ b/PARR.EsppSync/PARR.EsppSync.csproj @@ -0,0 +1,17 @@ + + + + net7.0 + enable + enable + + + + + + + + + + + diff --git a/PARR.EsppSync/SyncService.cs b/PARR.EsppSync/SyncService.cs new file mode 100644 index 00000000..f2986e87 --- /dev/null +++ b/PARR.EsppSync/SyncService.cs @@ -0,0 +1,140 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using PARR.DAL.Contracts; +using PARR.DAL.Models; +using PARR.DAL.Services.Interfaces; + +namespace PARR.EsppSync +{ + internal class SyncService : ISyncService where EsppObject : class, IEsppObject + { + private readonly ILogger> logger; + private readonly IServiceProvider serviceProvider; + + public SyncService( + ILogger> logger, + IServiceProvider serviceProvider + ) + { + this.logger = logger; + this.serviceProvider = serviceProvider; + } + + + public async Task SyncEsppObjectAsync( + string str, + ParserHandlerDelegate parser, + ConvertDbObjToComparisonObjHandlerDelegate converterToEsppObject, + RobotsEnum robot + ) + { + logger.LogDebug($"Получил строку. Начинаю работать. Строка: {str}"); + + if (string.IsNullOrEmpty(str)) + { + logger.LogWarning("Получил пустую строку, ничего не делаю."); + return; + } + + var esppObject = parser.Invoke(str); + + if (esppObject == null) + { + logger.LogWarning("После парсинга строки, esppObject = null. Дальше ничего не буду делать."); + return; + } + + using (var scope = serviceProvider.CreateScope()) + { + var templateService = GetServiceInScope(scope); + var robotConfigurationService = GetServiceInScope(scope); + + var template = await templateService.GetTemplateByNameAsync(esppObject.TemplateName); + + //todo: существует в ЕСПП но отсутствует в ПАРР. Может его деактивировать или еще что-то сделать. Пока просто пропустим + if (template == null) + { + logger.LogWarning($"Найден объект в ЕСПП с именем шаблона {esppObject.TemplateName} незарегистрированный в ПАРР."); + + return; + } + else + { + var dbObjectInEsppObject = converterToEsppObject.Invoke(template); + var isChanged = IsChanged(esppObject, dbObjectInEsppObject); + + if (isChanged) + { + SetUpdateStatus(ref template, robotConfigurationService, robot); + + if (!await templateService.CommitAsync()) + logger.LogError($"Не удалось изменить запись Template {template.Name}, Robot: {robot}"); + else + logger.LogInformation($"Установлен принудительный статус {TaskStatusEnum.Updating}, Template {template.Name}, Robot: {robot}"); + }//надо ли проверять если не изменился, но был статус Updating не понятно. Доверяем роботу пока, что после окончания работ он точно сообщит + else + { + //если все поля совпали + //проверяем, какой был статус предыдущий статус в БД, если он был не Ок, то ставим ему ОК + var robotConfig = robotConfigurationService.GetFromTemplateByRobotCode(robot, ref template); + if (robotConfig.TaskStatusCode != (int)TaskStatusEnum.Ok) + { + robotConfigurationService.ChangeTaskStatus(TaskStatusEnum.Ok, ref robotConfig); + if (!await templateService.CommitAsync()) + logger.LogError($"Не удалось изменить запись Template {template.Name}, Robot: {robot}"); + else + logger.LogInformation($"Установлен принудительный статус {TaskStatusEnum.Ok}, Template {template.Name}, Robot: {robot}"); + } + } + } + } + } + + + private void SetUpdateStatus(ref Template template, IRobotConfigurationService robotConfigurationService, RobotsEnum robot) + { + var robotConfig = robotConfigurationService.GetFromTemplateByRobotCode(robot, ref template); + robotConfigurationService.ChangeTaskStatus(TaskStatusEnum.Updating, ref robotConfig); + } + + + private Service GetServiceInScope(IServiceScope scope) + { + var service = scope.ServiceProvider.GetService(); + if (service == null) + throw new Exception($"Не найден сервис: {nameof(Service)}"); + + return service; + } + + + private bool IsChanged(EsppObject esppObj, EsppObject dbObj) + { + foreach (var prop in dbObj.GetType().GetProperties()) + { + if (prop == null) + continue; + + var dbValue = dbObj.GetType().GetProperty(prop.Name)?.GetValue(dbObj, null); + var esppValue = esppObj.GetType().GetProperty(prop.Name)?.GetValue(esppObj, null); + + if (dbValue == null || esppValue == null) + continue; + + //Replace("\r","").Replace("\n","") - в подробном описании могут быть переносы строк, в Rabbit прилетает без переносов. Убираем переносы для стравнения + var dbValueStr = dbValue!.ToString()!.ToLower().Replace("\r", "").Replace("\n", ""); + var esppValueStr = esppValue!.ToString()!.ToLower(); + + if (dbValueStr != esppValueStr) + { + logger.LogDebug($"Не совпадают поля. dbValueStr: {dbValueStr}, esppValueStr: {esppValueStr}"); + + return true; + } + } + + return false; + } + + } +} diff --git a/PARR.EsppTemplateSync/Services/Manager.cs b/PARR.EsppTemplateSync/Services/Manager.cs index 83f2f6f5..4dc4b864 100644 --- a/PARR.EsppTemplateSync/Services/Manager.cs +++ b/PARR.EsppTemplateSync/Services/Manager.cs @@ -116,9 +116,9 @@ namespace PARR.EsppTemplateSync.Services if (!await templateService.CommitAsync()) logger.LogError($"Не удалось изменить запись Template {template.Name}"); else - logger.LogInformation($"----- Установлен принудительный статус {TaskStatusEnum.Updating.ToString()} Template {template.Name} -----"); + logger.LogInformation($"----- Установлен принудительный статус {TaskStatusEnum.Updating} Template {template.Name} -----"); - } //надо ли проверять если не изменился, но был статус Updating не понятно. Доверяем роботу пока, что после окончания работ от точно сообщит + } //надо ли проверять если не изменился, но был статус Updating не понятно. Доверяем роботу пока, что после окончания работ он точно сообщит else { //если все поля совпали @@ -151,9 +151,11 @@ namespace PARR.EsppTemplateSync.Services { foreach (var prop in template.GetType().GetProperties()) { - if (prop == null) continue; + if (prop == null) + continue; - if (globalSettings.IgnoreTemplateFields != null && globalSettings.IgnoreTemplateFields.Contains(prop.Name)) continue; + if (globalSettings.IgnoreTemplateFields != null && globalSettings.IgnoreTemplateFields.Contains(prop.Name)) + continue; var parrValue = template.GetType().GetProperty(prop.Name)?.GetValue(template, null); var esppValue = esppTemplate.GetType().GetProperty(prop.Name)?.GetValue(esppTemplate, null); diff --git a/PARR.EsppTemplateSync/Services/ParserService.cs b/PARR.EsppTemplateSync/Services/ParserService.cs index 226bae23..43635045 100644 --- a/PARR.EsppTemplateSync/Services/ParserService.cs +++ b/PARR.EsppTemplateSync/Services/ParserService.cs @@ -119,7 +119,7 @@ namespace PARR.EsppTemplateSync.Services } - // dll + //// dll //public delegate Dt CustomParserHandlerDelegate
(string str); @@ -135,7 +135,7 @@ namespace PARR.EsppTemplateSync.Services //public class RunConverter //{ - // public void Run(CustomParserHandlerDelegate customParser) + // public void Run(CustomParserHandlerDelegate customParser) // { // var conv = new Converter(); // //var obj = conv.ParseString("sdfsdfsdf", SuperParser); diff --git a/README.md b/README.md index f299d19b..90a2cca7 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ - PARR.EsppOrderLoaderWorker - PARR.EsppOrderManager - управление нарядами в ЕСПП (в работу, выполнить, и т.п.) - PARR.EsppOrderManagerWorker +- PARR.EsppSync - общая логика синхронизации шаблонов и расписаний ЕСПП с БД PARR - PARR.EsppTemplateSync - логика синхронизации шаблонов ESPP с БД PARR - PARR.EsppTemplateSyncWorker - worker для PARR.EsppTemplateSync - PARR.GeneratorTemplates - логика генерации шаблонов в ПАРР From ede7075eb52bc393a77be48e803e5e7c136df870 Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Wed, 22 Nov 2023 12:04:33 +1000 Subject: [PATCH 2/7] =?UTF-8?q?feat(EsppSync):=20=D0=B4=D0=BE=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D0=BA=D0=B0=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V1/Requests/Queries/RobotHistoryQuery.cs | 3 ++- PARR.API/Controllers/V1/RobotTaskController.cs | 1 + PARR.API/Controllers/V1/TemplateController.cs | 1 + .../Contracts => PARR.Constants}/RobotsEnum.cs | 2 +- .../Implementations/RobotConfigurationService.cs | 1 + .../Services/Implementations/TemplateService.cs | 1 + .../Interfaces/IRobotConfigurationService.cs | 3 ++- PARR.EsppSync/EsppSyncInstaller.cs | 16 ++++++++++++++++ PARR.EsppSync/IEsppObject.cs | 6 +++++- PARR.EsppSync/ISyncService.cs | 4 ++-- PARR.EsppSync/SyncService.cs | 16 ++++++++-------- .../PARR.EsppTemplateSync.csproj | 1 + PARR.EsppTemplateSync/Services/Manager.cs | 1 + .../Services/TemplateManager.cs | 1 + 14 files changed, 43 insertions(+), 14 deletions(-) rename {PARR.DAL/Contracts => PARR.Constants}/RobotsEnum.cs (93%) create mode 100644 PARR.EsppSync/EsppSyncInstaller.cs diff --git a/PARR.API/Contracts/V1/Requests/Queries/RobotHistoryQuery.cs b/PARR.API/Contracts/V1/Requests/Queries/RobotHistoryQuery.cs index 9c060738..1f68b7cd 100644 --- a/PARR.API/Contracts/V1/Requests/Queries/RobotHistoryQuery.cs +++ b/PARR.API/Contracts/V1/Requests/Queries/RobotHistoryQuery.cs @@ -1,4 +1,5 @@ -using PARR.DAL.Contracts; +using PARR.Constants; +using PARR.DAL.Contracts; namespace PARR.API.Contracts.V1.Requests.Queries { diff --git a/PARR.API/Controllers/V1/RobotTaskController.cs b/PARR.API/Controllers/V1/RobotTaskController.cs index dde23f19..ccdd2d17 100644 --- a/PARR.API/Controllers/V1/RobotTaskController.cs +++ b/PARR.API/Controllers/V1/RobotTaskController.cs @@ -5,6 +5,7 @@ using PARR.API.Contracts.V1; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; +using PARR.Constants; using PARR.DAL.Contracts; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; diff --git a/PARR.API/Controllers/V1/TemplateController.cs b/PARR.API/Controllers/V1/TemplateController.cs index 335a8d00..7e4cbc0b 100644 --- a/PARR.API/Controllers/V1/TemplateController.cs +++ b/PARR.API/Controllers/V1/TemplateController.cs @@ -9,6 +9,7 @@ using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Extensions; using PARR.BLL.Helpers; +using PARR.Constants; using PARR.DAL.Contracts; using PARR.DAL.DomainModels; using PARR.DAL.Models; diff --git a/PARR.DAL/Contracts/RobotsEnum.cs b/PARR.Constants/RobotsEnum.cs similarity index 93% rename from PARR.DAL/Contracts/RobotsEnum.cs rename to PARR.Constants/RobotsEnum.cs index d81e5543..3aa6da9a 100644 --- a/PARR.DAL/Contracts/RobotsEnum.cs +++ b/PARR.Constants/RobotsEnum.cs @@ -1,4 +1,4 @@ -namespace PARR.DAL.Contracts +namespace PARR.Constants { /// /// Список роботов diff --git a/PARR.DAL/Services/Implementations/RobotConfigurationService.cs b/PARR.DAL/Services/Implementations/RobotConfigurationService.cs index ddfca2a0..edc58728 100644 --- a/PARR.DAL/Services/Implementations/RobotConfigurationService.cs +++ b/PARR.DAL/Services/Implementations/RobotConfigurationService.cs @@ -1,5 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; +using PARR.Constants; using PARR.DAL.Context; using PARR.DAL.Contracts; using PARR.DAL.Models; diff --git a/PARR.DAL/Services/Implementations/TemplateService.cs b/PARR.DAL/Services/Implementations/TemplateService.cs index 34b7ef45..8a85860a 100644 --- a/PARR.DAL/Services/Implementations/TemplateService.cs +++ b/PARR.DAL/Services/Implementations/TemplateService.cs @@ -1,5 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; +using PARR.Constants; using PARR.DAL.Context; using PARR.DAL.Contracts; using PARR.DAL.Models; diff --git a/PARR.DAL/Services/Interfaces/IRobotConfigurationService.cs b/PARR.DAL/Services/Interfaces/IRobotConfigurationService.cs index a2f37b68..f5540a9d 100644 --- a/PARR.DAL/Services/Interfaces/IRobotConfigurationService.cs +++ b/PARR.DAL/Services/Interfaces/IRobotConfigurationService.cs @@ -1,4 +1,5 @@ -using PARR.DAL.Contracts; +using PARR.Constants; +using PARR.DAL.Contracts; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces.Base; diff --git a/PARR.EsppSync/EsppSyncInstaller.cs b/PARR.EsppSync/EsppSyncInstaller.cs new file mode 100644 index 00000000..afba32c0 --- /dev/null +++ b/PARR.EsppSync/EsppSyncInstaller.cs @@ -0,0 +1,16 @@ +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using PARR.DAL; + +namespace PARR.EsppSync +{ + public static class EsppSyncInstaller + { + public static void InstallEsppSyncServices(this IServiceCollection services, IConfiguration configuration) where EsppObject : class, IEsppObject + { + services.InstallDalServices(configuration); + + services.AddTransient, SyncService>(); + } + } +} diff --git a/PARR.EsppSync/IEsppObject.cs b/PARR.EsppSync/IEsppObject.cs index c1f410fc..64f3f877 100644 --- a/PARR.EsppSync/IEsppObject.cs +++ b/PARR.EsppSync/IEsppObject.cs @@ -1,7 +1,11 @@ -namespace PARR.EsppSync +using PARR.Constants; + +namespace PARR.EsppSync { public interface IEsppObject { public string TemplateName { get; set; } + + public RobotsEnum Robot { get; set; } } } diff --git a/PARR.EsppSync/ISyncService.cs b/PARR.EsppSync/ISyncService.cs index f8a092a7..6c46d060 100644 --- a/PARR.EsppSync/ISyncService.cs +++ b/PARR.EsppSync/ISyncService.cs @@ -1,4 +1,4 @@ -using PARR.DAL.Contracts; +using PARR.Constants; using PARR.DAL.Models; namespace PARR.EsppSync @@ -21,6 +21,6 @@ namespace PARR.EsppSync public interface ISyncService where EsppObject : class, IEsppObject { - Task SyncEsppObjectAsync(string str, ParserHandlerDelegate parser, ConvertDbObjToComparisonObjHandlerDelegate converterToEsppObject, RobotsEnum robot); + Task SyncEsppObjectAsync(string str, ParserHandlerDelegate parser, ConvertDbObjToComparisonObjHandlerDelegate converterToEsppObject); } } \ No newline at end of file diff --git a/PARR.EsppSync/SyncService.cs b/PARR.EsppSync/SyncService.cs index f2986e87..d6ff6a68 100644 --- a/PARR.EsppSync/SyncService.cs +++ b/PARR.EsppSync/SyncService.cs @@ -1,5 +1,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; +using PARR.Constants; using PARR.DAL.Contracts; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; @@ -24,8 +25,7 @@ namespace PARR.EsppSync public async Task SyncEsppObjectAsync( string str, ParserHandlerDelegate parser, - ConvertDbObjToComparisonObjHandlerDelegate converterToEsppObject, - RobotsEnum robot + ConvertDbObjToComparisonObjHandlerDelegate converterToEsppObject ) { logger.LogDebug($"Получил строку. Начинаю работать. Строка: {str}"); @@ -65,25 +65,25 @@ namespace PARR.EsppSync if (isChanged) { - SetUpdateStatus(ref template, robotConfigurationService, robot); + SetUpdateStatus(ref template, robotConfigurationService, esppObject.Robot); if (!await templateService.CommitAsync()) - logger.LogError($"Не удалось изменить запись Template {template.Name}, Robot: {robot}"); + logger.LogError($"Не удалось изменить запись Template {template.Name}, Robot: {esppObject.Robot}"); else - logger.LogInformation($"Установлен принудительный статус {TaskStatusEnum.Updating}, Template {template.Name}, Robot: {robot}"); + logger.LogInformation($"Установлен принудительный статус {TaskStatusEnum.Updating}, Template {template.Name}, Robot: {esppObject.Robot}"); }//надо ли проверять если не изменился, но был статус Updating не понятно. Доверяем роботу пока, что после окончания работ он точно сообщит else { //если все поля совпали //проверяем, какой был статус предыдущий статус в БД, если он был не Ок, то ставим ему ОК - var robotConfig = robotConfigurationService.GetFromTemplateByRobotCode(robot, ref template); + var robotConfig = robotConfigurationService.GetFromTemplateByRobotCode(esppObject.Robot, ref template); if (robotConfig.TaskStatusCode != (int)TaskStatusEnum.Ok) { robotConfigurationService.ChangeTaskStatus(TaskStatusEnum.Ok, ref robotConfig); if (!await templateService.CommitAsync()) - logger.LogError($"Не удалось изменить запись Template {template.Name}, Robot: {robot}"); + logger.LogError($"Не удалось изменить запись Template {template.Name}, Robot: {esppObject.Robot}"); else - logger.LogInformation($"Установлен принудительный статус {TaskStatusEnum.Ok}, Template {template.Name}, Robot: {robot}"); + logger.LogInformation($"Установлен принудительный статус {TaskStatusEnum.Ok}, Template {template.Name}, Robot: {esppObject.Robot}"); } } } diff --git a/PARR.EsppTemplateSync/PARR.EsppTemplateSync.csproj b/PARR.EsppTemplateSync/PARR.EsppTemplateSync.csproj index 3737e35b..09175082 100644 --- a/PARR.EsppTemplateSync/PARR.EsppTemplateSync.csproj +++ b/PARR.EsppTemplateSync/PARR.EsppTemplateSync.csproj @@ -14,6 +14,7 @@ + diff --git a/PARR.EsppTemplateSync/Services/Manager.cs b/PARR.EsppTemplateSync/Services/Manager.cs index 4dc4b864..f3d30a0e 100644 --- a/PARR.EsppTemplateSync/Services/Manager.cs +++ b/PARR.EsppTemplateSync/Services/Manager.cs @@ -1,6 +1,7 @@ using AutoMapper; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; +using PARR.Constants; using PARR.DAL.Contracts; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; diff --git a/PARR.GeneratorTemplates/Services/TemplateManager.cs b/PARR.GeneratorTemplates/Services/TemplateManager.cs index fbf70405..7f4633ef 100644 --- a/PARR.GeneratorTemplates/Services/TemplateManager.cs +++ b/PARR.GeneratorTemplates/Services/TemplateManager.cs @@ -2,6 +2,7 @@ using Microsoft.Extensions.Logging; using PARR.BLL.Domain.Mq; using PARR.BLL.Helpers; +using PARR.Constants; using PARR.DAL.Contracts; using PARR.DAL.Models; using PARR.DAL.Services.Interfaces; From dc90275f6f2fa0abc514a59e929b4af541c7a66d Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Wed, 22 Nov 2023 14:19:15 +1000 Subject: [PATCH 3/7] =?UTF-8?q?feat(esppTemplateSync):=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D0=BB=D0=BE=D0=B3?= =?UTF-8?q?=D0=B8=D0=BA=D1=83,=20=D0=BF=D0=BE=D0=B4=D0=BA=D0=BB=D1=8E?= =?UTF-8?q?=D1=87=D0=B8=D0=BB=20ISyncService?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PARR.EsppSync/IEsppObject.cs | 2 +- PARR.EsppSync/ISyncService.cs | 5 +- ...{EsppTemplate.cs => EsppObjectTemplate.cs} | 12 +- .../EsppTemplateSyncInstaller.cs | 9 +- .../MappingProfiles/DomainToDomainProfile.cs | 30 --- .../PARR.EsppTemplateSync.csproj | 1 - PARR.EsppTemplateSync/Services/IManager.cs | 8 - .../Services/IParserService.cs | 9 - PARR.EsppTemplateSync/Services/Manager.cs | 180 ------------------ .../Services/ParserService.cs | 170 ----------------- PARR.EsppTemplateSync/TemplateFileSyncer.cs | 29 ++- PARR.EsppTemplateSync/TemplateMQSyncer.cs | 121 +++++++++++- 12 files changed, 144 insertions(+), 432 deletions(-) rename PARR.EsppTemplateSync/Domain/{EsppTemplate.cs => EsppObjectTemplate.cs} (76%) delete mode 100644 PARR.EsppTemplateSync/MappingProfiles/DomainToDomainProfile.cs delete mode 100644 PARR.EsppTemplateSync/Services/IManager.cs delete mode 100644 PARR.EsppTemplateSync/Services/IParserService.cs delete mode 100644 PARR.EsppTemplateSync/Services/Manager.cs delete mode 100644 PARR.EsppTemplateSync/Services/ParserService.cs diff --git a/PARR.EsppSync/IEsppObject.cs b/PARR.EsppSync/IEsppObject.cs index 64f3f877..54862c3b 100644 --- a/PARR.EsppSync/IEsppObject.cs +++ b/PARR.EsppSync/IEsppObject.cs @@ -6,6 +6,6 @@ namespace PARR.EsppSync { public string TemplateName { get; set; } - public RobotsEnum Robot { get; set; } + public RobotsEnum Robot { get; } } } diff --git a/PARR.EsppSync/ISyncService.cs b/PARR.EsppSync/ISyncService.cs index 6c46d060..73b027b2 100644 --- a/PARR.EsppSync/ISyncService.cs +++ b/PARR.EsppSync/ISyncService.cs @@ -1,5 +1,4 @@ -using PARR.Constants; -using PARR.DAL.Models; +using PARR.DAL.Models; namespace PARR.EsppSync { @@ -9,7 +8,7 @@ namespace PARR.EsppSync /// /// /// - public delegate EsppObject ParserHandlerDelegate(string str) where EsppObject : class, IEsppObject; + public delegate EsppObject? ParserHandlerDelegate(string str) where EsppObject : class, IEsppObject; /// /// Конвертирует Template в модель для сравнения diff --git a/PARR.EsppTemplateSync/Domain/EsppTemplate.cs b/PARR.EsppTemplateSync/Domain/EsppObjectTemplate.cs similarity index 76% rename from PARR.EsppTemplateSync/Domain/EsppTemplate.cs rename to PARR.EsppTemplateSync/Domain/EsppObjectTemplate.cs index 3adcc400..21c2f4ff 100644 --- a/PARR.EsppTemplateSync/Domain/EsppTemplate.cs +++ b/PARR.EsppTemplateSync/Domain/EsppObjectTemplate.cs @@ -1,8 +1,14 @@ -namespace PARR.EsppTemplateSync.Domain +using PARR.Constants; +using PARR.EsppSync; + +namespace PARR.EsppTemplateSync.Domain { - internal class EsppTemplate + internal class EsppObjectTemplate : IEsppObject { - public required string Name { get; set; } + public required string TemplateName { get; set; } + + public RobotsEnum Robot => RobotsEnum.TemplateOrder; + public bool IsActive { get; set; } public required string WorkGroup { get; set; } public required string ShortDescription { get; set; } diff --git a/PARR.EsppTemplateSync/EsppTemplateSyncInstaller.cs b/PARR.EsppTemplateSync/EsppTemplateSyncInstaller.cs index 8e598819..b4ee4398 100644 --- a/PARR.EsppTemplateSync/EsppTemplateSyncInstaller.cs +++ b/PARR.EsppTemplateSync/EsppTemplateSyncInstaller.cs @@ -2,7 +2,8 @@ using Microsoft.Extensions.DependencyInjection; using PARR.BLL; using PARR.DAL; -using PARR.EsppTemplateSync.Services; +using PARR.EsppSync; +using PARR.EsppTemplateSync.Domain; using PARR.EsppTemplateSync.Settings; namespace PARR.EsppTemplateSync @@ -12,16 +13,14 @@ namespace PARR.EsppTemplateSync public static void InstallEsppTemplateSyncServices(this IServiceCollection services, IConfiguration configuration) { services.InstallBllServices(configuration); - services.InstallDalServices(configuration); + //services.InstallDalServices(configuration); + services.InstallEsppSyncServices(configuration); var globalSettings = new GlobalSettings(); configuration.GetSection(nameof(GlobalSettings)).Bind(globalSettings); services.AddSingleton(globalSettings); - services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies()); services.AddTransient(); - services.AddTransient(); - services.AddTransient(); } public static IConfigurationBuilder AddEsppTemplateConfigurations(this IConfigurationBuilder builder, IServiceCollection services) diff --git a/PARR.EsppTemplateSync/MappingProfiles/DomainToDomainProfile.cs b/PARR.EsppTemplateSync/MappingProfiles/DomainToDomainProfile.cs deleted file mode 100644 index c49240bc..00000000 --- a/PARR.EsppTemplateSync/MappingProfiles/DomainToDomainProfile.cs +++ /dev/null @@ -1,30 +0,0 @@ -using AutoMapper; -using PARR.DAL.Models; -using PARR.EsppTemplateSync.Domain; - -namespace PARR.EsppTemplateSync.MappingProfiles -{ - public class DomainToDomainProfile : Profile - { - public DomainToDomainProfile() - { - - CreateMap() - .ForMember(d => d.Name, o => o.MapFrom(s => s.Name)) - .ForMember(d => d.IsActive, o => o.MapFrom(s => s.IsActiveTemplate)) - .ForMember(d => d.WorkGroup, o => o.MapFrom(s => s.Host!.WorkGroup)) - .ForMember(d => d.ShortDescription, o => o.MapFrom(s => s.ApplicationsInWork!.ShortDescription)) - .ForMember(d => d.ResponseArea, o => o.MapFrom(s => s.Host!.ResponseArea!.Name)) - .ForMember(d => d.Duration, o => o.MapFrom(s => s.ApplicationsInWork!.TemplateDuration)) - .ForMember(d => d.EK, o => o.MapFrom(s => s.Host!.Ek)) - //.ForMember(d => d.Initiator, o => o.MapFrom(s => )) TODO откуда то нужно брать инициатора - .ForMember(d => d.FullDescription, o => o.MapFrom(s => s.ApplicationsInWork!.FullDescription)) - //.ForMember(d => d.ClosingCode, o => o.MapFrom(s => s.)) TODO toоda же к инициатору - .ForMember(d => d.Solution, o => o.MapFrom(s => s.ApplicationsInWork!.Solution)) - .ForMember(d => d.Process, o => o.MapFrom(s => s.ApplicationsInWork!.Work!.Tnk!.Subprocess!.Process!.Name)) - .ForMember(d => d.SubProcess, o => o.MapFrom(s => s.ApplicationsInWork!.Work!.Tnk!.Subprocess!.Name)) - .ForMember(d => d.TNK, o => o.MapFrom(s => s.ApplicationsInWork!.Work!.Tnk!.Name)) - .ForMember(d => d.Work, o => o.MapFrom(s => s.ApplicationsInWork!.Work!.Name)); - } - } -} diff --git a/PARR.EsppTemplateSync/PARR.EsppTemplateSync.csproj b/PARR.EsppTemplateSync/PARR.EsppTemplateSync.csproj index 09175082..56c2b3ea 100644 --- a/PARR.EsppTemplateSync/PARR.EsppTemplateSync.csproj +++ b/PARR.EsppTemplateSync/PARR.EsppTemplateSync.csproj @@ -7,7 +7,6 @@ - diff --git a/PARR.EsppTemplateSync/Services/IManager.cs b/PARR.EsppTemplateSync/Services/IManager.cs deleted file mode 100644 index 31fff479..00000000 --- a/PARR.EsppTemplateSync/Services/IManager.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace PARR.EsppTemplateSync.Services -{ - internal interface IManager - { - Task ManageFileAsync(string path); - Task ManageStringAsync(string str); - } -} diff --git a/PARR.EsppTemplateSync/Services/IParserService.cs b/PARR.EsppTemplateSync/Services/IParserService.cs deleted file mode 100644 index 1dd1d75b..00000000 --- a/PARR.EsppTemplateSync/Services/IParserService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using PARR.EsppTemplateSync.Domain; - -namespace PARR.EsppTemplateSync.Services -{ - internal interface IParserService - { - EsppTemplate? ParseString(string str); - } -} diff --git a/PARR.EsppTemplateSync/Services/Manager.cs b/PARR.EsppTemplateSync/Services/Manager.cs deleted file mode 100644 index f3d30a0e..00000000 --- a/PARR.EsppTemplateSync/Services/Manager.cs +++ /dev/null @@ -1,180 +0,0 @@ -using AutoMapper; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using PARR.Constants; -using PARR.DAL.Contracts; -using PARR.DAL.Models; -using PARR.DAL.Services.Interfaces; -using PARR.EsppTemplateSync.Domain; -using PARR.EsppTemplateSync.Settings; - -namespace PARR.EsppTemplateSync.Services -{ - internal class Manager : IManager - { - private readonly ILogger logger; - private readonly IServiceProvider serviceProvider; - private readonly IParserService parserService; - private readonly GlobalSettings globalSettings; - private readonly IMapper mapper; - - public Manager( - ILogger logger, - IServiceProvider serviceProvider, - IParserService parserService, - GlobalSettings globalSettings, - IMapper mapper - ) - { - this.logger = logger; - this.serviceProvider = serviceProvider; - this.parserService = parserService; - this.globalSettings = globalSettings; - this.mapper = mapper; - } - - public Task ManageFileAsync(string path) - { - throw new NotImplementedException(); - } - - public async Task ManageStringAsync(string str) - { - - // тут обязательно нужна проверка, если str не того формата, возникает exception в ParseStringAsync - if (string.IsNullOrEmpty(str)) - return; - - var esppTemplate = parserService.ParseString(str); - - if (esppTemplate == null) - { - return; - } - else - { - //если шаблон не аквтивен, пропускаем - //if (!esppTemplate.IsActive) - //{ - // return isSuccess; - //} - - await SyncTemplateAsync(esppTemplate); - - } - - return; - } - - - private async Task SyncTemplateAsync(EsppTemplate esppTemplate) - { - using (var scope = serviceProvider.CreateScope()) - { - var services = scope.ServiceProvider; - - var templateService = services.GetService(); - if (templateService == null) - throw new Exception($"Не найден сервис: {nameof(ITemplateService)}"); - - var robotConfigurationService = services.GetService(); - if (robotConfigurationService == null) - throw new Exception($"Не найден сервис: {nameof(IRobotConfigurationService)}"); - - Template? template = await templateService.GetTemplateByNameAsync(esppTemplate.Name); - - //существует в ЕСПП но отсутствует в ПАРР. - //TODO деактивируем и видимо ещё что-то нужно - if (template == null) - { - // создает запись-шаблон из ЕСПП в ПАРР. Возможно избыточно так как эталон в ПАРР - ////esppTemplate.StatusCode = "Deactivating"; - ////--- - //esppTemplate.StatusCode = (int)StatusTemplateEnum.Ok; - //esppTemplate.IsActive = false; - //if (!await templateService.CreateAsync(esppTemplate) || !await templateService.CommitAsync()) - //{ - // logger.LogError($"Не удалось создать запись Template {esppTemplate.Name}({esppTemplate.ShortDescription})"); - //} - //else - // logger.LogInformation($"----- Создана запись Template {esppTemplate.Name}({esppTemplate.ShortDescription}) -----"); - //--- - logger.LogWarning($"----- Найден шаблон ЕСПП незарегистрированный в ПАРР {esppTemplate.Name}({esppTemplate.ShortDescription}) -----"); - - return; - } - else - { - var mappedTemplate = mapper.Map(template); - if (mappedTemplate == null) - return; - - var isChanged = IsChanged(mappedTemplate, esppTemplate); - if (isChanged) - { - SetUpdateStatus(template, robotConfigurationService); - - if (!await templateService.CommitAsync()) - logger.LogError($"Не удалось изменить запись Template {template.Name}"); - else - logger.LogInformation($"----- Установлен принудительный статус {TaskStatusEnum.Updating} Template {template.Name} -----"); - - } //надо ли проверять если не изменился, но был статус Updating не понятно. Доверяем роботу пока, что после окончания работ он точно сообщит - else - { - //если все поля совпали - //проверяем, какой был статус у шаблона, если он был не Ок, то ставим ему ОК - var robotConfig = robotConfigurationService.GetFromTemplateByRobotCode(RobotsEnum.TemplateOrder, ref template); - if (robotConfig.TaskStatusCode != (int)TaskStatusEnum.Ok) - { - robotConfigurationService.ChangeTaskStatus(TaskStatusEnum.Ok, ref robotConfig); - if (!await templateService.CommitAsync()) - logger.LogError($"Не удалось изменить запись Template {template.Name}"); - else - logger.LogInformation($"----- Установлен принудительный статус {TaskStatusEnum.Ok.ToString()} Template {template.Name} -----"); - } - } - } - } - - return; - } - - - private void SetUpdateStatus(Template template, IRobotConfigurationService robotConfigurationService) - { - var robotConfig = robotConfigurationService.GetFromTemplateByRobotCode(RobotsEnum.TemplateOrder, ref template); - robotConfigurationService.ChangeTaskStatus(TaskStatusEnum.Updating, ref robotConfig); - } - - - private bool IsChanged(EsppTemplate template, EsppTemplate esppTemplate) - { - foreach (var prop in template.GetType().GetProperties()) - { - if (prop == null) - continue; - - if (globalSettings.IgnoreTemplateFields != null && globalSettings.IgnoreTemplateFields.Contains(prop.Name)) - continue; - - var parrValue = template.GetType().GetProperty(prop.Name)?.GetValue(template, null); - var esppValue = esppTemplate.GetType().GetProperty(prop.Name)?.GetValue(esppTemplate, null); - - if (parrValue == null || esppValue == null) - continue; - - //Replace("\r","").Replace("\n","") - в подробном описании могут быть переносы строк, в Rabbit прилетает без переносов. Убираем переносы для стравнения - var parrValueStr = parrValue!.ToString()!.ToLower().Replace("\r", "").Replace("\n", ""); - var esppValueStr = esppValue!.ToString()!.ToLower(); - - if (parrValueStr != esppValueStr) - { - logger.LogDebug($"Не совпадают поля. parrValueStr: {parrValueStr}, esppValueStr: {esppValueStr}"); - return true; - } - } - return false; - } - } -} \ No newline at end of file diff --git a/PARR.EsppTemplateSync/Services/ParserService.cs b/PARR.EsppTemplateSync/Services/ParserService.cs deleted file mode 100644 index 43635045..00000000 --- a/PARR.EsppTemplateSync/Services/ParserService.cs +++ /dev/null @@ -1,170 +0,0 @@ -using Microsoft.Extensions.Logging; -using PARR.DAL.Contracts; -using PARR.EsppTemplateSync.Domain; -using PARR.EsppTemplateSync.Settings; -using System.Globalization; - -namespace PARR.EsppTemplateSync.Services -{ - internal class ParserService : IParserService - { - private readonly ILogger logger; - private readonly GlobalSettings globalSettings; - private readonly SettingsFromDb settingsFromDb; - - public ParserService( - ILogger logger, - GlobalSettings globalSettings, - SettingsFromDb settingsFromDb - ) - { - this.logger = logger; - this.globalSettings = globalSettings; - this.settingsFromDb = settingsFromDb; - } - public async Task ParseFileAsync(string path) - { - //TODO: - - bool isSuccess = true; - - - return isSuccess; - } - - public EsppTemplate? ParseString(string str) - { - // TODO: а если формат нет тот? Все будет ок? - var splittedContent = str.Split(globalSettings.ParsingSeparator); - if (splittedContent.Length != 17) - { - return null; - } - - //var name = splittedContent[0].Trim().Substring(1, splittedContent[0].Length - 2); - var name = splittedContent[0].Trim(); - - CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture; - if (!string.IsNullOrEmpty(settingsFromDb.TemplatePrefixName) - && !name.StartsWith(settingsFromDb.TemplatePrefixName, true, currentCulture) - ) - { - logger.LogWarning($"Имя шаблона не соответствует обязательному префиксу({settingsFromDb.TemplatePrefixName}). Шаблон {name} игнорирован"); - return null; - - } - - if (!bool.TryParse(splittedContent[1].Trim(), out var isActive)) - isActive = false; - var workGroup = splittedContent[2].Trim(); - var shortDescription = splittedContent[3].Trim(); - var category = splittedContent[4].Trim(); - var responseArea = splittedContent[5].Trim(); - var duration = splittedContent[6].Trim(); - var ek = splittedContent[7].Trim(); - var initiator = splittedContent[8].Trim(); - - var fullDescription = splittedContent[9].Trim(); - var closingCode = splittedContent[10].Trim(); - var solution = splittedContent[11].Trim(); - var process = splittedContent[12].Trim(); - var subProcess = splittedContent[13].Trim(); - var tnk = splittedContent[14].Trim(); - var work = splittedContent[15].Trim(); - var worker = splittedContent[16].Trim(); - - var template = new EsppTemplate - { - Name = name, - IsActive = isActive, - WorkGroup = workGroup, - ShortDescription = shortDescription, - //Category = category, - ResponseArea = responseArea, - Duration = duration, - EK = ek, - //Initiator = initiator, - FullDescription = fullDescription, - //ClosingCode = closingCode, - Solution = solution, - Process = process, - SubProcess = subProcess, - TNK = tnk, - Work = work, - //Worker = worker - - }; - - return template; - } - - - - private DateTimeOffset? ConvertDateFromStr(string dateString) - { - var format = "dd/MM/yy HH:mm:ss"; - var provider = CultureInfo.CurrentCulture; - try - { - var result = DateTimeOffset.ParseExact(dateString, format, provider).ToOffset(new TimeSpan(0)); - logger.LogInformation($"{dateString} было преобразовано в {result.ToString()}."); - return result; - } - catch (FormatException) - { - logger.LogWarning($"{dateString} имеет некоррктный формат для преобразование в DateTimeOffset"); - } - return null; - } - } - - - //// dll - - //public delegate Dt CustomParserHandlerDelegate
(string str); - - //public class Converter - //{ - // public T ParseString(string str, CustomParserHandlerDelegate customParser) - // { - // var obj = customParser(str); - - // return obj; - // } - //} - - //public class RunConverter - //{ - // public void Run(CustomParserHandlerDelegate customParser) - // { - // var conv = new Converter(); - // //var obj = conv.ParseString("sdfsdfsdf", SuperParser); - // var obj = conv.ParseString("sdfsdfsdf", customParser); - // } - //} - - - ////--- - //public class Xxx - //{ - // void Test() - // { - // var rc = new RunConverter(); - // rc.Run(SuperParser); - // } - - - // Model1 SuperParser(string str) - // { - // // custom logic - - // return new Model1 { Field = str }; - // } - //} - - - //public class Model1 - //{ - // public string Field { get; set; } = "111"; - //} -} diff --git a/PARR.EsppTemplateSync/TemplateFileSyncer.cs b/PARR.EsppTemplateSync/TemplateFileSyncer.cs index 60ed197c..1b44ac00 100644 --- a/PARR.EsppTemplateSync/TemplateFileSyncer.cs +++ b/PARR.EsppTemplateSync/TemplateFileSyncer.cs @@ -1,6 +1,5 @@ using Microsoft.Extensions.Logging; using PARR.BLL.Services.Interfaces; -using PARR.EsppTemplateSync.Services; using PARR.EsppTemplateSync.Settings; namespace PARR.EsppTemplateSync @@ -10,7 +9,7 @@ namespace PARR.EsppTemplateSync private readonly ILogger logger; private readonly IFileService fileService; private readonly GlobalSettings globalSettings; - private readonly IManager manager; + //private readonly IManager manager; private readonly string dirPath; private readonly string filterExtensions; @@ -20,14 +19,14 @@ namespace PARR.EsppTemplateSync BLL.Settings.StorageSettings storageSettings, ILogger logger, IFileService fileService, - GlobalSettings globalSettings, - IManager manager + GlobalSettings globalSettings//, + // IManager manager ) { this.logger = logger; this.fileService = fileService; this.globalSettings = globalSettings; - this.manager = manager; + //this.manager = manager; if (storageSettings.EsppTemplates == null) { logger.LogError("Нет секции настроек хранилища. StorageSettings, EsppTemplates"); @@ -120,17 +119,17 @@ namespace PARR.EsppTemplateSync private async Task ParseFileAsync(string path) { logger.LogInformation($"--- --- Найден файл. Готов для парсинга {path} --- ---"); - var parseResult = await manager.ManageFileAsync(path);//parserService.ParseFileAsync(path); + //var parseResult = await manager.ManageFileAsync(path);//parserService.ParseFileAsync(path); - if (parseResult) - { - logger.LogInformation($"Парсинг успешно завершен. Удаляю файл {path}"); - var removeResult = fileService.DeleteFile(path); - } - else - { - logger.LogError($"Парсинг завершен c ошибкой. Файл не удален {path}"); - } + //if (parseResult) + //{ + // logger.LogInformation($"Парсинг успешно завершен. Удаляю файл {path}"); + // var removeResult = fileService.DeleteFile(path); + //} + //else + //{ + // logger.LogError($"Парсинг завершен c ошибкой. Файл не удален {path}"); + //} } } diff --git a/PARR.EsppTemplateSync/TemplateMQSyncer.cs b/PARR.EsppTemplateSync/TemplateMQSyncer.cs index fdce03be..a077f5d0 100644 --- a/PARR.EsppTemplateSync/TemplateMQSyncer.cs +++ b/PARR.EsppTemplateSync/TemplateMQSyncer.cs @@ -1,6 +1,9 @@ using Microsoft.Extensions.Logging; using PARR.BLL.Services.Interfaces; -using PARR.EsppTemplateSync.Services; +using PARR.DAL.Contracts; +using PARR.DAL.Models; +using PARR.EsppSync; +using PARR.EsppTemplateSync.Domain; using PARR.EsppTemplateSync.Settings; namespace PARR.EsppTemplateSync @@ -8,22 +11,24 @@ namespace PARR.EsppTemplateSync internal class TemplateMQSyncer : ITemplateSyncer { private readonly ILogger logger; - private readonly IManager manager; private readonly GlobalSettings globalSettings; private readonly IMqService mqService; + private readonly ISyncService syncService; + private readonly SettingsFromDb settingsFromDb; public TemplateMQSyncer( ILogger logger, - IManager manager, GlobalSettings globalSettings, - IMqService mqService + IMqService mqService, + ISyncService syncService, + SettingsFromDb settingsFromDb ) { this.logger = logger; - this.manager = manager; this.globalSettings = globalSettings; this.mqService = mqService; - + this.syncService = syncService; + this.settingsFromDb = settingsFromDb; if (globalSettings.MqSettings == null) { logger.LogError("Нет секции настроек хранилища. MqSettings, EsppTemplates"); @@ -33,7 +38,7 @@ namespace PARR.EsppTemplateSync public void Start() { - var isConnected = mqService.InitConsumer(globalSettings!.MqSettings!, manager.ManageStringAsync); + var isConnected = mqService.InitConsumer(globalSettings!.MqSettings!, SyncTemplateAsync); if (!isConnected) throw new Exception("Ошибка при подключении к RabbitMq"); @@ -48,6 +53,108 @@ namespace PARR.EsppTemplateSync logger.LogInformation($"=== === === Соединение с очередью {globalSettings.MqSettings!.QueueName} закрыто === === ==="); } + + private async Task SyncTemplateAsync(string str) + { + await syncService.SyncEsppObjectAsync(str, ParseStrToEsppObject, ConvertDbObjToEsppObj); + } + + + /// + /// Преобразование модели БД в модель для сравнения + /// + /// + /// + /// + private EsppObjectTemplate ConvertDbObjToEsppObj(Template template) + { + var templateFromDb = new EsppObjectTemplate + { + TemplateName = template.Name, + IsActive = template.IsActiveTemplate, + WorkGroup = template.Host!.WorkGroup!, + ShortDescription = template.ApplicationsInWork!.ShortDescription, + ResponseArea = template.Host!.ResponseArea!.Name, + Duration = template.ApplicationsInWork.TemplateDuration, + EK = template.Host.Ek, + FullDescription = template.ApplicationsInWork.FullDescription, + Solution = template.ApplicationsInWork.Solution, + Process = template.ApplicationsInWork.Work!.Tnk!.Subprocess!.Process!.Name, + SubProcess = template.ApplicationsInWork.Work.Tnk.Subprocess.Name, + TNK = template.ApplicationsInWork.Work.Tnk.Name, + Work = template.ApplicationsInWork.Work.Name + }; + + return templateFromDb; + } + + + /// + /// Парсинг из строки в модель для сравнения + /// + /// + /// + /// + private EsppObjectTemplate? ParseStrToEsppObject(string str) + { + var splittedContent = str.Split(globalSettings.ParsingSeparator); + if (splittedContent.Length != 17) + { + logger.LogError($"Входная строка после сплита не содержит 17 объектов (факт: {splittedContent.Length})."); + return null; + } + + var templateName = splittedContent[0].Trim(); + + var currentCulture = Thread.CurrentThread.CurrentCulture; + if (!string.IsNullOrEmpty(settingsFromDb.TemplatePrefixName) && !templateName.StartsWith(settingsFromDb.TemplatePrefixName, true, currentCulture)) + { + logger.LogWarning($"Имя шаблона не соответствует обязательному префиксу({settingsFromDb.TemplatePrefixName}). Шаблон {templateName} игнорирован"); + return null; + } + + bool.TryParse(splittedContent[1].Trim(), out var isActive); + + var workGroup = splittedContent[2].Trim(); + var shortDescription = splittedContent[3].Trim(); + var category = splittedContent[4].Trim(); + var responseArea = splittedContent[5].Trim(); + var duration = splittedContent[6].Trim(); + var ek = splittedContent[7].Trim(); + var initiator = splittedContent[8].Trim(); + + var fullDescription = splittedContent[9].Trim(); + var closingCode = splittedContent[10].Trim(); + var solution = splittedContent[11].Trim(); + var process = splittedContent[12].Trim(); + var subProcess = splittedContent[13].Trim(); + var tnk = splittedContent[14].Trim(); + var work = splittedContent[15].Trim(); + var worker = splittedContent[16].Trim(); + + var templateFromEspp = new EsppObjectTemplate + { + TemplateName = templateName, + IsActive = isActive, + WorkGroup = workGroup, + ShortDescription = shortDescription, + //Category = category, + ResponseArea = responseArea, + Duration = duration, + EK = ek, + //Initiator = initiator, + FullDescription = fullDescription, + //ClosingCode = closingCode, + Solution = solution, + Process = process, + SubProcess = subProcess, + TNK = tnk, + Work = work + //Worker = worker + }; + + return templateFromEspp; + } } } From b2f150890cf0c6b44b71d2424ee4a8ba47e2bfd9 Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Wed, 22 Nov 2023 16:34:16 +1000 Subject: [PATCH 4/7] =?UTF-8?q?feat(esppScheduleSync):=20=D1=81=D0=BE?= =?UTF-8?q?=D0=B7=D0=B4=D0=B0=D0=BD=20=D0=BF=D1=80=D0=BE=D0=B5=D0=BA=D1=82?= =?UTF-8?q?.=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=BE=D1=81=D0=BD=D0=BE=D0=B2=D0=BD=D0=B0=D1=8F=20=D0=BB=D0=BE?= =?UTF-8?q?=D0=B3=D0=B8=D0=BA=D0=B0=20=D1=81=D0=B8=D0=BD=D1=85=D1=80=D0=BE?= =?UTF-8?q?=D0=BD=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D0=B8.=20Docker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 49 ++++++++++ PARR.API.sln | 12 +++ PARR.API/Dockerfile | 1 + PARR.EsppOrderLoaderWorker/Dockerfile | 1 + PARR.EsppOrderManagerWorker/Dockerfile | 1 + .../Domain/EsppObjectSchedule.cs | 14 +++ .../EsppScheduleSyncInstaller.cs | 37 ++++++++ PARR.EsppScheduleSync/IScheduleSyncher.cs | 8 ++ .../PARR.EsppScheduleSync.csproj | 15 +++ PARR.EsppScheduleSync/ScheduleSyncher.cs | 91 +++++++++++++++++++ .../Settings/GlobalSettings.cs | 18 ++++ PARR.EsppScheduleSyncWorker/Dockerfile | 28 ++++++ .../PARR.EsppScheduleSyncWorker.csproj | 24 +++++ PARR.EsppScheduleSyncWorker/Program.cs | 32 +++++++ .../Properties/launchSettings.json | 14 +++ PARR.EsppScheduleSyncWorker/Worker.cs | 29 ++++++ .../appsettings.Development.json | 13 +++ PARR.EsppScheduleSyncWorker/appsettings.json | 38 ++++++++ .../Domain/EsppObjectTemplate.cs | 2 +- .../Settings/GlobalSettings.cs | 2 +- PARR.EsppTemplateSync/TemplateMQSyncer.cs | 1 + PARR.EsppTemplateSyncWorker/Dockerfile | 1 + PARR.EsppTemplateSyncWorker/appsettings.json | 1 - PARR.GeneratorTemplatesWorker/Dockerfile | 1 + PARR.MasterWorker/Dockerfile | 1 + README.md | 4 +- docker-compose.espp-schedule-sync.yml | 23 +++++ 27 files changed, 457 insertions(+), 4 deletions(-) create mode 100644 PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs create mode 100644 PARR.EsppScheduleSync/EsppScheduleSyncInstaller.cs create mode 100644 PARR.EsppScheduleSync/IScheduleSyncher.cs create mode 100644 PARR.EsppScheduleSync/PARR.EsppScheduleSync.csproj create mode 100644 PARR.EsppScheduleSync/ScheduleSyncher.cs create mode 100644 PARR.EsppScheduleSync/Settings/GlobalSettings.cs create mode 100644 PARR.EsppScheduleSyncWorker/Dockerfile create mode 100644 PARR.EsppScheduleSyncWorker/PARR.EsppScheduleSyncWorker.csproj create mode 100644 PARR.EsppScheduleSyncWorker/Program.cs create mode 100644 PARR.EsppScheduleSyncWorker/Properties/launchSettings.json create mode 100644 PARR.EsppScheduleSyncWorker/Worker.cs create mode 100644 PARR.EsppScheduleSyncWorker/appsettings.Development.json create mode 100644 PARR.EsppScheduleSyncWorker/appsettings.json create mode 100644 docker-compose.espp-schedule-sync.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d2da2c29..e3757bc7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ variables: PROD_NAME_API: "parr/parr-api" PROD_NAME_AIHIT: "parr/parr-aihit-syncher" PROD_NAME_ESPP_TEMPLATE: "parr/parr-espp-template-sync" + PROD_NAME_ESPP_SCHEDULE: "parr/parr-espp-schedule-sync" PROD_NAME_GENERATOR_TEMPLATES: "parr/parr-generator-templates" PROD_NAME_ESPP_ORDER_LOADER: "parr/parr-espp-order-loader" PROD_NAME_ESPP_ORDER_MANAGER: "parr/parr-espp-order-manager" @@ -358,3 +359,51 @@ prod_master_deploy: - RUNNER: shell-api-swarm-01 tags: - ${RUNNER} + + +### ESPP SCHEDULE SYNC PROD ### +prod_espp_schedule_build: + stage: build + only: + - /^es[0-9]+\.[0-9]+\.[0-9]+$/ + except: + - branches + services: + - name: docker:20.10.21-dind + command: [ + "--insecure-registry=10.99.253.167:8090", + "--registry-mirror=http://10.99.253.167:8090", + "--insecure-registry=harbor.dvgd.rzd", + "--tls=false" + ] + variables: + DOCKER_HOST: tcp://docker:2375 + DOCKER_DRIVER: overlay2 + DOCKER_TLS_CERTDIR: "" + script: + - APP_VERSION=$(echo $CI_COMMIT_TAG | tr -d es) + - IMAGE_VERSION=$(echo $CI_COMMIT_TAG | sed 's/es/v/g') + - docker build -t $REPO/$PROD_NAME_ESPP_SCHEDULE:$IMAGE_VERSION -t $REPO/$PROD_NAME_ESPP_SCHEDULE:latest -t $PROD_NAME_ESPP_SCHEDULE:$IMAGE_VERSION -t $PROD_NAME_ESPP_SCHEDULE:latest --build-arg app_version=$APP_VERSION -f PARR.EsppScheduleSyncWorker/Dockerfile . + - docker login -u $HARBOR_PUSH_USER -p $HARBOR_PUSH_PASS $REPO + - docker push --all-tags $REPO/$PROD_NAME_ESPP_SCHEDULE + tags: + - docker + + +prod_espp_schedule_deploy: + stage: deploy + environment: + name: parr-espp-schedule-sync + only: + - /^es[0-9]+\.[0-9]+\.[0-9]+$/ + except: + - branches + script: + - IMAGE_VERSION=$(echo $CI_COMMIT_TAG | sed 's/es/v/g') + - docker login -u $HARBOR_PULL_USER -p $HARBOR_PULL_PASS $REPO + - tag=$IMAGE_VERSION docker stack deploy -c docker-compose.espp-schedule-sync.yml parr-espp-schedule-sync --with-registry-auth + parallel: + matrix: + - RUNNER: shell-api-swarm-01 + tags: + - ${RUNNER} \ No newline at end of file diff --git a/PARR.API.sln b/PARR.API.sln index 2abc5c3e..f118a72d 100644 --- a/PARR.API.sln +++ b/PARR.API.sln @@ -55,6 +55,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PARR.Constants", "PARR.Cons EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PARR.EsppSync", "PARR.EsppSync\PARR.EsppSync.csproj", "{71121EF7-D4C1-43A4-9243-EF5C4C82030F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PARR.EsppScheduleSync", "PARR.EsppScheduleSync\PARR.EsppScheduleSync.csproj", "{1E7F0EFE-784E-42E1-96BA-1FF743998619}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PARR.EsppScheduleSyncWorker", "PARR.EsppScheduleSyncWorker\PARR.EsppScheduleSyncWorker.csproj", "{C597A1D7-1BC5-493B-BC29-03EC830FB090}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -147,6 +151,14 @@ Global {71121EF7-D4C1-43A4-9243-EF5C4C82030F}.Debug|Any CPU.Build.0 = Debug|Any CPU {71121EF7-D4C1-43A4-9243-EF5C4C82030F}.Release|Any CPU.ActiveCfg = Release|Any CPU {71121EF7-D4C1-43A4-9243-EF5C4C82030F}.Release|Any CPU.Build.0 = Release|Any CPU + {1E7F0EFE-784E-42E1-96BA-1FF743998619}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1E7F0EFE-784E-42E1-96BA-1FF743998619}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1E7F0EFE-784E-42E1-96BA-1FF743998619}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1E7F0EFE-784E-42E1-96BA-1FF743998619}.Release|Any CPU.Build.0 = Release|Any CPU + {C597A1D7-1BC5-493B-BC29-03EC830FB090}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C597A1D7-1BC5-493B-BC29-03EC830FB090}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C597A1D7-1BC5-493B-BC29-03EC830FB090}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C597A1D7-1BC5-493B-BC29-03EC830FB090}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/PARR.API/Dockerfile b/PARR.API/Dockerfile index 0385d801..41f81a92 100644 --- a/PARR.API/Dockerfile +++ b/PARR.API/Dockerfile @@ -10,6 +10,7 @@ COPY ["NuGet.config", "."] COPY ["PARR.API/PARR.API.csproj", "PARR.API/"] COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"] COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"] +COPY ["PARR.Constants/PARR.Constants.csproj", "PARR.Constants/"] RUN dotnet restore "PARR.API/PARR.API.csproj" COPY . . WORKDIR "/src/PARR.API" diff --git a/PARR.EsppOrderLoaderWorker/Dockerfile b/PARR.EsppOrderLoaderWorker/Dockerfile index 32eab145..30091746 100644 --- a/PARR.EsppOrderLoaderWorker/Dockerfile +++ b/PARR.EsppOrderLoaderWorker/Dockerfile @@ -11,6 +11,7 @@ COPY ["PARR.EsppOrderLoader/PARR.EsppOrderLoader.csproj", "PARR.EsppOrderLoader/ COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"] COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"] COPY ["PARR.EsppApi/PARR.EsppApi.csproj", "PARR.EsppApi/"] +COPY ["PARR.Constants/PARR.Constants.csproj", "PARR.Constants/"] RUN dotnet restore "PARR.EsppOrderLoaderWorker/PARR.EsppOrderLoaderWorker.csproj" COPY . . WORKDIR "/src/PARR.EsppOrderLoaderWorker" diff --git a/PARR.EsppOrderManagerWorker/Dockerfile b/PARR.EsppOrderManagerWorker/Dockerfile index 6fc09ca3..3d66bc41 100644 --- a/PARR.EsppOrderManagerWorker/Dockerfile +++ b/PARR.EsppOrderManagerWorker/Dockerfile @@ -11,6 +11,7 @@ COPY ["PARR.EsppOrderManager/PARR.EsppOrderManager.csproj", "PARR.EsppOrderManag COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"] COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"] COPY ["PARR.EsppApi/PARR.EsppApi.csproj", "PARR.EsppApi/"] +COPY ["PARR.Constants/PARR.Constants.csproj", "PARR.Constants/"] RUN dotnet restore "PARR.EsppOrderManagerWorker/PARR.EsppOrderManagerWorker.csproj" COPY . . WORKDIR "/src/PARR.EsppOrderManagerWorker" diff --git a/PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs b/PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs new file mode 100644 index 00000000..6bad89ae --- /dev/null +++ b/PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs @@ -0,0 +1,14 @@ +using PARR.Constants; +using PARR.EsppSync; + +namespace PARR.EsppScheduleSync.Domain +{ + internal class EsppObjectSchedule : IEsppObject + { + public required string TemplateName { get; set; } + + public RobotsEnum Robot => RobotsEnum.ScheduleOrder; + + //todo: + } +} diff --git a/PARR.EsppScheduleSync/EsppScheduleSyncInstaller.cs b/PARR.EsppScheduleSync/EsppScheduleSyncInstaller.cs new file mode 100644 index 00000000..4cbebe01 --- /dev/null +++ b/PARR.EsppScheduleSync/EsppScheduleSyncInstaller.cs @@ -0,0 +1,37 @@ +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using PARR.BLL; +using PARR.DAL; +using PARR.EsppSync; +using PARR.EsppScheduleSync.Domain; +using PARR.EsppScheduleSync.Settings; + +namespace PARR.EsppScheduleSync +{ + public static class EsppScheduleSyncInstaller + { + public static void InstallEsppScheduleSyncServices(this IServiceCollection services, IConfiguration configuration) + { + services.InstallBllServices(configuration); + services.InstallEsppSyncServices(configuration); + + var globalSettings = new GlobalSettings(); + configuration.GetSection(nameof(GlobalSettings)).Bind(globalSettings); + services.AddSingleton(globalSettings); + + services.AddTransient(); + } + + public static IConfigurationBuilder AddEsppScheduleConfigurations(this IConfigurationBuilder builder, IServiceCollection services) + { + builder.AddDalConfigurations(services); + + return builder; + } + + public static void AddEsppScheduleSettings(this IServiceCollection services, IConfiguration configuration) + { + services.AddDallSettings(configuration); + } + } +} diff --git a/PARR.EsppScheduleSync/IScheduleSyncher.cs b/PARR.EsppScheduleSync/IScheduleSyncher.cs new file mode 100644 index 00000000..23ef722d --- /dev/null +++ b/PARR.EsppScheduleSync/IScheduleSyncher.cs @@ -0,0 +1,8 @@ +namespace PARR.EsppScheduleSync +{ + public interface IScheduleSyncher + { + void Start(); + void Stop(); + } +} diff --git a/PARR.EsppScheduleSync/PARR.EsppScheduleSync.csproj b/PARR.EsppScheduleSync/PARR.EsppScheduleSync.csproj new file mode 100644 index 00000000..81c8506a --- /dev/null +++ b/PARR.EsppScheduleSync/PARR.EsppScheduleSync.csproj @@ -0,0 +1,15 @@ + + + + net7.0 + enable + enable + + + + + + + + + diff --git a/PARR.EsppScheduleSync/ScheduleSyncher.cs b/PARR.EsppScheduleSync/ScheduleSyncher.cs new file mode 100644 index 00000000..b0c53ca0 --- /dev/null +++ b/PARR.EsppScheduleSync/ScheduleSyncher.cs @@ -0,0 +1,91 @@ +using Microsoft.Extensions.Logging; +using PARR.BLL.Services.Interfaces; +using PARR.DAL.Contracts; +using PARR.DAL.Models; +using PARR.EsppScheduleSync.Domain; +using PARR.EsppScheduleSync.Settings; +using PARR.EsppSync; + +namespace PARR.EsppScheduleSync +{ + internal class ScheduleSyncher : IScheduleSyncher + { + private readonly ILogger logger; + private readonly GlobalSettings globalSettings; + private readonly IMqService mqService; + private readonly ISyncService syncService; + private readonly SettingsFromDb settingsFromDb; + + public ScheduleSyncher( + ILogger logger, + GlobalSettings globalSettings, + IMqService mqService, + ISyncService syncService, + SettingsFromDb settingsFromDb + ) + { + this.logger = logger; + this.globalSettings = globalSettings; + this.mqService = mqService; + this.syncService = syncService; + this.settingsFromDb = settingsFromDb; + + if (globalSettings.MqSettings == null) + { + logger.LogError("Нет секции настроек хранилища. MqSettings, EsppTemplates"); + throw new Exception("Нет секции настроек хранилища. MqSettings, EsppTemplates"); + } + } + + + public void Start() + { + var isConnected = mqService.InitConsumer(globalSettings!.MqSettings!, SyncScheduleAsync); + + if (!isConnected) + throw new Exception("Ошибка при подключении к RabbitMq"); + + logger.LogInformation($"Запущена проверка очереди {globalSettings.MqSettings!.QueueName}."); + } + + + public void Stop() + { + mqService.Dispose(); + + logger.LogInformation($"=== === === Соединение с очередью {globalSettings.MqSettings!.QueueName} закрыто === === ==="); + } + + + private async Task SyncScheduleAsync(string str) + { + await syncService.SyncEsppObjectAsync(str, ParseStrToEsppObject, ConvertDbObjToEsppObj); + } + + + /// + /// Преобразование модели БД в модель для сравнения + /// + /// + /// + /// + private EsppObjectSchedule ConvertDbObjToEsppObj(Template template) + { + //todo: + throw new NotImplementedException(); + } + + + /// + /// Парсинг из строки в модель для сравнения + /// + /// + /// + /// + private EsppObjectSchedule? ParseStrToEsppObject(string str) + { + //todo: + throw new NotImplementedException(); + } + } +} diff --git a/PARR.EsppScheduleSync/Settings/GlobalSettings.cs b/PARR.EsppScheduleSync/Settings/GlobalSettings.cs new file mode 100644 index 00000000..a22e87a5 --- /dev/null +++ b/PARR.EsppScheduleSync/Settings/GlobalSettings.cs @@ -0,0 +1,18 @@ +using PARR.BLL.Contracts.Interfaces; + +namespace PARR.EsppScheduleSync.Settings +{ + internal class GlobalSettings + { + public MqSettings? MqSettings { get; set; } + public string ParsingSeparator { get; set; } = "<|>"; + } + + internal class MqSettings : IMqSettings + { + public string HostName { get; set; } = string.Empty; + public string QueueName { get; set; } = string.Empty; + public string User { get; set; } = string.Empty; + public string Password { get; set; } = string.Empty; + } +} diff --git a/PARR.EsppScheduleSyncWorker/Dockerfile b/PARR.EsppScheduleSyncWorker/Dockerfile new file mode 100644 index 00000000..3b390db8 --- /dev/null +++ b/PARR.EsppScheduleSyncWorker/Dockerfile @@ -0,0 +1,28 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM 10.99.253.167:8090/dotnet/runtime:7.0 AS base +WORKDIR /app + +FROM 10.99.253.167:8090/dotnet/sdk:7.0 AS build +WORKDIR /src +COPY ["NuGet.config", "."] +COPY ["PARR.EsppScheduleSyncWorker/PARR.EsppScheduleSyncWorker.csproj", "PARR.EsppScheduleSyncWorker/"] +COPY ["PARR.EsppScheduleSync/PARR.EsppScheduleSync.csproj", "PARR.EsppScheduleSync/"] +COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"] +COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"] +COPY ["PARR.Constants/PARR.Constants.csproj", "PARR.Constants/"] +COPY ["PARR.EsppSync/PARR.EsppSync.csproj", "PARR.EsppSync/"] +RUN dotnet restore "PARR.EsppScheduleSyncWorker/PARR.EsppScheduleSyncWorker.csproj" +COPY . . +WORKDIR "/src/PARR.EsppScheduleSyncWorker" +RUN dotnet build "PARR.EsppScheduleSyncWorker.csproj" -c Release -o /app/build + +FROM build AS publish +ARG app_version=0.0.0-default +RUN dotnet publish "PARR.EsppScheduleSyncWorker.csproj" -c Release -o /app/publish /p:UseAppHost=false /p:Version=$app_version + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . + +ENTRYPOINT ["dotnet", "PARR.EsppScheduleSyncWorker.dll"] \ No newline at end of file diff --git a/PARR.EsppScheduleSyncWorker/PARR.EsppScheduleSyncWorker.csproj b/PARR.EsppScheduleSyncWorker/PARR.EsppScheduleSyncWorker.csproj new file mode 100644 index 00000000..2d1c2ff5 --- /dev/null +++ b/PARR.EsppScheduleSyncWorker/PARR.EsppScheduleSyncWorker.csproj @@ -0,0 +1,24 @@ + + + + net7.0 + enable + enable + dotnet-PARR.EsppScheduleSyncWorker-30fab400-2a4f-412e-ad4d-ec19f45d7c50 + Linux + + + + + + + + + + + + + + + + diff --git a/PARR.EsppScheduleSyncWorker/Program.cs b/PARR.EsppScheduleSyncWorker/Program.cs new file mode 100644 index 00000000..862412a5 --- /dev/null +++ b/PARR.EsppScheduleSyncWorker/Program.cs @@ -0,0 +1,32 @@ +using Elastic.CommonSchema.Serilog; +using PARR.EsppScheduleSync; +using PARR.EsppScheduleSyncWorker; +using Serilog; + +var builder = Host.CreateApplicationBuilder(); + +builder.Services.AddLogging(config => +{ + config.ClearProviders(); + + var logger = new LoggerConfiguration(); + + if (builder.Environment.IsProduction()) + logger.WriteTo.Console(new EcsTextFormatter()); + else + logger.WriteTo.Console(); + + logger.ReadFrom.Configuration(builder.Configuration); + + config.AddSerilog(logger.CreateLogger()); +}); + +builder.Services.InstallEsppScheduleSyncServices(builder.Configuration); +builder.Configuration.AddEsppScheduleConfigurations(builder.Services); +builder.Services.AddEsppScheduleSettings(builder.Configuration); + +builder.Services.AddHostedService(); + +var host = builder.Build(); +host.Run(); + diff --git a/PARR.EsppScheduleSyncWorker/Properties/launchSettings.json b/PARR.EsppScheduleSyncWorker/Properties/launchSettings.json new file mode 100644 index 00000000..4c56f28f --- /dev/null +++ b/PARR.EsppScheduleSyncWorker/Properties/launchSettings.json @@ -0,0 +1,14 @@ +{ + "profiles": { + "PARR.EsppScheduleSyncWorker": { + "commandName": "Project", + "environmentVariables": { + "DOTNET_ENVIRONMENT": "Development" + }, + "dotnetRunMessages": true + }, + "Docker": { + "commandName": "Docker" + } + } +} \ No newline at end of file diff --git a/PARR.EsppScheduleSyncWorker/Worker.cs b/PARR.EsppScheduleSyncWorker/Worker.cs new file mode 100644 index 00000000..28e88dfb --- /dev/null +++ b/PARR.EsppScheduleSyncWorker/Worker.cs @@ -0,0 +1,29 @@ +using PARR.DAL.TransformServices; +using PARR.EsppScheduleSync; + +namespace PARR.EsppScheduleSyncWorker +{ + public class Worker : BackgroundService + { + private readonly ILogger _logger; + private readonly IScheduleSyncher scheduleSyncher; + + public Worker(ILogger logger, IScheduleSyncher scheduleSyncher) + { + _logger = logger; + this.scheduleSyncher = scheduleSyncher; + } + + protected override async Task ExecuteAsync(CancellationToken stoppingToken) + { + scheduleSyncher.Start(); + } + + public override Task StopAsync(CancellationToken cancellationToken) + { + scheduleSyncher.Stop(); + + return base.StopAsync(cancellationToken); + } + } +} \ No newline at end of file diff --git a/PARR.EsppScheduleSyncWorker/appsettings.Development.json b/PARR.EsppScheduleSyncWorker/appsettings.Development.json new file mode 100644 index 00000000..8fe710ee --- /dev/null +++ b/PARR.EsppScheduleSyncWorker/appsettings.Development.json @@ -0,0 +1,13 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "GlobalSettings": { + "MqSettings": { + "HostName": "10.99.253.216" + } + } +} diff --git a/PARR.EsppScheduleSyncWorker/appsettings.json b/PARR.EsppScheduleSyncWorker/appsettings.json new file mode 100644 index 00000000..7ab20277 --- /dev/null +++ b/PARR.EsppScheduleSyncWorker/appsettings.json @@ -0,0 +1,38 @@ +{ + "ConnectionStrings": { + "DefaultConnection": "Server=10.99.253.184;Database=parr;User Id=app_parr; Password=PosdfkhT&)%sdfligL&%5546;" + }, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "Serilog": { + "MinimumLevel": { + "Default": "Debug", + "Override": { + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Debug" + } + }, + "WriteTo": [ + { + "Name": "File", + "Args": { + "path": "log/log-.txt", + "rollingInterval": "Day" + } + } + ] + }, + "GlobalSettings": { + "MqSettings": { + "HostName": "parr-rabbitmq", + "QueueName": "parr-espp-schedulers", + "User": "espp_schedulers_reader", + "Password": "KjdhGLJDshgd&^%84S2" + }, + "ParsingSeparator": "<|>" + } +} diff --git a/PARR.EsppTemplateSync/Domain/EsppObjectTemplate.cs b/PARR.EsppTemplateSync/Domain/EsppObjectTemplate.cs index 21c2f4ff..4a2afe64 100644 --- a/PARR.EsppTemplateSync/Domain/EsppObjectTemplate.cs +++ b/PARR.EsppTemplateSync/Domain/EsppObjectTemplate.cs @@ -8,7 +8,7 @@ namespace PARR.EsppTemplateSync.Domain public required string TemplateName { get; set; } public RobotsEnum Robot => RobotsEnum.TemplateOrder; - + public bool IsActive { get; set; } public required string WorkGroup { get; set; } public required string ShortDescription { get; set; } diff --git a/PARR.EsppTemplateSync/Settings/GlobalSettings.cs b/PARR.EsppTemplateSync/Settings/GlobalSettings.cs index 7a6fd582..1fbb53f1 100644 --- a/PARR.EsppTemplateSync/Settings/GlobalSettings.cs +++ b/PARR.EsppTemplateSync/Settings/GlobalSettings.cs @@ -7,7 +7,7 @@ namespace PARR.EsppTemplateSync.Settings public MqSettings? MqSettings { get; set; } public StorageSettings? StorageSettings { get; set; } - public List? IgnoreTemplateFields { get; set; } + //public List? IgnoreTemplateFields { get; set; } public string ParsingSeparator { get; set; } = "<|>"; } diff --git a/PARR.EsppTemplateSync/TemplateMQSyncer.cs b/PARR.EsppTemplateSync/TemplateMQSyncer.cs index a077f5d0..ec251bd4 100644 --- a/PARR.EsppTemplateSync/TemplateMQSyncer.cs +++ b/PARR.EsppTemplateSync/TemplateMQSyncer.cs @@ -29,6 +29,7 @@ namespace PARR.EsppTemplateSync this.mqService = mqService; this.syncService = syncService; this.settingsFromDb = settingsFromDb; + if (globalSettings.MqSettings == null) { logger.LogError("Нет секции настроек хранилища. MqSettings, EsppTemplates"); diff --git a/PARR.EsppTemplateSyncWorker/Dockerfile b/PARR.EsppTemplateSyncWorker/Dockerfile index cde978df..ec3a584c 100644 --- a/PARR.EsppTemplateSyncWorker/Dockerfile +++ b/PARR.EsppTemplateSyncWorker/Dockerfile @@ -10,6 +10,7 @@ COPY ["PARR.EsppTemplateSyncWorker/PARR.EsppTemplateSyncWorker.csproj", "PARR.Es COPY ["PARR.EsppTemplateSync/PARR.EsppTemplateSync.csproj", "PARR.EsppTemplateSync/"] COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"] COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"] +COPY ["PARR.Constants/PARR.Constants.csproj", "PARR.Constants/"] RUN dotnet restore "PARR.EsppTemplateSyncWorker/PARR.EsppTemplateSyncWorker.csproj" COPY . . WORKDIR "/src/PARR.EsppTemplateSyncWorker" diff --git a/PARR.EsppTemplateSyncWorker/appsettings.json b/PARR.EsppTemplateSyncWorker/appsettings.json index 7acdc92c..06ca9eaf 100644 --- a/PARR.EsppTemplateSyncWorker/appsettings.json +++ b/PARR.EsppTemplateSyncWorker/appsettings.json @@ -43,7 +43,6 @@ "StorageSettings": { "CheckIntervalSeconds": 30 }, - "IgnoreTemplateFields": [ "Id", "Status", "Name", "DateCreated", "DateModified", "StatusCode" ], "ParsingSeparator": "<|>" } } diff --git a/PARR.GeneratorTemplatesWorker/Dockerfile b/PARR.GeneratorTemplatesWorker/Dockerfile index 1933f127..e3eed96b 100644 --- a/PARR.GeneratorTemplatesWorker/Dockerfile +++ b/PARR.GeneratorTemplatesWorker/Dockerfile @@ -10,6 +10,7 @@ COPY ["PARR.GeneratorTemplatesWorker/PARR.GeneratorTemplatesWorker.csproj", "PAR COPY ["PARR.GeneratorTemplates/PARR.GeneratorTemplates.csproj", "PARR.GeneratorTemplates/"] COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"] COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"] +COPY ["PARR.Constants/PARR.Constants.csproj", "PARR.Constants/"] RUN dotnet restore "PARR.GeneratorTemplatesWorker/PARR.GeneratorTemplatesWorker.csproj" COPY . . WORKDIR "/src/PARR.GeneratorTemplatesWorker" diff --git a/PARR.MasterWorker/Dockerfile b/PARR.MasterWorker/Dockerfile index 62f9d055..c829b00b 100644 --- a/PARR.MasterWorker/Dockerfile +++ b/PARR.MasterWorker/Dockerfile @@ -10,6 +10,7 @@ COPY ["PARR.MasterWorker/PARR.MasterWorker.csproj", "PARR.MasterWorker/"] COPY ["PARR.Master/PARR.Master.csproj", "PARR.Master/"] COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"] COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"] +COPY ["PARR.Constants/PARR.Constants.csproj", "PARR.Constants/"] RUN dotnet restore "PARR.MasterWorker/PARR.MasterWorker.csproj" COPY . . WORKDIR "/src/PARR.MasterWorker" diff --git a/README.md b/README.md index 90a2cca7..f7759631 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,10 @@ - PARR.EsppOrderLoaderWorker - PARR.EsppOrderManager - управление нарядами в ЕСПП (в работу, выполнить, и т.п.) - PARR.EsppOrderManagerWorker +- PARR.EsppScheduleSync - логика синхронизации расписаний ЕСПП с БД PARR +- PARR.EsppScheduleSyncWorker - worker для PARR.EsppScheduleSync - PARR.EsppSync - общая логика синхронизации шаблонов и расписаний ЕСПП с БД PARR -- PARR.EsppTemplateSync - логика синхронизации шаблонов ESPP с БД PARR +- PARR.EsppTemplateSync - логика синхронизации шаблонов ЕСПП с БД PARR - PARR.EsppTemplateSyncWorker - worker для PARR.EsppTemplateSync - PARR.GeneratorTemplates - логика генерации шаблонов в ПАРР - PARR.GeneratorTemplatesWorker - Worker для PARR.GeneratorTemplates diff --git a/docker-compose.espp-schedule-sync.yml b/docker-compose.espp-schedule-sync.yml new file mode 100644 index 00000000..464e10ea --- /dev/null +++ b/docker-compose.espp-schedule-sync.yml @@ -0,0 +1,23 @@ +version: '3.4' + +#ESPP SCHEDULE SYNC +services: + parr-espp-schedule-sync: + image: harbor.dvgd.rzd/parr/parr-espp-schedule-sync:${tag:-latest} + environment: + - ASPNETCORE_ENVIRONMENT=Production + - TZ=Europe/Moscow + logging: + driver: fluentd + options: + fluentd-address: dvgd-mng-02.dvgd.oao.rzd:24224 + tag: parr.espp-schedule-sync.serilog + deploy: + replicas: 4 + networks: + - parr-network + +networks: + parr-network: + driver: overlay + external: true \ No newline at end of file From 4a0433a3893bf90f212297c503d6f0037b25b6f7 Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Fri, 24 Nov 2023 16:52:56 +1000 Subject: [PATCH 5/7] =?UTF-8?q?feat(esppScheduleSync):=20=D0=BC=D0=B5?= =?UTF-8?q?=D1=82=D0=BE=D0=B4=20ParseStrToEsppObject?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Domain/EsppObjectSchedule.cs | 101 +++++++++- PARR.EsppScheduleSync/ScheduleSyncher.cs | 179 +++++++++++++++++- PARR.EsppSync/SyncService.cs | 4 + PARR.EsppTemplateSync/TemplateMQSyncer.cs | 2 +- 4 files changed, 281 insertions(+), 5 deletions(-) diff --git a/PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs b/PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs index 6bad89ae..099c52dc 100644 --- a/PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs +++ b/PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs @@ -1,14 +1,111 @@ using PARR.Constants; +using PARR.DAL.Contracts; using PARR.EsppSync; namespace PARR.EsppScheduleSync.Domain { internal class EsppObjectSchedule : IEsppObject { - public required string TemplateName { get; set; } + //Все поля описаны в документации по роботам: http://gitlab.dvgd.oao.rzd/devptk/parr/parr_api/-/wikis/EsppRobots public RobotsEnum Robot => RobotsEnum.ScheduleOrder; - //todo: + public required string TemplateName { get; set; } + + public string Code { get; set; } = string.Empty; + + public string ScheduleName { get; set; } = string.Empty; + + public bool IsActive { get; set; } + + public string ResponseArea { get; set; } = string.Empty; + + public string WorkGroup { get; set; } = string.Empty; + + /// + /// Тип повторения: Регулярно, Ежегодно... + /// + public EsppSchTypeScheduleEnum TypeSchedule { get; set; } + + /// + /// Интервал времени: Ежедневно, 1 00:00:00 + /// + public string Interval { get; set; } = string.Empty; + + /// + /// Еженедельно: Каждый понедельник + /// + public string Dayofweek { get; set; } = string.Empty; + + /// + /// Ежемесячно: Каждое 23 + /// + public string Dayofmonth { get; set; } = string.Empty; + + /// + /// Ежемесячно-2: Каждый Первый + /// + public string Md1 { get; set; } = string.Empty; + + /// + /// Ежемесячно-2: Каждый Понедельник + /// + public string Md2 { get; set; } = string.Empty; + + + /// + /// Ежегодно: Каждый Январь + /// + public string Annualm { get; set; } = string.Empty; + + /// + /// Ежегодно: Каждый 12 + /// + public string Annualday { get; set; } = string.Empty; + + /// + /// Ежегодно-2: Каждый Первый + /// + public string An1 { get; set; } = string.Empty; + + /// + /// Ежегодно-2: Каждый Понедельник + /// + public string An2 { get; set; } = string.Empty; + + /// + /// Ежегодно-2: Каждый Января + /// + public string An3 { get; set; } = string.Empty; + + /// + /// Тип исключения: Нет исключений + /// + public string TypeV60calendar { get; set; } = string.Empty; + + /// + /// Следующее срабатывание: 16/10/23 17:00:00 + /// + public required string Scheduled { get; set; } + + /// + /// В каком часовом поясе: MSK + /// + public required string Timezone { get; set; } + + /// + /// Тип прекращения, Отсутствует дата завершения: Выбран radio button forever + /// + public required string TerminationType { get; set; } + + /// + /// Завершение после: 0 + /// + public string CompleteAfter { get; set; } = string.Empty; + + /// + /// Рабочий график + /// + public string V60calendar { get; set; } = string.Empty; } } diff --git a/PARR.EsppScheduleSync/ScheduleSyncher.cs b/PARR.EsppScheduleSync/ScheduleSyncher.cs index b0c53ca0..91f2f049 100644 --- a/PARR.EsppScheduleSync/ScheduleSyncher.cs +++ b/PARR.EsppScheduleSync/ScheduleSyncher.cs @@ -84,8 +84,183 @@ namespace PARR.EsppScheduleSync /// private EsppObjectSchedule? ParseStrToEsppObject(string str) { - //todo: - throw new NotImplementedException(); + var splittedContent = str.Split(globalSettings.ParsingSeparator); + if (splittedContent.Length != 23) + { + logger.LogError($"Входная строка после сплита не содержит 23 объекта (факт: {splittedContent.Length})."); + return null; + } + + var templateName = splittedContent[6]; + var scheduleName = splittedContent[2]; + + if (!IsValidName(templateName) || !IsValidName(scheduleName)) + return null; + + bool.TryParse(splittedContent[1].Trim(), out var isActive); + + var esppObject = new EsppObjectSchedule + { + TemplateName = templateName, + Code = splittedContent[0], + ScheduleName = scheduleName, + IsActive = isActive, + ResponseArea = splittedContent[5], + WorkGroup = splittedContent[3], + //TODO:!!! + //TypeSchedule = splittedContent[7], + Interval = splittedContent[8], + Dayofweek = splittedContent[15], + Dayofmonth = splittedContent[14], + Md1 = splittedContent[16], + Md2 = splittedContent[17], + Annualm = splittedContent[13], + Annualday = splittedContent[12], + An1 = splittedContent[9], + An2 = splittedContent[10], + An3 = splittedContent[11], + TypeV60calendar = splittedContent[21], + Scheduled = splittedContent[4], + Timezone = splittedContent[18], + TerminationType = splittedContent[19], + CompleteAfter = splittedContent[20], + V60calendar = splittedContent[22] + }; + + return ClearOptionalFields(esppObject); } + + + /// + /// Проверка имени шаблона и расписание на соответствие префиксу из настроек + /// + /// + /// + private bool IsValidName(string name) + { + var currentCulture = Thread.CurrentThread.CurrentCulture; + + if (!string.IsNullOrEmpty(settingsFromDb.TemplatePrefixName) && name.StartsWith(settingsFromDb.TemplatePrefixName, true, currentCulture)) + return true; + + logger.LogWarning($"Имя шаблона или расписания не соответствует обязательному префиксу({settingsFromDb.TemplatePrefixName}). {name} игнорирован"); + + return false; + } + + + /// + /// Очистка полей которые не нуждаются в синхронизации + /// + /// + /// + private EsppObjectSchedule ClearOptionalFields(EsppObjectSchedule esppObject) + { + esppObject.Code = string.Empty; + esppObject.ScheduleName = string.Empty; + esppObject.ResponseArea = string.Empty; + esppObject.WorkGroup = string.Empty; + esppObject.CompleteAfter = string.Empty; + + // В ЕСПП, при изменении "Повторять задачу", остаются предыдущие значения, их не нужно синхронизировать (касается только данных полученных из ЕСПП, в БД все ок) + // т.е. если стояло Ежедненвно:понедельник, а изменили например на Еженедельно..., то в ежедневно значения останутся, но будут отрабатывать значения из Еженедельно. + // Т е значения из Ежедненвно проверять не нужно, вот их и будем очищать + + //TODO: сделать миграцию в БД: Еженежельно + + //TODO:!!! + ////Regularly, Регулярно (значение в ЕСПП и в БД не совпадают, в бд Regularly, в ЕСПП simple) + //if (esppObject.TypeSchedule.ToLower() == "simple" || esppObject.TypeSchedule.ToLower() == EsppSchTypeScheduleEnum.Regularly.ToString().ToLower()) + //{ + // //esppObject.Interval = string.Empty; + // esppObject.Dayofweek = string.Empty; + // esppObject.Dayofmonth = string.Empty; + // esppObject.Md1 = string.Empty; + // esppObject.Md2 = string.Empty; + // esppObject.Annualm = string.Empty; + // esppObject.Annualday = string.Empty; + // esppObject.An1 = string.Empty; + // esppObject.An2 = string.Empty; + // esppObject.An3 = string.Empty; + //} + + ////Weekly, Еженедельно + //if (esppObject.TypeSchedule == "weekly") + //{ + // esppObject.Interval = string.Empty; + // //esppObject.Dayofweek = string.Empty; + // esppObject.Dayofmonth = string.Empty; + // esppObject.Md1 = string.Empty; + // esppObject.Md2 = string.Empty; + // esppObject.Annualm = string.Empty; + // esppObject.Annualday = string.Empty; + // esppObject.An1 = string.Empty; + // esppObject.An2 = string.Empty; + // esppObject.An3 = string.Empty; + //} + + ////Monthly, Ежемесячно + //if (esppObject.TypeSchedule == "monthly") + //{ + // esppObject.Interval = string.Empty; + // esppObject.Dayofweek = string.Empty; + // //esppObject.Dayofmonth = string.Empty; + // esppObject.Md1 = string.Empty; + // esppObject.Md2 = string.Empty; + // esppObject.Annualm = string.Empty; + // esppObject.Annualday = string.Empty; + // esppObject.An1 = string.Empty; + // esppObject.An2 = string.Empty; + // esppObject.An3 = string.Empty; + //} + + ////Monthly2, Ежемесячно-2 + //if (esppObject.TypeSchedule == "monthly2") + //{ + // esppObject.Interval = string.Empty; + // esppObject.Dayofweek = string.Empty; + // esppObject.Dayofmonth = string.Empty; + // //esppObject.Md1 = string.Empty; + // //esppObject.Md2 = string.Empty; + // esppObject.Annualm = string.Empty; + // esppObject.Annualday = string.Empty; + // esppObject.An1 = string.Empty; + // esppObject.An2 = string.Empty; + // esppObject.An3 = string.Empty; + //} + + ////Annually, Ежегодно + //if (esppObject.TypeSchedule == "annually") + //{ + // esppObject.Interval = string.Empty; + // esppObject.Dayofweek = string.Empty; + // esppObject.Dayofmonth = string.Empty; + // esppObject.Md1 = string.Empty; + // esppObject.Md2 = string.Empty; + // //esppObject.Annualm = string.Empty; + // //esppObject.Annualday = string.Empty; + // esppObject.An1 = string.Empty; + // esppObject.An2 = string.Empty; + // esppObject.An3 = string.Empty; + //} + + ////Annually2, Ежегодно-2 + //if (esppObject.TypeSchedule == "annually2") + //{ + // esppObject.Interval = string.Empty; + // esppObject.Dayofweek = string.Empty; + // esppObject.Dayofmonth = string.Empty; + // esppObject.Md1 = string.Empty; + // esppObject.Md2 = string.Empty; + // esppObject.Annualm = string.Empty; + // esppObject.Annualday = string.Empty; + // //esppObject.An1 = string.Empty; + // //esppObject.An2 = string.Empty; + // //esppObject.An3 = string.Empty; + //} + + return esppObject; + } + } } diff --git a/PARR.EsppSync/SyncService.cs b/PARR.EsppSync/SyncService.cs index d6ff6a68..57107ac3 100644 --- a/PARR.EsppSync/SyncService.cs +++ b/PARR.EsppSync/SyncService.cs @@ -65,6 +65,8 @@ namespace PARR.EsppSync if (isChanged) { + logger.LogInformation($"Есть изменения, требуется обновление. {esppObject.TemplateName}"); + SetUpdateStatus(ref template, robotConfigurationService, esppObject.Robot); if (!await templateService.CommitAsync()) @@ -74,6 +76,8 @@ namespace PARR.EsppSync }//надо ли проверять если не изменился, но был статус Updating не понятно. Доверяем роботу пока, что после окончания работ он точно сообщит else { + logger.LogInformation($"Нет изменений, обновление не требуется. {esppObject.TemplateName}"); + //если все поля совпали //проверяем, какой был статус предыдущий статус в БД, если он был не Ок, то ставим ему ОК var robotConfig = robotConfigurationService.GetFromTemplateByRobotCode(esppObject.Robot, ref template); diff --git a/PARR.EsppTemplateSync/TemplateMQSyncer.cs b/PARR.EsppTemplateSync/TemplateMQSyncer.cs index ec251bd4..6c633aed 100644 --- a/PARR.EsppTemplateSync/TemplateMQSyncer.cs +++ b/PARR.EsppTemplateSync/TemplateMQSyncer.cs @@ -108,7 +108,7 @@ namespace PARR.EsppTemplateSync var templateName = splittedContent[0].Trim(); var currentCulture = Thread.CurrentThread.CurrentCulture; - if (!string.IsNullOrEmpty(settingsFromDb.TemplatePrefixName) && !templateName.StartsWith(settingsFromDb.TemplatePrefixName, true, currentCulture)) + if (!string.IsNullOrEmpty(settingsFromDb.TemplatePrefixName) || !templateName.StartsWith(settingsFromDb.TemplatePrefixName, true, currentCulture)) { logger.LogWarning($"Имя шаблона не соответствует обязательному префиксу({settingsFromDb.TemplatePrefixName}). Шаблон {templateName} игнорирован"); return null; From 2fde70c9a2854d2d19ea5395ac3ae5f8f4cc9b29 Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Mon, 27 Nov 2023 09:27:20 +1000 Subject: [PATCH 6/7] =?UTF-8?q?feat(esppScheduleSync):=20=D0=B4=D0=BE?= =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4?= =?UTF-8?q?=20ParseStrToEsppObject?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PARR.DAL/Context/DataContext.cs | 2 +- ...pSchTypeScheduleFixDescription.Designer.cs | 2667 +++++++++++++++++ ...27_TblEsppSchTypeScheduleFixDescription.cs | 32 + .../Migrations/DataContextModelSnapshot.cs | 2 +- PARR.EsppScheduleSync/ScheduleSyncher.cs | 208 +- docker-compose.dcproj | 1 + 6 files changed, 2816 insertions(+), 96 deletions(-) create mode 100644 PARR.DAL/Migrations/20231126232527_TblEsppSchTypeScheduleFixDescription.Designer.cs create mode 100644 PARR.DAL/Migrations/20231126232527_TblEsppSchTypeScheduleFixDescription.cs diff --git a/PARR.DAL/Context/DataContext.cs b/PARR.DAL/Context/DataContext.cs index 45c8eb21..e9521e32 100644 --- a/PARR.DAL/Context/DataContext.cs +++ b/PARR.DAL/Context/DataContext.cs @@ -294,7 +294,7 @@ namespace PARR.DAL.Context { f.HasData( new { Id = (int)EsppSchTypeScheduleEnum.Regularly, Name = EsppSchTypeScheduleEnum.Regularly.ToString(), Description = "Регулярно" }, - new { Id = (int)EsppSchTypeScheduleEnum.Weekly, Name = EsppSchTypeScheduleEnum.Weekly.ToString(), Description = "Еженежельно" }, + new { Id = (int)EsppSchTypeScheduleEnum.Weekly, Name = EsppSchTypeScheduleEnum.Weekly.ToString(), Description = "Еженедельно" }, new { Id = (int)EsppSchTypeScheduleEnum.Monthly, Name = EsppSchTypeScheduleEnum.Monthly.ToString(), Description = "Ежемесячно" }, new { Id = (int)EsppSchTypeScheduleEnum.Monthly2, Name = EsppSchTypeScheduleEnum.Monthly2.ToString(), Description = "Ежемесячно-2" }, new { Id = (int)EsppSchTypeScheduleEnum.Annually, Name = EsppSchTypeScheduleEnum.Annually.ToString(), Description = "Ежегодно" }, diff --git a/PARR.DAL/Migrations/20231126232527_TblEsppSchTypeScheduleFixDescription.Designer.cs b/PARR.DAL/Migrations/20231126232527_TblEsppSchTypeScheduleFixDescription.Designer.cs new file mode 100644 index 00000000..c4496639 --- /dev/null +++ b/PARR.DAL/Migrations/20231126232527_TblEsppSchTypeScheduleFixDescription.Designer.cs @@ -0,0 +1,2667 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using PARR.DAL.Context; + +#nullable disable + +namespace PARR.DAL.Migrations +{ + [DbContext(typeof(DataContext))] + [Migration("20231126232527_TblEsppSchTypeScheduleFixDescription")] + partial class TblEsppSchTypeScheduleFixDescription + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("PARR.DAL.Models.AIHIT.RawDataEK", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AIHID") + .HasColumnType("integer"); + + b.Property("APPType") + .HasColumnType("text"); + + b.Property("AdditionalInfo") + .HasColumnType("text"); + + b.Property("CKBSServerType") + .HasColumnType("text"); + + b.Property("CTSDirection") + .HasColumnType("text"); + + b.Property("ClientOS") + .HasColumnType("text"); + + b.Property("ClientSoftware") + .HasColumnType("text"); + + b.Property("Company") + .HasColumnType("text"); + + b.Property("CreateTime") + .HasColumnType("text"); + + b.Property("DBType") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EKCategory") + .HasColumnType("text"); + + b.Property("EKFindCode") + .HasColumnType("text"); + + b.Property("EKRegister") + .HasColumnType("text"); + + b.Property("EKRevizor") + .HasColumnType("text"); + + b.Property("EKSubCategory") + .HasColumnType("text"); + + b.Property("EKType") + .HasColumnType("text"); + + b.Property("EndExplotationDate") + .HasColumnType("text"); + + b.Property("FullName") + .HasColumnType("text"); + + b.Property("IBServerType") + .HasColumnType("text"); + + b.Property("IP") + .HasColumnType("text"); + + b.Property("InfrastructureServerType") + .HasColumnType("text"); + + b.Property("IsActive") + .HasColumnType("text"); + + b.Property("IsImportant") + .HasColumnType("text"); + + b.Property("IsUnreliableData") + .HasColumnType("character(1)"); + + b.Property("Location") + .HasColumnType("text"); + + b.Property("Metka") + .HasColumnType("text"); + + b.Property("MonitoringServerType") + .HasColumnType("text"); + + b.Property("NetworkName") + .HasColumnType("text"); + + b.Property("NewEKFindCode") + .HasColumnType("text"); + + b.Property("OSType") + .HasColumnType("text"); + + b.Property("OldEKFindCode") + .HasColumnType("text"); + + b.Property("PlannedTimeToRepair") + .HasColumnType("text"); + + b.Property("Prescription") + .HasColumnType("text"); + + b.Property("ProductCode") + .HasColumnType("text"); + + b.Property("ResponseArea") + .HasColumnType("text"); + + b.Property("ResponsibleByEK") + .HasColumnType("text"); + + b.Property("ServiceCode") + .HasColumnType("text"); + + b.Property("ShiftWorkGroup") + .HasColumnType("text"); + + b.Property("ShortName") + .HasColumnType("text"); + + b.Property("StartExplotationDate") + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("text"); + + b.Property("SysModTime") + .HasColumnType("text"); + + b.Property("SysModUser") + .HasColumnType("text"); + + b.Property("TargetRepairTime") + .HasColumnType("text"); + + b.Property("WorkGroup") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("RawDataEKs", "AIHIT"); + }); + + modelBuilder.Entity("PARR.DAL.Models.AIHIT.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Group") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Settings", "AIHIT"); + + b.HasData( + new + { + Id = new Guid("b16afd06-605b-499f-9e35-a19586de96b0"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ГВЦ", + Value = "00-ГВЦ" + }, + new + { + Id = new Guid("42a2ec03-da3a-45fc-971e-399910fdc5ae"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ОКТ", + Value = "01-ОКТ" + }, + new + { + Id = new Guid("17efaf65-ae8c-45f1-b187-e6cb1bd6385b"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "КЛГ", + Value = "10-КЛГ" + }, + new + { + Id = new Guid("51270997-20f6-4a61-85ac-64f6b6dd5dc4"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "МСК", + Value = "17-МСК" + }, + new + { + Id = new Guid("b94f8c38-e78a-494e-81ba-39e4e902ffcc"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ГОР", + Value = "24-ГОР" + }, + new + { + Id = new Guid("52ba20ea-4e7a-4500-939b-e2cff563809a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "СЕВ", + Value = "28-СЕВ" + }, + new + { + Id = new Guid("cb9da805-29e9-4e08-b1ed-d4b374920f77"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "СКВ", + Value = "51-СКВ" + }, + new + { + Id = new Guid("1943a65c-2060-4b5f-af1f-acec74835481"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ЮВСТ", + Value = "58-ЮВСТ" + }, + new + { + Id = new Guid("4d9ef2ee-d4fa-4d28-a93b-6f1fd0a639f9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ПРИВ", + Value = "61-ПРИВ" + }, + new + { + Id = new Guid("f1a54c25-a93a-4fe3-8268-afbcc435b6e9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "КБШ", + Value = "63-КБШ" + }, + new + { + Id = new Guid("cc839c48-62bb-46a8-924c-85b5e7a3e245"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "СВРД", + Value = "76-СВРД" + }, + new + { + Id = new Guid("c98fb684-ff03-441e-a9c3-ac5071d69857"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ЮУР", + Value = "80-ЮУР" + }, + new + { + Id = new Guid("f2684a90-6029-4476-bd3d-e713a8a228d6"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ЗСИБ", + Value = "83-ЗСИБ" + }, + new + { + Id = new Guid("b3c73162-21ea-42f0-b0e1-3c5076176f8a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "КРАСН", + Value = "88-КРАСН" + }, + new + { + Id = new Guid("a8cff6fd-28b7-49f2-a412-9208c10f6516"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ВСИБ", + Value = "92-ВСИБ" + }, + new + { + Id = new Guid("50f66704-4d26-4587-bb1e-dca70c8f4b89"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ЗАБ", + Value = "94-ЗАБ" + }, + new + { + Id = new Guid("1fd43634-4a06-4237-9727-edfa6f3eebe8"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ДВС", + Value = "96-ДВС" + }, + new + { + Id = new Guid("77c73c0a-8e4d-4676-b6e2-6a112f20e346"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Статус актуальных ЭК", + Group = "Status", + Name = "Exploitation", + Value = "3-В эксплуатации" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.AgentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("HistoryLevelId") + .HasColumnType("integer"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("OrderId") + .HasColumnType("uuid"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("HistoryLevelId"); + + b.HasIndex("OrderId"); + + b.HasIndex("TemplateId"); + + b.ToTable("AgentHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.AgentHistoryLevel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("AgentHistoryLevels"); + + b.HasData( + new + { + Id = 1, + Description = "Агент начал выполнять задание", + Name = "Start" + }, + new + { + Id = 5, + Description = "Агент завершил выполнение задания", + Name = "End" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.Application", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationTypeId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationTypeId"); + + b.ToTable("Applications"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationInHost", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("HostId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId"); + + b.HasIndex("HostId"); + + b.ToTable("ApplicationsInHost"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("ApplicationTypes"); + + b.HasData( + new + { + Id = new Guid("32c28386-6f13-4f7b-8508-be165b7fabdb"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Поле СП xml АИХ ИТ", + Name = "APP" + }, + new + { + Id = new Guid("7848a96c-cdee-48c1-a786-de9cb889723a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Поле ОС xml АИХ ИТ", + Name = "OS" + }, + new + { + Id = new Guid("aae2636f-b93a-42dc-873e-0764a90a0a40"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Поле СУБД xml АИХ ИТ", + Name = "DB" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationsInWork", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AgentName") + .HasColumnType("text"); + + b.Property("AgentScript") + .HasColumnType("text"); + + b.Property("AgentTimeOutSec") + .HasColumnType("integer"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("FullDescription") + .IsRequired() + .HasColumnType("text"); + + b.Property("IsAgent") + .HasColumnType("boolean"); + + b.Property("LastRun") + .HasColumnType("timestamp with time zone"); + + b.Property("NextRun") + .HasColumnType("timestamp with time zone"); + + b.Property("ShortDescription") + .IsRequired() + .HasColumnType("text"); + + b.Property("Solution") + .IsRequired() + .HasColumnType("text"); + + b.Property("TemplateDuration") + .IsRequired() + .HasColumnType("text"); + + b.Property("WorkId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId"); + + b.HasIndex("WorkId", "ApplicationId") + .IsUnique(); + + b.ToTable("ApplicationsInWorks"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EkStatus", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("EkStatuses"); + + b.HasData( + new + { + Code = 1, + Name = "1-Новый" + }, + new + { + Code = 2, + Name = "2-Подготовка к эксплуатации" + }, + new + { + Code = 3, + Name = "3-В эксплуатации" + }, + new + { + Code = 4, + Name = "4-В ремонте" + }, + new + { + Code = 5, + Name = "5-В резерве" + }, + new + { + Code = 6, + Name = "6-Выведен из эксплуатации" + }, + new + { + Code = 7, + Name = "7-Тестовый" + }, + new + { + Code = 9, + Name = "9-В разработке" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("EsppSchTypes"); + + b.HasData( + new + { + Id = 1, + Description = "Через интервал", + Name = "Interval" + }, + new + { + Id = 2, + Description = "День недели: пнд, вт...", + Name = "DayOfWeek" + }, + new + { + Id = 3, + Description = "Число месяца: 1,2,3,4", + Name = "DayOfMonth" + }, + new + { + Id = 4, + Description = "Каждый: первый, второй, третий, четвертый, последний", + Name = "Order" + }, + new + { + Id = 5, + Description = "Месяц: январь, февраль...", + Name = "Month" + }, + new + { + Id = 6, + Description = "Месяц (родительный падеж): января, февраля...", + Name = "MonthGenitive" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Order") + .HasColumnType("integer"); + + b.Property("TypeId") + .HasColumnType("integer"); + + b.Property("TypeScheduleId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TypeId"); + + b.HasIndex("TypeScheduleId", "TypeId") + .IsUnique(); + + b.ToTable("EsppSchTypeConfigs"); + + b.HasData( + new + { + Id = new Guid("d2693562-b3eb-41e9-97db-c6b5d2ef1bea"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 1, + TypeScheduleId = 1 + }, + new + { + Id = new Guid("06b2e7aa-6927-4fbf-99fb-67c92a4fce8a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 2, + TypeScheduleId = 2 + }, + new + { + Id = new Guid("78079071-ff80-417e-9bb0-d928cec853e7"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 3, + TypeScheduleId = 3 + }, + new + { + Id = new Guid("accb1d46-e1c1-4396-9182-4c0766155921"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 4, + TypeScheduleId = 4 + }, + new + { + Id = new Guid("162ffe73-2428-4abe-8f83-235c2593664c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 1, + TypeId = 2, + TypeScheduleId = 4 + }, + new + { + Id = new Guid("8470d1ef-165d-42fc-ab05-8203e4d263cf"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 5, + TypeScheduleId = 5 + }, + new + { + Id = new Guid("006900b5-f65c-413e-bc67-09e6dae60b7c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 1, + TypeId = 3, + TypeScheduleId = 5 + }, + new + { + Id = new Guid("85635bc8-f17a-46b8-9c15-8615761be3d9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 4, + TypeScheduleId = 6 + }, + new + { + Id = new Guid("439460c2-deca-4b54-80e7-2f20806696ec"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 1, + TypeId = 2, + TypeScheduleId = 6 + }, + new + { + Id = new Guid("5c63ad8c-e9b4-43fd-9d24-5c2eed80dadd"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 2, + TypeId = 6, + TypeScheduleId = 6 + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeSchedule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("EsppSchTypeSchedules"); + + b.HasData( + new + { + Id = 1, + Description = "Регулярно", + Name = "Regularly" + }, + new + { + Id = 2, + Description = "Еженедельно", + Name = "Weekly" + }, + new + { + Id = 3, + Description = "Ежемесячно", + Name = "Monthly" + }, + new + { + Id = 4, + Description = "Ежемесячно-2", + Name = "Monthly2" + }, + new + { + Id = 5, + Description = "Ежегодно", + Name = "Annually" + }, + new + { + Id = 6, + Description = "Ежегодно-2", + Name = "Annually2" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("TypeId") + .HasColumnType("integer"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("TypeId"); + + b.ToTable("EsppSchTypeValues"); + + b.HasData( + new + { + Id = new Guid("6e3b5dd2-b2f7-40bc-bace-15bfa6bbd4ff"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 1, + Value = "Каждый час" + }, + new + { + Id = new Guid("4df04834-f14f-43d9-8984-334f080f4107"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 1, + Value = "Каждые 2 часа" + }, + new + { + Id = new Guid("dab6e3f9-2385-4966-b77c-133ad233c592"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 1, + Value = "Каждые 3 часа" + }, + new + { + Id = new Guid("035f485d-8451-47df-bfaa-ba4dd36cf146"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 1, + Value = "Каждые 4 часа" + }, + new + { + Id = new Guid("d627daa7-3eed-4571-acae-ffbb3c5bedb9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 1, + Value = "Каждые 6 часов" + }, + new + { + Id = new Guid("ae0a0015-0f1e-4496-b71e-6244f7e321e7"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 1, + Value = "Каждые 12 часов" + }, + new + { + Id = new Guid("8df097aa-9860-4a62-9675-a8eecd3f2ce7"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 1, + Value = "Ежедневно" + }, + new + { + Id = new Guid("dee32e60-c1a1-4206-98bc-aa03deabfdf6"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 1, + Value = "Каждые 72 часа" + }, + new + { + Id = new Guid("e0465fbf-e3a5-4486-9f53-5bb85c6feeca"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 1, + Value = "Каждые 98 часов" + }, + new + { + Id = new Guid("4e3f73d1-a0f3-4dd1-bca9-68ada0dd5ce2"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 1, + Value = "Каждые 2 недели" + }, + new + { + Id = new Guid("55833417-6a24-42f6-bcc2-5d032f883202"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 1, + Value = "Каждые 60 дней" + }, + new + { + Id = new Guid("7fefa052-29db-4ce5-9c57-2fd9ff855f21"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 1, + Value = "Каждые 80 дней" + }, + new + { + Id = new Guid("b0ca99f9-5ee0-45b3-bb80-948f82b1fcb1"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 1, + Value = "Каждые 90 дней" + }, + new + { + Id = new Guid("086f7a37-9848-423a-a3cc-36dbb5ad43e3"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 1, + Value = "Каждые полгода" + }, + new + { + Id = new Guid("f2da9e02-d619-4517-a598-374880a8c8e8"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 1, + Value = "Каждые 1,5 года" + }, + new + { + Id = new Guid("f38d7d30-8923-4ea0-aa7c-5b251e19ab61"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 1, + Value = "Каждые 3 года" + }, + new + { + Id = new Guid("b7303461-9a30-43fa-8e55-305aa13f186f"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 2, + Value = "Понедельник" + }, + new + { + Id = new Guid("e951135e-71f2-4262-9342-df4d5315ab6c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 2, + Value = "Вторник" + }, + new + { + Id = new Guid("c34d5375-70e7-4632-b3af-30e279a0621a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 2, + Value = "Среда" + }, + new + { + Id = new Guid("ec9540df-c2de-4bda-a063-34d02d4b6e03"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 2, + Value = "Четверг" + }, + new + { + Id = new Guid("2ed85534-4684-4eb2-9ccb-e264d212c945"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 2, + Value = "Пятница" + }, + new + { + Id = new Guid("a6804315-96ef-484e-82ee-c5795694468b"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 2, + Value = "Суббота" + }, + new + { + Id = new Guid("eb71e699-937f-4894-9688-f7a7f95e5e58"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 2, + Value = "Воскресенье" + }, + new + { + Id = new Guid("e86adbfb-3345-4e0c-aa3b-b4418f9cfe88"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "1" + }, + new + { + Id = new Guid("5b4d7ca6-31e7-475b-b7c8-13c6680c3dc3"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "2" + }, + new + { + Id = new Guid("0da03db0-9404-425d-bea1-5da0c9b60b59"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "3" + }, + new + { + Id = new Guid("199474c8-0a77-47e5-aab8-ba33c216cc9e"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "4" + }, + new + { + Id = new Guid("e6619da1-f7e8-45b9-bbd3-9c17bec2ccd3"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "5" + }, + new + { + Id = new Guid("a8708763-c838-49a5-95fe-bf4f73518d71"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "6" + }, + new + { + Id = new Guid("7ec056aa-820c-4900-96cb-4564d2ea6398"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "7" + }, + new + { + Id = new Guid("554d7d0c-91b1-4b81-b94d-1ee864192962"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "8" + }, + new + { + Id = new Guid("8b7847a4-23de-4199-8aad-3b5c0323b5a2"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "9" + }, + new + { + Id = new Guid("fb7f41ca-950b-4dc1-a0a6-bd9a221ab2ad"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "10" + }, + new + { + Id = new Guid("a28b530f-ea38-4a2c-a16b-0b7fa3770d3c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "11" + }, + new + { + Id = new Guid("7a004a11-32e1-40ae-ab35-0d3dc3a69785"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "12" + }, + new + { + Id = new Guid("e0f2f4d1-4a5e-4997-8336-83c3c35f38df"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "13" + }, + new + { + Id = new Guid("9c5aaf48-88ec-4c67-b936-2be45550f8bf"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "14" + }, + new + { + Id = new Guid("8dbd680c-ce49-4d2e-8a1a-05619685e240"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "15" + }, + new + { + Id = new Guid("2f476f70-b1ef-419d-aad5-3911f1e3231f"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "16" + }, + new + { + Id = new Guid("2c635ce2-fc18-47be-b3e9-98c211abf312"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "17" + }, + new + { + Id = new Guid("f9d5b03b-624a-4f9f-8da3-1490ea5d2914"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "18" + }, + new + { + Id = new Guid("4f4b249c-db60-4582-86ed-75cfee4edd0c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "19" + }, + new + { + Id = new Guid("220a1464-4d39-416c-b4b2-3093eb007298"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "20" + }, + new + { + Id = new Guid("c887ca60-b05d-4d3c-ad1f-223c879b1a6d"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "21" + }, + new + { + Id = new Guid("2905765d-63fb-41fe-a111-ee2f1d03d62e"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "22" + }, + new + { + Id = new Guid("dbbe704a-8d6d-40e7-bd30-6974035b1fab"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "23" + }, + new + { + Id = new Guid("cf7b9645-52ed-43a2-8267-267e0aed19b1"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "24" + }, + new + { + Id = new Guid("454788d6-d0ad-4c07-878c-da3fd3cd05e1"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "25" + }, + new + { + Id = new Guid("40d70d73-8582-4be6-a9e6-503b96ae3d49"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "26" + }, + new + { + Id = new Guid("8f6610dc-ef46-4842-a57e-18d7aaa75931"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "27" + }, + new + { + Id = new Guid("03858472-d4ce-47fd-9497-8051728766e4"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "28" + }, + new + { + Id = new Guid("b1018e07-e90e-42ee-b399-19f3d0c14dd6"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "29" + }, + new + { + Id = new Guid("a1669207-aa31-40fe-98d0-d941008d1655"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "30" + }, + new + { + Id = new Guid("0936aa99-73e0-43de-b6df-334c1228a226"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 3, + Value = "31" + }, + new + { + Id = new Guid("626ca076-f09e-4a7a-8610-b7de6337b24a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 4, + Value = "Первый" + }, + new + { + Id = new Guid("032fbd02-67d0-4b8c-bed0-42629ab7113b"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 4, + Value = "Второй" + }, + new + { + Id = new Guid("fa8a8f60-e41e-495e-ac86-35174d9976bf"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 4, + Value = "Третий" + }, + new + { + Id = new Guid("d2f90168-2b49-42f2-820b-79db2c522adf"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 4, + Value = "Четвертый" + }, + new + { + Id = new Guid("12bb8db2-cf7f-4113-baff-6883770f1ba5"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 4, + Value = "Последний" + }, + new + { + Id = new Guid("18260e91-3fbe-4401-9edc-78dbc419370e"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 5, + Value = "Январь" + }, + new + { + Id = new Guid("361526aa-3e1c-452e-bb44-0ade8521830d"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 5, + Value = "Февраль" + }, + new + { + Id = new Guid("fad4bdb0-6c51-4810-a30b-6d031a0d4c46"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 5, + Value = "Март" + }, + new + { + Id = new Guid("06ab835d-3d3e-4057-8422-a553b6b40995"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 5, + Value = "Апрель" + }, + new + { + Id = new Guid("83f56b5d-b16b-4aa5-89d7-a253fee4e4ad"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 5, + Value = "Май" + }, + new + { + Id = new Guid("e679ec84-a9ee-4bed-a051-2b14edddcb18"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 5, + Value = "Июнь" + }, + new + { + Id = new Guid("d439808a-6a10-409b-8809-a755b7cca60b"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 5, + Value = "Июль" + }, + new + { + Id = new Guid("6e9972c4-6bf7-4fe4-b4ea-bbb333fb69c8"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 5, + Value = "Август" + }, + new + { + Id = new Guid("0883aac2-9d5b-4098-b672-c684d2a3a0c9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 5, + Value = "Сентябрь" + }, + new + { + Id = new Guid("5e6592bc-acb2-45a4-979b-fdecf8457453"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 5, + Value = "Октябрь" + }, + new + { + Id = new Guid("edd7cb49-d6a0-4969-b2d6-1967da69b336"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 5, + Value = "Ноябрь" + }, + new + { + Id = new Guid("dd695fb2-4ad0-4cda-a4df-e15059c56b24"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 5, + Value = "Декабрь" + }, + new + { + Id = new Guid("2f473624-4eb3-49b4-a4b9-cc7fc08a50f5"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 6, + Value = "Января" + }, + new + { + Id = new Guid("f0003490-a249-44bd-814f-4566999915d8"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 6, + Value = "Февраля" + }, + new + { + Id = new Guid("f4c3fe38-aeaa-42f7-a9ba-190ea2dfe339"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 6, + Value = "Марта" + }, + new + { + Id = new Guid("06a8bd2f-68e1-42f5-961c-ac3b98a2181e"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 6, + Value = "Апреля" + }, + new + { + Id = new Guid("963b9c41-d607-444a-9fe0-fe429590e326"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 6, + Value = "Мая" + }, + new + { + Id = new Guid("ec8554c8-dee4-49a1-b1b7-474ad8ec1473"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 6, + Value = "Июня" + }, + new + { + Id = new Guid("e15c7c63-e29f-41a3-9c82-f70eb6c24fde"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 6, + Value = "Июля" + }, + new + { + Id = new Guid("0b1f3cea-301a-4d74-9ce1-2cd93b41897d"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 6, + Value = "Августа" + }, + new + { + Id = new Guid("e2fa3769-f66f-4753-a161-35adad7717a5"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 6, + Value = "Сентября" + }, + new + { + Id = new Guid("c1de4aca-9f49-48ae-9279-cf9ec4092112"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 6, + Value = "Октября" + }, + new + { + Id = new Guid("a74b9ebd-bcd8-4537-b371-194de2fe0a4d"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 6, + Value = "Ноября" + }, + new + { + Id = new Guid("852a5ebd-4545-494b-bc69-c27409a41adc"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + TypeId = 6, + Value = "Декабря" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchValue", b => + { + b.Property("ApplicationsInWorkId") + .HasColumnType("uuid"); + + b.Property("TypeValueId") + .HasColumnType("uuid"); + + b.Property("TypeConfigId") + .HasColumnType("uuid"); + + b.HasKey("ApplicationsInWorkId", "TypeValueId", "TypeConfigId"); + + b.HasIndex("TypeConfigId"); + + b.HasIndex("TypeValueId"); + + b.ToTable("EsppSchValues"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Host", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Ek") + .IsRequired() + .HasColumnType("text"); + + b.Property("EkStatusCode") + .HasColumnType("integer"); + + b.Property("IP") + .IsRequired() + .HasColumnType("text"); + + b.Property("ResponseAreaCode") + .HasColumnType("integer"); + + b.Property("WorkGroup") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("EkStatusCode"); + + b.HasIndex("ResponseAreaCode"); + + b.ToTable("Hosts"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("GenerateDate") + .HasColumnType("timestamp with time zone"); + + b.Property("NextStatusCode") + .HasColumnType("integer"); + + b.Property("Number") + .IsRequired() + .HasColumnType("text"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("text"); + + b.Property("StatusCode") + .HasColumnType("integer"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.Property("WorkGroup") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("NextStatusCode"); + + b.HasIndex("StatusCode"); + + b.HasIndex("TemplateId"); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("PARR.DAL.Models.OrderStatus", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("OrderStatuses"); + + b.HasData( + new + { + Code = 1, + Description = "1-Направлен в группу", + Name = "New" + }, + new + { + Code = 2, + Description = "2-В работе", + Name = "InWork" + }, + new + { + Code = 3, + Description = "3-Приостановлен", + Name = "Stop" + }, + new + { + Code = 4, + Description = "4-Выполнен", + Name = "Complete" + }, + new + { + Code = 5, + Description = "5-Закрыт", + Name = "Closed" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.Process", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Processes"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ResponseArea", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("ResponseAreas"); + + b.HasData( + new + { + Code = 96, + Name = "96-ДВС" + }, + new + { + Code = 94, + Name = "94-ЗАБ" + }, + new + { + Code = 92, + Name = "92-ВСИБ" + }, + new + { + Code = 88, + Name = "88-КРАСН" + }, + new + { + Code = 83, + Name = "83-ЗСИБ" + }, + new + { + Code = 80, + Name = "80-ЮУР" + }, + new + { + Code = 76, + Name = "76-СВРД" + }, + new + { + Code = 63, + Name = "63-КБШ" + }, + new + { + Code = 61, + Name = "61-ПРИВ" + }, + new + { + Code = 58, + Name = "58-ЮВСТ" + }, + new + { + Code = 51, + Name = "51-СКВ" + }, + new + { + Code = 28, + Name = "28-СЕВ" + }, + new + { + Code = 24, + Name = "24-ГОР" + }, + new + { + Code = 17, + Name = "17-МСК" + }, + new + { + Code = 10, + Name = "10-КЛГ" + }, + new + { + Code = 1, + Name = "01-ОКТ" + }, + new + { + Code = 99, + Name = "00-ГВЦ" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.Robot", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Robots"); + + b.HasData( + new + { + Code = 1, + Description = "Робот по созданию/изменению шаблона наряда ЕСПП", + Name = "TemplateOrder" + }, + new + { + Code = 2, + Description = "Робот по созданию/изменению расписания шаблона наряда в ЕСПП", + Name = "ScheduleOrder" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptsNumber") + .HasColumnType("integer"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("LastRobotStatusUpdated") + .HasColumnType("timestamp with time zone"); + + b.Property("RobotCode") + .HasColumnType("integer"); + + b.Property("RobotStatusCode") + .HasColumnType("integer"); + + b.Property("TaskStatusCode") + .HasColumnType("integer"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("RobotCode"); + + b.HasIndex("RobotStatusCode"); + + b.HasIndex("TaskStatusCode"); + + b.HasIndex("TemplateId", "RobotCode") + .IsUnique(); + + b.ToTable("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppMessage") + .HasColumnType("text"); + + b.Property("HistoryLevel") + .HasColumnType("integer"); + + b.Property("RobotConfigurationId") + .HasColumnType("uuid"); + + b.Property("RobotMessage") + .HasColumnType("text"); + + b.Property("TaskStatusCode") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("HistoryLevel"); + + b.HasIndex("RobotConfigurationId"); + + b.HasIndex("TaskStatusCode"); + + b.ToTable("RobotHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotHistoryLevel", b => + { + b.Property("Level") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Level")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Level"); + + b.ToTable("RobotHistoryLevels"); + + b.HasData( + new + { + Level = 1, + Description = "Робот начал работу ", + Name = "Start" + }, + new + { + Level = 5, + Description = "Информация", + Name = "Inforamtion" + }, + new + { + Level = 10, + Description = "Ошибка", + Name = "Error" + }, + new + { + Level = 15, + Description = "Успешно завершил работу", + Name = "Complete" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotStatus", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("RobotStatuses"); + + b.HasData( + new + { + Code = 11, + Description = "Ожидание, ждет пока робот возьмет в работу.", + Name = "Wait" + }, + new + { + Code = 22, + Description = "Робот взял в работу.", + Name = "InProgress" + }, + new + { + Code = 33, + Description = "Ошибка отработки роботом. Требует ручного вмешательства.", + Name = "Error" + }, + new + { + Code = 44, + Description = "Робот успешно отработал.", + Name = "Complete" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.Setting", b => + { + b.Property("Name") + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Name"); + + b.ToTable("Settings"); + + b.HasData( + new + { + Name = "Initiator", + Description = "Инициатор регламентной работы, указывается при создании шаблона в ЕСПП.", + Value = "КУЗНЕЦОВ МИХАИЛ ВАЛЕРЬЕВИЧ (IVC_KUZNETSOVMV@DVGD.OAO.RZD)" + }, + new + { + Name = "ClosingCode", + Description = "Код закрытия регламентной работы, указывается при создании шаблона в ЕСПП.", + Value = "выполнен" + }, + new + { + Name = "Category", + Description = "Категория создаваемого объекта в ЕСПП", + Value = "регламентная работа" + }, + new + { + Name = "TemplatePrefixName", + Description = "Префикс имени шаблона в ЕСПП", + Value = "ПАРР-ДВС-ПТК" + }, + new + { + Name = "RobotAttemptsNumber", + Description = "Количество попыток выполнения задания роботом", + Value = "3" + }, + new + { + Name = "RobotWaitTime", + Description = "Время ожидания выполнения роботом задания", + Value = "00:15:00" + }, + new + { + Name = "ScheduleTimezone", + Description = "Расписание регламентной работы - В каком часовом поясе", + Value = "MSK" + }, + new + { + Name = "ScheduleExclude", + Description = "Расписание регламентной работы - Тип исключения", + Value = "Нет исключений" + }, + new + { + Name = "ScheduleRepeatRange", + Description = "Расписание регламентной работы - Диапазн повторов", + Value = "Отсутствует дата завершения" + }, + new + { + Name = "OrderSearchDeltaDate", + Description = "Промежуток времени для поиска нарядов в ЕСПП", + Value = "01:30:00" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.Subprocess", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ProcessId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ProcessId"); + + b.ToTable("Subprocesses"); + }); + + modelBuilder.Entity("PARR.DAL.Models.TaskStatus", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("TaskStatuses"); + + b.HasData( + new + { + Code = 10, + Description = "Требуется создание объекта в ЕСПП", + Name = "Creating" + }, + new + { + Code = 20, + Description = "Требуется обновление объекта в ЕСПП", + Name = "Updating" + }, + new + { + Code = 30, + Description = "Нормальное состояние объекта в ЕСПП и ПАРР. ОБъект в ПАРР соответствует объекту в ЕСПП", + Name = "Ok" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.Template", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationInWorkId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("HostId") + .HasColumnType("uuid"); + + b.Property("IsActiveSchedule") + .HasColumnType("boolean"); + + b.Property("IsActiveTemplate") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ScheduleEsppId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationInWorkId"); + + b.HasIndex("HostId"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Templates"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Tnk", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("SubprocessId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("SubprocessId"); + + b.ToTable("Tnks"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Work", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("TnkId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("TnkId"); + + b.ToTable("Works"); + }); + + modelBuilder.Entity("PARR.DAL.Models.AgentHistory", b => + { + b.HasOne("PARR.DAL.Models.AgentHistoryLevel", "AgentHistoryLevel") + .WithMany("AgentHistories") + .HasForeignKey("HistoryLevelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.Order", "Order") + .WithMany("AgentHistories") + .HasForeignKey("OrderId"); + + b.HasOne("PARR.DAL.Models.Template", "Template") + .WithMany("AgentHistories") + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AgentHistoryLevel"); + + b.Navigation("Order"); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Application", b => + { + b.HasOne("PARR.DAL.Models.ApplicationType", "ApplicationType") + .WithMany("Applications") + .HasForeignKey("ApplicationTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ApplicationType"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationInHost", b => + { + b.HasOne("PARR.DAL.Models.Application", "Application") + .WithMany("ApplicationsInHosts") + .HasForeignKey("ApplicationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.Host", "Host") + .WithMany("ApplicationsInHosts") + .HasForeignKey("HostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Application"); + + b.Navigation("Host"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationsInWork", b => + { + b.HasOne("PARR.DAL.Models.Application", "Application") + .WithMany("ApplicationsInWorks") + .HasForeignKey("ApplicationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.Work", "Work") + .WithMany("ApplicationsInWorks") + .HasForeignKey("WorkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Application"); + + b.Navigation("Work"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeConfig", b => + { + b.HasOne("PARR.DAL.Models.EsppSchType", "EsppSchType") + .WithMany("EsppSchTypeConfigs") + .HasForeignKey("TypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.EsppSchTypeSchedule", "EsppSchTypeSchedule") + .WithMany("EsppSchTypeConfigs") + .HasForeignKey("TypeScheduleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EsppSchType"); + + b.Navigation("EsppSchTypeSchedule"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeValue", b => + { + b.HasOne("PARR.DAL.Models.EsppSchType", "EsppSchType") + .WithMany("EsppSchTypeValues") + .HasForeignKey("TypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EsppSchType"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchValue", b => + { + b.HasOne("PARR.DAL.Models.ApplicationsInWork", "ApplicationsInWork") + .WithMany("EsppSchValues") + .HasForeignKey("ApplicationsInWorkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.EsppSchTypeConfig", "EsppSchTypeConfig") + .WithMany("EsppSchValues") + .HasForeignKey("TypeConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.EsppSchTypeValue", "EsppSchTypeValue") + .WithMany("EsppSchValues") + .HasForeignKey("TypeValueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ApplicationsInWork"); + + b.Navigation("EsppSchTypeConfig"); + + b.Navigation("EsppSchTypeValue"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Host", b => + { + b.HasOne("PARR.DAL.Models.EkStatus", "EkStatus") + .WithMany("Hosts") + .HasForeignKey("EkStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.ResponseArea", "ResponseArea") + .WithMany("Hosts") + .HasForeignKey("ResponseAreaCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EkStatus"); + + b.Navigation("ResponseArea"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Order", b => + { + b.HasOne("PARR.DAL.Models.OrderStatus", "NextStatus") + .WithMany("OrdersNext") + .HasForeignKey("NextStatusCode"); + + b.HasOne("PARR.DAL.Models.OrderStatus", "OrderStatus") + .WithMany("Orders") + .HasForeignKey("StatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.Template", "Template") + .WithMany("Orders") + .HasForeignKey("TemplateId"); + + b.Navigation("NextStatus"); + + b.Navigation("OrderStatus"); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotConfiguration", b => + { + b.HasOne("PARR.DAL.Models.Robot", "Robot") + .WithMany("RobotConfigurations") + .HasForeignKey("RobotCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.RobotStatus", "RobotStatus") + .WithMany("RobotConfigurations") + .HasForeignKey("RobotStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.TaskStatus", "TaskStatus") + .WithMany("RobotConfigurations") + .HasForeignKey("TaskStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.Template", "Template") + .WithMany("RobotConfigurations") + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Robot"); + + b.Navigation("RobotStatus"); + + b.Navigation("TaskStatus"); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotHistory", b => + { + b.HasOne("PARR.DAL.Models.RobotHistoryLevel", "RobotHistoryLevel") + .WithMany("RobotHistories") + .HasForeignKey("HistoryLevel") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.RobotConfiguration", "RobotConfiguration") + .WithMany("RobotHistories") + .HasForeignKey("RobotConfigurationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.TaskStatus", "StatusTask") + .WithMany("RobotHistories") + .HasForeignKey("TaskStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RobotConfiguration"); + + b.Navigation("RobotHistoryLevel"); + + b.Navigation("StatusTask"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Subprocess", b => + { + b.HasOne("PARR.DAL.Models.Process", "Process") + .WithMany("Subprocesses") + .HasForeignKey("ProcessId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Process"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Template", b => + { + b.HasOne("PARR.DAL.Models.ApplicationsInWork", "ApplicationsInWork") + .WithMany("Templates") + .HasForeignKey("ApplicationInWorkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.Host", "Host") + .WithMany("Templates") + .HasForeignKey("HostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ApplicationsInWork"); + + b.Navigation("Host"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Tnk", b => + { + b.HasOne("PARR.DAL.Models.Subprocess", "Subprocess") + .WithMany("Tnks") + .HasForeignKey("SubprocessId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Subprocess"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Work", b => + { + b.HasOne("PARR.DAL.Models.Tnk", "Tnk") + .WithMany("Works") + .HasForeignKey("TnkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tnk"); + }); + + modelBuilder.Entity("PARR.DAL.Models.AgentHistoryLevel", b => + { + b.Navigation("AgentHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Application", b => + { + b.Navigation("ApplicationsInHosts"); + + b.Navigation("ApplicationsInWorks"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b => + { + b.Navigation("Applications"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationsInWork", b => + { + b.Navigation("EsppSchValues"); + + b.Navigation("Templates"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EkStatus", b => + { + b.Navigation("Hosts"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchType", b => + { + b.Navigation("EsppSchTypeConfigs"); + + b.Navigation("EsppSchTypeValues"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeConfig", b => + { + b.Navigation("EsppSchValues"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeSchedule", b => + { + b.Navigation("EsppSchTypeConfigs"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeValue", b => + { + b.Navigation("EsppSchValues"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Host", b => + { + b.Navigation("ApplicationsInHosts"); + + b.Navigation("Templates"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Order", b => + { + b.Navigation("AgentHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.OrderStatus", b => + { + b.Navigation("Orders"); + + b.Navigation("OrdersNext"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Process", b => + { + b.Navigation("Subprocesses"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ResponseArea", b => + { + b.Navigation("Hosts"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Robot", b => + { + b.Navigation("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotConfiguration", b => + { + b.Navigation("RobotHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotHistoryLevel", b => + { + b.Navigation("RobotHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotStatus", b => + { + b.Navigation("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Subprocess", b => + { + b.Navigation("Tnks"); + }); + + modelBuilder.Entity("PARR.DAL.Models.TaskStatus", b => + { + b.Navigation("RobotConfigurations"); + + b.Navigation("RobotHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Template", b => + { + b.Navigation("AgentHistories"); + + b.Navigation("Orders"); + + b.Navigation("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Tnk", b => + { + b.Navigation("Works"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Work", b => + { + b.Navigation("ApplicationsInWorks"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/PARR.DAL/Migrations/20231126232527_TblEsppSchTypeScheduleFixDescription.cs b/PARR.DAL/Migrations/20231126232527_TblEsppSchTypeScheduleFixDescription.cs new file mode 100644 index 00000000..49e5e7e6 --- /dev/null +++ b/PARR.DAL/Migrations/20231126232527_TblEsppSchTypeScheduleFixDescription.cs @@ -0,0 +1,32 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace PARR.DAL.Migrations +{ + /// + public partial class TblEsppSchTypeScheduleFixDescription : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "EsppSchTypeSchedules", + keyColumn: "Id", + keyValue: 2, + column: "Description", + value: "Еженедельно"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "EsppSchTypeSchedules", + keyColumn: "Id", + keyValue: 2, + column: "Description", + value: "Еженежельно"); + } + } +} diff --git a/PARR.DAL/Migrations/DataContextModelSnapshot.cs b/PARR.DAL/Migrations/DataContextModelSnapshot.cs index 168f4a89..00059475 100644 --- a/PARR.DAL/Migrations/DataContextModelSnapshot.cs +++ b/PARR.DAL/Migrations/DataContextModelSnapshot.cs @@ -859,7 +859,7 @@ namespace PARR.DAL.Migrations new { Id = 2, - Description = "Еженежельно", + Description = "Еженедельно", Name = "Weekly" }, new diff --git a/PARR.EsppScheduleSync/ScheduleSyncher.cs b/PARR.EsppScheduleSync/ScheduleSyncher.cs index 91f2f049..323e2970 100644 --- a/PARR.EsppScheduleSync/ScheduleSyncher.cs +++ b/PARR.EsppScheduleSync/ScheduleSyncher.cs @@ -99,6 +99,10 @@ namespace PARR.EsppScheduleSync bool.TryParse(splittedContent[1].Trim(), out var isActive); + var typeSchedule = GetTypeScheduleByString(splittedContent[7]); + if (!typeSchedule.HasValue) + return null; + var esppObject = new EsppObjectSchedule { TemplateName = templateName, @@ -107,8 +111,7 @@ namespace PARR.EsppScheduleSync IsActive = isActive, ResponseArea = splittedContent[5], WorkGroup = splittedContent[3], - //TODO:!!! - //TypeSchedule = splittedContent[7], + TypeSchedule = typeSchedule.Value, Interval = splittedContent[8], Dayofweek = splittedContent[15], Dayofmonth = splittedContent[14], @@ -131,6 +134,40 @@ namespace PARR.EsppScheduleSync } + /// + /// Преобразовать из строки в Тип Повторения + /// + /// + /// + private EsppSchTypeScheduleEnum? GetTypeScheduleByString(string typeSchedule) + { + typeSchedule = typeSchedule.ToLower(); + + //Regularly, Регулярно (значение в ЕСПП и в БД не совпадают, в бд Regularly, в ЕСПП simple) + if (typeSchedule == "simple" || typeSchedule == EsppSchTypeScheduleEnum.Regularly.ToString().ToLower()) + return EsppSchTypeScheduleEnum.Regularly; + + if (typeSchedule == EsppSchTypeScheduleEnum.Weekly.ToString().ToLower()) + return EsppSchTypeScheduleEnum.Weekly; + + if (typeSchedule == EsppSchTypeScheduleEnum.Monthly.ToString().ToLower()) + return EsppSchTypeScheduleEnum.Monthly; + + if (typeSchedule == EsppSchTypeScheduleEnum.Monthly2.ToString().ToLower()) + return EsppSchTypeScheduleEnum.Monthly2; + + if (typeSchedule == EsppSchTypeScheduleEnum.Annually.ToString().ToLower()) + return EsppSchTypeScheduleEnum.Annually; + + if (typeSchedule == EsppSchTypeScheduleEnum.Annually2.ToString().ToLower()) + return EsppSchTypeScheduleEnum.Annually2; + + logger.LogError($"Не смог преобразовать Тип повторения из ЕСПП в EsppSchTypeScheduleEnum. Получено значение {typeSchedule}"); + + return null; + } + + /// /// Проверка имени шаблона и расписание на соответствие префиксу из настроек /// @@ -166,98 +203,81 @@ namespace PARR.EsppScheduleSync // т.е. если стояло Ежедненвно:понедельник, а изменили например на Еженедельно..., то в ежедневно значения останутся, но будут отрабатывать значения из Еженедельно. // Т е значения из Ежедненвно проверять не нужно, вот их и будем очищать - //TODO: сделать миграцию в БД: Еженежельно - - //TODO:!!! - ////Regularly, Регулярно (значение в ЕСПП и в БД не совпадают, в бд Regularly, в ЕСПП simple) - //if (esppObject.TypeSchedule.ToLower() == "simple" || esppObject.TypeSchedule.ToLower() == EsppSchTypeScheduleEnum.Regularly.ToString().ToLower()) - //{ - // //esppObject.Interval = string.Empty; - // esppObject.Dayofweek = string.Empty; - // esppObject.Dayofmonth = string.Empty; - // esppObject.Md1 = string.Empty; - // esppObject.Md2 = string.Empty; - // esppObject.Annualm = string.Empty; - // esppObject.Annualday = string.Empty; - // esppObject.An1 = string.Empty; - // esppObject.An2 = string.Empty; - // esppObject.An3 = string.Empty; - //} - - ////Weekly, Еженедельно - //if (esppObject.TypeSchedule == "weekly") - //{ - // esppObject.Interval = string.Empty; - // //esppObject.Dayofweek = string.Empty; - // esppObject.Dayofmonth = string.Empty; - // esppObject.Md1 = string.Empty; - // esppObject.Md2 = string.Empty; - // esppObject.Annualm = string.Empty; - // esppObject.Annualday = string.Empty; - // esppObject.An1 = string.Empty; - // esppObject.An2 = string.Empty; - // esppObject.An3 = string.Empty; - //} - - ////Monthly, Ежемесячно - //if (esppObject.TypeSchedule == "monthly") - //{ - // esppObject.Interval = string.Empty; - // esppObject.Dayofweek = string.Empty; - // //esppObject.Dayofmonth = string.Empty; - // esppObject.Md1 = string.Empty; - // esppObject.Md2 = string.Empty; - // esppObject.Annualm = string.Empty; - // esppObject.Annualday = string.Empty; - // esppObject.An1 = string.Empty; - // esppObject.An2 = string.Empty; - // esppObject.An3 = string.Empty; - //} - - ////Monthly2, Ежемесячно-2 - //if (esppObject.TypeSchedule == "monthly2") - //{ - // esppObject.Interval = string.Empty; - // esppObject.Dayofweek = string.Empty; - // esppObject.Dayofmonth = string.Empty; - // //esppObject.Md1 = string.Empty; - // //esppObject.Md2 = string.Empty; - // esppObject.Annualm = string.Empty; - // esppObject.Annualday = string.Empty; - // esppObject.An1 = string.Empty; - // esppObject.An2 = string.Empty; - // esppObject.An3 = string.Empty; - //} - - ////Annually, Ежегодно - //if (esppObject.TypeSchedule == "annually") - //{ - // esppObject.Interval = string.Empty; - // esppObject.Dayofweek = string.Empty; - // esppObject.Dayofmonth = string.Empty; - // esppObject.Md1 = string.Empty; - // esppObject.Md2 = string.Empty; - // //esppObject.Annualm = string.Empty; - // //esppObject.Annualday = string.Empty; - // esppObject.An1 = string.Empty; - // esppObject.An2 = string.Empty; - // esppObject.An3 = string.Empty; - //} - - ////Annually2, Ежегодно-2 - //if (esppObject.TypeSchedule == "annually2") - //{ - // esppObject.Interval = string.Empty; - // esppObject.Dayofweek = string.Empty; - // esppObject.Dayofmonth = string.Empty; - // esppObject.Md1 = string.Empty; - // esppObject.Md2 = string.Empty; - // esppObject.Annualm = string.Empty; - // esppObject.Annualday = string.Empty; - // //esppObject.An1 = string.Empty; - // //esppObject.An2 = string.Empty; - // //esppObject.An3 = string.Empty; - //} + switch (esppObject.TypeSchedule) + { + case EsppSchTypeScheduleEnum.Regularly: + //esppObject.Interval = string.Empty; + esppObject.Dayofweek = string.Empty; + esppObject.Dayofmonth = string.Empty; + esppObject.Md1 = string.Empty; + esppObject.Md2 = string.Empty; + esppObject.Annualm = string.Empty; + esppObject.Annualday = string.Empty; + esppObject.An1 = string.Empty; + esppObject.An2 = string.Empty; + esppObject.An3 = string.Empty; + break; + case EsppSchTypeScheduleEnum.Weekly: + esppObject.Interval = string.Empty; + //esppObject.Dayofweek = string.Empty; + esppObject.Dayofmonth = string.Empty; + esppObject.Md1 = string.Empty; + esppObject.Md2 = string.Empty; + esppObject.Annualm = string.Empty; + esppObject.Annualday = string.Empty; + esppObject.An1 = string.Empty; + esppObject.An2 = string.Empty; + esppObject.An3 = string.Empty; + break; + case EsppSchTypeScheduleEnum.Monthly: + esppObject.Interval = string.Empty; + esppObject.Dayofweek = string.Empty; + //esppObject.Dayofmonth = string.Empty; + esppObject.Md1 = string.Empty; + esppObject.Md2 = string.Empty; + esppObject.Annualm = string.Empty; + esppObject.Annualday = string.Empty; + esppObject.An1 = string.Empty; + esppObject.An2 = string.Empty; + esppObject.An3 = string.Empty; + break; + case EsppSchTypeScheduleEnum.Monthly2: + esppObject.Interval = string.Empty; + esppObject.Dayofweek = string.Empty; + esppObject.Dayofmonth = string.Empty; + //esppObject.Md1 = string.Empty; + //esppObject.Md2 = string.Empty; + esppObject.Annualm = string.Empty; + esppObject.Annualday = string.Empty; + esppObject.An1 = string.Empty; + esppObject.An2 = string.Empty; + esppObject.An3 = string.Empty; + break; + case EsppSchTypeScheduleEnum.Annually: + esppObject.Interval = string.Empty; + esppObject.Dayofweek = string.Empty; + esppObject.Dayofmonth = string.Empty; + esppObject.Md1 = string.Empty; + esppObject.Md2 = string.Empty; + //esppObject.Annualm = string.Empty; + //esppObject.Annualday = string.Empty; + esppObject.An1 = string.Empty; + esppObject.An2 = string.Empty; + esppObject.An3 = string.Empty; + break; + case EsppSchTypeScheduleEnum.Annually2: + esppObject.Interval = string.Empty; + esppObject.Dayofweek = string.Empty; + esppObject.Dayofmonth = string.Empty; + esppObject.Md1 = string.Empty; + esppObject.Md2 = string.Empty; + esppObject.Annualm = string.Empty; + esppObject.Annualday = string.Empty; + //esppObject.An1 = string.Empty; + //esppObject.An2 = string.Empty; + //esppObject.An3 = string.Empty; + break; + } return esppObject; } diff --git a/docker-compose.dcproj b/docker-compose.dcproj index 75eb6251..1c902ded 100644 --- a/docker-compose.dcproj +++ b/docker-compose.dcproj @@ -12,6 +12,7 @@ + From a1fb3047fe84611cd2f760ce34e3fdfa2c747d22 Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Mon, 27 Nov 2023 12:06:16 +1000 Subject: [PATCH 7/7] =?UTF-8?q?feat(esppScheduleSync):=20=D0=B4=D0=BE?= =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D1=81=D0=B8=D0=BD=D1=85=D1=80?= =?UTF-8?q?=D0=BE=D0=BD=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8E=20=D1=80=D0=B0?= =?UTF-8?q?=D1=81=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D0=B9.=20dal:=20?= =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D1=82?= =?UTF-8?q?=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=D0=B0=20EsppSchTypeValue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PARR.DAL/Context/DataContext.cs | 166 +- ...SchTypeValueAddEsppExportValue.Designer.cs | 2754 +++++++++++++++++ ...4_TblEsppSchTypeValueAddEsppExportValue.cs | 618 ++++ .../Migrations/DataContextModelSnapshot.cs | 89 +- PARR.DAL/Models/EsppSchTypeValue.cs | 9 + .../EsppSchTypeConfigService.cs | 6 - PARR.EsppScheduleSync/ScheduleSyncher.cs | 91 +- 7 files changed, 3638 insertions(+), 95 deletions(-) create mode 100644 PARR.DAL/Migrations/20231127003844_TblEsppSchTypeValueAddEsppExportValue.Designer.cs create mode 100644 PARR.DAL/Migrations/20231127003844_TblEsppSchTypeValueAddEsppExportValue.cs diff --git a/PARR.DAL/Context/DataContext.cs b/PARR.DAL/Context/DataContext.cs index e9521e32..328579ff 100644 --- a/PARR.DAL/Context/DataContext.cs +++ b/PARR.DAL/Context/DataContext.cs @@ -204,89 +204,89 @@ namespace PARR.DAL.Context modelBuilder.Entity(f => { f.HasData( - new { Id = new Guid("6E3B5DD2-B2F7-40BC-BACE-15BFA6BBD4FF"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждый час" }, - new { Id = new Guid("4DF04834-F14F-43D9-8984-334F080F4107"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 2 часа" }, - new { Id = new Guid("DAB6E3F9-2385-4966-B77C-133AD233C592"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 3 часа" }, - new { Id = new Guid("035F485D-8451-47DF-BFAA-BA4DD36CF146"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 4 часа" }, - new { Id = new Guid("D627DAA7-3EED-4571-ACAE-FFBB3C5BEDB9"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 6 часов" }, - new { Id = new Guid("AE0A0015-0F1E-4496-B71E-6244F7E321E7"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 12 часов" }, - new { Id = new Guid("8DF097AA-9860-4A62-9675-A8EECD3F2CE7"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Ежедневно" }, - new { Id = new Guid("DEE32E60-C1A1-4206-98BC-AA03DEABFDF6"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 72 часа" }, - new { Id = new Guid("E0465FBF-E3A5-4486-9F53-5BB85C6FEECA"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 98 часов" }, - new { Id = new Guid("4E3F73D1-A0F3-4DD1-BCA9-68ADA0DD5CE2"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 2 недели" }, - new { Id = new Guid("55833417-6A24-42F6-BCC2-5D032F883202"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 60 дней" }, - new { Id = new Guid("7FEFA052-29DB-4CE5-9C57-2FD9FF855F21"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 80 дней" }, - new { Id = new Guid("B0CA99F9-5EE0-45B3-BB80-948F82B1FCB1"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 90 дней" }, - new { Id = new Guid("086F7A37-9848-423A-A3CC-36DBB5AD43E3"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые полгода" }, - new { Id = new Guid("F2DA9E02-D619-4517-A598-374880A8C8E8"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 1,5 года" }, - new { Id = new Guid("F38D7D30-8923-4EA0-AA7C-5B251E19AB61"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 3 года" }, - new { Id = new Guid("B7303461-9A30-43FA-8E55-305AA13F186F"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfWeek, Value = "Понедельник" }, - new { Id = new Guid("E951135E-71F2-4262-9342-DF4D5315AB6C"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfWeek, Value = "Вторник" }, - new { Id = new Guid("C34D5375-70E7-4632-B3AF-30E279A0621A"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfWeek, Value = "Среда" }, - new { Id = new Guid("EC9540DF-C2DE-4BDA-A063-34D02D4B6E03"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfWeek, Value = "Четверг" }, - new { Id = new Guid("2ED85534-4684-4EB2-9CCB-E264D212C945"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfWeek, Value = "Пятница" }, - new { Id = new Guid("A6804315-96EF-484E-82EE-C5795694468B"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfWeek, Value = "Суббота" }, - new { Id = new Guid("EB71E699-937F-4894-9688-F7A7F95E5E58"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfWeek, Value = "Воскресенье" }, - new { Id = new Guid("E86ADBFB-3345-4E0C-AA3B-B4418F9CFE88"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "1" }, - new { Id = new Guid("5B4D7CA6-31E7-475B-B7C8-13C6680C3DC3"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "2" }, - new { Id = new Guid("0DA03DB0-9404-425D-BEA1-5DA0C9B60B59"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "3" }, - new { Id = new Guid("199474C8-0A77-47E5-AAB8-BA33C216CC9E"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "4" }, - new { Id = new Guid("E6619DA1-F7E8-45B9-BBD3-9C17BEC2CCD3"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "5" }, - new { Id = new Guid("A8708763-C838-49A5-95FE-BF4F73518D71"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "6" }, - new { Id = new Guid("7EC056AA-820C-4900-96CB-4564D2EA6398"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "7" }, - new { Id = new Guid("554D7D0C-91B1-4B81-B94D-1EE864192962"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "8" }, - new { Id = new Guid("8B7847A4-23DE-4199-8AAD-3B5C0323B5A2"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "9" }, - new { Id = new Guid("FB7F41CA-950B-4DC1-A0A6-BD9A221AB2AD"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "10" }, - new { Id = new Guid("A28B530F-EA38-4A2C-A16B-0B7FA3770D3C"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "11" }, - new { Id = new Guid("7A004A11-32E1-40AE-AB35-0D3DC3A69785"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "12" }, - new { Id = new Guid("E0F2F4D1-4A5E-4997-8336-83C3C35F38DF"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "13" }, - new { Id = new Guid("9C5AAF48-88EC-4C67-B936-2BE45550F8BF"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "14" }, - new { Id = new Guid("8DBD680C-CE49-4D2E-8A1A-05619685E240"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "15" }, - new { Id = new Guid("2F476F70-B1EF-419D-AAD5-3911F1E3231F"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "16" }, - new { Id = new Guid("2C635CE2-FC18-47BE-B3E9-98C211ABF312"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "17" }, - new { Id = new Guid("F9D5B03B-624A-4F9F-8DA3-1490EA5D2914"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "18" }, - new { Id = new Guid("4F4B249C-DB60-4582-86ED-75CFEE4EDD0C"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "19" }, - new { Id = new Guid("220A1464-4D39-416C-B4B2-3093EB007298"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "20" }, - new { Id = new Guid("C887CA60-B05D-4D3C-AD1F-223C879B1A6D"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "21" }, - new { Id = new Guid("2905765D-63FB-41FE-A111-EE2F1D03D62E"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "22" }, - new { Id = new Guid("DBBE704A-8D6D-40E7-BD30-6974035B1FAB"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "23" }, - new { Id = new Guid("CF7B9645-52ED-43A2-8267-267E0AED19B1"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "24" }, - new { Id = new Guid("454788D6-D0AD-4C07-878C-DA3FD3CD05E1"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "25" }, - new { Id = new Guid("40D70D73-8582-4BE6-A9E6-503B96AE3D49"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "26" }, - new { Id = new Guid("8F6610DC-EF46-4842-A57E-18D7AAA75931"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "27" }, - new { Id = new Guid("03858472-D4CE-47FD-9497-8051728766E4"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "28" }, - new { Id = new Guid("B1018E07-E90E-42EE-B399-19F3D0C14DD6"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "29" }, - new { Id = new Guid("A1669207-AA31-40FE-98D0-D941008D1655"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "30" }, - new { Id = new Guid("0936AA99-73E0-43DE-B6DF-334C1228A226"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "31" }, - new { Id = new Guid("626CA076-F09E-4A7A-8610-B7DE6337B24A"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Order, Value = "Первый" }, - new { Id = new Guid("032FBD02-67D0-4B8C-BED0-42629AB7113B"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Order, Value = "Второй" }, - new { Id = new Guid("FA8A8F60-E41E-495E-AC86-35174D9976BF"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Order, Value = "Третий" }, - new { Id = new Guid("D2F90168-2B49-42F2-820B-79DB2C522ADF"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Order, Value = "Четвертый" }, - new { Id = new Guid("12BB8DB2-CF7F-4113-BAFF-6883770F1BA5"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Order, Value = "Последний" }, - new { Id = new Guid("18260E91-3FBE-4401-9EDC-78DBC419370E"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Январь" }, - new { Id = new Guid("361526AA-3E1C-452E-BB44-0ADE8521830D"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Февраль" }, - new { Id = new Guid("FAD4BDB0-6C51-4810-A30B-6D031A0D4C46"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Март" }, - new { Id = new Guid("06AB835D-3D3E-4057-8422-A553B6B40995"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Апрель" }, - new { Id = new Guid("83F56B5D-B16B-4AA5-89D7-A253FEE4E4AD"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Май" }, - new { Id = new Guid("E679EC84-A9EE-4BED-A051-2B14EDDDCB18"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Июнь" }, - new { Id = new Guid("D439808A-6A10-409B-8809-A755B7CCA60B"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Июль" }, - new { Id = new Guid("6E9972C4-6BF7-4FE4-B4EA-BBB333FB69C8"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Август" }, - new { Id = new Guid("0883AAC2-9D5B-4098-B672-C684D2A3A0C9"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Сентябрь" }, - new { Id = new Guid("5E6592BC-ACB2-45A4-979B-FDECF8457453"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Октябрь" }, - new { Id = new Guid("EDD7CB49-D6A0-4969-B2D6-1967DA69B336"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Ноябрь" }, - new { Id = new Guid("DD695FB2-4AD0-4CDA-A4DF-E15059C56B24"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Декабрь" }, - new { Id = new Guid("2F473624-4EB3-49B4-A4B9-CC7FC08A50F5"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Января" }, - new { Id = new Guid("F0003490-A249-44BD-814F-4566999915D8"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Февраля" }, - new { Id = new Guid("F4C3FE38-AEAA-42F7-A9BA-190EA2DFE339"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Марта" }, - new { Id = new Guid("06A8BD2F-68E1-42F5-961C-AC3B98A2181E"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Апреля" }, - new { Id = new Guid("963B9C41-D607-444A-9FE0-FE429590E326"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Мая" }, - new { Id = new Guid("EC8554C8-DEE4-49A1-B1B7-474AD8EC1473"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Июня" }, - new { Id = new Guid("E15C7C63-E29F-41A3-9C82-F70EB6C24FDE"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Июля" }, - new { Id = new Guid("0B1F3CEA-301A-4D74-9CE1-2CD93B41897D"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Августа" }, - new { Id = new Guid("E2FA3769-F66F-4753-A161-35ADAD7717A5"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Сентября" }, - new { Id = new Guid("C1DE4ACA-9F49-48AE-9279-CF9EC4092112"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Октября" }, - new { Id = new Guid("A74B9EBD-BCD8-4537-B371-194DE2FE0A4D"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Ноября" }, - new { Id = new Guid("852A5EBD-4545-494B-BC69-C27409A41ADC"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Декабря" } + new { Id = new Guid("6E3B5DD2-B2F7-40BC-BACE-15BFA6BBD4FF"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждый час", EsppExportValue = "01:00:00" }, + new { Id = new Guid("4DF04834-F14F-43D9-8984-334F080F4107"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 2 часа", EsppExportValue = "02:00:00" }, + new { Id = new Guid("DAB6E3F9-2385-4966-B77C-133AD233C592"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 3 часа", EsppExportValue = "03:00:00" }, + new { Id = new Guid("035F485D-8451-47DF-BFAA-BA4DD36CF146"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 4 часа", EsppExportValue = "04:00:00" }, + new { Id = new Guid("D627DAA7-3EED-4571-ACAE-FFBB3C5BEDB9"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 6 часов", EsppExportValue = "06:00:00" }, + new { Id = new Guid("AE0A0015-0F1E-4496-B71E-6244F7E321E7"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 12 часов", EsppExportValue = "12:00:00" }, + new { Id = new Guid("8DF097AA-9860-4A62-9675-A8EECD3F2CE7"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Ежедневно", EsppExportValue = "1 00:00:00" }, + new { Id = new Guid("DEE32E60-C1A1-4206-98BC-AA03DEABFDF6"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 72 часа", EsppExportValue = "3 00:00:00" }, + new { Id = new Guid("E0465FBF-E3A5-4486-9F53-5BB85C6FEECA"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 96 часов", EsppExportValue = "4 00:00:00" }, + new { Id = new Guid("4E3F73D1-A0F3-4DD1-BCA9-68ADA0DD5CE2"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 2 недели", EsppExportValue = "14 00:00:00" }, + new { Id = new Guid("55833417-6A24-42F6-BCC2-5D032F883202"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 60 дней", EsppExportValue = "60 00:00:00" }, + new { Id = new Guid("7FEFA052-29DB-4CE5-9C57-2FD9FF855F21"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 80 дней", EsppExportValue = "80 00:00:00" }, + new { Id = new Guid("B0CA99F9-5EE0-45B3-BB80-948F82B1FCB1"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 90 дней", EsppExportValue = "90 00:00:00" }, + new { Id = new Guid("086F7A37-9848-423A-A3CC-36DBB5AD43E3"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые полгода", EsppExportValue = "182 00:00:00" }, + new { Id = new Guid("F2DA9E02-D619-4517-A598-374880A8C8E8"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 1,5 года", EsppExportValue = "540 00:00:00" }, + new { Id = new Guid("F38D7D30-8923-4EA0-AA7C-5B251E19AB61"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Interval, Value = "Каждые 3 года", EsppExportValue = "1095 00:00:00" }, + new { Id = new Guid("B7303461-9A30-43FA-8E55-305AA13F186F"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfWeek, Value = "Понедельник", EsppExportValue = "1" }, + new { Id = new Guid("E951135E-71F2-4262-9342-DF4D5315AB6C"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfWeek, Value = "Вторник", EsppExportValue = "2" }, + new { Id = new Guid("C34D5375-70E7-4632-B3AF-30E279A0621A"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfWeek, Value = "Среда", EsppExportValue = "3" }, + new { Id = new Guid("EC9540DF-C2DE-4BDA-A063-34D02D4B6E03"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfWeek, Value = "Четверг", EsppExportValue = "4" }, + new { Id = new Guid("2ED85534-4684-4EB2-9CCB-E264D212C945"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfWeek, Value = "Пятница", EsppExportValue = "5" }, + new { Id = new Guid("A6804315-96EF-484E-82EE-C5795694468B"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfWeek, Value = "Суббота", EsppExportValue = "6" }, + new { Id = new Guid("EB71E699-937F-4894-9688-F7A7F95E5E58"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfWeek, Value = "Воскресенье", EsppExportValue = "7" }, + new { Id = new Guid("E86ADBFB-3345-4E0C-AA3B-B4418F9CFE88"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "1", EsppExportValue = "1" }, + new { Id = new Guid("5B4D7CA6-31E7-475B-B7C8-13C6680C3DC3"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "2", EsppExportValue = "2" }, + new { Id = new Guid("0DA03DB0-9404-425D-BEA1-5DA0C9B60B59"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "3", EsppExportValue = "3" }, + new { Id = new Guid("199474C8-0A77-47E5-AAB8-BA33C216CC9E"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "4", EsppExportValue = "4" }, + new { Id = new Guid("E6619DA1-F7E8-45B9-BBD3-9C17BEC2CCD3"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "5", EsppExportValue = "5" }, + new { Id = new Guid("A8708763-C838-49A5-95FE-BF4F73518D71"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "6", EsppExportValue = "6" }, + new { Id = new Guid("7EC056AA-820C-4900-96CB-4564D2EA6398"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "7", EsppExportValue = "7" }, + new { Id = new Guid("554D7D0C-91B1-4B81-B94D-1EE864192962"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "8", EsppExportValue = "8" }, + new { Id = new Guid("8B7847A4-23DE-4199-8AAD-3B5C0323B5A2"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "9", EsppExportValue = "9" }, + new { Id = new Guid("FB7F41CA-950B-4DC1-A0A6-BD9A221AB2AD"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "10", EsppExportValue = "10" }, + new { Id = new Guid("A28B530F-EA38-4A2C-A16B-0B7FA3770D3C"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "11", EsppExportValue = "11" }, + new { Id = new Guid("7A004A11-32E1-40AE-AB35-0D3DC3A69785"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "12", EsppExportValue = "12" }, + new { Id = new Guid("E0F2F4D1-4A5E-4997-8336-83C3C35F38DF"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "13", EsppExportValue = "13" }, + new { Id = new Guid("9C5AAF48-88EC-4C67-B936-2BE45550F8BF"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "14", EsppExportValue = "14" }, + new { Id = new Guid("8DBD680C-CE49-4D2E-8A1A-05619685E240"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "15", EsppExportValue = "15" }, + new { Id = new Guid("2F476F70-B1EF-419D-AAD5-3911F1E3231F"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "16", EsppExportValue = "16" }, + new { Id = new Guid("2C635CE2-FC18-47BE-B3E9-98C211ABF312"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "17", EsppExportValue = "17" }, + new { Id = new Guid("F9D5B03B-624A-4F9F-8DA3-1490EA5D2914"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "18", EsppExportValue = "18" }, + new { Id = new Guid("4F4B249C-DB60-4582-86ED-75CFEE4EDD0C"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "19", EsppExportValue = "19" }, + new { Id = new Guid("220A1464-4D39-416C-B4B2-3093EB007298"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "20", EsppExportValue = "20" }, + new { Id = new Guid("C887CA60-B05D-4D3C-AD1F-223C879B1A6D"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "21", EsppExportValue = "21" }, + new { Id = new Guid("2905765D-63FB-41FE-A111-EE2F1D03D62E"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "22", EsppExportValue = "22" }, + new { Id = new Guid("DBBE704A-8D6D-40E7-BD30-6974035B1FAB"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "23", EsppExportValue = "23" }, + new { Id = new Guid("CF7B9645-52ED-43A2-8267-267E0AED19B1"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "24", EsppExportValue = "24" }, + new { Id = new Guid("454788D6-D0AD-4C07-878C-DA3FD3CD05E1"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "25", EsppExportValue = "25" }, + new { Id = new Guid("40D70D73-8582-4BE6-A9E6-503B96AE3D49"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "26", EsppExportValue = "26" }, + new { Id = new Guid("8F6610DC-EF46-4842-A57E-18D7AAA75931"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "27", EsppExportValue = "27" }, + new { Id = new Guid("03858472-D4CE-47FD-9497-8051728766E4"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "28", EsppExportValue = "28" }, + new { Id = new Guid("B1018E07-E90E-42EE-B399-19F3D0C14DD6"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "29", EsppExportValue = "29" }, + new { Id = new Guid("A1669207-AA31-40FE-98D0-D941008D1655"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "30", EsppExportValue = "30" }, + new { Id = new Guid("0936AA99-73E0-43DE-B6DF-334C1228A226"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.DayOfMonth, Value = "31", EsppExportValue = "31" }, + new { Id = new Guid("626CA076-F09E-4A7A-8610-B7DE6337B24A"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Order, Value = "Первый", EsppExportValue = "1" }, + new { Id = new Guid("032FBD02-67D0-4B8C-BED0-42629AB7113B"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Order, Value = "Второй", EsppExportValue = "2" }, + new { Id = new Guid("FA8A8F60-E41E-495E-AC86-35174D9976BF"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Order, Value = "Третий", EsppExportValue = "3" }, + new { Id = new Guid("D2F90168-2B49-42F2-820B-79DB2C522ADF"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Order, Value = "Четвертый", EsppExportValue = "4" }, + new { Id = new Guid("12BB8DB2-CF7F-4113-BAFF-6883770F1BA5"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Order, Value = "Последний", EsppExportValue = "5" }, + new { Id = new Guid("18260E91-3FBE-4401-9EDC-78DBC419370E"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Январь", EsppExportValue = "1" }, + new { Id = new Guid("361526AA-3E1C-452E-BB44-0ADE8521830D"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Февраль", EsppExportValue = "2" }, + new { Id = new Guid("FAD4BDB0-6C51-4810-A30B-6D031A0D4C46"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Март", EsppExportValue = "3" }, + new { Id = new Guid("06AB835D-3D3E-4057-8422-A553B6B40995"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Апрель", EsppExportValue = "4" }, + new { Id = new Guid("83F56B5D-B16B-4AA5-89D7-A253FEE4E4AD"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Май", EsppExportValue = "5" }, + new { Id = new Guid("E679EC84-A9EE-4BED-A051-2B14EDDDCB18"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Июнь", EsppExportValue = "6" }, + new { Id = new Guid("D439808A-6A10-409B-8809-A755B7CCA60B"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Июль", EsppExportValue = "7" }, + new { Id = new Guid("6E9972C4-6BF7-4FE4-B4EA-BBB333FB69C8"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Август", EsppExportValue = "8" }, + new { Id = new Guid("0883AAC2-9D5B-4098-B672-C684D2A3A0C9"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Сентябрь", EsppExportValue = "9" }, + new { Id = new Guid("5E6592BC-ACB2-45A4-979B-FDECF8457453"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Октябрь", EsppExportValue = "10" }, + new { Id = new Guid("EDD7CB49-D6A0-4969-B2D6-1967DA69B336"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Ноябрь", EsppExportValue = "11" }, + new { Id = new Guid("DD695FB2-4AD0-4CDA-A4DF-E15059C56B24"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.Month, Value = "Декабрь", EsppExportValue = "12" }, + new { Id = new Guid("2F473624-4EB3-49B4-A4B9-CC7FC08A50F5"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Января", EsppExportValue = "1" }, + new { Id = new Guid("F0003490-A249-44BD-814F-4566999915D8"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Февраля", EsppExportValue = "2" }, + new { Id = new Guid("F4C3FE38-AEAA-42F7-A9BA-190EA2DFE339"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Марта", EsppExportValue = "3" }, + new { Id = new Guid("06A8BD2F-68E1-42F5-961C-AC3B98A2181E"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Апреля", EsppExportValue = "4" }, + new { Id = new Guid("963B9C41-D607-444A-9FE0-FE429590E326"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Мая", EsppExportValue = "5" }, + new { Id = new Guid("EC8554C8-DEE4-49A1-B1B7-474AD8EC1473"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Июня", EsppExportValue = "6" }, + new { Id = new Guid("E15C7C63-E29F-41A3-9C82-F70EB6C24FDE"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Июля", EsppExportValue = "7" }, + new { Id = new Guid("0B1F3CEA-301A-4D74-9CE1-2CD93B41897D"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Августа", EsppExportValue = "8" }, + new { Id = new Guid("E2FA3769-F66F-4753-A161-35ADAD7717A5"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Сентября", EsppExportValue = "9" }, + new { Id = new Guid("C1DE4ACA-9F49-48AE-9279-CF9EC4092112"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Октября", EsppExportValue = "10" }, + new { Id = new Guid("A74B9EBD-BCD8-4537-B371-194DE2FE0A4D"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Ноября", EsppExportValue = "11" }, + new { Id = new Guid("852A5EBD-4545-494B-BC69-C27409A41ADC"), DateCreated = dateCreated, TypeId = (int)EsppSchTypeEnum.MonthGenitive, Value = "Декабря", EsppExportValue = "12" } ); }); diff --git a/PARR.DAL/Migrations/20231127003844_TblEsppSchTypeValueAddEsppExportValue.Designer.cs b/PARR.DAL/Migrations/20231127003844_TblEsppSchTypeValueAddEsppExportValue.Designer.cs new file mode 100644 index 00000000..bf210d10 --- /dev/null +++ b/PARR.DAL/Migrations/20231127003844_TblEsppSchTypeValueAddEsppExportValue.Designer.cs @@ -0,0 +1,2754 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using PARR.DAL.Context; + +#nullable disable + +namespace PARR.DAL.Migrations +{ + [DbContext(typeof(DataContext))] + [Migration("20231127003844_TblEsppSchTypeValueAddEsppExportValue")] + partial class TblEsppSchTypeValueAddEsppExportValue + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("PARR.DAL.Models.AIHIT.RawDataEK", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AIHID") + .HasColumnType("integer"); + + b.Property("APPType") + .HasColumnType("text"); + + b.Property("AdditionalInfo") + .HasColumnType("text"); + + b.Property("CKBSServerType") + .HasColumnType("text"); + + b.Property("CTSDirection") + .HasColumnType("text"); + + b.Property("ClientOS") + .HasColumnType("text"); + + b.Property("ClientSoftware") + .HasColumnType("text"); + + b.Property("Company") + .HasColumnType("text"); + + b.Property("CreateTime") + .HasColumnType("text"); + + b.Property("DBType") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EKCategory") + .HasColumnType("text"); + + b.Property("EKFindCode") + .HasColumnType("text"); + + b.Property("EKRegister") + .HasColumnType("text"); + + b.Property("EKRevizor") + .HasColumnType("text"); + + b.Property("EKSubCategory") + .HasColumnType("text"); + + b.Property("EKType") + .HasColumnType("text"); + + b.Property("EndExplotationDate") + .HasColumnType("text"); + + b.Property("FullName") + .HasColumnType("text"); + + b.Property("IBServerType") + .HasColumnType("text"); + + b.Property("IP") + .HasColumnType("text"); + + b.Property("InfrastructureServerType") + .HasColumnType("text"); + + b.Property("IsActive") + .HasColumnType("text"); + + b.Property("IsImportant") + .HasColumnType("text"); + + b.Property("IsUnreliableData") + .HasColumnType("character(1)"); + + b.Property("Location") + .HasColumnType("text"); + + b.Property("Metka") + .HasColumnType("text"); + + b.Property("MonitoringServerType") + .HasColumnType("text"); + + b.Property("NetworkName") + .HasColumnType("text"); + + b.Property("NewEKFindCode") + .HasColumnType("text"); + + b.Property("OSType") + .HasColumnType("text"); + + b.Property("OldEKFindCode") + .HasColumnType("text"); + + b.Property("PlannedTimeToRepair") + .HasColumnType("text"); + + b.Property("Prescription") + .HasColumnType("text"); + + b.Property("ProductCode") + .HasColumnType("text"); + + b.Property("ResponseArea") + .HasColumnType("text"); + + b.Property("ResponsibleByEK") + .HasColumnType("text"); + + b.Property("ServiceCode") + .HasColumnType("text"); + + b.Property("ShiftWorkGroup") + .HasColumnType("text"); + + b.Property("ShortName") + .HasColumnType("text"); + + b.Property("StartExplotationDate") + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("text"); + + b.Property("SysModTime") + .HasColumnType("text"); + + b.Property("SysModUser") + .HasColumnType("text"); + + b.Property("TargetRepairTime") + .HasColumnType("text"); + + b.Property("WorkGroup") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("RawDataEKs", "AIHIT"); + }); + + modelBuilder.Entity("PARR.DAL.Models.AIHIT.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Group") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Settings", "AIHIT"); + + b.HasData( + new + { + Id = new Guid("b16afd06-605b-499f-9e35-a19586de96b0"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ГВЦ", + Value = "00-ГВЦ" + }, + new + { + Id = new Guid("42a2ec03-da3a-45fc-971e-399910fdc5ae"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ОКТ", + Value = "01-ОКТ" + }, + new + { + Id = new Guid("17efaf65-ae8c-45f1-b187-e6cb1bd6385b"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "КЛГ", + Value = "10-КЛГ" + }, + new + { + Id = new Guid("51270997-20f6-4a61-85ac-64f6b6dd5dc4"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "МСК", + Value = "17-МСК" + }, + new + { + Id = new Guid("b94f8c38-e78a-494e-81ba-39e4e902ffcc"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ГОР", + Value = "24-ГОР" + }, + new + { + Id = new Guid("52ba20ea-4e7a-4500-939b-e2cff563809a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "СЕВ", + Value = "28-СЕВ" + }, + new + { + Id = new Guid("cb9da805-29e9-4e08-b1ed-d4b374920f77"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "СКВ", + Value = "51-СКВ" + }, + new + { + Id = new Guid("1943a65c-2060-4b5f-af1f-acec74835481"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ЮВСТ", + Value = "58-ЮВСТ" + }, + new + { + Id = new Guid("4d9ef2ee-d4fa-4d28-a93b-6f1fd0a639f9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ПРИВ", + Value = "61-ПРИВ" + }, + new + { + Id = new Guid("f1a54c25-a93a-4fe3-8268-afbcc435b6e9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "КБШ", + Value = "63-КБШ" + }, + new + { + Id = new Guid("cc839c48-62bb-46a8-924c-85b5e7a3e245"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "СВРД", + Value = "76-СВРД" + }, + new + { + Id = new Guid("c98fb684-ff03-441e-a9c3-ac5071d69857"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ЮУР", + Value = "80-ЮУР" + }, + new + { + Id = new Guid("f2684a90-6029-4476-bd3d-e713a8a228d6"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ЗСИБ", + Value = "83-ЗСИБ" + }, + new + { + Id = new Guid("b3c73162-21ea-42f0-b0e1-3c5076176f8a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "КРАСН", + Value = "88-КРАСН" + }, + new + { + Id = new Guid("a8cff6fd-28b7-49f2-a412-9208c10f6516"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ВСИБ", + Value = "92-ВСИБ" + }, + new + { + Id = new Guid("50f66704-4d26-4587-bb1e-dca70c8f4b89"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ЗАБ", + Value = "94-ЗАБ" + }, + new + { + Id = new Guid("1fd43634-4a06-4237-9727-edfa6f3eebe8"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Зона ответственности", + Group = "ResponsibleArea", + Name = "ДВС", + Value = "96-ДВС" + }, + new + { + Id = new Guid("77c73c0a-8e4d-4676-b6e2-6a112f20e346"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Статус актуальных ЭК", + Group = "Status", + Name = "Exploitation", + Value = "3-В эксплуатации" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.AgentHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("HistoryLevelId") + .HasColumnType("integer"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("OrderId") + .HasColumnType("uuid"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("HistoryLevelId"); + + b.HasIndex("OrderId"); + + b.HasIndex("TemplateId"); + + b.ToTable("AgentHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.AgentHistoryLevel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("AgentHistoryLevels"); + + b.HasData( + new + { + Id = 1, + Description = "Агент начал выполнять задание", + Name = "Start" + }, + new + { + Id = 5, + Description = "Агент завершил выполнение задания", + Name = "End" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.Application", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationTypeId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationTypeId"); + + b.ToTable("Applications"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationInHost", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("HostId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId"); + + b.HasIndex("HostId"); + + b.ToTable("ApplicationsInHost"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("ApplicationTypes"); + + b.HasData( + new + { + Id = new Guid("32c28386-6f13-4f7b-8508-be165b7fabdb"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Поле СП xml АИХ ИТ", + Name = "APP" + }, + new + { + Id = new Guid("7848a96c-cdee-48c1-a786-de9cb889723a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Поле ОС xml АИХ ИТ", + Name = "OS" + }, + new + { + Id = new Guid("aae2636f-b93a-42dc-873e-0764a90a0a40"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Description = "Поле СУБД xml АИХ ИТ", + Name = "DB" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationsInWork", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AgentName") + .HasColumnType("text"); + + b.Property("AgentScript") + .HasColumnType("text"); + + b.Property("AgentTimeOutSec") + .HasColumnType("integer"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("FullDescription") + .IsRequired() + .HasColumnType("text"); + + b.Property("IsAgent") + .HasColumnType("boolean"); + + b.Property("LastRun") + .HasColumnType("timestamp with time zone"); + + b.Property("NextRun") + .HasColumnType("timestamp with time zone"); + + b.Property("ShortDescription") + .IsRequired() + .HasColumnType("text"); + + b.Property("Solution") + .IsRequired() + .HasColumnType("text"); + + b.Property("TemplateDuration") + .IsRequired() + .HasColumnType("text"); + + b.Property("WorkId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId"); + + b.HasIndex("WorkId", "ApplicationId") + .IsUnique(); + + b.ToTable("ApplicationsInWorks"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EkStatus", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("EkStatuses"); + + b.HasData( + new + { + Code = 1, + Name = "1-Новый" + }, + new + { + Code = 2, + Name = "2-Подготовка к эксплуатации" + }, + new + { + Code = 3, + Name = "3-В эксплуатации" + }, + new + { + Code = 4, + Name = "4-В ремонте" + }, + new + { + Code = 5, + Name = "5-В резерве" + }, + new + { + Code = 6, + Name = "6-Выведен из эксплуатации" + }, + new + { + Code = 7, + Name = "7-Тестовый" + }, + new + { + Code = 9, + Name = "9-В разработке" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("EsppSchTypes"); + + b.HasData( + new + { + Id = 1, + Description = "Через интервал", + Name = "Interval" + }, + new + { + Id = 2, + Description = "День недели: пнд, вт...", + Name = "DayOfWeek" + }, + new + { + Id = 3, + Description = "Число месяца: 1,2,3,4", + Name = "DayOfMonth" + }, + new + { + Id = 4, + Description = "Каждый: первый, второй, третий, четвертый, последний", + Name = "Order" + }, + new + { + Id = 5, + Description = "Месяц: январь, февраль...", + Name = "Month" + }, + new + { + Id = 6, + Description = "Месяц (родительный падеж): января, февраля...", + Name = "MonthGenitive" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Order") + .HasColumnType("integer"); + + b.Property("TypeId") + .HasColumnType("integer"); + + b.Property("TypeScheduleId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TypeId"); + + b.HasIndex("TypeScheduleId", "TypeId") + .IsUnique(); + + b.ToTable("EsppSchTypeConfigs"); + + b.HasData( + new + { + Id = new Guid("d2693562-b3eb-41e9-97db-c6b5d2ef1bea"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 1, + TypeScheduleId = 1 + }, + new + { + Id = new Guid("06b2e7aa-6927-4fbf-99fb-67c92a4fce8a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 2, + TypeScheduleId = 2 + }, + new + { + Id = new Guid("78079071-ff80-417e-9bb0-d928cec853e7"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 3, + TypeScheduleId = 3 + }, + new + { + Id = new Guid("accb1d46-e1c1-4396-9182-4c0766155921"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 4, + TypeScheduleId = 4 + }, + new + { + Id = new Guid("162ffe73-2428-4abe-8f83-235c2593664c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 1, + TypeId = 2, + TypeScheduleId = 4 + }, + new + { + Id = new Guid("8470d1ef-165d-42fc-ab05-8203e4d263cf"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 5, + TypeScheduleId = 5 + }, + new + { + Id = new Guid("006900b5-f65c-413e-bc67-09e6dae60b7c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 1, + TypeId = 3, + TypeScheduleId = 5 + }, + new + { + Id = new Guid("85635bc8-f17a-46b8-9c15-8615761be3d9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 0, + TypeId = 4, + TypeScheduleId = 6 + }, + new + { + Id = new Guid("439460c2-deca-4b54-80e7-2f20806696ec"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 1, + TypeId = 2, + TypeScheduleId = 6 + }, + new + { + Id = new Guid("5c63ad8c-e9b4-43fd-9d24-5c2eed80dadd"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Order = 2, + TypeId = 6, + TypeScheduleId = 6 + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeSchedule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("EsppSchTypeSchedules"); + + b.HasData( + new + { + Id = 1, + Description = "Регулярно", + Name = "Regularly" + }, + new + { + Id = 2, + Description = "Еженедельно", + Name = "Weekly" + }, + new + { + Id = 3, + Description = "Ежемесячно", + Name = "Monthly" + }, + new + { + Id = 4, + Description = "Ежемесячно-2", + Name = "Monthly2" + }, + new + { + Id = 5, + Description = "Ежегодно", + Name = "Annually" + }, + new + { + Id = 6, + Description = "Ежегодно-2", + Name = "Annually2" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppExportValue") + .IsRequired() + .HasColumnType("text"); + + b.Property("TypeId") + .HasColumnType("integer"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("TypeId"); + + b.ToTable("EsppSchTypeValues"); + + b.HasData( + new + { + Id = new Guid("6e3b5dd2-b2f7-40bc-bace-15bfa6bbd4ff"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "01:00:00", + TypeId = 1, + Value = "Каждый час" + }, + new + { + Id = new Guid("4df04834-f14f-43d9-8984-334f080f4107"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "02:00:00", + TypeId = 1, + Value = "Каждые 2 часа" + }, + new + { + Id = new Guid("dab6e3f9-2385-4966-b77c-133ad233c592"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "03:00:00", + TypeId = 1, + Value = "Каждые 3 часа" + }, + new + { + Id = new Guid("035f485d-8451-47df-bfaa-ba4dd36cf146"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "04:00:00", + TypeId = 1, + Value = "Каждые 4 часа" + }, + new + { + Id = new Guid("d627daa7-3eed-4571-acae-ffbb3c5bedb9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "06:00:00", + TypeId = 1, + Value = "Каждые 6 часов" + }, + new + { + Id = new Guid("ae0a0015-0f1e-4496-b71e-6244f7e321e7"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "12:00:00", + TypeId = 1, + Value = "Каждые 12 часов" + }, + new + { + Id = new Guid("8df097aa-9860-4a62-9675-a8eecd3f2ce7"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1 00:00:00", + TypeId = 1, + Value = "Ежедневно" + }, + new + { + Id = new Guid("dee32e60-c1a1-4206-98bc-aa03deabfdf6"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3 00:00:00", + TypeId = 1, + Value = "Каждые 72 часа" + }, + new + { + Id = new Guid("e0465fbf-e3a5-4486-9f53-5bb85c6feeca"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4 00:00:00", + TypeId = 1, + Value = "Каждые 96 часов" + }, + new + { + Id = new Guid("4e3f73d1-a0f3-4dd1-bca9-68ada0dd5ce2"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "14 00:00:00", + TypeId = 1, + Value = "Каждые 2 недели" + }, + new + { + Id = new Guid("55833417-6a24-42f6-bcc2-5d032f883202"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "60 00:00:00", + TypeId = 1, + Value = "Каждые 60 дней" + }, + new + { + Id = new Guid("7fefa052-29db-4ce5-9c57-2fd9ff855f21"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "80 00:00:00", + TypeId = 1, + Value = "Каждые 80 дней" + }, + new + { + Id = new Guid("b0ca99f9-5ee0-45b3-bb80-948f82b1fcb1"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "90 00:00:00", + TypeId = 1, + Value = "Каждые 90 дней" + }, + new + { + Id = new Guid("086f7a37-9848-423a-a3cc-36dbb5ad43e3"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "182 00:00:00", + TypeId = 1, + Value = "Каждые полгода" + }, + new + { + Id = new Guid("f2da9e02-d619-4517-a598-374880a8c8e8"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "540 00:00:00", + TypeId = 1, + Value = "Каждые 1,5 года" + }, + new + { + Id = new Guid("f38d7d30-8923-4ea0-aa7c-5b251e19ab61"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1095 00:00:00", + TypeId = 1, + Value = "Каждые 3 года" + }, + new + { + Id = new Guid("b7303461-9a30-43fa-8e55-305aa13f186f"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", + TypeId = 2, + Value = "Понедельник" + }, + new + { + Id = new Guid("e951135e-71f2-4262-9342-df4d5315ab6c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", + TypeId = 2, + Value = "Вторник" + }, + new + { + Id = new Guid("c34d5375-70e7-4632-b3af-30e279a0621a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", + TypeId = 2, + Value = "Среда" + }, + new + { + Id = new Guid("ec9540df-c2de-4bda-a063-34d02d4b6e03"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", + TypeId = 2, + Value = "Четверг" + }, + new + { + Id = new Guid("2ed85534-4684-4eb2-9ccb-e264d212c945"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", + TypeId = 2, + Value = "Пятница" + }, + new + { + Id = new Guid("a6804315-96ef-484e-82ee-c5795694468b"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "6", + TypeId = 2, + Value = "Суббота" + }, + new + { + Id = new Guid("eb71e699-937f-4894-9688-f7a7f95e5e58"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "7", + TypeId = 2, + Value = "Воскресенье" + }, + new + { + Id = new Guid("e86adbfb-3345-4e0c-aa3b-b4418f9cfe88"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", + TypeId = 3, + Value = "1" + }, + new + { + Id = new Guid("5b4d7ca6-31e7-475b-b7c8-13c6680c3dc3"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", + TypeId = 3, + Value = "2" + }, + new + { + Id = new Guid("0da03db0-9404-425d-bea1-5da0c9b60b59"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", + TypeId = 3, + Value = "3" + }, + new + { + Id = new Guid("199474c8-0a77-47e5-aab8-ba33c216cc9e"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", + TypeId = 3, + Value = "4" + }, + new + { + Id = new Guid("e6619da1-f7e8-45b9-bbd3-9c17bec2ccd3"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", + TypeId = 3, + Value = "5" + }, + new + { + Id = new Guid("a8708763-c838-49a5-95fe-bf4f73518d71"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "6", + TypeId = 3, + Value = "6" + }, + new + { + Id = new Guid("7ec056aa-820c-4900-96cb-4564d2ea6398"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "7", + TypeId = 3, + Value = "7" + }, + new + { + Id = new Guid("554d7d0c-91b1-4b81-b94d-1ee864192962"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "8", + TypeId = 3, + Value = "8" + }, + new + { + Id = new Guid("8b7847a4-23de-4199-8aad-3b5c0323b5a2"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "9", + TypeId = 3, + Value = "9" + }, + new + { + Id = new Guid("fb7f41ca-950b-4dc1-a0a6-bd9a221ab2ad"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "10", + TypeId = 3, + Value = "10" + }, + new + { + Id = new Guid("a28b530f-ea38-4a2c-a16b-0b7fa3770d3c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "11", + TypeId = 3, + Value = "11" + }, + new + { + Id = new Guid("7a004a11-32e1-40ae-ab35-0d3dc3a69785"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "12", + TypeId = 3, + Value = "12" + }, + new + { + Id = new Guid("e0f2f4d1-4a5e-4997-8336-83c3c35f38df"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "13", + TypeId = 3, + Value = "13" + }, + new + { + Id = new Guid("9c5aaf48-88ec-4c67-b936-2be45550f8bf"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "14", + TypeId = 3, + Value = "14" + }, + new + { + Id = new Guid("8dbd680c-ce49-4d2e-8a1a-05619685e240"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "15", + TypeId = 3, + Value = "15" + }, + new + { + Id = new Guid("2f476f70-b1ef-419d-aad5-3911f1e3231f"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "16", + TypeId = 3, + Value = "16" + }, + new + { + Id = new Guid("2c635ce2-fc18-47be-b3e9-98c211abf312"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "17", + TypeId = 3, + Value = "17" + }, + new + { + Id = new Guid("f9d5b03b-624a-4f9f-8da3-1490ea5d2914"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "18", + TypeId = 3, + Value = "18" + }, + new + { + Id = new Guid("4f4b249c-db60-4582-86ed-75cfee4edd0c"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "19", + TypeId = 3, + Value = "19" + }, + new + { + Id = new Guid("220a1464-4d39-416c-b4b2-3093eb007298"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "20", + TypeId = 3, + Value = "20" + }, + new + { + Id = new Guid("c887ca60-b05d-4d3c-ad1f-223c879b1a6d"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "21", + TypeId = 3, + Value = "21" + }, + new + { + Id = new Guid("2905765d-63fb-41fe-a111-ee2f1d03d62e"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "22", + TypeId = 3, + Value = "22" + }, + new + { + Id = new Guid("dbbe704a-8d6d-40e7-bd30-6974035b1fab"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "23", + TypeId = 3, + Value = "23" + }, + new + { + Id = new Guid("cf7b9645-52ed-43a2-8267-267e0aed19b1"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "24", + TypeId = 3, + Value = "24" + }, + new + { + Id = new Guid("454788d6-d0ad-4c07-878c-da3fd3cd05e1"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "25", + TypeId = 3, + Value = "25" + }, + new + { + Id = new Guid("40d70d73-8582-4be6-a9e6-503b96ae3d49"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "26", + TypeId = 3, + Value = "26" + }, + new + { + Id = new Guid("8f6610dc-ef46-4842-a57e-18d7aaa75931"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "27", + TypeId = 3, + Value = "27" + }, + new + { + Id = new Guid("03858472-d4ce-47fd-9497-8051728766e4"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "28", + TypeId = 3, + Value = "28" + }, + new + { + Id = new Guid("b1018e07-e90e-42ee-b399-19f3d0c14dd6"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "29", + TypeId = 3, + Value = "29" + }, + new + { + Id = new Guid("a1669207-aa31-40fe-98d0-d941008d1655"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "30", + TypeId = 3, + Value = "30" + }, + new + { + Id = new Guid("0936aa99-73e0-43de-b6df-334c1228a226"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "31", + TypeId = 3, + Value = "31" + }, + new + { + Id = new Guid("626ca076-f09e-4a7a-8610-b7de6337b24a"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", + TypeId = 4, + Value = "Первый" + }, + new + { + Id = new Guid("032fbd02-67d0-4b8c-bed0-42629ab7113b"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", + TypeId = 4, + Value = "Второй" + }, + new + { + Id = new Guid("fa8a8f60-e41e-495e-ac86-35174d9976bf"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", + TypeId = 4, + Value = "Третий" + }, + new + { + Id = new Guid("d2f90168-2b49-42f2-820b-79db2c522adf"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", + TypeId = 4, + Value = "Четвертый" + }, + new + { + Id = new Guid("12bb8db2-cf7f-4113-baff-6883770f1ba5"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", + TypeId = 4, + Value = "Последний" + }, + new + { + Id = new Guid("18260e91-3fbe-4401-9edc-78dbc419370e"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", + TypeId = 5, + Value = "Январь" + }, + new + { + Id = new Guid("361526aa-3e1c-452e-bb44-0ade8521830d"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", + TypeId = 5, + Value = "Февраль" + }, + new + { + Id = new Guid("fad4bdb0-6c51-4810-a30b-6d031a0d4c46"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", + TypeId = 5, + Value = "Март" + }, + new + { + Id = new Guid("06ab835d-3d3e-4057-8422-a553b6b40995"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", + TypeId = 5, + Value = "Апрель" + }, + new + { + Id = new Guid("83f56b5d-b16b-4aa5-89d7-a253fee4e4ad"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", + TypeId = 5, + Value = "Май" + }, + new + { + Id = new Guid("e679ec84-a9ee-4bed-a051-2b14edddcb18"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "6", + TypeId = 5, + Value = "Июнь" + }, + new + { + Id = new Guid("d439808a-6a10-409b-8809-a755b7cca60b"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "7", + TypeId = 5, + Value = "Июль" + }, + new + { + Id = new Guid("6e9972c4-6bf7-4fe4-b4ea-bbb333fb69c8"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "8", + TypeId = 5, + Value = "Август" + }, + new + { + Id = new Guid("0883aac2-9d5b-4098-b672-c684d2a3a0c9"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "9", + TypeId = 5, + Value = "Сентябрь" + }, + new + { + Id = new Guid("5e6592bc-acb2-45a4-979b-fdecf8457453"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "10", + TypeId = 5, + Value = "Октябрь" + }, + new + { + Id = new Guid("edd7cb49-d6a0-4969-b2d6-1967da69b336"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "11", + TypeId = 5, + Value = "Ноябрь" + }, + new + { + Id = new Guid("dd695fb2-4ad0-4cda-a4df-e15059c56b24"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "12", + TypeId = 5, + Value = "Декабрь" + }, + new + { + Id = new Guid("2f473624-4eb3-49b4-a4b9-cc7fc08a50f5"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", + TypeId = 6, + Value = "Января" + }, + new + { + Id = new Guid("f0003490-a249-44bd-814f-4566999915d8"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", + TypeId = 6, + Value = "Февраля" + }, + new + { + Id = new Guid("f4c3fe38-aeaa-42f7-a9ba-190ea2dfe339"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", + TypeId = 6, + Value = "Марта" + }, + new + { + Id = new Guid("06a8bd2f-68e1-42f5-961c-ac3b98a2181e"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", + TypeId = 6, + Value = "Апреля" + }, + new + { + Id = new Guid("963b9c41-d607-444a-9fe0-fe429590e326"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", + TypeId = 6, + Value = "Мая" + }, + new + { + Id = new Guid("ec8554c8-dee4-49a1-b1b7-474ad8ec1473"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "6", + TypeId = 6, + Value = "Июня" + }, + new + { + Id = new Guid("e15c7c63-e29f-41a3-9c82-f70eb6c24fde"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "7", + TypeId = 6, + Value = "Июля" + }, + new + { + Id = new Guid("0b1f3cea-301a-4d74-9ce1-2cd93b41897d"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "8", + TypeId = 6, + Value = "Августа" + }, + new + { + Id = new Guid("e2fa3769-f66f-4753-a161-35adad7717a5"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "9", + TypeId = 6, + Value = "Сентября" + }, + new + { + Id = new Guid("c1de4aca-9f49-48ae-9279-cf9ec4092112"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "10", + TypeId = 6, + Value = "Октября" + }, + new + { + Id = new Guid("a74b9ebd-bcd8-4537-b371-194de2fe0a4d"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "11", + TypeId = 6, + Value = "Ноября" + }, + new + { + Id = new Guid("852a5ebd-4545-494b-bc69-c27409a41adc"), + DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "12", + TypeId = 6, + Value = "Декабря" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchValue", b => + { + b.Property("ApplicationsInWorkId") + .HasColumnType("uuid"); + + b.Property("TypeValueId") + .HasColumnType("uuid"); + + b.Property("TypeConfigId") + .HasColumnType("uuid"); + + b.HasKey("ApplicationsInWorkId", "TypeValueId", "TypeConfigId"); + + b.HasIndex("TypeConfigId"); + + b.HasIndex("TypeValueId"); + + b.ToTable("EsppSchValues"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Host", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Ek") + .IsRequired() + .HasColumnType("text"); + + b.Property("EkStatusCode") + .HasColumnType("integer"); + + b.Property("IP") + .IsRequired() + .HasColumnType("text"); + + b.Property("ResponseAreaCode") + .HasColumnType("integer"); + + b.Property("WorkGroup") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("EkStatusCode"); + + b.HasIndex("ResponseAreaCode"); + + b.ToTable("Hosts"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("GenerateDate") + .HasColumnType("timestamp with time zone"); + + b.Property("NextStatusCode") + .HasColumnType("integer"); + + b.Property("Number") + .IsRequired() + .HasColumnType("text"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("text"); + + b.Property("StatusCode") + .HasColumnType("integer"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.Property("WorkGroup") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("NextStatusCode"); + + b.HasIndex("StatusCode"); + + b.HasIndex("TemplateId"); + + b.ToTable("Orders"); + }); + + modelBuilder.Entity("PARR.DAL.Models.OrderStatus", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("OrderStatuses"); + + b.HasData( + new + { + Code = 1, + Description = "1-Направлен в группу", + Name = "New" + }, + new + { + Code = 2, + Description = "2-В работе", + Name = "InWork" + }, + new + { + Code = 3, + Description = "3-Приостановлен", + Name = "Stop" + }, + new + { + Code = 4, + Description = "4-Выполнен", + Name = "Complete" + }, + new + { + Code = 5, + Description = "5-Закрыт", + Name = "Closed" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.Process", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Processes"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ResponseArea", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("ResponseAreas"); + + b.HasData( + new + { + Code = 96, + Name = "96-ДВС" + }, + new + { + Code = 94, + Name = "94-ЗАБ" + }, + new + { + Code = 92, + Name = "92-ВСИБ" + }, + new + { + Code = 88, + Name = "88-КРАСН" + }, + new + { + Code = 83, + Name = "83-ЗСИБ" + }, + new + { + Code = 80, + Name = "80-ЮУР" + }, + new + { + Code = 76, + Name = "76-СВРД" + }, + new + { + Code = 63, + Name = "63-КБШ" + }, + new + { + Code = 61, + Name = "61-ПРИВ" + }, + new + { + Code = 58, + Name = "58-ЮВСТ" + }, + new + { + Code = 51, + Name = "51-СКВ" + }, + new + { + Code = 28, + Name = "28-СЕВ" + }, + new + { + Code = 24, + Name = "24-ГОР" + }, + new + { + Code = 17, + Name = "17-МСК" + }, + new + { + Code = 10, + Name = "10-КЛГ" + }, + new + { + Code = 1, + Name = "01-ОКТ" + }, + new + { + Code = 99, + Name = "00-ГВЦ" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.Robot", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Robots"); + + b.HasData( + new + { + Code = 1, + Description = "Робот по созданию/изменению шаблона наряда ЕСПП", + Name = "TemplateOrder" + }, + new + { + Code = 2, + Description = "Робот по созданию/изменению расписания шаблона наряда в ЕСПП", + Name = "ScheduleOrder" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptsNumber") + .HasColumnType("integer"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("LastRobotStatusUpdated") + .HasColumnType("timestamp with time zone"); + + b.Property("RobotCode") + .HasColumnType("integer"); + + b.Property("RobotStatusCode") + .HasColumnType("integer"); + + b.Property("TaskStatusCode") + .HasColumnType("integer"); + + b.Property("TemplateId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("RobotCode"); + + b.HasIndex("RobotStatusCode"); + + b.HasIndex("TaskStatusCode"); + + b.HasIndex("TemplateId", "RobotCode") + .IsUnique(); + + b.ToTable("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppMessage") + .HasColumnType("text"); + + b.Property("HistoryLevel") + .HasColumnType("integer"); + + b.Property("RobotConfigurationId") + .HasColumnType("uuid"); + + b.Property("RobotMessage") + .HasColumnType("text"); + + b.Property("TaskStatusCode") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("HistoryLevel"); + + b.HasIndex("RobotConfigurationId"); + + b.HasIndex("TaskStatusCode"); + + b.ToTable("RobotHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotHistoryLevel", b => + { + b.Property("Level") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Level")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Level"); + + b.ToTable("RobotHistoryLevels"); + + b.HasData( + new + { + Level = 1, + Description = "Робот начал работу ", + Name = "Start" + }, + new + { + Level = 5, + Description = "Информация", + Name = "Inforamtion" + }, + new + { + Level = 10, + Description = "Ошибка", + Name = "Error" + }, + new + { + Level = 15, + Description = "Успешно завершил работу", + Name = "Complete" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotStatus", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("RobotStatuses"); + + b.HasData( + new + { + Code = 11, + Description = "Ожидание, ждет пока робот возьмет в работу.", + Name = "Wait" + }, + new + { + Code = 22, + Description = "Робот взял в работу.", + Name = "InProgress" + }, + new + { + Code = 33, + Description = "Ошибка отработки роботом. Требует ручного вмешательства.", + Name = "Error" + }, + new + { + Code = 44, + Description = "Робот успешно отработал.", + Name = "Complete" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.Setting", b => + { + b.Property("Name") + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Name"); + + b.ToTable("Settings"); + + b.HasData( + new + { + Name = "Initiator", + Description = "Инициатор регламентной работы, указывается при создании шаблона в ЕСПП.", + Value = "КУЗНЕЦОВ МИХАИЛ ВАЛЕРЬЕВИЧ (IVC_KUZNETSOVMV@DVGD.OAO.RZD)" + }, + new + { + Name = "ClosingCode", + Description = "Код закрытия регламентной работы, указывается при создании шаблона в ЕСПП.", + Value = "выполнен" + }, + new + { + Name = "Category", + Description = "Категория создаваемого объекта в ЕСПП", + Value = "регламентная работа" + }, + new + { + Name = "TemplatePrefixName", + Description = "Префикс имени шаблона в ЕСПП", + Value = "ПАРР-ДВС-ПТК" + }, + new + { + Name = "RobotAttemptsNumber", + Description = "Количество попыток выполнения задания роботом", + Value = "3" + }, + new + { + Name = "RobotWaitTime", + Description = "Время ожидания выполнения роботом задания", + Value = "00:15:00" + }, + new + { + Name = "ScheduleTimezone", + Description = "Расписание регламентной работы - В каком часовом поясе", + Value = "MSK" + }, + new + { + Name = "ScheduleExclude", + Description = "Расписание регламентной работы - Тип исключения", + Value = "Нет исключений" + }, + new + { + Name = "ScheduleRepeatRange", + Description = "Расписание регламентной работы - Диапазн повторов", + Value = "Отсутствует дата завершения" + }, + new + { + Name = "OrderSearchDeltaDate", + Description = "Промежуток времени для поиска нарядов в ЕСПП", + Value = "01:30:00" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.Subprocess", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ProcessId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ProcessId"); + + b.ToTable("Subprocesses"); + }); + + modelBuilder.Entity("PARR.DAL.Models.TaskStatus", b => + { + b.Property("Code") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Code")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.ToTable("TaskStatuses"); + + b.HasData( + new + { + Code = 10, + Description = "Требуется создание объекта в ЕСПП", + Name = "Creating" + }, + new + { + Code = 20, + Description = "Требуется обновление объекта в ЕСПП", + Name = "Updating" + }, + new + { + Code = 30, + Description = "Нормальное состояние объекта в ЕСПП и ПАРР. ОБъект в ПАРР соответствует объекту в ЕСПП", + Name = "Ok" + }); + }); + + modelBuilder.Entity("PARR.DAL.Models.Template", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationInWorkId") + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("HostId") + .HasColumnType("uuid"); + + b.Property("IsActiveSchedule") + .HasColumnType("boolean"); + + b.Property("IsActiveTemplate") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ScheduleEsppId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationInWorkId"); + + b.HasIndex("HostId"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Templates"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Tnk", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("SubprocessId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("SubprocessId"); + + b.ToTable("Tnks"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Work", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("EsppId") + .HasColumnType("integer"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("TnkId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("TnkId"); + + b.ToTable("Works"); + }); + + modelBuilder.Entity("PARR.DAL.Models.AgentHistory", b => + { + b.HasOne("PARR.DAL.Models.AgentHistoryLevel", "AgentHistoryLevel") + .WithMany("AgentHistories") + .HasForeignKey("HistoryLevelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.Order", "Order") + .WithMany("AgentHistories") + .HasForeignKey("OrderId"); + + b.HasOne("PARR.DAL.Models.Template", "Template") + .WithMany("AgentHistories") + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AgentHistoryLevel"); + + b.Navigation("Order"); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Application", b => + { + b.HasOne("PARR.DAL.Models.ApplicationType", "ApplicationType") + .WithMany("Applications") + .HasForeignKey("ApplicationTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ApplicationType"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationInHost", b => + { + b.HasOne("PARR.DAL.Models.Application", "Application") + .WithMany("ApplicationsInHosts") + .HasForeignKey("ApplicationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.Host", "Host") + .WithMany("ApplicationsInHosts") + .HasForeignKey("HostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Application"); + + b.Navigation("Host"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationsInWork", b => + { + b.HasOne("PARR.DAL.Models.Application", "Application") + .WithMany("ApplicationsInWorks") + .HasForeignKey("ApplicationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.Work", "Work") + .WithMany("ApplicationsInWorks") + .HasForeignKey("WorkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Application"); + + b.Navigation("Work"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeConfig", b => + { + b.HasOne("PARR.DAL.Models.EsppSchType", "EsppSchType") + .WithMany("EsppSchTypeConfigs") + .HasForeignKey("TypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.EsppSchTypeSchedule", "EsppSchTypeSchedule") + .WithMany("EsppSchTypeConfigs") + .HasForeignKey("TypeScheduleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EsppSchType"); + + b.Navigation("EsppSchTypeSchedule"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeValue", b => + { + b.HasOne("PARR.DAL.Models.EsppSchType", "EsppSchType") + .WithMany("EsppSchTypeValues") + .HasForeignKey("TypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EsppSchType"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchValue", b => + { + b.HasOne("PARR.DAL.Models.ApplicationsInWork", "ApplicationsInWork") + .WithMany("EsppSchValues") + .HasForeignKey("ApplicationsInWorkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.EsppSchTypeConfig", "EsppSchTypeConfig") + .WithMany("EsppSchValues") + .HasForeignKey("TypeConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.EsppSchTypeValue", "EsppSchTypeValue") + .WithMany("EsppSchValues") + .HasForeignKey("TypeValueId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ApplicationsInWork"); + + b.Navigation("EsppSchTypeConfig"); + + b.Navigation("EsppSchTypeValue"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Host", b => + { + b.HasOne("PARR.DAL.Models.EkStatus", "EkStatus") + .WithMany("Hosts") + .HasForeignKey("EkStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.ResponseArea", "ResponseArea") + .WithMany("Hosts") + .HasForeignKey("ResponseAreaCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EkStatus"); + + b.Navigation("ResponseArea"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Order", b => + { + b.HasOne("PARR.DAL.Models.OrderStatus", "NextStatus") + .WithMany("OrdersNext") + .HasForeignKey("NextStatusCode"); + + b.HasOne("PARR.DAL.Models.OrderStatus", "OrderStatus") + .WithMany("Orders") + .HasForeignKey("StatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.Template", "Template") + .WithMany("Orders") + .HasForeignKey("TemplateId"); + + b.Navigation("NextStatus"); + + b.Navigation("OrderStatus"); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotConfiguration", b => + { + b.HasOne("PARR.DAL.Models.Robot", "Robot") + .WithMany("RobotConfigurations") + .HasForeignKey("RobotCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.RobotStatus", "RobotStatus") + .WithMany("RobotConfigurations") + .HasForeignKey("RobotStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.TaskStatus", "TaskStatus") + .WithMany("RobotConfigurations") + .HasForeignKey("TaskStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.Template", "Template") + .WithMany("RobotConfigurations") + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Robot"); + + b.Navigation("RobotStatus"); + + b.Navigation("TaskStatus"); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotHistory", b => + { + b.HasOne("PARR.DAL.Models.RobotHistoryLevel", "RobotHistoryLevel") + .WithMany("RobotHistories") + .HasForeignKey("HistoryLevel") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.RobotConfiguration", "RobotConfiguration") + .WithMany("RobotHistories") + .HasForeignKey("RobotConfigurationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.TaskStatus", "StatusTask") + .WithMany("RobotHistories") + .HasForeignKey("TaskStatusCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RobotConfiguration"); + + b.Navigation("RobotHistoryLevel"); + + b.Navigation("StatusTask"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Subprocess", b => + { + b.HasOne("PARR.DAL.Models.Process", "Process") + .WithMany("Subprocesses") + .HasForeignKey("ProcessId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Process"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Template", b => + { + b.HasOne("PARR.DAL.Models.ApplicationsInWork", "ApplicationsInWork") + .WithMany("Templates") + .HasForeignKey("ApplicationInWorkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("PARR.DAL.Models.Host", "Host") + .WithMany("Templates") + .HasForeignKey("HostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ApplicationsInWork"); + + b.Navigation("Host"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Tnk", b => + { + b.HasOne("PARR.DAL.Models.Subprocess", "Subprocess") + .WithMany("Tnks") + .HasForeignKey("SubprocessId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Subprocess"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Work", b => + { + b.HasOne("PARR.DAL.Models.Tnk", "Tnk") + .WithMany("Works") + .HasForeignKey("TnkId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tnk"); + }); + + modelBuilder.Entity("PARR.DAL.Models.AgentHistoryLevel", b => + { + b.Navigation("AgentHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Application", b => + { + b.Navigation("ApplicationsInHosts"); + + b.Navigation("ApplicationsInWorks"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b => + { + b.Navigation("Applications"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ApplicationsInWork", b => + { + b.Navigation("EsppSchValues"); + + b.Navigation("Templates"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EkStatus", b => + { + b.Navigation("Hosts"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchType", b => + { + b.Navigation("EsppSchTypeConfigs"); + + b.Navigation("EsppSchTypeValues"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeConfig", b => + { + b.Navigation("EsppSchValues"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeSchedule", b => + { + b.Navigation("EsppSchTypeConfigs"); + }); + + modelBuilder.Entity("PARR.DAL.Models.EsppSchTypeValue", b => + { + b.Navigation("EsppSchValues"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Host", b => + { + b.Navigation("ApplicationsInHosts"); + + b.Navigation("Templates"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Order", b => + { + b.Navigation("AgentHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.OrderStatus", b => + { + b.Navigation("Orders"); + + b.Navigation("OrdersNext"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Process", b => + { + b.Navigation("Subprocesses"); + }); + + modelBuilder.Entity("PARR.DAL.Models.ResponseArea", b => + { + b.Navigation("Hosts"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Robot", b => + { + b.Navigation("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotConfiguration", b => + { + b.Navigation("RobotHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotHistoryLevel", b => + { + b.Navigation("RobotHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.RobotStatus", b => + { + b.Navigation("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Subprocess", b => + { + b.Navigation("Tnks"); + }); + + modelBuilder.Entity("PARR.DAL.Models.TaskStatus", b => + { + b.Navigation("RobotConfigurations"); + + b.Navigation("RobotHistories"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Template", b => + { + b.Navigation("AgentHistories"); + + b.Navigation("Orders"); + + b.Navigation("RobotConfigurations"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Tnk", b => + { + b.Navigation("Works"); + }); + + modelBuilder.Entity("PARR.DAL.Models.Work", b => + { + b.Navigation("ApplicationsInWorks"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/PARR.DAL/Migrations/20231127003844_TblEsppSchTypeValueAddEsppExportValue.cs b/PARR.DAL/Migrations/20231127003844_TblEsppSchTypeValueAddEsppExportValue.cs new file mode 100644 index 00000000..424fb1b0 --- /dev/null +++ b/PARR.DAL/Migrations/20231127003844_TblEsppSchTypeValueAddEsppExportValue.cs @@ -0,0 +1,618 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace PARR.DAL.Migrations +{ + /// + public partial class TblEsppSchTypeValueAddEsppExportValue : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "EsppExportValue", + table: "EsppSchTypeValues", + type: "text", + nullable: false, + defaultValue: ""); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("032fbd02-67d0-4b8c-bed0-42629ab7113b"), + column: "EsppExportValue", + value: "2"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("035f485d-8451-47df-bfaa-ba4dd36cf146"), + column: "EsppExportValue", + value: "04:00:00"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("03858472-d4ce-47fd-9497-8051728766e4"), + column: "EsppExportValue", + value: "28"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("06a8bd2f-68e1-42f5-961c-ac3b98a2181e"), + column: "EsppExportValue", + value: "4"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("06ab835d-3d3e-4057-8422-a553b6b40995"), + column: "EsppExportValue", + value: "4"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("086f7a37-9848-423a-a3cc-36dbb5ad43e3"), + column: "EsppExportValue", + value: "182 00:00:00"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("0883aac2-9d5b-4098-b672-c684d2a3a0c9"), + column: "EsppExportValue", + value: "9"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("0936aa99-73e0-43de-b6df-334c1228a226"), + column: "EsppExportValue", + value: "31"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("0b1f3cea-301a-4d74-9ce1-2cd93b41897d"), + column: "EsppExportValue", + value: "8"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("0da03db0-9404-425d-bea1-5da0c9b60b59"), + column: "EsppExportValue", + value: "3"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("12bb8db2-cf7f-4113-baff-6883770f1ba5"), + column: "EsppExportValue", + value: "5"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("18260e91-3fbe-4401-9edc-78dbc419370e"), + column: "EsppExportValue", + value: "1"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("199474c8-0a77-47e5-aab8-ba33c216cc9e"), + column: "EsppExportValue", + value: "4"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("220a1464-4d39-416c-b4b2-3093eb007298"), + column: "EsppExportValue", + value: "20"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("2905765d-63fb-41fe-a111-ee2f1d03d62e"), + column: "EsppExportValue", + value: "22"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("2c635ce2-fc18-47be-b3e9-98c211abf312"), + column: "EsppExportValue", + value: "17"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("2ed85534-4684-4eb2-9ccb-e264d212c945"), + column: "EsppExportValue", + value: "5"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("2f473624-4eb3-49b4-a4b9-cc7fc08a50f5"), + column: "EsppExportValue", + value: "1"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("2f476f70-b1ef-419d-aad5-3911f1e3231f"), + column: "EsppExportValue", + value: "16"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("361526aa-3e1c-452e-bb44-0ade8521830d"), + column: "EsppExportValue", + value: "2"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("40d70d73-8582-4be6-a9e6-503b96ae3d49"), + column: "EsppExportValue", + value: "26"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("454788d6-d0ad-4c07-878c-da3fd3cd05e1"), + column: "EsppExportValue", + value: "25"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("4df04834-f14f-43d9-8984-334f080f4107"), + column: "EsppExportValue", + value: "02:00:00"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("4e3f73d1-a0f3-4dd1-bca9-68ada0dd5ce2"), + column: "EsppExportValue", + value: "14 00:00:00"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("4f4b249c-db60-4582-86ed-75cfee4edd0c"), + column: "EsppExportValue", + value: "19"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("554d7d0c-91b1-4b81-b94d-1ee864192962"), + column: "EsppExportValue", + value: "8"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("55833417-6a24-42f6-bcc2-5d032f883202"), + column: "EsppExportValue", + value: "60 00:00:00"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("5b4d7ca6-31e7-475b-b7c8-13c6680c3dc3"), + column: "EsppExportValue", + value: "2"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("5e6592bc-acb2-45a4-979b-fdecf8457453"), + column: "EsppExportValue", + value: "10"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("626ca076-f09e-4a7a-8610-b7de6337b24a"), + column: "EsppExportValue", + value: "1"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("6e3b5dd2-b2f7-40bc-bace-15bfa6bbd4ff"), + column: "EsppExportValue", + value: "01:00:00"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("6e9972c4-6bf7-4fe4-b4ea-bbb333fb69c8"), + column: "EsppExportValue", + value: "8"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("7a004a11-32e1-40ae-ab35-0d3dc3a69785"), + column: "EsppExportValue", + value: "12"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("7ec056aa-820c-4900-96cb-4564d2ea6398"), + column: "EsppExportValue", + value: "7"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("7fefa052-29db-4ce5-9c57-2fd9ff855f21"), + column: "EsppExportValue", + value: "80 00:00:00"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("83f56b5d-b16b-4aa5-89d7-a253fee4e4ad"), + column: "EsppExportValue", + value: "5"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("852a5ebd-4545-494b-bc69-c27409a41adc"), + column: "EsppExportValue", + value: "12"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("8b7847a4-23de-4199-8aad-3b5c0323b5a2"), + column: "EsppExportValue", + value: "9"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("8dbd680c-ce49-4d2e-8a1a-05619685e240"), + column: "EsppExportValue", + value: "15"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("8df097aa-9860-4a62-9675-a8eecd3f2ce7"), + column: "EsppExportValue", + value: "1 00:00:00"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("8f6610dc-ef46-4842-a57e-18d7aaa75931"), + column: "EsppExportValue", + value: "27"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("963b9c41-d607-444a-9fe0-fe429590e326"), + column: "EsppExportValue", + value: "5"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("9c5aaf48-88ec-4c67-b936-2be45550f8bf"), + column: "EsppExportValue", + value: "14"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("a1669207-aa31-40fe-98d0-d941008d1655"), + column: "EsppExportValue", + value: "30"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("a28b530f-ea38-4a2c-a16b-0b7fa3770d3c"), + column: "EsppExportValue", + value: "11"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("a6804315-96ef-484e-82ee-c5795694468b"), + column: "EsppExportValue", + value: "6"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("a74b9ebd-bcd8-4537-b371-194de2fe0a4d"), + column: "EsppExportValue", + value: "11"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("a8708763-c838-49a5-95fe-bf4f73518d71"), + column: "EsppExportValue", + value: "6"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("ae0a0015-0f1e-4496-b71e-6244f7e321e7"), + column: "EsppExportValue", + value: "12:00:00"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("b0ca99f9-5ee0-45b3-bb80-948f82b1fcb1"), + column: "EsppExportValue", + value: "90 00:00:00"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("b1018e07-e90e-42ee-b399-19f3d0c14dd6"), + column: "EsppExportValue", + value: "29"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("b7303461-9a30-43fa-8e55-305aa13f186f"), + column: "EsppExportValue", + value: "1"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("c1de4aca-9f49-48ae-9279-cf9ec4092112"), + column: "EsppExportValue", + value: "10"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("c34d5375-70e7-4632-b3af-30e279a0621a"), + column: "EsppExportValue", + value: "3"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("c887ca60-b05d-4d3c-ad1f-223c879b1a6d"), + column: "EsppExportValue", + value: "21"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("cf7b9645-52ed-43a2-8267-267e0aed19b1"), + column: "EsppExportValue", + value: "24"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("d2f90168-2b49-42f2-820b-79db2c522adf"), + column: "EsppExportValue", + value: "4"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("d439808a-6a10-409b-8809-a755b7cca60b"), + column: "EsppExportValue", + value: "7"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("d627daa7-3eed-4571-acae-ffbb3c5bedb9"), + column: "EsppExportValue", + value: "06:00:00"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("dab6e3f9-2385-4966-b77c-133ad233c592"), + column: "EsppExportValue", + value: "03:00:00"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("dbbe704a-8d6d-40e7-bd30-6974035b1fab"), + column: "EsppExportValue", + value: "23"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("dd695fb2-4ad0-4cda-a4df-e15059c56b24"), + column: "EsppExportValue", + value: "12"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("dee32e60-c1a1-4206-98bc-aa03deabfdf6"), + column: "EsppExportValue", + value: "3 00:00:00"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("e0465fbf-e3a5-4486-9f53-5bb85c6feeca"), + columns: new[] { "EsppExportValue", "Value" }, + values: new object[] { "4 00:00:00", "Каждые 96 часов" }); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("e0f2f4d1-4a5e-4997-8336-83c3c35f38df"), + column: "EsppExportValue", + value: "13"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("e15c7c63-e29f-41a3-9c82-f70eb6c24fde"), + column: "EsppExportValue", + value: "7"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("e2fa3769-f66f-4753-a161-35adad7717a5"), + column: "EsppExportValue", + value: "9"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("e6619da1-f7e8-45b9-bbd3-9c17bec2ccd3"), + column: "EsppExportValue", + value: "5"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("e679ec84-a9ee-4bed-a051-2b14edddcb18"), + column: "EsppExportValue", + value: "6"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("e86adbfb-3345-4e0c-aa3b-b4418f9cfe88"), + column: "EsppExportValue", + value: "1"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("e951135e-71f2-4262-9342-df4d5315ab6c"), + column: "EsppExportValue", + value: "2"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("eb71e699-937f-4894-9688-f7a7f95e5e58"), + column: "EsppExportValue", + value: "7"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("ec8554c8-dee4-49a1-b1b7-474ad8ec1473"), + column: "EsppExportValue", + value: "6"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("ec9540df-c2de-4bda-a063-34d02d4b6e03"), + column: "EsppExportValue", + value: "4"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("edd7cb49-d6a0-4969-b2d6-1967da69b336"), + column: "EsppExportValue", + value: "11"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("f0003490-a249-44bd-814f-4566999915d8"), + column: "EsppExportValue", + value: "2"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("f2da9e02-d619-4517-a598-374880a8c8e8"), + column: "EsppExportValue", + value: "540 00:00:00"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("f38d7d30-8923-4ea0-aa7c-5b251e19ab61"), + column: "EsppExportValue", + value: "1095 00:00:00"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("f4c3fe38-aeaa-42f7-a9ba-190ea2dfe339"), + column: "EsppExportValue", + value: "3"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("f9d5b03b-624a-4f9f-8da3-1490ea5d2914"), + column: "EsppExportValue", + value: "18"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("fa8a8f60-e41e-495e-ac86-35174d9976bf"), + column: "EsppExportValue", + value: "3"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("fad4bdb0-6c51-4810-a30b-6d031a0d4c46"), + column: "EsppExportValue", + value: "3"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("fb7f41ca-950b-4dc1-a0a6-bd9a221ab2ad"), + column: "EsppExportValue", + value: "10"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "EsppExportValue", + table: "EsppSchTypeValues"); + + migrationBuilder.UpdateData( + table: "EsppSchTypeValues", + keyColumn: "Id", + keyValue: new Guid("e0465fbf-e3a5-4486-9f53-5bb85c6feeca"), + column: "Value", + value: "Каждые 98 часов"); + } + } +} diff --git a/PARR.DAL/Migrations/DataContextModelSnapshot.cs b/PARR.DAL/Migrations/DataContextModelSnapshot.cs index 00059475..c66bdc14 100644 --- a/PARR.DAL/Migrations/DataContextModelSnapshot.cs +++ b/PARR.DAL/Migrations/DataContextModelSnapshot.cs @@ -897,6 +897,10 @@ namespace PARR.DAL.Migrations b.Property("DateCreated") .HasColumnType("timestamp with time zone"); + b.Property("EsppExportValue") + .IsRequired() + .HasColumnType("text"); + b.Property("TypeId") .HasColumnType("integer"); @@ -915,6 +919,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("6e3b5dd2-b2f7-40bc-bace-15bfa6bbd4ff"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "01:00:00", TypeId = 1, Value = "Каждый час" }, @@ -922,6 +927,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("4df04834-f14f-43d9-8984-334f080f4107"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "02:00:00", TypeId = 1, Value = "Каждые 2 часа" }, @@ -929,6 +935,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("dab6e3f9-2385-4966-b77c-133ad233c592"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "03:00:00", TypeId = 1, Value = "Каждые 3 часа" }, @@ -936,6 +943,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("035f485d-8451-47df-bfaa-ba4dd36cf146"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "04:00:00", TypeId = 1, Value = "Каждые 4 часа" }, @@ -943,6 +951,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("d627daa7-3eed-4571-acae-ffbb3c5bedb9"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "06:00:00", TypeId = 1, Value = "Каждые 6 часов" }, @@ -950,6 +959,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("ae0a0015-0f1e-4496-b71e-6244f7e321e7"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "12:00:00", TypeId = 1, Value = "Каждые 12 часов" }, @@ -957,6 +967,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("8df097aa-9860-4a62-9675-a8eecd3f2ce7"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1 00:00:00", TypeId = 1, Value = "Ежедневно" }, @@ -964,6 +975,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("dee32e60-c1a1-4206-98bc-aa03deabfdf6"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3 00:00:00", TypeId = 1, Value = "Каждые 72 часа" }, @@ -971,13 +983,15 @@ namespace PARR.DAL.Migrations { Id = new Guid("e0465fbf-e3a5-4486-9f53-5bb85c6feeca"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4 00:00:00", TypeId = 1, - Value = "Каждые 98 часов" + Value = "Каждые 96 часов" }, new { Id = new Guid("4e3f73d1-a0f3-4dd1-bca9-68ada0dd5ce2"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "14 00:00:00", TypeId = 1, Value = "Каждые 2 недели" }, @@ -985,6 +999,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("55833417-6a24-42f6-bcc2-5d032f883202"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "60 00:00:00", TypeId = 1, Value = "Каждые 60 дней" }, @@ -992,6 +1007,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("7fefa052-29db-4ce5-9c57-2fd9ff855f21"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "80 00:00:00", TypeId = 1, Value = "Каждые 80 дней" }, @@ -999,6 +1015,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("b0ca99f9-5ee0-45b3-bb80-948f82b1fcb1"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "90 00:00:00", TypeId = 1, Value = "Каждые 90 дней" }, @@ -1006,6 +1023,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("086f7a37-9848-423a-a3cc-36dbb5ad43e3"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "182 00:00:00", TypeId = 1, Value = "Каждые полгода" }, @@ -1013,6 +1031,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("f2da9e02-d619-4517-a598-374880a8c8e8"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "540 00:00:00", TypeId = 1, Value = "Каждые 1,5 года" }, @@ -1020,6 +1039,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("f38d7d30-8923-4ea0-aa7c-5b251e19ab61"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1095 00:00:00", TypeId = 1, Value = "Каждые 3 года" }, @@ -1027,6 +1047,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("b7303461-9a30-43fa-8e55-305aa13f186f"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", TypeId = 2, Value = "Понедельник" }, @@ -1034,6 +1055,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("e951135e-71f2-4262-9342-df4d5315ab6c"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", TypeId = 2, Value = "Вторник" }, @@ -1041,6 +1063,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("c34d5375-70e7-4632-b3af-30e279a0621a"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", TypeId = 2, Value = "Среда" }, @@ -1048,6 +1071,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("ec9540df-c2de-4bda-a063-34d02d4b6e03"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", TypeId = 2, Value = "Четверг" }, @@ -1055,6 +1079,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("2ed85534-4684-4eb2-9ccb-e264d212c945"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", TypeId = 2, Value = "Пятница" }, @@ -1062,6 +1087,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("a6804315-96ef-484e-82ee-c5795694468b"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "6", TypeId = 2, Value = "Суббота" }, @@ -1069,6 +1095,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("eb71e699-937f-4894-9688-f7a7f95e5e58"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "7", TypeId = 2, Value = "Воскресенье" }, @@ -1076,6 +1103,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("e86adbfb-3345-4e0c-aa3b-b4418f9cfe88"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", TypeId = 3, Value = "1" }, @@ -1083,6 +1111,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("5b4d7ca6-31e7-475b-b7c8-13c6680c3dc3"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", TypeId = 3, Value = "2" }, @@ -1090,6 +1119,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("0da03db0-9404-425d-bea1-5da0c9b60b59"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", TypeId = 3, Value = "3" }, @@ -1097,6 +1127,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("199474c8-0a77-47e5-aab8-ba33c216cc9e"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", TypeId = 3, Value = "4" }, @@ -1104,6 +1135,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("e6619da1-f7e8-45b9-bbd3-9c17bec2ccd3"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", TypeId = 3, Value = "5" }, @@ -1111,6 +1143,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("a8708763-c838-49a5-95fe-bf4f73518d71"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "6", TypeId = 3, Value = "6" }, @@ -1118,6 +1151,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("7ec056aa-820c-4900-96cb-4564d2ea6398"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "7", TypeId = 3, Value = "7" }, @@ -1125,6 +1159,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("554d7d0c-91b1-4b81-b94d-1ee864192962"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "8", TypeId = 3, Value = "8" }, @@ -1132,6 +1167,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("8b7847a4-23de-4199-8aad-3b5c0323b5a2"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "9", TypeId = 3, Value = "9" }, @@ -1139,6 +1175,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("fb7f41ca-950b-4dc1-a0a6-bd9a221ab2ad"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "10", TypeId = 3, Value = "10" }, @@ -1146,6 +1183,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("a28b530f-ea38-4a2c-a16b-0b7fa3770d3c"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "11", TypeId = 3, Value = "11" }, @@ -1153,6 +1191,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("7a004a11-32e1-40ae-ab35-0d3dc3a69785"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "12", TypeId = 3, Value = "12" }, @@ -1160,6 +1199,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("e0f2f4d1-4a5e-4997-8336-83c3c35f38df"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "13", TypeId = 3, Value = "13" }, @@ -1167,6 +1207,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("9c5aaf48-88ec-4c67-b936-2be45550f8bf"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "14", TypeId = 3, Value = "14" }, @@ -1174,6 +1215,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("8dbd680c-ce49-4d2e-8a1a-05619685e240"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "15", TypeId = 3, Value = "15" }, @@ -1181,6 +1223,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("2f476f70-b1ef-419d-aad5-3911f1e3231f"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "16", TypeId = 3, Value = "16" }, @@ -1188,6 +1231,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("2c635ce2-fc18-47be-b3e9-98c211abf312"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "17", TypeId = 3, Value = "17" }, @@ -1195,6 +1239,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("f9d5b03b-624a-4f9f-8da3-1490ea5d2914"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "18", TypeId = 3, Value = "18" }, @@ -1202,6 +1247,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("4f4b249c-db60-4582-86ed-75cfee4edd0c"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "19", TypeId = 3, Value = "19" }, @@ -1209,6 +1255,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("220a1464-4d39-416c-b4b2-3093eb007298"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "20", TypeId = 3, Value = "20" }, @@ -1216,6 +1263,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("c887ca60-b05d-4d3c-ad1f-223c879b1a6d"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "21", TypeId = 3, Value = "21" }, @@ -1223,6 +1271,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("2905765d-63fb-41fe-a111-ee2f1d03d62e"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "22", TypeId = 3, Value = "22" }, @@ -1230,6 +1279,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("dbbe704a-8d6d-40e7-bd30-6974035b1fab"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "23", TypeId = 3, Value = "23" }, @@ -1237,6 +1287,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("cf7b9645-52ed-43a2-8267-267e0aed19b1"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "24", TypeId = 3, Value = "24" }, @@ -1244,6 +1295,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("454788d6-d0ad-4c07-878c-da3fd3cd05e1"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "25", TypeId = 3, Value = "25" }, @@ -1251,6 +1303,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("40d70d73-8582-4be6-a9e6-503b96ae3d49"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "26", TypeId = 3, Value = "26" }, @@ -1258,6 +1311,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("8f6610dc-ef46-4842-a57e-18d7aaa75931"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "27", TypeId = 3, Value = "27" }, @@ -1265,6 +1319,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("03858472-d4ce-47fd-9497-8051728766e4"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "28", TypeId = 3, Value = "28" }, @@ -1272,6 +1327,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("b1018e07-e90e-42ee-b399-19f3d0c14dd6"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "29", TypeId = 3, Value = "29" }, @@ -1279,6 +1335,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("a1669207-aa31-40fe-98d0-d941008d1655"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "30", TypeId = 3, Value = "30" }, @@ -1286,6 +1343,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("0936aa99-73e0-43de-b6df-334c1228a226"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "31", TypeId = 3, Value = "31" }, @@ -1293,6 +1351,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("626ca076-f09e-4a7a-8610-b7de6337b24a"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", TypeId = 4, Value = "Первый" }, @@ -1300,6 +1359,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("032fbd02-67d0-4b8c-bed0-42629ab7113b"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", TypeId = 4, Value = "Второй" }, @@ -1307,6 +1367,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("fa8a8f60-e41e-495e-ac86-35174d9976bf"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", TypeId = 4, Value = "Третий" }, @@ -1314,6 +1375,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("d2f90168-2b49-42f2-820b-79db2c522adf"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", TypeId = 4, Value = "Четвертый" }, @@ -1321,6 +1383,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("12bb8db2-cf7f-4113-baff-6883770f1ba5"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", TypeId = 4, Value = "Последний" }, @@ -1328,6 +1391,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("18260e91-3fbe-4401-9edc-78dbc419370e"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", TypeId = 5, Value = "Январь" }, @@ -1335,6 +1399,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("361526aa-3e1c-452e-bb44-0ade8521830d"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", TypeId = 5, Value = "Февраль" }, @@ -1342,6 +1407,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("fad4bdb0-6c51-4810-a30b-6d031a0d4c46"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", TypeId = 5, Value = "Март" }, @@ -1349,6 +1415,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("06ab835d-3d3e-4057-8422-a553b6b40995"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", TypeId = 5, Value = "Апрель" }, @@ -1356,6 +1423,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("83f56b5d-b16b-4aa5-89d7-a253fee4e4ad"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", TypeId = 5, Value = "Май" }, @@ -1363,6 +1431,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("e679ec84-a9ee-4bed-a051-2b14edddcb18"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "6", TypeId = 5, Value = "Июнь" }, @@ -1370,6 +1439,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("d439808a-6a10-409b-8809-a755b7cca60b"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "7", TypeId = 5, Value = "Июль" }, @@ -1377,6 +1447,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("6e9972c4-6bf7-4fe4-b4ea-bbb333fb69c8"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "8", TypeId = 5, Value = "Август" }, @@ -1384,6 +1455,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("0883aac2-9d5b-4098-b672-c684d2a3a0c9"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "9", TypeId = 5, Value = "Сентябрь" }, @@ -1391,6 +1463,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("5e6592bc-acb2-45a4-979b-fdecf8457453"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "10", TypeId = 5, Value = "Октябрь" }, @@ -1398,6 +1471,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("edd7cb49-d6a0-4969-b2d6-1967da69b336"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "11", TypeId = 5, Value = "Ноябрь" }, @@ -1405,6 +1479,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("dd695fb2-4ad0-4cda-a4df-e15059c56b24"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "12", TypeId = 5, Value = "Декабрь" }, @@ -1412,6 +1487,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("2f473624-4eb3-49b4-a4b9-cc7fc08a50f5"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "1", TypeId = 6, Value = "Января" }, @@ -1419,6 +1495,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("f0003490-a249-44bd-814f-4566999915d8"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "2", TypeId = 6, Value = "Февраля" }, @@ -1426,6 +1503,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("f4c3fe38-aeaa-42f7-a9ba-190ea2dfe339"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "3", TypeId = 6, Value = "Марта" }, @@ -1433,6 +1511,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("06a8bd2f-68e1-42f5-961c-ac3b98a2181e"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "4", TypeId = 6, Value = "Апреля" }, @@ -1440,6 +1519,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("963b9c41-d607-444a-9fe0-fe429590e326"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "5", TypeId = 6, Value = "Мая" }, @@ -1447,6 +1527,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("ec8554c8-dee4-49a1-b1b7-474ad8ec1473"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "6", TypeId = 6, Value = "Июня" }, @@ -1454,6 +1535,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("e15c7c63-e29f-41a3-9c82-f70eb6c24fde"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "7", TypeId = 6, Value = "Июля" }, @@ -1461,6 +1543,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("0b1f3cea-301a-4d74-9ce1-2cd93b41897d"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "8", TypeId = 6, Value = "Августа" }, @@ -1468,6 +1551,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("e2fa3769-f66f-4753-a161-35adad7717a5"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "9", TypeId = 6, Value = "Сентября" }, @@ -1475,6 +1559,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("c1de4aca-9f49-48ae-9279-cf9ec4092112"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "10", TypeId = 6, Value = "Октября" }, @@ -1482,6 +1567,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("a74b9ebd-bcd8-4537-b371-194de2fe0a4d"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "11", TypeId = 6, Value = "Ноября" }, @@ -1489,6 +1575,7 @@ namespace PARR.DAL.Migrations { Id = new Guid("852a5ebd-4545-494b-bc69-c27409a41adc"), DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + EsppExportValue = "12", TypeId = 6, Value = "Декабря" }); diff --git a/PARR.DAL/Models/EsppSchTypeValue.cs b/PARR.DAL/Models/EsppSchTypeValue.cs index 9e2c1c15..c30df448 100644 --- a/PARR.DAL/Models/EsppSchTypeValue.cs +++ b/PARR.DAL/Models/EsppSchTypeValue.cs @@ -18,10 +18,19 @@ namespace PARR.DAL.Models [NotMapped] public DateTimeOffset? DateModified { get; set; } + /// + /// Значение в ЕСПП, при создании/изменении расписания + /// public required string Value { get; set; } public int TypeId { get; set; } + /// + /// Значение ЕСПП при отображении представления, используется при экспорте + /// + public required string EsppExportValue { get; set; } + + [ForeignKey(nameof(TypeId))] public EsppSchType? EsppSchType { get; set; } diff --git a/PARR.DAL/Services/Implementations/EsppSchTypeConfigService.cs b/PARR.DAL/Services/Implementations/EsppSchTypeConfigService.cs index 90dc34c4..1d0fe691 100644 --- a/PARR.DAL/Services/Implementations/EsppSchTypeConfigService.cs +++ b/PARR.DAL/Services/Implementations/EsppSchTypeConfigService.cs @@ -35,12 +35,6 @@ namespace PARR.DAL.Services.Implementations { //Формирует расписание в нормальном понятном виде из БД - if (applicationInWorksId == new Guid("4c65475c-e11d-4147-b219-50d632fa321b")) - { - - } - - var schValues = await dataContext.EsppSchValues .Include(t => t.EsppSchTypeConfig) .ThenInclude(t => t!.EsppSchTypeSchedule) diff --git a/PARR.EsppScheduleSync/ScheduleSyncher.cs b/PARR.EsppScheduleSync/ScheduleSyncher.cs index 323e2970..8ed44bf5 100644 --- a/PARR.EsppScheduleSync/ScheduleSyncher.cs +++ b/PARR.EsppScheduleSync/ScheduleSyncher.cs @@ -1,7 +1,10 @@ -using Microsoft.Extensions.Logging; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using PARR.BLL.Helpers; using PARR.BLL.Services.Interfaces; using PARR.DAL.Contracts; using PARR.DAL.Models; +using PARR.DAL.Services.Interfaces; using PARR.EsppScheduleSync.Domain; using PARR.EsppScheduleSync.Settings; using PARR.EsppSync; @@ -15,13 +18,15 @@ namespace PARR.EsppScheduleSync private readonly IMqService mqService; private readonly ISyncService syncService; private readonly SettingsFromDb settingsFromDb; + private readonly IServiceProvider serviceProvider; public ScheduleSyncher( ILogger logger, GlobalSettings globalSettings, IMqService mqService, ISyncService syncService, - SettingsFromDb settingsFromDb + SettingsFromDb settingsFromDb, + IServiceProvider serviceProvider ) { this.logger = logger; @@ -29,7 +34,7 @@ namespace PARR.EsppScheduleSync this.mqService = mqService; this.syncService = syncService; this.settingsFromDb = settingsFromDb; - + this.serviceProvider = serviceProvider; if (globalSettings.MqSettings == null) { logger.LogError("Нет секции настроек хранилища. MqSettings, EsppTemplates"); @@ -71,8 +76,83 @@ namespace PARR.EsppScheduleSync /// private EsppObjectSchedule ConvertDbObjToEsppObj(Template template) { - //todo: - throw new NotImplementedException(); + var esppObjectFromDb = new EsppObjectSchedule + { + TemplateName = template.Name, + Code = template.ScheduleEsppId ?? "", + ScheduleName = template.Name, + IsActive = template.IsActiveSchedule, + ResponseArea = template.Host!.ResponseArea!.Name, + WorkGroup = template.Host!.WorkGroup!, + //Мы решили, что для всех расписаний "Нет исключений", если что-то поменяется, тут нужно переделать + TypeV60calendar = settingsFromDb.ScheduleExclude == "Нет исключений" ? "NONE" : "", + Scheduled = EsppScheduleHelpers.GetNextRun(template.ApplicationsInWork!.NextRun), + Timezone = settingsFromDb.ScheduleTimezone, + //Мы решили, что для всех расписаний "Отсутствует дата завершения", если что-то поменяется, тут нужно переделать + TerminationType = settingsFromDb.ScheduleRepeatRange == "Отсутствует дата завершения" ? "forever" : "", + CompleteAfter = "", + V60calendar = "" + }; + + FillScheduleFromDb(template, ref esppObjectFromDb); + + return ClearOptionalFields(esppObjectFromDb); + } + + + /// + /// Заполнить расписание из БД + /// + /// + private void FillScheduleFromDb(Template template, ref EsppObjectSchedule esppObject) + { + using (var scope = serviceProvider.CreateScope()) + { + var esppSchTypeConfigService = scope.ServiceProvider.GetService(); + if (esppSchTypeConfigService == null) + throw new Exception($"Не найден сервис: {nameof(IEsppSchTypeConfigService)}"); + + var esppSchedule = esppSchTypeConfigService.GetEsppScheduleDto(template.ApplicationInWorkId); + if (esppSchedule == null) + { + logger.LogError($"Не смог получить расписание из БД для шаблона templateId: {template.Id}, {template.Name}"); + return; + } + + var typeSchedule = GetTypeScheduleByString(esppSchedule.TypeSchedule.Name); + if (!typeSchedule.HasValue) + return; + + //тип повторения + esppObject.TypeSchedule = typeSchedule.Value; + + //в зависимости от типа, присваиваем значения + switch (esppObject.TypeSchedule) + { + case EsppSchTypeScheduleEnum.Regularly: + esppObject.Interval = esppSchedule.Values.First(t => t.Order == 0).Value.EsppExportValue; + break; + case EsppSchTypeScheduleEnum.Weekly: + esppObject.Dayofweek = esppSchedule.Values.First(t => t.Order == 0).Value.EsppExportValue; + break; + case EsppSchTypeScheduleEnum.Monthly: + esppObject.Dayofmonth = esppSchedule.Values.First(t => t.Order == 0).Value.EsppExportValue; + break; + case EsppSchTypeScheduleEnum.Monthly2: + esppObject.Md1 = esppSchedule.Values.First(t => t.Order == 0).Value.EsppExportValue; + esppObject.Md2 = esppSchedule.Values.First(t => t.Order == 1).Value.EsppExportValue; + break; + case EsppSchTypeScheduleEnum.Annually: + esppObject.Annualm = esppSchedule.Values.First(t => t.Order == 0).Value.EsppExportValue; + esppObject.Annualday = esppSchedule.Values.First(t => t.Order == 1).Value.EsppExportValue; + break; + case EsppSchTypeScheduleEnum.Annually2: + esppObject.An1 = esppSchedule.Values.First(t => t.Order == 0).Value.EsppExportValue; + esppObject.An2 = esppSchedule.Values.First(t => t.Order == 1).Value.EsppExportValue; + esppObject.An3 = esppSchedule.Values.First(t => t.Order == 2).Value.EsppExportValue; + break; + } + } } @@ -198,6 +278,7 @@ namespace PARR.EsppScheduleSync esppObject.ResponseArea = string.Empty; esppObject.WorkGroup = string.Empty; esppObject.CompleteAfter = string.Empty; + esppObject.V60calendar = string.Empty; // В ЕСПП, при изменении "Повторять задачу", остаются предыдущие значения, их не нужно синхронизировать (касается только данных полученных из ЕСПП, в БД все ок) // т.е. если стояло Ежедненвно:понедельник, а изменили например на Еженедельно..., то в ежедневно значения останутся, но будут отрабатывать значения из Еженедельно.