feat(all): ! Критические изменения логики работы всех сервисорв, База Данных имееет неокончательную версию. Template, Scheduler переведены на работу с Unit+Job+JobGroup вместо Host+ApplicationsInWork

This commit is contained in:
Mikhail Kuznetsov
2025-06-25 14:17:34 +10:00
parent 1b867585d8
commit 03c7852378
54 changed files with 5176 additions and 989 deletions

View File

@@ -71,11 +71,11 @@ namespace PARR.API.Controllers.V1
case RobotsEnum.TemplateOrder:
// шаблоны
query = query.Include(t => t.Template)
.ThenInclude(t => t!.Host).ThenInclude(t => t!.ResponseArea)
.ThenInclude(t => t!.Hosts).ThenInclude(t => t.WorkGroup).ThenInclude(t => t!.ResponseArea)
.ThenInclude(t => t!.Unit)
//.ThenInclude(t => t!.Hosts).ThenInclude(t => t.WorkGroup).ThenInclude(t => t!.ResponseArea)
.Include(t => t.Template)
.ThenInclude(a => a!.ApplicationsInWork)
.ThenInclude(w => w!.Work)
.ThenInclude(a => a!.Job)
//.ThenInclude(w => w!.Work)
.ThenInclude(t => t!.Tnk)
.ThenInclude(s => s!.Subprocess)
.ThenInclude(p => p!.Process);
@@ -84,10 +84,12 @@ namespace PARR.API.Controllers.V1
//расписание
// тут не делаем AsSplitQuery, не может подтянуть все таблицы
query = query.Include(t => t.Template)
.ThenInclude(t => t!.Host).ThenInclude(t => t!.ResponseArea)
.ThenInclude(t => t!.Hosts).ThenInclude(t => t.WorkGroup)
.ThenInclude(t => t!.Unit)//.ThenInclude(t => t!.ResponseArea)
//.ThenInclude(t => t!.Hosts).ThenInclude(t => t.WorkGroup)
.Include(t => t.Template)
.ThenInclude(t => t!.ApplicationsInWork)
.ThenInclude(t => t!.Job)
.ThenInclude(t => t!.Group)
//.ThenInclude(t => t!.ApplicationsInWork)
.ThenInclude(t => t!.EsppSchValues)
.ThenInclude(t => t!.EsppSchTypeConfig)
.ThenInclude(t => t!.EsppSchTypeSchedule);
@@ -169,7 +171,7 @@ namespace PARR.API.Controllers.V1
// передаем LastRun, если его нет, то NextRun
//var nextRun = await esppScheduleTransformService.GetNextDateAsync(task.Template!.ApplicationInWorkId, task.Template.ApplicationsInWork!.LastRun ?? task.Template.ApplicationsInWork.NextRun);
// всегда считаем по nextRun
var nextRun = await esppScheduleTransformService.GetNextDateAsync(template.ApplicationInWorkId, template.NextRun);
var nextRun = await esppScheduleTransformService.GetNextDateAsync(template.Job!.GroupId, template.NextRun);
if (nextRun != template.NextRun)
{