diff --git a/GWMS.Data/Controllers/GWMSController.cs b/GWMS.Data/Controllers/GWMSController.cs
index 86e6e76..f8c8ba6 100644
--- a/GWMS.Data/Controllers/GWMSController.cs
+++ b/GWMS.Data/Controllers/GWMSController.cs
@@ -30,6 +30,30 @@ namespace GWMS.Data.Controllers
#region Public Methods
+ ///
+ /// Esegue pulizia allarmi impianto richiesto
+ ///
+ ///
+ ///
+ public int AlarmLogCleanDup(int PlantId)
+ {
+ int numMod = 0;
+ using (GWMSContext localDbCtx = new GWMSContext(_configuration))
+ {
+ try
+ {
+ // eseguo stored
+ string sqlCommand = $"CALL stp_deleteDuplicatedAlarms ({PlantId});";
+ numMod = localDbCtx.Database.ExecuteSqlRaw(sqlCommand);
+ }
+ catch (Exception exc)
+ {
+ Log.Error($"Eccezione in AlarmLogCleanDup{Environment.NewLine}{exc}");
+ }
+ }
+ return numMod;
+ }
+
///
/// Recupero elenco allarmi (ultimi?)
///
diff --git a/GWMS.UI/Data/GWMSDataService.cs b/GWMS.UI/Data/GWMSDataService.cs
index b8ea30c..fe521bc 100644
--- a/GWMS.UI/Data/GWMSDataService.cs
+++ b/GWMS.UI/Data/GWMSDataService.cs
@@ -180,14 +180,24 @@ namespace GWMS.UI.Data
return answ;
}
+ ///
+ /// Esecuzione cleanup + recupero allarmi
+ ///
+ ///
+ ///
+ ///
+ ///
public async Task> AlarmLogGetFilt(int PlantId, int skipRec, int numRec)
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
+ // effettuo pulizia
+ var numClean = dbController.AlarmLogCleanDup(PlantId);
+ // restituisco elenco
var dbResult = dbController.AlarmLogGetFilt(PlantId, skipRec, numRec);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
- Log.Debug($"Effettuata lettura da DB AlarmLogGetFilt: {ts.TotalMilliseconds} ms");
+ Log.Debug($"Effettuato dedup + lettura da DB AlarmLogGetFilt: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
diff --git a/GWMS.UI/GWMS.UI.csproj b/GWMS.UI/GWMS.UI.csproj
index 30786eb..8b80f75 100644
--- a/GWMS.UI/GWMS.UI.csproj
+++ b/GWMS.UI/GWMS.UI.csproj
@@ -2,7 +2,7 @@
net6.0
- 1.0.2509.2211
+ 1.0.2510.1515
95c9f021-52d1-4390-a670-5810b7b777b0
true
true
diff --git a/GWMS.UI/Pages/Orders.razor b/GWMS.UI/Pages/Orders.razor
index 4f2aa1f..21c04b0 100644
--- a/GWMS.UI/Pages/Orders.razor
+++ b/GWMS.UI/Pages/Orders.razor
@@ -3,7 +3,7 @@
@using GWMS.UI.Components
-