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

@@ -86,9 +86,9 @@ namespace PARR.EsppScheduleSync
Code = template.ScheduleEsppId ?? "",
ScheduleName = template.Name,
IsActive = template.IsActiveSchedule,
ResponseArea = template.Host!.ResponseArea!.Name,
//ResponseArea = template.Host!.ResponseArea!.Name,//TODO Migration to job
//WorkGroup = template.Host!.WorkGroup!,
WorkGroup = template.Host!.WorkGroup!.Name,
//WorkGroup = template.Host!.WorkGroup!.Name,//TODO Migration to job
//Мы решили, что для всех расписаний "Нет исключений", если что-то поменяется, тут нужно переделать
TypeV60calendar = settingsFromDb.ScheduleExclude == "Нет исключений" ? "NONE" : "",
//Scheduled = EsppScheduleHelpers.GetNextRun(template.NextRun),
@@ -119,7 +119,7 @@ namespace PARR.EsppScheduleSync
if (esppSchTypeConfigService == null)
throw new Exception($"Не найден сервис: {nameof(IEsppSchTypeConfigService)}");
var esppSchedule = esppSchTypeConfigService.GetEsppScheduleDto(template.ApplicationInWorkId);
var esppSchedule = esppSchTypeConfigService.GetEsppScheduleDto(template.JobId);
if (esppSchedule == null)
{
logger.LogError($"Не смог получить расписание из БД для шаблона templateId: {template.Id}, {template.Name}");
@@ -144,16 +144,16 @@ namespace PARR.EsppScheduleSync
break;
case EsppSchTypeScheduleEnum.Monthly:
//если включено автораспределение, подставляем дату месяца из NextRun
if (template.ApplicationsInWork?.IsAutoDistributionEnabled == true)
{
var nextRunByRobotTimeZone = nextRunModifierService.GetNextRunByAccountRobotTimeZone(template.NextRun);
esppObject.Dayofmonth = nextRunByRobotTimeZone.Day.ToString();
// esppObject.Dayofmonth = template.NextRun.Day.ToString();
}
else
{
//if (template.ApplicationsInWork?.IsAutoDistributionEnabled == true)//TODO Migration to job
//{
// var nextRunByRobotTimeZone = nextRunModifierService.GetNextRunByAccountRobotTimeZone(template.NextRun);
// esppObject.Dayofmonth = nextRunByRobotTimeZone.Day.ToString();
// // esppObject.Dayofmonth = template.NextRun.Day.ToString();
//}
//else
//{
esppObject.Dayofmonth = esppSchedule.Values.First(t => t.Order == 0).Value.EsppExportValue;
}
//}
break;
case EsppSchTypeScheduleEnum.Monthly2:
esppObject.Md1 = esppSchedule.Values.First(t => t.Order == 0).Value.EsppExportValue;