diff --git a/PARR.API/Contracts/V1/ApiRoutes.cs b/PARR.API/Contracts/V1/ApiRoutes.cs
index ecb11262..594ad678 100644
--- a/PARR.API/Contracts/V1/ApiRoutes.cs
+++ b/PARR.API/Contracts/V1/ApiRoutes.cs
@@ -49,20 +49,7 @@
public const string GetNextRun = Base + "/tests/next-run";
- public const string GetNextScheduleDate = Base + "/tests/next-schedule-date/" + paramApplicationInWorkId + "/" + paramDate;
-
- public const string GetNextSchedule = Base + "/tests/next-schedule/" + paramApplicationInWorkId + "/" + paramDate;
-
public const string CreateCache = Base + "/tests/cache/";
-
- public const string IsWorkDay = Base + "/tests/is-work-day/";
-
- public const string TestHandler = Base + "/tests/test/";
-
- public const string GetWorkDay = Base + "/tests/get-work-day/{date}";
-
- public const string paramDate = "{lastRunDate}";
- public const string paramApplicationInWorkId = "{applicationInWorkId}";
}
public static class Template
@@ -309,6 +296,11 @@
public const string GetByApplicationInWork = BaseStat + "/work-workloads/";
}
+ public static class Workload
+ {
+ public const string Build = BaseStat + "/workload/build";
+ }
+
#endregion
#region Наряды
diff --git a/PARR.API/Controllers/V1/Statistics/StatWorkloadController.cs b/PARR.API/Controllers/V1/Statistics/StatWorkloadController.cs
new file mode 100644
index 00000000..78a0ca3f
--- /dev/null
+++ b/PARR.API/Controllers/V1/Statistics/StatWorkloadController.cs
@@ -0,0 +1,34 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using PARR.API.Contracts.V1;
+using PARR.API.Controllers.V1.Base;
+using PARR.Constants;
+
+namespace PARR.API.Controllers.V1.Statistics
+{
+ ///
+ /// Статистика загруженности по ЗО, РГ
+ ///
+ [Authorize(Roles = ParrRoles.EsppRobot.RoleOrAdmin)]
+ public class StatWorkloadController : BaseApiController
+ {
+ public StatWorkloadController()
+ {
+
+ }
+
+
+ ///
+ /// Сформировать отчетность
+ ///
+ ///
+ [HttpPost(ApiRoutes.Workload.Build)]
+ public async Task Build()
+ {
+
+ return Ok();
+ }
+
+
+ }
+}
diff --git a/PARR.API/Controllers/V1/TestController.cs b/PARR.API/Controllers/V1/TestController.cs
index da19f183..ccc11361 100644
--- a/PARR.API/Controllers/V1/TestController.cs
+++ b/PARR.API/Controllers/V1/TestController.cs
@@ -1,16 +1,12 @@
-using AutoMapper;
-using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using PARR.API.Contracts.V1;
using PARR.API.Contracts.V1.Responses.Base;
using PARR.API.Controllers.V1.Base;
using PARR.API.Services.Interfaces;
using PARR.DAL.Cache.Services.Base;
-using PARR.DAL.DomainServices.UnitFilterService;
using PARR.DAL.NextRunServices;
using PARR.DAL.Services.Interfaces;
-using PARR.DAL.Services.Interfaces.Job;
-using PARR.DAL.Services.Interfaces.Unit;
namespace PARR.API.Controllers.V1
@@ -19,43 +15,19 @@ namespace PARR.API.Controllers.V1
public class TestController : BaseApiController
{
private readonly IClientService clientService;
- //private readonly IEsppScheduleTransformService esppScheduleTransformService;
private readonly IRedisCacheService redisCacheService;
- private readonly IWeekendDayService weekendDayService;
- private readonly IUnitService unitService;
- private readonly IFieldFilterService fieldFilterService;
- private readonly IJobService jobService;
- private readonly IJobUnitFilterService jobUnitFilterService;
- private readonly IUnitFilterService unitFilterService;
- private readonly IMapper mapper;
private readonly INextRunService nextRunService;
private readonly ITemplateService templateService;
public TestController(
IClientService clientService,
- //IEsppScheduleTransformService esppScheduleTransformService,
IRedisCacheService redisCacheService,
- IWeekendDayService weekendDayService,
- IUnitService unitService,
- IFieldFilterService fieldFilterService,
- IJobService jobService,
- IJobUnitFilterService jobUnitFilterService,
- IUnitFilterService unitFilterService,
- IMapper mapper,
INextRunService nextRunService,
ITemplateService templateService
)
{
this.clientService = clientService;
- //this.esppScheduleTransformService = esppScheduleTransformService;
this.redisCacheService = redisCacheService;
- this.weekendDayService = weekendDayService;
- this.unitService = unitService;
- this.fieldFilterService = fieldFilterService;
- this.jobService = jobService;
- this.jobUnitFilterService = jobUnitFilterService;
- this.unitFilterService = unitFilterService;
- this.mapper = mapper;
this.nextRunService = nextRunService;
this.templateService = templateService;
}
@@ -92,124 +64,49 @@ namespace PARR.API.Controllers.V1
}
- /////
- ///// Получить следующую дату запуска
- /////
- /////
- /////
- /////
- //[HttpGet(ApiRoutes.Test.GetNextScheduleDate)]
- //public async Task GetNextScheduleDate([FromRoute] Guid applicationInWorkId, [FromRoute] DateTimeOffset lastRunDate)
- //{
- // var result = await esppScheduleTransformService.GetNextDateAsync(applicationInWorkId, lastRunDate);
- // return Ok(result);
- //}
-
-
- /////
- ///// Получить следующее расписание
- /////
- /////
- /////
- /////
- //[HttpGet(ApiRoutes.Test.GetNextSchedule)]
- //public async Task GetNextSchedule([FromRoute] Guid applicationInWorkId, [FromRoute] DateTimeOffset lastRunDate)
- //{
- // var result = await esppScheduleTransformService.GetNextScheduleAsync(applicationInWorkId, lastRunDate);
- // return Ok(result);
- //}
-
///
- /// Записать в кэш и получить обратно значение из кэша
+ /// Записать в кэш
///
///
///
[HttpPost(ApiRoutes.Test.CreateCache)]
- public async Task CreateCache([FromBody] CaheRequestTest request)
+ public async Task CreateCache()
{
- await redisCacheService.SetCachedDataAsync(request.Key, request, TimeSpan.FromMinutes(1));
+ //var val = await redisCacheService.GetCachedDataAsync