diff --git a/PARR.DAL/Services/Implementations/EsppSchTypeConfigService.cs b/PARR.DAL/Services/Implementations/EsppSchTypeConfigService.cs index 4e418797..90dc34c4 100644 --- a/PARR.DAL/Services/Implementations/EsppSchTypeConfigService.cs +++ b/PARR.DAL/Services/Implementations/EsppSchTypeConfigService.cs @@ -35,23 +35,55 @@ namespace PARR.DAL.Services.Implementations { //Формирует расписание в нормальном понятном виде из БД - var configs = await GetWithSchIncludes() - .Where(t => t.EsppSchValues.Any(x => x.ApplicationsInWorkId == applicationInWorksId)) + if (applicationInWorksId == new Guid("4c65475c-e11d-4147-b219-50d632fa321b")) + { + + } + + + var schValues = await dataContext.EsppSchValues + .Include(t => t.EsppSchTypeConfig) + .ThenInclude(t => t!.EsppSchTypeSchedule) + .Include(t => t.EsppSchTypeConfig) + .ThenInclude(t=>t.EsppSchType) + .Include(t => t.EsppSchTypeValue) + .Where(t => t.ApplicationsInWorkId == applicationInWorksId) + .OrderBy(t => t.EsppSchTypeConfig!.Order) .ToListAsync(); - if (!configs.Any()) + + //var configs = await GetWithSchIncludes() + // .Where(t => t.EsppSchValues.Any(x => x.ApplicationsInWorkId == applicationInWorksId)) + // .ToListAsync(); + + //if (!configs.Any()) + // return null; + + if (!schValues.Any()) return null; + var values = new List(); - foreach (var config in configs) + //foreach (var config in configs) + //{ + // var value = new EsppScheduleValDto + // { + // Order = config.Order, + // Type = config.EsppSchType!, + // Value = config.EsppSchValues.First().EsppSchTypeValue! + // }; + + // values.Add(value); + //} + + foreach (var schValue in schValues) { var value = new EsppScheduleValDto { - Order = config.Order, - Type = config.EsppSchType!, - Value = config.EsppSchValues.First().EsppSchTypeValue! - + Order = schValue.EsppSchTypeConfig!.Order, + Type = schValue.EsppSchTypeConfig!.EsppSchType!, + Value = schValue.EsppSchTypeValue! }; values.Add(value); @@ -60,7 +92,7 @@ namespace PARR.DAL.Services.Implementations var dto = new EsppScheduleDto { - TypeSchedule = configs.First().EsppSchTypeSchedule!, + TypeSchedule = schValues.First().EsppSchTypeConfig!.EsppSchTypeSchedule!, Values = values.OrderBy(t => t.Order).ToList() }; diff --git a/docker-compose.dcproj b/docker-compose.dcproj index 560c9d71..fae8e6af 100644 --- a/docker-compose.dcproj +++ b/docker-compose.dcproj @@ -10,6 +10,7 @@ +