feat(bll,dal,common): в common - DateResolver - проверка даты на текущие сутки относительно часового пояса МСК. Dal - EsppScheduleTransformService - рассчет NextRun с учетом выходных дней

This commit is contained in:
Mikhail Trubnikov
2024-09-18 16:32:45 +10:00
parent 9987626478
commit 60c0ba9ec8
24 changed files with 181 additions and 29 deletions

View File

@@ -16,6 +16,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PARR.Common\PARR.Common.csproj" />
<ProjectReference Include="..\PARR.Constants\PARR.Constants.csproj" />
</ItemGroup>

View File

@@ -1,5 +1,6 @@
using Microsoft.Extensions.Logging;
using PARR.BLL.Services.Interfaces;
using PARR.Common;
using PARR.Constants;
namespace PARR.BLL.Services.Implementations
@@ -76,7 +77,8 @@ namespace PARR.BLL.Services.Implementations
//Так как в базе всё храним в UTC то время с 21 часа уже соответствует следующими суткам в календаре Москвы
//просто сдвигаем на день весь список
if (refTime.Hour > 21)
//if (refTime.Hour > 21)
if (DateResolver.IsCurrentDayRelativeMskTime(refTime.Hour) == false)
return workDays.Select(wd => wd.AddDays(-1)).ToList();
//иначе просто отдаём как есть
@@ -84,6 +86,8 @@ namespace PARR.BLL.Services.Implementations
}
/// <summary>
/// Возвращает список дней между датами
/// </summary>