From bff3b15936f67ccfd6e110f0cf9ed4ae3f638dbe Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Fri, 20 Oct 2023 16:33:50 +1000 Subject: [PATCH] =?UTF-8?q?fix(api):=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D0=BB=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=80=D0=B0?= =?UTF-8?q?=D1=81=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=B5=D1=81?= =?UTF-8?q?=D0=BF=D0=BF=20GetEsppScheduleDtoAsync?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EsppSchTypeConfigService.cs | 50 +++++++++++++++---- docker-compose.dcproj | 1 + 2 files changed, 42 insertions(+), 9 deletions(-) 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 @@ +