diff --git a/PARR.EsppSync/Domain/EsppObjectSchedule.cs b/PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs similarity index 89% rename from PARR.EsppSync/Domain/EsppObjectSchedule.cs rename to PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs index f047cec6..a2f45892 100644 --- a/PARR.EsppSync/Domain/EsppObjectSchedule.cs +++ b/PARR.EsppScheduleSync/Domain/EsppObjectSchedule.cs @@ -1,9 +1,11 @@ using PARR.Constants; using PARR.DAL.Contracts; +using PARR.EsppSync; +using PARR.EsppSync.Attributes; -namespace PARR.EsppSync.Domain +namespace PARR.EsppScheduleSync.Domain { - public class EsppObjectSchedule : IEsppObject + internal class EsppObjectSchedule : IEsppObject { //Все поля описаны в документации по роботам: http://gitlab.dvgd.oao.rzd/devptk/parr/parr_api/-/wikis/EsppRobots @@ -13,15 +15,20 @@ namespace PARR.EsppSync.Domain /// /// ИД расписания + /// Не сраваниваем ЕСПП ИД, потому что У НАС РЕАЛЬНЫЙ ЕСПП ИД И ЕСПП ИД В БД МОГУ РАСХОДИТЬСЯ!!! УЖАССС!!! /// + [SkipComparison] public string Code { get; set; } = string.Empty; + [SkipComparison] public string ScheduleName { get; set; } = string.Empty; public bool IsActive { get; set; } + [SkipComparison] public string ResponseArea { get; set; } = string.Empty; + [SkipComparison] public string WorkGroup { get; set; } = string.Empty; /// @@ -103,6 +110,7 @@ namespace PARR.EsppSync.Domain /// /// Завершение после: 0 /// + [SkipComparison] public string CompleteAfter { get; set; } = string.Empty; /// diff --git a/PARR.EsppScheduleSync/EsppScheduleSyncInstaller.cs b/PARR.EsppScheduleSync/EsppScheduleSyncInstaller.cs index 4dfc8041..4a0e01a9 100644 --- a/PARR.EsppScheduleSync/EsppScheduleSyncInstaller.cs +++ b/PARR.EsppScheduleSync/EsppScheduleSyncInstaller.cs @@ -2,9 +2,9 @@ using Microsoft.Extensions.DependencyInjection; using PARR.BLL; using PARR.DAL; +using PARR.EsppScheduleSync.Domain; using PARR.EsppScheduleSync.Settings; using PARR.EsppSync; -using PARR.EsppSync.Domain; namespace PARR.EsppScheduleSync { diff --git a/PARR.EsppScheduleSync/ScheduleSyncher.cs b/PARR.EsppScheduleSync/ScheduleSyncher.cs index 6fc936b9..d3410738 100644 --- a/PARR.EsppScheduleSync/ScheduleSyncher.cs +++ b/PARR.EsppScheduleSync/ScheduleSyncher.cs @@ -10,9 +10,9 @@ using PARR.DAL.Models; using PARR.DAL.NextRunServices; using PARR.DAL.Services.Interfaces; using PARR.DAL.Services.Interfaces.Schedule; +using PARR.EsppScheduleSync.Domain; using PARR.EsppScheduleSync.Settings; using PARR.EsppSync; -using PARR.EsppSync.Domain; using PARR.EsppSync.Helpers; namespace PARR.EsppScheduleSync @@ -125,10 +125,24 @@ namespace PARR.EsppScheduleSync using var scope = serviceProvider.CreateScope(); var templateService = scope.ServiceProvider.GetRequiredService(); - var candidates = await templateService.Get() - .Include(t => t.RobotConfigurations) - .Where(t => t.Name == esppTemplateName || t.ScheduleEsppId == esppScheduleId) - .ToListAsync(); + // это не очень, так как esppScheduleId может быть null или empty, а в БД таких значений может быть много + //var candidates = await templateService.Get() + // .Include(t => t.RobotConfigurations) + // .Where(t => t.Name == esppTemplateName || t.ScheduleEsppId == esppScheduleId) + // .ToListAsync(); + + IQueryable