From 5fdc6fcf4e61e39890ebb667d8d70e38354f6407 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 11 May 2026 09:13:30 +0200 Subject: [PATCH] Aggiunta preliminare repository x nuove tab statistiche --- .../Repository/Utils/IStatsCodeRepository.cs | 36 +++++++++++++++++++ .../Repository/Utils/IStatsErrRepository.cs | 36 +++++++++++++++++++ MP.IOC/Data/MpDataService.cs | 4 +-- MP.RIOC/MP.RIOC.csproj | 2 +- MP.RIOC/Resources/ChangeLog.html | 2 +- MP.RIOC/Resources/VersNum.txt | 2 +- MP.RIOC/Resources/manifest.xml | 2 +- 7 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 MP.Data/Repository/Utils/IStatsCodeRepository.cs create mode 100644 MP.Data/Repository/Utils/IStatsErrRepository.cs diff --git a/MP.Data/Repository/Utils/IStatsCodeRepository.cs b/MP.Data/Repository/Utils/IStatsCodeRepository.cs new file mode 100644 index 00000000..fb38eed8 --- /dev/null +++ b/MP.Data/Repository/Utils/IStatsCodeRepository.cs @@ -0,0 +1,36 @@ +using EgwCoreLib.Utils; +using MP.Data.DbModels.Utils; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace MP.Data.Repository.Utils +{ + /// + /// Gestione statistica StatusCode HTML + /// + public interface IStatsCodeRepository + { + /// + /// Recupera l'elenco delle statistiche StatusCode per un periodo specifico. + /// + /// La data di inizio del periodo. + /// La data di fine del periodo. + /// L'elenco delle statistiche aggregate ordinate cronologicamente. + Task> GetFiltAsync(DateTime dtStart, DateTime dtEnd); + + /// + /// Recupera l'intervallo temporale disponibile nel database per le statistiche StatusCode. + /// + /// L'intervallo di date (minima e massima ora presente). + Task GetRangeAsync(); + + /// + /// Inserisce o aggiorna in blocco le statistiche StatusCode nel database. + /// + /// L'elenco dei record da inserire. + /// Se true, elimina preventivamente i record nel periodo richiesto. + /// Il numero di record inseriti. + Task UpsertManyAsync(List listRecords, bool removeOld); + } +} diff --git a/MP.Data/Repository/Utils/IStatsErrRepository.cs b/MP.Data/Repository/Utils/IStatsErrRepository.cs new file mode 100644 index 00000000..fdd704ec --- /dev/null +++ b/MP.Data/Repository/Utils/IStatsErrRepository.cs @@ -0,0 +1,36 @@ +using EgwCoreLib.Utils; +using MP.Data.DbModels.Utils; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace MP.Data.Repository.Utils +{ + /// + /// Gestione statistiche errori + /// + public interface IStatsErrRepository + { + /// + /// Recupera l'elenco delle statistiche errori per un periodo specifico. + /// + /// La data di inizio del periodo. + /// La data di fine del periodo. + /// L'elenco delle statistiche errori ordinate cronologicamente. + Task> GetFiltAsync(DateTime dtStart, DateTime dtEnd); + + /// + /// Recupera l'intervallo temporale disponibile nel database per le statistiche errore. + /// + /// L'intervallo di date (minima e massima ora presente). + Task GetRangeAsync(); + + /// + /// Inserisce o aggiorna in blocco le statistiche errore nel database. + /// + /// L'elenco dei record da inserire. + /// Se true, elimina preventivamente i record nel periodo richiesto. + /// Il numero di record inseriti. + Task UpsertManyAsync(List listRecords, bool removeOld); + } +} diff --git a/MP.IOC/Data/MpDataService.cs b/MP.IOC/Data/MpDataService.cs index abce85b4..922965f3 100644 --- a/MP.IOC/Data/MpDataService.cs +++ b/MP.IOC/Data/MpDataService.cs @@ -4054,7 +4054,7 @@ namespace MP.IOC.Data { Log.Info($"upsertCurrObjItems | idxMacchina: {idxMacchina} | {innovations.Count} innovations"); // leggo i valori attuali... - List actValues = MachineParamList(idxMacchina); + List actValues = await MachineParamListAsync(idxMacchina); // per ogni valOut passatomi faccio insert o update rispetto elenco valori correnti in REDIS foreach (var item in actValues) { @@ -4078,7 +4078,7 @@ namespace MP.IOC.Data string serVal = JsonConvert.SerializeObject(innovations); var currKey = Utils.RedKeyCurrObjItems(idxMacchina, MpIoNS); - RedisValue rawData = redisDb.StringSet(currKey, serVal); + RedisValue rawData = await redisDb.StringSetAsync(currKey, serVal); } return answ; } diff --git a/MP.RIOC/MP.RIOC.csproj b/MP.RIOC/MP.RIOC.csproj index be311fc5..e8d5f3d0 100644 --- a/MP.RIOC/MP.RIOC.csproj +++ b/MP.RIOC/MP.RIOC.csproj @@ -5,7 +5,7 @@ enable enable MP.RIOC - 8.16.2605.1108 + 8.16.2605.1109 diff --git a/MP.RIOC/Resources/ChangeLog.html b/MP.RIOC/Resources/ChangeLog.html index 5979f6aa..4380d8ab 100644 --- a/MP.RIOC/Resources/ChangeLog.html +++ b/MP.RIOC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MP-RIOC -

Versione: 8.16.2605.1108

+

Versione: 8.16.2605.1109


Note di rilascio:
  • diff --git a/MP.RIOC/Resources/VersNum.txt b/MP.RIOC/Resources/VersNum.txt index d02d4ce2..76353e18 100644 --- a/MP.RIOC/Resources/VersNum.txt +++ b/MP.RIOC/Resources/VersNum.txt @@ -1 +1 @@ -8.16.2605.1108 +8.16.2605.1109 diff --git a/MP.RIOC/Resources/manifest.xml b/MP.RIOC/Resources/manifest.xml index a8c220af..09de1267 100644 --- a/MP.RIOC/Resources/manifest.xml +++ b/MP.RIOC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 8.16.2605.1108 + 8.16.2605.1109 https://nexus.steamware.net/repository/SWS/MP-RIOC/stable/LAST/MP.RIOC.zip https://nexus.steamware.net/repository/SWS/MP-RIOC/stable/LAST/ChangeLog.html false