fix(dal): исправлен расчет следующего запуска Regularly в EsppScheduleTransformService.

This commit is contained in:
Mikhail Kuznetsov
2025-11-27 14:21:27 +10:00
parent 57b9ba8b9a
commit f42e5b5ea8
3 changed files with 21 additions and 13 deletions

View File

@@ -5,7 +5,6 @@ using PARR.DAL.Contracts;
using PARR.DAL.DomainModels;
using PARR.DAL.Extensions;
using PARR.DAL.Services.Interfaces;
using PARR.DAL.Services.Interfaces.Job;
namespace PARR.DAL.TransformServices
{
@@ -206,7 +205,9 @@ namespace PARR.DAL.TransformServices
throw new ArgumentException($"Неизвестное значение: {values[0].Value.Value}");
}
var calcDay = referenceDate.AddHours(regNum);
var calcDay = referenceDate;
if (calcDay < DateTimeOffset.UtcNow)
calcDay = calcDay.AddHours(regNum);
//TODO: вот это повторяется от метода к методу
//Если итоговая дата указывает на прошлое, то повторяем расчёт и уходим в рекурсию
@@ -305,7 +306,7 @@ namespace PARR.DAL.TransformServices
return calcDay;
}
private DateTimeOffset GetNextDateAnnually(List<EsppScheduleValDto> values, DateTimeOffset referenceDate)
{