fix(api): Исправил метод получение расписания еспп GetEsppScheduleDtoAsync
This commit is contained in:
@@ -35,23 +35,55 @@ namespace PARR.DAL.Services.Implementations
|
|||||||
{
|
{
|
||||||
//Формирует расписание в нормальном понятном виде из БД
|
//Формирует расписание в нормальном понятном виде из БД
|
||||||
|
|
||||||
var configs = await GetWithSchIncludes()
|
if (applicationInWorksId == new Guid("4c65475c-e11d-4147-b219-50d632fa321b"))
|
||||||
.Where(t => t.EsppSchValues.Any(x => x.ApplicationsInWorkId == applicationInWorksId))
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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();
|
.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;
|
return null;
|
||||||
|
|
||||||
|
|
||||||
var values = new List<EsppScheduleValDto>();
|
var values = new List<EsppScheduleValDto>();
|
||||||
|
|
||||||
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
|
var value = new EsppScheduleValDto
|
||||||
{
|
{
|
||||||
Order = config.Order,
|
Order = schValue.EsppSchTypeConfig!.Order,
|
||||||
Type = config.EsppSchType!,
|
Type = schValue.EsppSchTypeConfig!.EsppSchType!,
|
||||||
Value = config.EsppSchValues.First().EsppSchTypeValue!
|
Value = schValue.EsppSchTypeValue!
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
values.Add(value);
|
values.Add(value);
|
||||||
@@ -60,7 +92,7 @@ namespace PARR.DAL.Services.Implementations
|
|||||||
|
|
||||||
var dto = new EsppScheduleDto
|
var dto = new EsppScheduleDto
|
||||||
{
|
{
|
||||||
TypeSchedule = configs.First().EsppSchTypeSchedule!,
|
TypeSchedule = schValues.First().EsppSchTypeConfig!.EsppSchTypeSchedule!,
|
||||||
Values = values.OrderBy(t => t.Order).ToList()
|
Values = values.OrderBy(t => t.Order).ToList()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="docker-compose.aihit-syncher.yml" />
|
<None Include="docker-compose.aihit-syncher.yml" />
|
||||||
|
<None Include="docker-compose.espp-order-loader.yml" />
|
||||||
<None Include="docker-compose.espp-template-sync.yml" />
|
<None Include="docker-compose.espp-template-sync.yml" />
|
||||||
<None Include="docker-compose.generator-templates.yml" />
|
<None Include="docker-compose.generator-templates.yml" />
|
||||||
<None Include="docker-compose.yml" />
|
<None Include="docker-compose.yml" />
|
||||||
|
|||||||
Reference in New Issue
Block a user