feat(api): статистика по регламентным работам по ЗО, РГ, РР
This commit is contained in:
@@ -248,11 +248,21 @@
|
||||
public const string Get = BaseStat + "/template-distribution/{applicationInWorkId}";
|
||||
}
|
||||
|
||||
public static class StatStatResponseAreaWorkLoad
|
||||
public static class StatResponseAreaWorkLoad
|
||||
{
|
||||
public const string GetAll = BaseStat + "/response-area-workloads/";
|
||||
}
|
||||
|
||||
public static class StatWorkGroupWorkLoad
|
||||
{
|
||||
public const string Get = BaseStat + "/work-group-workloads/{responseAreaCode}";
|
||||
}
|
||||
|
||||
public static class StatWorkWorkLoad
|
||||
{
|
||||
public const string Get = BaseStat + "/work-workloads/{workGroupId}";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Наряды
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace PARR.API.Contracts.V1.Responses
|
||||
namespace PARR.API.Contracts.V1.Responses
|
||||
{
|
||||
public class ApplicationInWorkResponse
|
||||
public class ApplicationInWorkBaseResponse
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
@@ -14,16 +12,18 @@ namespace PARR.API.Contracts.V1.Responses
|
||||
|
||||
public required string Solution { get; set; }
|
||||
|
||||
//public DateTimeOffset? LastRun { get; set; }
|
||||
|
||||
//public DateTimeOffset NextRun { get; set; }
|
||||
|
||||
public DateTimeOffset ReferenceDate { get; set; }
|
||||
|
||||
public bool IsAutoDistributionEnabled { get; set; }
|
||||
|
||||
public bool IsAgent { get; set; }
|
||||
|
||||
public ApplicationResponse? Application { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class ApplicationInWorkResponse : ApplicationInWorkBaseResponse
|
||||
{
|
||||
public string? AgentName { get; set; }
|
||||
|
||||
public int? AgentTimeOutSec { get; set; }
|
||||
@@ -32,8 +32,6 @@ namespace PARR.API.Contracts.V1.Responses
|
||||
|
||||
public WorkResponse? Work { get; set; }
|
||||
|
||||
public ApplicationResponse? Application { get; set; }
|
||||
|
||||
public int TemplatesCount { get; set; }
|
||||
|
||||
|
||||
@@ -77,7 +75,7 @@ namespace PARR.API.Contracts.V1.Responses
|
||||
/// <summary>
|
||||
/// Ошибок синхронизации (RobotStatus = 33/Error)
|
||||
/// </summary>
|
||||
public int Errors { get; set; }
|
||||
public int Errors { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +1,7 @@
|
||||
namespace PARR.API.Contracts.V1.Responses.Statistics
|
||||
{
|
||||
public class StatResponseAreaWorkLoadResponse
|
||||
public class StatResponseAreaWorkLoadResponse : StatWorkLoadDataBaseResponse
|
||||
{
|
||||
public required ResponseAreaResponse ResponseArea { get; set; }
|
||||
|
||||
public List<StatWorkLoadDataResponse> WorkLoad { get; set; }
|
||||
}
|
||||
|
||||
public class StatWorkLoadDataResponse
|
||||
{
|
||||
public DateTimeOffset Date { get; set; }
|
||||
public int TemplateCount { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace PARR.API.Contracts.V1.Responses.Statistics
|
||||
{
|
||||
public class StatWorkGroupWorkLoadResponse : StatWorkLoadDataBaseResponse
|
||||
{
|
||||
public required WorkGroupResponse WorkGroup { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace PARR.API.Contracts.V1.Responses.Statistics
|
||||
{
|
||||
public class StatWorkLoadDataBaseResponse
|
||||
{
|
||||
public List<StatWorkLoadDataResponse> WorkLoad { get; set; }
|
||||
|
||||
public int WorksCount => WorkLoad?.Sum(t => t.TemplateCount) ?? 0;
|
||||
|
||||
public double AverageWorksCount => Math.Round((double)WorksCount / WorkLoad.Count(), 2);
|
||||
}
|
||||
|
||||
public class StatWorkLoadDataResponse
|
||||
{
|
||||
public DateTimeOffset Date { get; set; }
|
||||
public int TemplateCount { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace PARR.API.Contracts.V1.Responses.Statistics
|
||||
{
|
||||
public class StatWorkWorkLoadResponse : StatWorkLoadDataBaseResponse
|
||||
{
|
||||
public required ApplicationInWorkBaseResponse Job { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user