feat(api, dal, esppOrderLoader, esppScheduleSync, generatorTemplates, nextRun):

This commit is contained in:
Mikhail Trubnikov
2024-07-03 15:19:09 +10:00
parent f8bd15cd6f
commit a4f6089438
10 changed files with 80 additions and 50 deletions

View File

@@ -71,7 +71,8 @@ namespace PARR.API.Controllers.V1
&& t.ApplicationsInWork!.IsAgent == true
&& t.IsActiveTemplate == true
&& t.IsActiveSchedule == true
&& t.ApplicationsInWork!.NextRun.DateTime.Date == date.Date.Date
//&& t.ApplicationsInWork!.NextRun.DateTime.Date == date.Date.Date
&& t.NextRun.DateTime.Date == date.Date.Date
&& t.RobotConfigurations.All(c => c.TaskStatusCode == (int)TaskStatusEnum.Ok)
&& t.ApplicationsInWork.EsppSchValues.Any()
).ToListAsync();
@@ -87,12 +88,12 @@ namespace PARR.API.Controllers.V1
foreach (var template in templates)
{
//var templateSchedule = await esppScheduleTransformService.GetNextScheduleAsync(template.ApplicationInWorkId, template.ApplicationsInWork!.LastRun ?? template.ApplicationsInWork!.NextRun);
var templateSchedule = await esppScheduleTransformService.GetNextScheduleAsync(template.ApplicationInWorkId, template.ApplicationsInWork!.NextRun);
var templateSchedule = await esppScheduleTransformService.GetNextScheduleAsync(template.ApplicationInWorkId, template.NextRun);
if (!templateSchedule.Any())
{
logger.LogWarning($"Запросили раписание для агента по NextRun и вернулся пустой список! Такого не должно быть! " +
$"ApplicationInWorkId: {template.ApplicationInWorkId}, latRun: {template.ApplicationsInWork!.LastRun}, NextRun: {template.ApplicationsInWork!.NextRun}, ip: {ip}, date: {date}");
$"ApplicationInWorkId: {template.ApplicationInWorkId}, latRun: {template.LastRun}, NextRun: {template.NextRun}, ip: {ip}, date: {date}");
continue;
}