feat(all): ! Критические изменения логики работы всех сервисорв, База Данных имееет неокончательную версию. Template, Scheduler переведены на работу с Unit+Job+JobGroup вместо Host+ApplicationsInWork
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user