feat(api, dal, nextRun): переделал вызов рассчета NextRun на INextRunService

This commit is contained in:
Mikhail Trubnikov
2026-01-22 11:46:05 +10:00
parent b34be5ccbe
commit 91082915bc
9 changed files with 280 additions and 277 deletions

View File

@@ -14,6 +14,7 @@ using PARR.DAL.Contracts;
using PARR.DAL.DomainServices.Shortcodes;
using PARR.DAL.DomainServices.Shortcodes.Models;
using PARR.DAL.Models;
using PARR.DAL.NextRunServices;
using PARR.DAL.Services.Interfaces;
using PARR.DAL.TransformServices;
@@ -25,31 +26,34 @@ namespace PARR.API.Controllers.V1
private readonly IMapper mapper;
private readonly SettingsFromDb settingsFromDb;
private readonly IRobotConfigurationService robotConfigurationService;
private readonly IEsppScheduleTransformService esppScheduleTransformService;
//private readonly IEsppScheduleTransformService esppScheduleTransformService;
private readonly ILogger<RobotTaskController> logger;
private readonly IClientService clientService;
private readonly IRobotHistoryService robotHistoryService;
private readonly IShortcodesService shortcodesService;
private readonly INextRunService nextRunService;
public RobotTaskController(
IMapper mapper,
SettingsFromDb settingsFromDb,
IRobotConfigurationService robotConfigurationService,
IEsppScheduleTransformService esppScheduleTransformService,
//IEsppScheduleTransformService esppScheduleTransformService,
ILogger<RobotTaskController> logger,
IClientService clientService,
IRobotHistoryService robotHistoryService,
IShortcodesService shortcodesService
IShortcodesService shortcodesService,
INextRunService nextRunService
)
{
this.mapper = mapper;
this.settingsFromDb = settingsFromDb;
this.robotConfigurationService = robotConfigurationService;
this.esppScheduleTransformService = esppScheduleTransformService;
//this.esppScheduleTransformService = esppScheduleTransformService;
this.logger = logger;
this.clientService = clientService;
this.robotHistoryService = robotHistoryService;
this.shortcodesService = shortcodesService;
this.nextRunService = nextRunService;
}
@@ -306,7 +310,8 @@ namespace PARR.API.Controllers.V1
//пока у нас выключено автораспределение, считает по refDate
//TODO: когда заработает автораспределение, будем думать!!!!!
var nextRun = await esppScheduleTransformService.GetNextDateAsync(template.Job!.GroupId, template!.Job!.Group!.ReferenceDate);
//var nextRun = await esppScheduleTransformService.GetNextDateAsync(template.Job!.GroupId, template!.Job!.Group!.ReferenceDate);
var nextRun = await nextRunService.GetNextRunForTemplateAsync(template.Id, false);
if (nextRun != template.NextRun)
{