feat(bll, dal): WeekendDayService + БД. CalendarService - получение рабочих дней за период

This commit is contained in:
Mikhail Kuznetsov
2024-07-01 11:32:19 +10:00
parent 9632b0c560
commit ff37e6c10f
14 changed files with 2981 additions and 43 deletions

View File

@@ -17,6 +17,7 @@
<ItemGroup>
<ProjectReference Include="..\PARR.BLL\PARR.BLL.csproj" />
<ProjectReference Include="..\PARR.DAL\PARR.DAL.csproj" />
<ProjectReference Include="..\PARR.EsppApi\PARR.EsppApi.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,5 +1,6 @@
using PARR.BLL;
using PARR.EsppApi;
using PARR.DAL;
using PARR.Test;
using Serilog;
@@ -8,6 +9,7 @@ IHost host = Host.CreateDefaultBuilder(args)
{
services.InstallEsppApiServices(hostContext.Configuration);
services.InstallBllServices(hostContext.Configuration);
services.InstallDalServices(hostContext.Configuration);
services.AddHostedService<Worker>();
})

View File

@@ -1,5 +1,6 @@
using PARR.BLL.Services.Interfaces;
using PARR.Constants;
using PARR.DAL.Services.Interfaces;
using PARR.EsppApi;
using PARR.EsppApi.Constants;
using PARR.EsppApi.Models.Query;
@@ -12,18 +13,21 @@ namespace PARR.Test
private readonly IEsppApiService esppApiService;
private readonly IIntervalService intervalService;
private readonly ICalendarService calendarService;
private readonly IServiceProvider serviceProvider;
public Worker(
ILogger<Worker> logger,
IEsppApiService esppApiService,
IIntervalService intervalService,
ICalendarService calendarService
ICalendarService calendarService,
IServiceProvider serviceProvider
)
{
_logger = logger;
this.esppApiService = esppApiService;
this.intervalService = intervalService;
this.calendarService = calendarService;
this.serviceProvider = serviceProvider;
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
@@ -38,9 +42,18 @@ namespace PARR.Test
#region Calendar
var testCalendar = new BLL.Services.Implementations.Test(calendarService);
//var testCalendar = new BLL.Services.Implementations.Test(calendarService);
testCalendar.Ttt() ;
//testCalendar.Ttt() ;
//using (var scope = serviceProvider.CreateScope())
//{
// var weekendDayService = scope.ServiceProvider.GetService<IWeekendDayService>();
// var workDays = calendarService.GetWorkDatesForPeriod(new DateOnly(2024, 07, 01), TimeSpan.Parse("30:00:00:00"), weekendDayService!.GetWeekends);
//}
#endregion

View File

@@ -1,4 +1,7 @@
{
"ConnectionStrings": {
"DefaultConnection": "Server=10.99.253.184;Database=parr;User Id=app_parr; Password=PosdfkhT&)%sdfligL&%5546;"
},
"Logging": {
"LogLevel": {
"Default": "Information",