Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 95e83f7d56 | |||
| 0efe322f7a | |||
| 3bc3746a9d | |||
| 08901bcebc | |||
| 4d481699a1 | |||
| 3efeb994cf | |||
| 5014bb1ecb | |||
| 523b1683d9 | |||
| 35c0f2856d | |||
| 77457df40a | |||
| add4fe13fa | |||
| b748c76cad | |||
| 279d2799ae | |||
| 198d18002b | |||
| 838ebe55da | |||
| f58253341f | |||
| 4644646fa4 | |||
| c3c5300830 | |||
| ebeeab69e1 | |||
| 2a41e8070b | |||
| 3a5b77314a | |||
| 16c7b0bc6b | |||
| 46f284ae0c |
@@ -9,18 +9,18 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.6">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.9">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.6">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.9">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NLog" Version="5.0.1" />
|
||||
<PackageReference Include="NLog" Version="5.0.4" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MP.Data.Conf
|
||||
{
|
||||
@@ -11,9 +7,13 @@ namespace MP.Data.Conf
|
||||
/// </summary>
|
||||
public class IobTags
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto dizionario di configurazione x IOB
|
||||
/// </summary>
|
||||
public Dictionary<string, List<TagData>> IobSetup = new Dictionary<string, List<TagData>>();
|
||||
|
||||
#endregion Public Fields
|
||||
}
|
||||
}
|
||||
}
|
||||
+18
-12
@@ -1,37 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Data.Conf
|
||||
namespace MP.Data.Conf
|
||||
{
|
||||
/// <summary>
|
||||
/// Item da mostrare nei blocchi MON degli impianti come override ai dati MSE
|
||||
/// </summary>
|
||||
public class TagData
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Indice della colonna (ordine) del dato
|
||||
/// </summary>
|
||||
public int ColNum { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Indice della riga del dato
|
||||
/// </summary>
|
||||
public int RowNum { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Override CSS (es fontSmall)
|
||||
/// </summary>
|
||||
public string TagCss { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Etichetta da mostrare
|
||||
/// </summary>
|
||||
public string TagName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Indicazione della chiave REDIS dove recuperare il tag indicato (già in formato string)
|
||||
/// </summary>
|
||||
public string TagLocation { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Etichetta da mostrare
|
||||
/// </summary>
|
||||
public string TagName { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Clone dell'oggetto
|
||||
/// </summary>
|
||||
@@ -40,5 +44,7 @@ namespace MP.Data.Conf
|
||||
{
|
||||
return (TagData)this.MemberwiseClone();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
-12
@@ -1,21 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Data
|
||||
namespace MP.Data
|
||||
{
|
||||
public class Constants
|
||||
public class Constants
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
public static readonly string ACT_BLINK_KEY = $"{BASE_HASH}:Current:Blink";
|
||||
|
||||
public static readonly string ACT_MSE_DATA_KEY = $"{BASE_HASH}:Current:MSE";
|
||||
|
||||
// dati conf REDIS Cache
|
||||
public static readonly string BASE_HASH = "MAPO";
|
||||
|
||||
// REDIS KEY Dati correnti
|
||||
public static readonly string CONF_MON_KEY = $"{BASE_HASH}:Conf:MonDispData";
|
||||
public static readonly string ACT_MSE_DATA_KEY = $"{BASE_HASH}:Current:MSE";
|
||||
public static readonly string ACT_BLINK_KEY = $"{BASE_HASH}:Current:Blink";
|
||||
|
||||
|
||||
#endregion Public Fields
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.Data.DatabaseModels;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -27,7 +28,7 @@ namespace MP.Data.Controllers
|
||||
/// Elenco Gruppi tipo Azienda
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.AnagGruppi> AnagGruppiAziende()
|
||||
public List<AnagGruppi> AnagGruppiAziende()
|
||||
{
|
||||
return AnagGruppiGetTipo("AZIENDA");
|
||||
}
|
||||
@@ -36,7 +37,7 @@ namespace MP.Data.Controllers
|
||||
/// Elenco Gruppi tipo Fasi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.AnagGruppi> AnagGruppiFase()
|
||||
public List<AnagGruppi> AnagGruppiFase()
|
||||
{
|
||||
return AnagGruppiGetTipo("FASE");
|
||||
}
|
||||
@@ -45,9 +46,9 @@ namespace MP.Data.Controllers
|
||||
/// Elenco Gruppi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.AnagGruppi> AnagGruppiGetAll()
|
||||
public List<AnagGruppi> AnagGruppiGetAll()
|
||||
{
|
||||
List<DatabaseModels.AnagGruppi> dbResult = new List<DatabaseModels.AnagGruppi>();
|
||||
List<AnagGruppi> dbResult = new List<AnagGruppi>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
@@ -64,9 +65,9 @@ namespace MP.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="tipoGruppo"></param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.AnagGruppi> AnagGruppiGetTipo(string tipoGruppo)
|
||||
public List<AnagGruppi> AnagGruppiGetTipo(string tipoGruppo)
|
||||
{
|
||||
List<DatabaseModels.AnagGruppi> dbResult = new List<DatabaseModels.AnagGruppi>();
|
||||
List<AnagGruppi> dbResult = new List<AnagGruppi>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
@@ -83,7 +84,7 @@ namespace MP.Data.Controllers
|
||||
/// Elenco valori ammessi x Stati commessa (es Yacht Baglietto)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.ListValues> AnagStatiComm()
|
||||
public List<ListValues> AnagStatiComm()
|
||||
{
|
||||
return ListValuesFilt("PODL", "StatoComm");
|
||||
}
|
||||
@@ -92,7 +93,7 @@ namespace MP.Data.Controllers
|
||||
/// Elenco valori ammessi x Tipo articoli
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.ListValues> AnagTipoArtLV()
|
||||
public List<ListValues> AnagTipoArtLV()
|
||||
{
|
||||
return ListValuesFilt("AnagArticoli", "Tipo");
|
||||
}
|
||||
@@ -102,7 +103,7 @@ namespace MP.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> ArticoliDeleteRecord(DatabaseModels.AnagArticoli currRec)
|
||||
public async Task<bool> ArticoliDeleteRecord(AnagArticoli currRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
@@ -133,9 +134,9 @@ namespace MP.Data.Controllers
|
||||
/// <param name="numRecord"></param>
|
||||
/// <param name="searchVal"></param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.AnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
|
||||
public List<AnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
|
||||
{
|
||||
List<DatabaseModels.AnagArticoli> dbResult = new List<DatabaseModels.AnagArticoli>();
|
||||
List<AnagArticoli> dbResult = new List<AnagArticoli>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
@@ -156,9 +157,9 @@ namespace MP.Data.Controllers
|
||||
/// <param name="azienda"></param>
|
||||
/// <param name="searchVal"></param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.AnagArticoli> ArticoliGetSearch(int numRecord, string azienda = "*", string searchVal = "")
|
||||
public List<AnagArticoli> ArticoliGetSearch(int numRecord, string azienda = "*", string searchVal = "")
|
||||
{
|
||||
List<DatabaseModels.AnagArticoli> dbResult = new List<DatabaseModels.AnagArticoli>();
|
||||
List<AnagArticoli> dbResult = new List<AnagArticoli>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
@@ -176,9 +177,9 @@ namespace MP.Data.Controllers
|
||||
/// Elenco tabella Articoli IMPIEGATI (da stored stp_ART_getUsed)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.AnagArticoli> ArticoliGetUsed()
|
||||
public List<AnagArticoli> ArticoliGetUsed()
|
||||
{
|
||||
List<DatabaseModels.AnagArticoli> dbResult = new List<DatabaseModels.AnagArticoli>();
|
||||
List<AnagArticoli> dbResult = new List<AnagArticoli>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
@@ -195,7 +196,7 @@ namespace MP.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> ArticoliUpdateRecord(DatabaseModels.AnagArticoli editRec)
|
||||
public async Task<bool> ArticoliUpdateRecord(AnagArticoli editRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
@@ -235,9 +236,9 @@ namespace MP.Data.Controllers
|
||||
/// Elenco da tabella Config
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.ConfigModel> ConfigGetAll()
|
||||
public List<ConfigModel> ConfigGetAll()
|
||||
{
|
||||
List<DatabaseModels.ConfigModel> dbResult = new List<DatabaseModels.ConfigModel>();
|
||||
List<ConfigModel> dbResult = new List<ConfigModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
@@ -253,10 +254,10 @@ namespace MP.Data.Controllers
|
||||
/// Update record config
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool ConfigUpdate(DatabaseModels.ConfigModel updRec)
|
||||
public bool ConfigUpdate(ConfigModel updRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
DatabaseModels.ConfigModel dbResult = new DatabaseModels.ConfigModel();
|
||||
ConfigModel dbResult = new ConfigModel();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
@@ -277,6 +278,36 @@ namespace MP.Data.Controllers
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazione di un dossier
|
||||
/// </summary>
|
||||
/// <param name="currRec">record dossier da eliminare</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DossiersDeleteRecord(Dossiers currRec)
|
||||
{
|
||||
bool answ = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currVal = dbCtx
|
||||
.DbSetDossiers
|
||||
.Where(x => x.IdxDossier == currRec.IdxDossier)
|
||||
.FirstOrDefault();
|
||||
dbCtx
|
||||
.DbSetDossiers
|
||||
.Remove(currVal);
|
||||
await dbCtx.SaveChangesAsync();
|
||||
answ = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante DossiersDeleteRecord{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ultimi n record DOssiers (che contengono ad esempio "salvataggi" di FLuxLog) dato
|
||||
/// macchina (ordinato x data registrazione)
|
||||
@@ -285,9 +316,9 @@ namespace MP.Data.Controllers
|
||||
/// <param name="DtRef">Data di riferimento (Massima) per estrazioen records</param>
|
||||
/// <param name="MaxRec">numero massimo record da restituire</param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.Dossiers> DossiersGetLastFilt(string IdxMacchina, DateTime DtRef, int MaxRec)
|
||||
public List<Dossiers> DossiersGetLastFilt(string IdxMacchina, DateTime DtRef, int MaxRec)
|
||||
{
|
||||
List<DatabaseModels.Dossiers> dbResult = new List<DatabaseModels.Dossiers>();
|
||||
List<Dossiers> dbResult = new List<Dossiers>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
@@ -301,17 +332,24 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public bool DossiersTakeParamsSnapshot(string idxMacchina, int maxSec)
|
||||
/// <summary>
|
||||
/// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina">macchina</param>
|
||||
/// <param name="maxSec">Num massimo secondi per recuperare dati correnti</param>
|
||||
/// <param name="dtRif">DataOra riferimento x cui prendere valori antecedenti</param>
|
||||
public bool DossiersTakeParamsSnapshot(string idxMacchina, int maxSec, DateTime dtRif)
|
||||
{
|
||||
bool answ = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
var pIdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
var pMaxSec = new SqlParameter("@MaxSec", maxSec);
|
||||
var pDtRif = new SqlParameter("@DtRif", dtRif);
|
||||
|
||||
var dbResult = dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRaw("EXEC stp_FL_TakeSnapshot @IdxMacchina,@MaxSec", pIdxMacchina, pMaxSec);
|
||||
.ExecuteSqlRaw("EXEC stp_FL_TakeSnapshot @IdxMacchina,@MaxSec,@DtRif", pIdxMacchina, pMaxSec, pDtRif);
|
||||
answ = true;
|
||||
}
|
||||
return answ;
|
||||
@@ -321,7 +359,7 @@ namespace MP.Data.Controllers
|
||||
/// Elenco valori link (x home e navMenu laterale)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.LinkMenu> ElencoLink()
|
||||
public List<LinkMenu> ElencoLink()
|
||||
{
|
||||
return ListLinkFilt("SpecLink");
|
||||
}
|
||||
@@ -329,19 +367,20 @@ namespace MP.Data.Controllers
|
||||
/// <summary>
|
||||
/// Elenco ultimi n record flux log dato macchina e flusso (ordinato x data registrazione)
|
||||
/// </summary>
|
||||
/// <param name="DtMax">Data massima (recupera eventi antecedenti)</param>
|
||||
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
|
||||
/// <param name="CodFlux">*=tutti, altrimenti solo selezionato</param>
|
||||
/// <param name="MaxRec">numero massimo record da restituire</param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.FluxLog> FluxLogGetLastFilt(string IdxMacchina, string CodFlux, int MaxRec)
|
||||
public List<FluxLog> FluxLogGetLastFilt(DateTime DtMax, string IdxMacchina, string CodFlux, int MaxRec)
|
||||
{
|
||||
List<DatabaseModels.FluxLog> dbResult = new List<DatabaseModels.FluxLog>();
|
||||
List<FluxLog> dbResult = new List<FluxLog>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetFluxLog
|
||||
.AsNoTracking()
|
||||
.Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && (CodFlux == "*" || x.CodFlux == CodFlux))
|
||||
.Where(x => (x.dtEvento <= DtMax) && (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && (CodFlux == "*" || x.CodFlux == CodFlux))
|
||||
.OrderByDescending(x => x.dtEvento)
|
||||
.Take(MaxRec)
|
||||
.ToList();
|
||||
@@ -349,9 +388,9 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public List<DatabaseModels.LinkMenu> ListLinkFilt(string tipoLink)
|
||||
public List<LinkMenu> ListLinkFilt(string tipoLink)
|
||||
{
|
||||
List<DatabaseModels.LinkMenu> dbResult = new List<DatabaseModels.LinkMenu>();
|
||||
List<LinkMenu> dbResult = new List<LinkMenu>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
@@ -371,9 +410,9 @@ namespace MP.Data.Controllers
|
||||
/// <param name="codArt">Cod articolo</param>
|
||||
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.ODLModel> ListODLFilt(bool inCorso, string codArt, string keyRichPart)
|
||||
public List<ODLModel> ListODLFilt(bool inCorso, string codArt, string keyRichPart)
|
||||
{
|
||||
List<DatabaseModels.ODLModel> dbResult = new List<DatabaseModels.ODLModel>();
|
||||
List<ODLModel> dbResult = new List<ODLModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
@@ -392,9 +431,9 @@ namespace MP.Data.Controllers
|
||||
/// <param name="codArt">Cod articolo</param>
|
||||
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.PODLModel> ListPODLFilt(string codArt, string keyRichPart)
|
||||
public List<PODLModel> ListPODLFilt(string codArt, string keyRichPart)
|
||||
{
|
||||
List<DatabaseModels.PODLModel> dbResult = new List<DatabaseModels.PODLModel>();
|
||||
List<PODLModel> dbResult = new List<PODLModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
@@ -413,9 +452,9 @@ namespace MP.Data.Controllers
|
||||
/// <param name="tabName"></param>
|
||||
/// <param name="fieldName"></param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.ListValues> ListValuesFilt(string tabName, string fieldName)
|
||||
public List<ListValues> ListValuesFilt(string tabName, string fieldName)
|
||||
{
|
||||
List<DatabaseModels.ListValues> dbResult = new List<DatabaseModels.ListValues>();
|
||||
List<ListValues> dbResult = new List<ListValues>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
@@ -432,9 +471,9 @@ namespace MP.Data.Controllers
|
||||
/// Elenco da tabella Macchine
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.Macchine> MacchineGetAll()
|
||||
public List<Macchine> MacchineGetAll()
|
||||
{
|
||||
List<DatabaseModels.Macchine> dbResult = new List<DatabaseModels.Macchine>();
|
||||
List<Macchine> dbResult = new List<Macchine>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
@@ -469,9 +508,9 @@ namespace MP.Data.Controllers
|
||||
/// Elenco da tabella MappaStatoExpl
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.MappaStatoExpl> MseGetAll(int maxAge = 2000)
|
||||
public List<MappaStatoExpl> MseGetAll(int maxAge = 2000)
|
||||
{
|
||||
List<DatabaseModels.MappaStatoExpl> dbResult = new List<DatabaseModels.MappaStatoExpl>();
|
||||
List<MappaStatoExpl> dbResult = new List<MappaStatoExpl>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
var maxAgeSec = new SqlParameter("@maxAgeSec", maxAge);
|
||||
@@ -511,7 +550,7 @@ namespace MP.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> PODLDeleteRecord(DatabaseModels.PODLModel currRec)
|
||||
public async Task<bool> PODLDeleteRecord(PODLModel currRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
@@ -541,7 +580,7 @@ namespace MP.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> PODLUpdateRecord(DatabaseModels.PODLModel editRec)
|
||||
public async Task<bool> PODLUpdateRecord(PODLModel editRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
|
||||
@@ -10,14 +10,6 @@ namespace MP.Data.Controllers
|
||||
{
|
||||
public class MpStatsController : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public MpStatsController(IConfiguration configuration)
|
||||
@@ -326,5 +318,13 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,10 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DTO
|
||||
{
|
||||
public class DossierFluxLogDTO
|
||||
|
||||
@@ -3,7 +3,9 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("AnagArticoli")]
|
||||
|
||||
@@ -4,7 +4,9 @@ using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("AnagraficaGruppi")]
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class AzioniUL
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("Config")]
|
||||
|
||||
@@ -4,6 +4,9 @@ using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("Dossiers")]
|
||||
@@ -11,16 +14,18 @@ namespace MP.Data.DatabaseModels
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[MaxLength(50)]
|
||||
public string IdxMacchina { get; set; }
|
||||
|
||||
public DateTime DtRif { get; set; }
|
||||
|
||||
public int IdxODL { get; set; }
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int IdxDossier { get; set; }
|
||||
|
||||
[MaxLength(50)]
|
||||
public string DataType { get; set; }
|
||||
|
||||
public DateTime DtRif { get; set; }
|
||||
|
||||
[MaxLength(50)]
|
||||
public string IdxMacchina { get; set; }
|
||||
|
||||
public int IdxODL { get; set; }
|
||||
public string Valore { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("FluxLog")]
|
||||
|
||||
@@ -3,8 +3,11 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("LinkMenuJQM")]
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("ListValues")]
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class Macchine
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class MappaStatoExpl
|
||||
|
||||
@@ -3,8 +3,11 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("ODL")]
|
||||
|
||||
@@ -3,8 +3,11 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("PromesseODL")]
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class ResControlli
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class ResScarti
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class StatsAnagArticoli
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class StatsODL
|
||||
|
||||
@@ -3,8 +3,11 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class TurniOee
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class UserActionLog
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.7" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.7" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.7" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.7">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.9">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.7" />
|
||||
<PackageReference Include="NLog" Version="5.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.9" />
|
||||
<PackageReference Include="NLog" Version="5.0.4" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
+46
-50
@@ -1,29 +1,11 @@
|
||||
using NLog;
|
||||
using StackExchange.Redis;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Data
|
||||
{
|
||||
public class MessagePipe
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private bool enableLog = false;
|
||||
private IConnectionMultiplexer redis;
|
||||
private IDatabase? redisDb;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public MessagePipe(IConnectionMultiplexer redisConn, string channelName, bool enableLog = false)
|
||||
@@ -44,37 +26,6 @@ namespace MP.Data
|
||||
|
||||
#endregion Public Events
|
||||
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Canale associato al gestore pipeline messaggi
|
||||
/// </summary>
|
||||
private string _channel { get; set; } = "";
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void setupSubscriber()
|
||||
{
|
||||
ISubscriber sub = redis.GetSubscriber();
|
||||
//Subscribe to the channel named messages
|
||||
sub.Subscribe(_channel, (channel, message) =>
|
||||
{
|
||||
Log.Trace($"ch {channel} | {message}");
|
||||
// messaggio
|
||||
PubSubEventArgs mea = new PubSubEventArgs(message);
|
||||
// se qualcuno ascolta sollevo evento nuovo valore...
|
||||
if (EA_NewMessage != null)
|
||||
{
|
||||
EA_NewMessage(this, mea);
|
||||
}
|
||||
});
|
||||
Log.Info($"Subscribed {_channel}");
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public bool saveAndSendMessage(string memKey, string message)
|
||||
@@ -108,6 +59,51 @@ namespace MP.Data
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private bool enableLog = false;
|
||||
private IConnectionMultiplexer redis;
|
||||
private IDatabase? redisDb;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Canale associato al gestore pipeline messaggi
|
||||
/// </summary>
|
||||
private string _channel { get; set; } = "";
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void setupSubscriber()
|
||||
{
|
||||
ISubscriber sub = redis.GetSubscriber();
|
||||
//Subscribe to the channel named messages
|
||||
sub.Subscribe(_channel, (channel, message) =>
|
||||
{
|
||||
Log.Trace($"ch {channel} | {message}");
|
||||
// messaggio
|
||||
PubSubEventArgs mea = new PubSubEventArgs(message);
|
||||
// se qualcuno ascolta sollevo evento nuovo valore...
|
||||
if (EA_NewMessage != null)
|
||||
{
|
||||
EA_NewMessage(this, mea);
|
||||
}
|
||||
});
|
||||
Log.Info($"Subscribed {_channel}");
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Invio messaggio sul canale + salvataggio in cache REDIS
|
||||
/// </summary>
|
||||
@@ -132,4 +128,4 @@ namespace MP.Data
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,9 @@ using MP.Data.DatabaseModels;
|
||||
using NLog;
|
||||
|
||||
#nullable disable
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data
|
||||
{
|
||||
public partial class MoonProContext : DbContext
|
||||
@@ -294,11 +296,6 @@ namespace MP.Data
|
||||
{
|
||||
entity.HasKey(e => new { e.IdxMacchina, e.dtEvento, e.CodFlux });
|
||||
|
||||
});
|
||||
modelBuilder.Entity<Dossiers>(entity =>
|
||||
{
|
||||
entity.HasKey(e => new { e.IdxMacchina, e.DtRif });
|
||||
|
||||
});
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
|
||||
@@ -6,7 +6,9 @@ using MP.Data.DatabaseModels;
|
||||
using NLog;
|
||||
|
||||
#nullable disable
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data
|
||||
{
|
||||
public partial class MoonPro_STATSContext : DbContext
|
||||
|
||||
+30
-25
@@ -3,13 +3,26 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Data
|
||||
{
|
||||
public class Utils
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public static string redKeyArtUsed
|
||||
{
|
||||
get => RedHash($"CACHE:CheckArtUsed");
|
||||
}
|
||||
|
||||
public static string redKeyTabCheckArt
|
||||
{
|
||||
get => RedHash($"CACHE:TabCheckArt");
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public static string ConvMinToTime(double minutes)
|
||||
@@ -28,6 +41,22 @@ namespace MP.Data
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Nome della variabile HASH da utilizzare (dato CodModulo / Server / DB impiegato da
|
||||
/// funzionalita' DbConfig) + keyName richiesto...
|
||||
/// </summary>
|
||||
public static string RedHash(string keyName)
|
||||
{
|
||||
string answ = keyName;
|
||||
try
|
||||
{
|
||||
answ = $"MP:Data:{keyName}";
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
public static async Task SaveToCsv<T>(List<T> reportData, string path)
|
||||
{
|
||||
var lines = new List<string>();
|
||||
@@ -39,30 +68,6 @@ namespace MP.Data
|
||||
await Task.Run(() => File.WriteAllLines(path, lines.ToArray()));
|
||||
}
|
||||
|
||||
public static string redKeyArtUsed
|
||||
{
|
||||
get => RedHash($"CACHE:CheckArtUsed");
|
||||
}
|
||||
public static string redKeyTabCheckArt
|
||||
{
|
||||
get => RedHash($"CACHE:TabCheckArt");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Nome della variabile HASH da utilizzare (dato CodModulo / Server / DB impiegato da funzionalita' DbConfig) + keyName richiesto...
|
||||
/// </summary>
|
||||
public static string RedHash(string keyName)
|
||||
{
|
||||
string answ = keyName;
|
||||
try
|
||||
{
|
||||
answ =$"MP:Data:{keyName}";
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>MP.Land</RootNamespace>
|
||||
<Version>6.15.2209.1212</Version>
|
||||
<Version>6.16.2209.2118</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -45,14 +45,14 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DiffMatchPatch" Version="1.0.3" />
|
||||
<PackageReference Include="Majorsoft.Blazor.Components.Debounce" Version="1.5.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.6">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.9">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.6" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.9" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" Version="5.0.0" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" Version="5.1.4" />
|
||||
<PackageReference Include="RestSharp" Version="107.1.2" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo gestione Programmi MAPO</i>
|
||||
<h4>Versione: 6.15.2209.1212</h4>
|
||||
<h4>Versione: 6.16.2209.2118</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.15.2209.1212
|
||||
6.16.2209.2118
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.15.2209.1212</version>
|
||||
<version>6.16.2209.2118</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>6.15.2209.1411</Version>
|
||||
<Version>6.16.2209.2118</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -30,8 +30,8 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="NLog" Version="5.0.1" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.6.48" />
|
||||
<PackageReference Include="NLog" Version="5.0.4" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.6.66" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MON MAPO</i>
|
||||
<h4>Versione: 6.15.2209.1411</h4>
|
||||
<h4>Versione: 6.16.2209.2118</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.15.2209.1411
|
||||
6.16.2209.2118
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.15.2209.1411</version>
|
||||
<version>6.16.2209.2118</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/MP.Mon.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -33,15 +33,15 @@ namespace MP.SPEC.Components
|
||||
aTimer.Start();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
version = typeof(Program).Assembly.GetName().Version;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
@@ -23,12 +23,6 @@ namespace MP.SPEC.Components
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task resetCurrPage()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
currPage = 1;
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<int> numPageChanged { get; set; }
|
||||
@@ -82,6 +76,16 @@ namespace MP.SPEC.Components
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public async Task resetCurrPage()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
currPage = 1;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected bool _showLoading = false;
|
||||
|
||||
@@ -5,53 +5,6 @@
|
||||
|
||||
<div class="px-0 col-6">
|
||||
<div class="">
|
||||
@*@if (showEditPar)
|
||||
{
|
||||
<div class="px-0 input-group py-1" id="basic-addon1">
|
||||
<button class="btn btn-primary" @onclick="() => toggleParams()"> <i class="fa-solid fa-arrow-right"></i></button>
|
||||
<label class="input-group-text" for="tempoAgg" title="Selezionare il tempo di aggiornamento dei dati"><i class="fa-solid fa-clock"></i></label>
|
||||
<select @bind="@selTempoAgg" class="form-select" id="tempoAgg" title="Selezionare il tempo di aggiornamento dei dati">
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="6">6</option>
|
||||
<option value="7">7</option>
|
||||
<option value="8">8</option>
|
||||
<option value="9">9</option>
|
||||
<option value="10">10</option>
|
||||
<option value="11">11</option>
|
||||
<option value="12">12</option>
|
||||
<option value="13">13</option>
|
||||
<option value="14">14</option>
|
||||
<option value="15">15</option>
|
||||
<option value="16">16</option>
|
||||
<option value="17">17</option>
|
||||
<option value="18">18</option>
|
||||
<option value="19">19</option>
|
||||
<option value="20">20</option>
|
||||
</select>
|
||||
<label class="input-group-text" for="maxRecord" title="Selezionare il numero massimo di record da visualizzare"><i class="fa-solid fa-list-ol"></i></label>
|
||||
<select @bind="@selMaxRecord" class="form-select" id="maxRecord" title="Selezionare il numero massimo di record da visualizzare">
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
<option value="150">150</option>
|
||||
<option value="200">200</option>
|
||||
<option value="250">250</option>
|
||||
<option value="300">300</option>
|
||||
<option value="350">350</option>
|
||||
<option value="400">400</option>
|
||||
<option value="450">450</option>
|
||||
<option value="500">500</option>
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="px-2 py-1">
|
||||
<button class="btn btn-primary" @onclick="() => toggleParams()"><i class="fa-solid fa-arrow-left"></i></button>
|
||||
</div>
|
||||
}*@
|
||||
<div class="px-0 py-1">
|
||||
<div class="px-2 input-group" id="basic-addon1">
|
||||
<label class="input-group-text" for="macchina" title="Selezionare la macchina"><i class="fa-solid fa-hard-drive"></i></label>
|
||||
@@ -65,8 +18,8 @@
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label class="input-group-text" for="DtRef" title="Selezionare il tipo di flusso"><i class="fa-solid fa-calendar-check"></i></label>
|
||||
<input @bind="@selDtRef" id="DtRef" class="form-control" type="datetime-local" />
|
||||
<label class="input-group-text" for="DtRef" title="Selezionare la data da visualizzare"><i class="fa-solid fa-calendar-check"></i></label>
|
||||
<input @bind="@selDtRef" id="DtRef" class="form-control" type="datetime-local" title="Selezionare la data da visualizzare" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,21 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Net.Http;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.Web.Virtualization;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.SPEC;
|
||||
using MP.SPEC.Shared;
|
||||
using MP.SPEC.Components;
|
||||
using MP.SPEC.Data;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.SPEC.Data;
|
||||
|
||||
namespace MP.SPEC.Components
|
||||
{
|
||||
@@ -31,15 +16,27 @@ namespace MP.SPEC.Components
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected MpDataService MDService { get; set; } = null!;
|
||||
|
||||
protected DateTime selDtRef
|
||||
{
|
||||
get
|
||||
{
|
||||
return SelFilterDossier.DtRef;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (!SelFilterDossier.DtRef.Equals(value))
|
||||
{
|
||||
SelFilterDossier.DtRef = value;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected string selMacchina
|
||||
{
|
||||
@@ -60,7 +57,6 @@ namespace MP.SPEC.Components
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected int selMaxRecord
|
||||
{
|
||||
get
|
||||
@@ -78,23 +74,6 @@ namespace MP.SPEC.Components
|
||||
}
|
||||
}
|
||||
|
||||
protected DateTime selDtRef
|
||||
{
|
||||
get
|
||||
{
|
||||
return SelFilterDossier.DtRef;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (!SelFilterDossier.DtRef.Equals(value))
|
||||
{
|
||||
SelFilterDossier.DtRef = value;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
@@ -22,7 +22,8 @@ else
|
||||
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
|
||||
<th><i class="fa-regular fa-calendar-days"></i> Data</th>
|
||||
<th><i class="fa-solid fa-sliders"></i> ODL</th>
|
||||
<th><i class="fa-solid fa-sliders"></i> DATA TYPE</th>
|
||||
<th><i class="fa-solid fa-circle-info"></i> DATA TYPE</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -44,6 +45,8 @@ else
|
||||
<td>
|
||||
@record.DataType
|
||||
</td>
|
||||
<td>
|
||||
<button @onclick="() => deleteRecord(record)" class="btn btn-danger btn-sm"><i class="bi bi-trash-fill"></i></button></td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
@@ -63,9 +66,8 @@ else
|
||||
<tr>
|
||||
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
|
||||
<th><i class="fa-regular fa-calendar-days"></i> Data</th>
|
||||
<th><i class="fa-solid fa-sliders"></i> ODL</th>
|
||||
<th class="d-flex justify-content-between"><i class="fa-solid fa-sliders"></i> Valore <button class="btn btn-primary btn-sm py-0" @onclick="() => unToggleTableFlux()"><i class="fa-solid fa-xmark"></i></button></th>
|
||||
@*<th class="d-flex justify-content-end"><button class="btn btn-primary btn-sm py-0" @onclick="() => unToggleTableFlux()"><i class="fa-solid fa-xmark"></i></button></th>*@
|
||||
<th><i class="fa-solid fa-sliders"></i> Data Type</th>
|
||||
<th class="d-flex justify-content-between"> Valore <button class="btn btn-primary btn-sm py-0" @onclick="() => unToggleTableFlux()"><i class="fa-solid fa-xmark"></i></button></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -84,15 +86,12 @@ else
|
||||
<td style="text-align: right;">
|
||||
<b>@record.Valore</b>
|
||||
</td>
|
||||
@* <td>
|
||||
</td>*@
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -37,6 +37,22 @@ namespace MP.SPEC.Components
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazione record selezionato (previa conferma)
|
||||
/// </summary>
|
||||
/// <param name="selRec"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task deleteRecord(Dossiers selRec)
|
||||
{
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Eliminazione Dossier: sei sicuro di voler procedere?"))
|
||||
return;
|
||||
await Task.Delay(1);
|
||||
var done = await MDService.DossiersDeleteRecord(selRec);
|
||||
currRecord = null;
|
||||
await reloadData();
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
public async Task reloadData(bool setChanged)
|
||||
{
|
||||
isLoading = true;
|
||||
|
||||
@@ -17,21 +17,20 @@ else
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@*<button @onclick="() => resetSel()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>*@
|
||||
<button @onclick="() => resetSel()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
|
||||
</th>
|
||||
<th><i class="fa-regular fa-calendar-days"></i> Data</th>
|
||||
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
|
||||
<th><i class="fa-solid fa-sliders"></i> Parametro</th>
|
||||
<th style="text-align: right">Valore</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr class="@checkSelect(@record.IdxMacchina)">
|
||||
<tr class="@checkSelect(@record)">
|
||||
<td>
|
||||
@*<button @onclick="() => selRecord(record)" class="btn btn-primary btn-sm"><i class="bi bi-pencil-square"></i></button>*@
|
||||
<button @onclick="() => selRecord(record)" class="btn btn-primary btn-sm"><i class="bi bi-search"></i></button>
|
||||
</td>
|
||||
<td>
|
||||
@record.dtEvento
|
||||
@@ -45,12 +44,6 @@ else
|
||||
<td style="text-align: right">
|
||||
<b>@record.Valore</b>
|
||||
</td>
|
||||
<td>
|
||||
@*@if (ArticoloDelEnabled(record.CodArticolo))
|
||||
{
|
||||
<button @onclick="() => deleteRecord(record)" class="btn btn-danger btn-sm"><i class="bi bi-trash-fill"></i></button>
|
||||
}*@
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
|
||||
@@ -13,6 +13,9 @@ namespace MP.SPEC.Components
|
||||
[Parameter]
|
||||
public EventCallback<bool> PagerResetReq { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<FluxLog> RecordSel { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public SelectFluxParams SelFilter { get; set; } = null!;
|
||||
|
||||
@@ -23,14 +26,14 @@ namespace MP.SPEC.Components
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public string checkSelect(string IdxMacchina)
|
||||
public string checkSelect(FluxLog selRecord)
|
||||
{
|
||||
string answ = "";
|
||||
if (currRecord != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = (currRecord.IdxMacchina == IdxMacchina) ? "table-info" : "";
|
||||
answ = (currRecord.IdxMacchina == selRecord.IdxMacchina && currRecord.dtEvento == selRecord.dtEvento && currRecord.CodFlux == selRecord.CodFlux) ? "table-info" : "";
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -38,6 +41,20 @@ namespace MP.SPEC.Components
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
// se sono cambiati --> rileggo...
|
||||
if (LastFilter==null || !SelFilter.Equals(LastFilter))
|
||||
{
|
||||
await reloadData(false);
|
||||
LastFilter = SelFilter;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SelectFluxParams? LastFilter = null;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
aTimer.Elapsed -= ElapsedTimer;
|
||||
@@ -73,7 +90,12 @@ namespace MP.SPEC.Components
|
||||
public async Task reloadData(bool setChanged)
|
||||
{
|
||||
isLoading = true;
|
||||
SearchRecords = await MDService.FluxLogGetLastFilt(SelMacchina, SelFlux, MaxRecord);
|
||||
DateTime limitData = DateTime.Now;
|
||||
if (SelDtMax != null)
|
||||
{
|
||||
limitData = (DateTime)SelDtMax;
|
||||
}
|
||||
SearchRecords = await MDService.FluxLogGetLastFilt(limitData, SelMacchina, SelFlux, MaxRecord);
|
||||
totalCount = SearchRecords.Count;
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
@@ -86,11 +108,9 @@ namespace MP.SPEC.Components
|
||||
|
||||
public void StartTimer()
|
||||
{
|
||||
//int.TryParse(Configuration["ReloadStatusTimer"], out tOutPeriod);
|
||||
aTimer = new System.Timers.Timer(RefreshPeriod);
|
||||
aTimer.Elapsed += ElapsedTimer;
|
||||
aTimer.Enabled = true;
|
||||
//aTimer.AutoReset = true;
|
||||
aTimer.Start();
|
||||
}
|
||||
|
||||
@@ -111,7 +131,6 @@ namespace MP.SPEC.Components
|
||||
{
|
||||
get => SelFilter.TempoAgg;
|
||||
}
|
||||
//protected int RefreshPeriod { get; set; } = 5000;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
@@ -122,10 +141,10 @@ namespace MP.SPEC.Components
|
||||
MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
|
||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||
StartTimer();
|
||||
|
||||
await reloadData(true);
|
||||
}
|
||||
|
||||
|
||||
//protected int RefreshPeriod { get; set; } = 5000;
|
||||
protected async void OnSeachUpdated()
|
||||
{
|
||||
await InvokeAsync(() =>
|
||||
@@ -137,6 +156,20 @@ namespace MP.SPEC.Components
|
||||
});
|
||||
}
|
||||
|
||||
protected async Task resetSel()
|
||||
{
|
||||
currRecord = null;
|
||||
await RecordSel.InvokeAsync(null);
|
||||
}
|
||||
|
||||
protected async Task selRecord(FluxLog selRec)
|
||||
{
|
||||
currRecord = selRec;
|
||||
SelFilter.IdxMacchina = selRec.IdxMacchina;
|
||||
await reloadData(false);
|
||||
await RecordSel.InvokeAsync(selRec);
|
||||
}
|
||||
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
currRecord = null;
|
||||
@@ -191,6 +224,10 @@ namespace MP.SPEC.Components
|
||||
{
|
||||
get => SelFilter.IdxMacchina;
|
||||
}
|
||||
private DateTime? SelDtMax
|
||||
{
|
||||
get => SelFilter.dtMax;
|
||||
}
|
||||
|
||||
private int totalCount
|
||||
{
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace MP.SPEC.Components
|
||||
[Parameter]
|
||||
public EventCallback<bool> PagerResetReq { get; set; }
|
||||
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<PODLModel> RecordSel { get; set; }
|
||||
|
||||
@@ -35,38 +34,6 @@ namespace MP.SPEC.Components
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected async Task resetSel()
|
||||
{
|
||||
await RecordSel.InvokeAsync(null);
|
||||
}
|
||||
|
||||
protected bool POdlDelEnabled(int idxOdl)
|
||||
{
|
||||
return idxOdl == 0;
|
||||
}
|
||||
|
||||
protected async Task selRecord(PODLModel selRec)
|
||||
{
|
||||
await RecordSel.InvokeAsync(selRec);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazione record selezioanto (previa conferma)
|
||||
/// </summary>
|
||||
/// <param name="selRec"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task deleteRecord(PODLModel selRec)
|
||||
{
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Eliminazione Record: sei sicuro di voler procedere?"))
|
||||
return;
|
||||
await Task.Delay(1);
|
||||
var done = await MDService.PODLDeleteRecord(selRec);
|
||||
currRecord = null;
|
||||
await reloadData();
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
@@ -84,6 +51,22 @@ namespace MP.SPEC.Components
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazione record selezionato (previa conferma)
|
||||
/// </summary>
|
||||
/// <param name="selRec"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task deleteRecord(PODLModel selRec)
|
||||
{
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Eliminazione Record: sei sicuro di voler procedere?"))
|
||||
return;
|
||||
await Task.Delay(1);
|
||||
var done = await MDService.PODLDeleteRecord(selRec);
|
||||
currRecord = null;
|
||||
await reloadData();
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
MsgService.EA_PageUpdated += MessageService_EA_PageUpdated;
|
||||
@@ -104,6 +87,21 @@ namespace MP.SPEC.Components
|
||||
});
|
||||
}
|
||||
|
||||
protected bool POdlDelEnabled(int idxOdl)
|
||||
{
|
||||
return idxOdl == 0;
|
||||
}
|
||||
|
||||
protected async Task resetSel()
|
||||
{
|
||||
await RecordSel.InvokeAsync(null);
|
||||
}
|
||||
|
||||
protected async Task selRecord(PODLModel selRec)
|
||||
{
|
||||
await RecordSel.InvokeAsync(selRec);
|
||||
}
|
||||
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
currRecord = null;
|
||||
@@ -118,6 +116,7 @@ namespace MP.SPEC.Components
|
||||
|
||||
private List<PODLModel>? ListRecords;
|
||||
|
||||
private List<ListValues>? ListStati;
|
||||
private List<PODLModel>? SearchRecords;
|
||||
|
||||
#endregion Private Fields
|
||||
@@ -175,6 +174,17 @@ namespace MP.SPEC.Components
|
||||
});
|
||||
}
|
||||
|
||||
private async Task reloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
SearchRecords = await MDService.ListPODLFilt(SearchVal, StatoSel);
|
||||
totalCount = SearchRecords.Count;
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
private string tradFase(string codFase)
|
||||
{
|
||||
string answ = codFase;
|
||||
@@ -189,20 +199,6 @@ namespace MP.SPEC.Components
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
private List<ListValues>? ListStati;
|
||||
|
||||
private async Task reloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
SearchRecords = await MDService.ListPODLFilt(SearchVal, StatoSel);
|
||||
totalCount = SearchRecords.Count;
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
@if (!liveUpdate)
|
||||
{
|
||||
<button class="btn btn-secondary" type="button" @onclick="() => toggleUpdate()">
|
||||
<button class="btn btn-secondary" type="button" @onclick="() => toggleUpdate()" title="Click per tornare a Valori Live">
|
||||
<small>@lastUpdate</small>
|
||||
</button>
|
||||
}
|
||||
@@ -19,12 +19,23 @@
|
||||
}
|
||||
</div>
|
||||
<div class="px-2">
|
||||
|
||||
@if (selMacchina != "*")
|
||||
{
|
||||
<button class="btn btn-warning" type="button" @onclick="() => takeSnapshot()">
|
||||
<i class="fa-solid fa-camera"></i>
|
||||
Registra
|
||||
@snapMode
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
<div class="px-2">
|
||||
@if (snapshotDone)
|
||||
{
|
||||
<button class="btn btn-success" type="button" @onclick="() => navDossier()">
|
||||
<div class="spinner-border spinner-border-sm" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
<i class="fa-solid fa-camera"></i>
|
||||
Fatto! Mostra Dossier
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
@@ -35,42 +46,25 @@
|
||||
<div class="d-flex justify-content-end">
|
||||
@if (showEditPar)
|
||||
{
|
||||
<div class="px-0 input-group py-1" id="basic-addon1">
|
||||
<div class="px-0 input-group py-1">
|
||||
<button class="btn btn-primary" @onclick="() => toggleParams()"> <i class="fa-solid fa-arrow-right"></i></button>
|
||||
<label class="input-group-text" for="tempoAgg" title="Selezionare il tempo di aggiornamento dei dati"><i class="fa-solid fa-clock"></i></label>
|
||||
<select @bind="@selTempoAgg" class="form-select" id="tempoAgg" title="Selezionare il tempo di aggiornamento dei dati" style="width: 3em;">
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="6">6</option>
|
||||
<option value="7">7</option>
|
||||
<option value="8">8</option>
|
||||
<option value="9">9</option>
|
||||
<option value="10">10</option>
|
||||
<option value="11">11</option>
|
||||
<option value="12">12</option>
|
||||
<option value="13">13</option>
|
||||
<option value="14">14</option>
|
||||
<option value="15">15</option>
|
||||
<option value="16">16</option>
|
||||
<option value="17">17</option>
|
||||
<option value="18">18</option>
|
||||
<option value="19">19</option>
|
||||
<option value="20">20</option>
|
||||
<option value="30">30</option>
|
||||
<option value="60">60</option>
|
||||
</select>
|
||||
<label class="input-group-text" for="maxRecord" title="Selezionare il numero massimo di record da visualizzare"><i class="fa-solid fa-list-ol"></i></label>
|
||||
<select @bind="@selMaxRecord" class="form-select" id="maxRecord" title="Selezionare il numero massimo di record da visualizzare">
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
<option value="150">150</option>
|
||||
<option value="200">200</option>
|
||||
<option value="250">250</option>
|
||||
<option value="300">300</option>
|
||||
<option value="350">350</option>
|
||||
<option value="400">400</option>
|
||||
<option value="450">450</option>
|
||||
<option value="500">500</option>
|
||||
<option value="1000">1000</option>
|
||||
<option value="2500">2500</option>
|
||||
<option value="5000">5000</option>
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
@@ -81,7 +75,7 @@
|
||||
</div>
|
||||
}
|
||||
<div class="px-0 py-1">
|
||||
<div class="px-2 input-group" id="basic-addon1">
|
||||
<div class="px-2 input-group">
|
||||
<label class="input-group-text" for="macchina" title="Selezionare la macchina"><i class="fa-solid fa-hard-drive"></i></label>
|
||||
<select @bind="@selMacchina" class="form-select" id="macchina" title="Selezionare la macchina">
|
||||
<option value="*">--- Tutti ---</option>
|
||||
@@ -104,6 +98,15 @@
|
||||
}
|
||||
}
|
||||
</select>
|
||||
@if (dtMax == null)
|
||||
{
|
||||
<button class="btn btn-primary" @onclick="() => setDtMax()"><i class="fa-regular fa-calendar-check"></i></button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text" for="flusso" title="Selezionare il tipo di flusso"><i class="fa-solid fa-sliders"></i></label>
|
||||
<input class="form" @bind="@dtMax" type="datetime-local" title="Data massima eventi da visualizzare">
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MP.SPEC.Data;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MP.SPEC.Components
|
||||
{
|
||||
public partial class ParamsFilter
|
||||
public partial class ParamsFilter : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
@@ -15,7 +16,45 @@ namespace MP.SPEC.Components
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Fields
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Inizializzazione con periodo e arrotondamento
|
||||
/// </summary>
|
||||
/// <param name="minRound"></param>
|
||||
/// <returns></returns>
|
||||
public static DateTime RoundDatetime(int minRound)
|
||||
{
|
||||
TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today);
|
||||
int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound;
|
||||
DateTime endRounded = DateTime.Today.AddMinutes(minDay);
|
||||
return endRounded;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
aTimer.Elapsed -= ElapsedTimer;
|
||||
aTimer.Stop();
|
||||
aTimer.Dispose();
|
||||
}
|
||||
|
||||
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
snapshotDone = false;
|
||||
aTimer.Stop();
|
||||
aTimer.Enabled = false;
|
||||
//reportChange();
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected string lastUpdate
|
||||
{
|
||||
@@ -23,10 +62,6 @@ namespace MP.SPEC.Components
|
||||
set => SelFilter.lastUpdate = value;
|
||||
}
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected bool liveUpdate
|
||||
{
|
||||
get => SelFilter.LiveUpdate;
|
||||
@@ -68,10 +103,7 @@ namespace MP.SPEC.Components
|
||||
|
||||
protected string selMacchina
|
||||
{
|
||||
get
|
||||
{
|
||||
return SelFilter.IdxMacchina;
|
||||
}
|
||||
get => SelFilter.IdxMacchina;
|
||||
set
|
||||
{
|
||||
if (!SelFilter.IdxMacchina.Equals(value))
|
||||
@@ -126,6 +158,13 @@ namespace MP.SPEC.Components
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected async Task navDossier()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
// rimando alla home
|
||||
NavManager.NavigateTo("DOSS", true);
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
SelFilter = new SelectFluxParams();
|
||||
@@ -134,6 +173,41 @@ namespace MP.SPEC.Components
|
||||
await FilterChanged.InvokeAsync(SelFilter);
|
||||
}
|
||||
|
||||
protected void setDtMax()
|
||||
{
|
||||
// copio il filtro
|
||||
var currFilt = SelFilter;
|
||||
// fermo update
|
||||
currFilt.LiveUpdate = false;
|
||||
currFilt.CurrPage = 0;
|
||||
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
currFilt.dtMax = RoundDatetime(5);
|
||||
SelFilter = currFilt;
|
||||
}
|
||||
|
||||
protected void startTimer()
|
||||
{
|
||||
aTimer = new System.Timers.Timer(5000);
|
||||
aTimer.Elapsed += ElapsedTimer;
|
||||
aTimer.Enabled = true;
|
||||
aTimer.Start();
|
||||
}
|
||||
|
||||
protected async Task takeSnapshot()
|
||||
{
|
||||
// indico snapshot fatto
|
||||
snapshotDone = true;
|
||||
startTimer();
|
||||
// fermo udpate
|
||||
liveUpdate = false;
|
||||
// se non ho data rif uso adesso...
|
||||
DateTime dtRif = SelFilter.dtRif == null ? DateTime.Now : (DateTime)SelFilter.dtRif;
|
||||
// aggiungo 2 sec
|
||||
dtRif = dtRif.AddSeconds(1);
|
||||
await MDService.DossiersTakeParamsSnapshot(selMacchina, 10, dtRif);
|
||||
lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
}
|
||||
|
||||
protected void toggleParams()
|
||||
{
|
||||
showEditPar = !showEditPar;
|
||||
@@ -145,31 +219,59 @@ namespace MP.SPEC.Components
|
||||
await Task.Delay(1);
|
||||
if (!liveUpdate)
|
||||
{
|
||||
lastUpdate = $"Last Snapshot: {DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
}
|
||||
else
|
||||
{
|
||||
dtMax = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task takeSnapshot()
|
||||
{
|
||||
// fermo udpate
|
||||
liveUpdate = false;
|
||||
await MDService.DossiersTakeParamsSnapshot(selMacchina, 10);
|
||||
lastUpdate = $"Last Snapshot: {DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static System.Timers.Timer aTimer = new System.Timers.Timer();
|
||||
private List<string>? ListFlux = null;
|
||||
|
||||
private List<string>? ListMacchine = null;
|
||||
|
||||
private bool snapshotDone = false;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private DateTime? dtMax
|
||||
{
|
||||
get => SelFilter.dtMax;
|
||||
set
|
||||
{
|
||||
if (SelFilter.dtMax != value)
|
||||
{
|
||||
// copio il filtro
|
||||
var currFilt = SelFilter;
|
||||
// fermo update
|
||||
currFilt.LiveUpdate = false;
|
||||
currFilt.CurrPage = 0;
|
||||
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
currFilt.dtMax = value;
|
||||
SelFilter = currFilt;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Inject]
|
||||
private NavigationManager NavManager { get; set; } = null!;
|
||||
|
||||
private bool showEditPar { get; set; } = false;
|
||||
|
||||
private string snapMode
|
||||
{
|
||||
get => SelFilter.dtRif == null ? "Realtime Rec" : $"Rec {SelFilter.dtRif:yyyy/MM/dd HH:mm:ss}";
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
@@ -289,6 +289,26 @@ namespace MP.SPEC.Data
|
||||
redisConn.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazione di un dossier
|
||||
/// </summary>
|
||||
/// <param name="selRecord">record dossier da eliminare</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DossiersDeleteRecord(Dossiers selRecord)
|
||||
{
|
||||
bool result = false;
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
result = await dbController.DossiersDeleteRecord(selRecord);
|
||||
// elimino cache redis...
|
||||
RedisValue pattern = new RedisValue($"{redisDossByMac}:*");
|
||||
bool answ = await ExecFlushRedisPattern(pattern);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"DossiersDeleteRecord | IdxMacchina {selRecord.IdxMacchina} | DtRif {selRecord.DtRif} | IdxODL {selRecord.IdxODL} | {ts.TotalMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ultimi n record DOssiers (che contengono ad esempio "salvataggi" di FLuxLog) dato
|
||||
/// macchina (ordinato x data registrazione)
|
||||
@@ -332,14 +352,15 @@ namespace MP.SPEC.Data
|
||||
/// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina">macchina</param>
|
||||
/// <param name="maxSec">NUm massimo secondi per recuperare dati correnti</param>
|
||||
/// <param name="MaxSec">NUm massimo secondi per recuperare dati correnti</param>
|
||||
/// <param name="DtRif">DataOra riferimento x cui prendere valori antecedenti</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DossiersTakeParamsSnapshot(string IdxMacchina, int MaxSec)
|
||||
public async Task<bool> DossiersTakeParamsSnapshot(string IdxMacchina, int MaxSec, DateTime DtRif)
|
||||
{
|
||||
bool answ = false;
|
||||
await Task.Delay(1);
|
||||
// chiamo stored x salvare parametri
|
||||
dbController.DossiersTakeParamsSnapshot(IdxMacchina, MaxSec);
|
||||
dbController.DossiersTakeParamsSnapshot(IdxMacchina, MaxSec, DtRif);
|
||||
// svuoto cache redis x macchina
|
||||
string currKey = $"{redisDossByMac}:{IdxMacchina}";
|
||||
redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1));
|
||||
@@ -374,36 +395,53 @@ namespace MP.SPEC.Data
|
||||
public async Task<bool> FlushRedisCache()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
RedisValue pattern = new RedisValue($"{redisBaseAddr}*");
|
||||
bool answ = await ExecFlushRedisPattern(pattern);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue flush memoria redis dato pattern
|
||||
/// </summary>
|
||||
/// <param name="pattern"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<bool> ExecFlushRedisPattern(RedisValue pattern)
|
||||
{
|
||||
bool answ = false;
|
||||
var listEndpoints = redisConnAdmin.GetEndPoints();
|
||||
var server = redisConnAdmin.GetServer(listEndpoints[0]);
|
||||
RedisValue pattern = new RedisValue($"{redisBaseAddr}*");
|
||||
if (server != null)
|
||||
foreach (var endPoint in listEndpoints)
|
||||
{
|
||||
var keyList = server.Keys(redisDb.Database, pattern);
|
||||
foreach (var item in keyList)
|
||||
//var server = redisConnAdmin.GetServer(listEndpoints[0]);
|
||||
var server = redisConnAdmin.GetServer(endPoint);
|
||||
if (server != null)
|
||||
{
|
||||
await redisDb.KeyDeleteAsync(item);
|
||||
var keyList = server.Keys(redisDb.Database, pattern);
|
||||
foreach (var item in keyList)
|
||||
{
|
||||
await redisDb.KeyDeleteAsync(item);
|
||||
}
|
||||
// brutalmente rimuovo intero contenuto DB... DANGER
|
||||
//await server.FlushDatabaseAsync();
|
||||
answ = true;
|
||||
}
|
||||
// brutalmente rimuovo intero contenuto DB... DANGER
|
||||
//await server.FlushDatabaseAsync();
|
||||
answ = true;
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ultimi n record flux log dato macchina e flusso (ordinato x data registrazione)
|
||||
/// </summary>
|
||||
/// <param name="DtMax">Data massima (recupera eventi antecedenti)</param>
|
||||
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
|
||||
/// <param name="CodFlux">*=tutti, altrimenti solo selezionato</param>
|
||||
/// <param name="MaxRec">numero massimo record da restituire</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<FluxLog>> FluxLogGetLastFilt(string IdxMacchina, string CodFlux, int MaxRec)
|
||||
public async Task<List<FluxLog>> FluxLogGetLastFilt(DateTime DtMax, string IdxMacchina, string CodFlux, int MaxRec)
|
||||
{
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
var results = await Task.FromResult(dbController.FluxLogGetLastFilt(IdxMacchina, CodFlux, MaxRec));
|
||||
var results = await Task.FromResult(dbController.FluxLogGetLastFilt(DtMax, IdxMacchina, CodFlux, MaxRec));
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"FluxLogGetLastFilt | Read from DB: {ts.TotalMilliseconds}ms");
|
||||
|
||||
@@ -11,13 +11,24 @@
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public int CurrPage { get; set; } = 1;
|
||||
|
||||
public DateTime DtRef { get; set; } = InitDatetime(5);
|
||||
|
||||
public string IdxMacchina { get; set; } = "*";
|
||||
|
||||
public int MaxRecord { get; set; } = 100;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Inizializzazione con periodo e arrotondamento
|
||||
/// </summary>
|
||||
/// <param name="minRound"></param>
|
||||
/// <param name="numDayPrev"></param>
|
||||
/// <returns></returns>
|
||||
public static DateTime Init(int minRound)
|
||||
/// Inizializzazione con periodo e arrotondamento
|
||||
/// </summary>
|
||||
/// <param name="minRound"></param>
|
||||
/// <returns></returns>
|
||||
public static DateTime InitDatetime(int minRound)
|
||||
{
|
||||
TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today);
|
||||
int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound;
|
||||
@@ -25,16 +36,6 @@
|
||||
return endRounded;
|
||||
}
|
||||
|
||||
public string IdxMacchina { get; set; } = "*";
|
||||
|
||||
public int MaxRecord { get; set; } = 100;
|
||||
public DateTime DtRef { get; set; } = Init(5);
|
||||
public int CurrPage { get; set; } = 1;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (!(obj is SelectDossierParams item))
|
||||
|
||||
@@ -12,13 +12,15 @@
|
||||
#region Public Properties
|
||||
|
||||
public string CodFlux { get; set; } = "*";
|
||||
public int CurrPage { get; set; } = 1;
|
||||
public DateTime? dtRif { get; set; } = null;
|
||||
public DateTime? dtMax { get; set; } = null;
|
||||
public string IdxMacchina { get; set; } = "*";
|
||||
public string lastUpdate { get; set; } = "-";
|
||||
public bool LiveUpdate { get; set; } = true;
|
||||
|
||||
public int MaxRecord { get; set; } = 100;
|
||||
public int TempoAgg { get; set; } = 2000;
|
||||
public int CurrPage { get; set; } = 1;
|
||||
public string lastUpdate { get; set; } = "-";
|
||||
public int TempoAgg { get; set; } = 10000;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.SPEC</RootNamespace>
|
||||
<Version>6.16.2209.2110</Version>
|
||||
<Version>6.16.2209.2711</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -17,8 +17,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="6.0.6" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="6.0.9" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@using MP.SPEC.Components
|
||||
@using MP.SPEC.Data
|
||||
|
||||
<div class="card">
|
||||
<div class="card mb-5">
|
||||
<div class="card-header table-primary">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-0">
|
||||
@@ -35,7 +35,7 @@
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card mb-5">
|
||||
<div class="card-header bg-primary text-light">Modifica</div>
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace MP.SPEC.Pages
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazione record selezioanto (previa conferma)
|
||||
/// Eliminazione record selezionato (previa conferma)
|
||||
/// </summary>
|
||||
/// <param name="selRec"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@page "/DOSS"
|
||||
|
||||
<div class="card">
|
||||
<div class="card mb-5">
|
||||
<div class="card-header table-primary">
|
||||
<div class="d-flex">
|
||||
<div class="px-0 py-1">
|
||||
@@ -30,7 +30,7 @@
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer py-1">
|
||||
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" totalCount="totalCount" showLoading="isLoading" />
|
||||
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -26,6 +26,12 @@ namespace MP.SPEC.Pages
|
||||
numRecord = newNum;
|
||||
}
|
||||
|
||||
protected void ForceReloadPage(int newNum)
|
||||
{
|
||||
currPage = newNum;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
isLoading = true;
|
||||
|
||||
@@ -8,20 +8,36 @@ namespace MP.SPEC.Pages
|
||||
[IgnoreAntiforgeryToken]
|
||||
public class ErrorModel : PageModel
|
||||
{
|
||||
public string? RequestId { get; set; }
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
|
||||
private readonly ILogger<ErrorModel> _logger;
|
||||
#region Public Constructors
|
||||
|
||||
public ErrorModel(ILogger<ErrorModel> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public string? RequestId { get; set; }
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private readonly ILogger<ErrorModel> _logger;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<PageTitle>Index</PageTitle>
|
||||
|
||||
<div class="card">
|
||||
<div class="card mb-5">
|
||||
<div class="card-header bg-dark text-light">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="p-2">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@page "/ODL"
|
||||
|
||||
<div class="card">
|
||||
<div class="card mb-5">
|
||||
<div class="card-header table-primary">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-1">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@page "/PARAMS"
|
||||
|
||||
<div class="card">
|
||||
<div class="card mb-5">
|
||||
<div class="card-header table-primary">
|
||||
<div class="d-flex">
|
||||
<div class="px-0 py-1">
|
||||
@@ -25,7 +25,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<ListPARAMS SelFilter="@currFilter" TotRecordChanged="@updateTotal"></ListPARAMS>
|
||||
<ListPARAMS SelFilter="@currFilter" TotRecordChanged="@updateTotal" RecordSel="@detailSel"></ListPARAMS>
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer py-1">
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.SPEC.Components;
|
||||
using MP.SPEC.Data;
|
||||
|
||||
@@ -29,8 +30,12 @@ namespace MP.SPEC.Pages
|
||||
protected void ForceReloadPage(int newNum)
|
||||
{
|
||||
currPage = newNum;
|
||||
currFilter.lastUpdate= $"Last Snapshot: {DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
currFilter.LiveUpdate = (currPage == 1);
|
||||
DateTime adesso = DateTime.Now.AddSeconds(1);
|
||||
var updFilter = currFilter;
|
||||
updFilter.LiveUpdate = (currPage == 1);
|
||||
updFilter.lastUpdate = updFilter.LiveUpdate ? "-" : $"{adesso:yyyy/MM/dd HH:mm:ss}";
|
||||
// salvo filtro
|
||||
currFilter = updFilter;
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
@@ -64,13 +69,31 @@ namespace MP.SPEC.Pages
|
||||
totalCount = newTotCount;
|
||||
}
|
||||
|
||||
|
||||
protected async Task detailSel(FluxLog newRec)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
var updFilter = currFilter;
|
||||
DateTime adesso = DateTime.Now.AddSeconds(1);
|
||||
updFilter.LiveUpdate = (newRec == null);
|
||||
// sistemo la data di riferimento x eventuale snapshot nel passato
|
||||
updFilter.dtRif = newRec != null ? newRec.dtEvento : null;
|
||||
if (newRec != null)
|
||||
{
|
||||
updFilter.lastUpdate = updFilter.lastUpdate == "-" ? $"{adesso:yyyy/MM/dd HH:mm:ss}" : updFilter.lastUpdate;
|
||||
updFilter.IdxMacchina = newRec.IdxMacchina;
|
||||
//updFilter.CodFlux = newRec.CodFlux;
|
||||
}
|
||||
else
|
||||
{
|
||||
updFilter.lastUpdate = "-";
|
||||
}
|
||||
// salvo filtro
|
||||
currFilter = updFilter;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private SelectFluxParams currFilter { get; set; } = new SelectFluxParams();
|
||||
@@ -81,8 +104,8 @@ namespace MP.SPEC.Pages
|
||||
set => MsgService.currPage = value;
|
||||
}
|
||||
|
||||
private bool isLoading { get; set; } = true;
|
||||
private bool isFiltering { get; set; } = false;
|
||||
private bool isLoading { get; set; } = true;
|
||||
|
||||
private int numRecord
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@page "/PODL"
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card mb-5">
|
||||
<div class="card-header table-primary">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="col-6">
|
||||
@@ -48,7 +48,7 @@
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card mb-5">
|
||||
<div class="card-header bg-primary text-light">Modifica PODL</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MP.SPEC.Data;
|
||||
using System.Reflection;
|
||||
|
||||
namespace MP.SPEC.Pages
|
||||
{
|
||||
public partial class Utils
|
||||
{
|
||||
[Inject]
|
||||
protected MpDataService MDService { get; set; }
|
||||
#region Public Methods
|
||||
|
||||
public async Task flushCache()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
await MDService.FlushRedisCache();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected MpDataService MDService { get; set; }
|
||||
|
||||
#endregion Protected Properties
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,28 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": true,
|
||||
"anonymousAuthentication": false,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:46815",
|
||||
"sslPort": 44370
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"MP.SPEC": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "https://localhost:7212;http://localhost:5212",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": true,
|
||||
"anonymousAuthentication": false,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:46815",
|
||||
"sslPort": 44370
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"MP.SPEC": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "https://localhost:7212;http://localhost:5212",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2209.2110</h4>
|
||||
<h4>Versione: 6.16.2209.2711</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2209.2110
|
||||
6.16.2209.2711
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2209.2110</version>
|
||||
<version>6.16.2209.2711</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -24,16 +24,16 @@ main {
|
||||
display: flex;*/
|
||||
}
|
||||
|
||||
.top-row ::deep a,
|
||||
.top-row .btn-link {
|
||||
white-space: nowrap;
|
||||
margin-left: 1.5rem;
|
||||
}
|
||||
.top-row ::deep a,
|
||||
.top-row .btn-link {
|
||||
white-space: nowrap;
|
||||
margin-left: 1.5rem;
|
||||
}
|
||||
|
||||
.top-row a:first-child {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.top-row a:first-child {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.bottom-row {
|
||||
color: #dedede;
|
||||
@@ -46,9 +46,11 @@ main {
|
||||
.top-row:not(.auth) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.top-row.auth {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.top-row a,
|
||||
.top-row .btn-link {
|
||||
margin-left: 0;
|
||||
@@ -59,34 +61,40 @@ main {
|
||||
.page {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
width: 15rem;
|
||||
height: 100vh;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.sidebarSmall {
|
||||
width: 5rem;
|
||||
height: 100vh;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.top-row {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.top-row,
|
||||
article {
|
||||
padding-left: 0.5rem !important;
|
||||
padding-right: 0.5rem !important;
|
||||
}
|
||||
|
||||
.bottom-row {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
.main>div {
|
||||
|
||||
.main > div {
|
||||
padding-left: 0.5rem !important;
|
||||
padding-right: 0.5rem !important;
|
||||
/*padding-left: 2rem !important;
|
||||
|
||||
@@ -59,4 +59,4 @@
|
||||
/* Never collapse the sidebar for wide screens */
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>MP.Stats</RootNamespace>
|
||||
<UserSecretsId>826e877c-ba70-4253-84cb-d0b1cafd4440</UserSecretsId>
|
||||
<Version>6.15.2209.1609</Version>
|
||||
<Version>6.16.2209.2211</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -188,9 +188,9 @@
|
||||
<PackageReference Include="ElmahCore" Version="2.1.2" />
|
||||
<PackageReference Include="ElmahCore.Common" Version="2.1.2" />
|
||||
<PackageReference Include="ElmahCore.Sql" Version="2.1.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.7" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.9" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" Version="5.0.0" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" Version="5.1.4" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo statistiche MAPO</i>
|
||||
<h4>Versione: 6.15.2209.1609</h4>
|
||||
<h4>Versione: 6.16.2209.2211</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.15.2209.1609
|
||||
6.16.2209.2211
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.15.2209.1609</version>
|
||||
<version>6.16.2209.2211</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/MP.Stats.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user