114 lines
3.7 KiB
C#
114 lines
3.7 KiB
C#
using LiMan.DB.DBModels;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
// <Auto-Generated>
|
|
// This is here so CodeMaid doesn't reorganize this document
|
|
// </Auto-Generated>
|
|
namespace LiMan.DB.DTO
|
|
{
|
|
/// <summary>
|
|
/// Resoconto informazioni per statistiche installazioni
|
|
/// </summary>
|
|
public class InstallStatusDTO
|
|
{
|
|
|
|
/// <summary>
|
|
/// Elenco delle licenze degli applicativi abilitati alla gestione verifica update
|
|
/// </summary>
|
|
public List<ApplicativoDTO> UpdaterList { get; set; } = new List<ApplicativoDTO>();
|
|
|
|
/// <summary>
|
|
/// Elenco chiamate con conteggio x CodApp
|
|
/// </summary>
|
|
public Dictionary<string, int> ReqCountApp { get; set; } = new Dictionary<string, int>();
|
|
|
|
/// <summary>
|
|
/// Lista delle ultime richieste registrate (TargetUrl like '%release%') come conteggio orario (tipicamente 15 gg)
|
|
/// </summary>
|
|
public Dictionary<DateTime, int> ReqCountHour { get; set; } = new Dictionary<DateTime, int>();
|
|
|
|
/// <summary>
|
|
/// Lista delle ultime richieste registrate (TargetUrl like '%release%') come conteggio giornaliero (tipicamente 1 anno)
|
|
/// </summary>
|
|
public Dictionary<DateTime, int> ReqCountDay { get; set; } = new Dictionary<DateTime, int>();
|
|
|
|
/// <summary>
|
|
/// Lista delle Releases Installate x le applicazioni gestite
|
|
/// </summary>
|
|
public List<AppRelStatusDTO> InstallRelList { get; set; } = new List<AppRelStatusDTO>();
|
|
|
|
/// <summary>
|
|
/// Statistica aggregata status applicativi
|
|
/// </summary>
|
|
public List<AppStatusDTO> InstallStatus { get; set; } = new List<AppStatusDTO>();
|
|
|
|
/// <summary>
|
|
/// Dizionario record Impiego/dati device
|
|
/// </summary>
|
|
public Dictionary<string, DeviceDTO> InstDevices { get; set; } = new Dictionary<string, DeviceDTO>();
|
|
|
|
[NotMapped]
|
|
public int LastCallHour
|
|
{
|
|
get => ReqCountHour != null && ReqCountHour.Count > 0 ? ReqCountHour.Last().Value : 0;
|
|
}
|
|
|
|
[NotMapped]
|
|
public int LastCallDay
|
|
{
|
|
get => ReqCountDay != null && ReqCountDay.Count > 0 ? ReqCountDay.Last().Value : 0;
|
|
}
|
|
|
|
[NotMapped]
|
|
public int TotalUpdaterAct
|
|
{
|
|
get
|
|
{
|
|
return UpdaterList.Sum(x => x.NumLicenzeAttive);
|
|
}
|
|
}
|
|
|
|
[NotMapped]
|
|
public double GlobalUpdateScore
|
|
{
|
|
get
|
|
{
|
|
return InstallStatus.Sum(x => x.UpdateScore * x.NumInst) / (InstallStatus.Sum(x => x.NumInst));
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Conteggio totale di tutte le applicazioni gestite, come somma CONTEGGIO degli applicativi diversi gestiti (per cliente)
|
|
/// </summary>
|
|
[NotMapped]
|
|
public int TotalManagedCount
|
|
{
|
|
get
|
|
{
|
|
return UpdaterList.Count + InstallRelList.Count;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Conteggio totale di tutte le applicazioni gestite, come somma NumImpieghi di tutti gli applicativi + conteggio updater
|
|
/// </summary>
|
|
[NotMapped]
|
|
public int TotalManagedNum
|
|
{
|
|
get
|
|
{
|
|
return UpdaterList.Sum(x => x.NumLicenzeAttive) + InstallRelList.Sum(x => x.NumImp);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Data Ora ultimo aggiornamento informazioni
|
|
/// </summary>
|
|
public DateTime LastUpdated { get; set; } = DateTime.Now;
|
|
}
|
|
}
|