diff --git a/MP.Data/Services/TabDataService.cs b/MP.Data/Services/TabDataService.cs
index f16614b2..2b6f631d 100644
--- a/MP.Data/Services/TabDataService.cs
+++ b/MP.Data/Services/TabDataService.cs
@@ -3417,7 +3417,7 @@ namespace MP.Data.Services
result = new StatoMacchineModel();
}
sw.Stop();
- Log.Debug($"StatoMacchina | {source} | {sw.Elapsed.TotalMilliseconds}ms");
+ Log.Debug($"StatoMacchinaAsync | {source} | {sw.Elapsed.TotalMilliseconds}ms");
return result;
}
diff --git a/MP.SPEC/Components/DossiersFilter.razor b/MP.SPEC/Components/DossiersFilter.razor
index 4c5528a4..93ef3275 100644
--- a/MP.SPEC/Components/DossiersFilter.razor
+++ b/MP.SPEC/Components/DossiersFilter.razor
@@ -5,13 +5,13 @@
@**@
@if (selMacchina != "*")
- {
-
- }
- @if (selArticolo != "*")
- {
-
- }
+ {
+
+ }
+ @if (selArticolo != "*")
+ {
+
+ }
}
@@ -34,7 +34,7 @@
-
-
+
@if (ListMacchine != null)
{
@@ -67,14 +67,14 @@
-
+
-
+
@@ -82,7 +82,7 @@
-
+
diff --git a/MP.SPEC/Components/DossiersFilter.razor.cs b/MP.SPEC/Components/DossiersFilter.razor.cs
index 3f4f0d11..a061c8c7 100644
--- a/MP.SPEC/Components/DossiersFilter.razor.cs
+++ b/MP.SPEC/Components/DossiersFilter.razor.cs
@@ -30,26 +30,11 @@ namespace MP.SPEC.Components
{
if (!SelFilterDossier.CodArticolo.Equals(value))
{
- SelFilterDossier.CurrPage = 1;
SelFilterDossier.CodArticolo = value;
- StateHasChanged();
- Task.Delay(1);
- reportChange();
}
}
}
- private bool filtActive
- {
- get => selMacchina != "*" || selArticolo != "*";
- }
- protected void resetMacchina()
- {
- selMacchina = "*";
- }
- protected void resetArticolo()
- {
- selArticolo = "*";
- }
+
protected DateTime selDtMax
{
get
@@ -62,7 +47,6 @@ namespace MP.SPEC.Components
if (!SelFilterDossier.DtEnd.Equals(value))
{
SelFilterDossier.DtEnd = value;
- reportChange();
}
}
}
@@ -79,7 +63,6 @@ namespace MP.SPEC.Components
if (!SelFilterDossier.DtStart.Equals(value))
{
SelFilterDossier.DtStart = value;
- reportChange();
}
}
}
@@ -94,11 +77,7 @@ namespace MP.SPEC.Components
{
if (!SelFilterDossier.IdxMacchina.Equals(value))
{
- SelFilterDossier.CurrPage = 1;
SelFilterDossier.IdxMacchina = value;
- StateHasChanged();
- Task.Delay(1);
- reportChange();
}
}
}
@@ -115,7 +94,6 @@ namespace MP.SPEC.Components
if (!SelFilterDossier.MaxRecord.Equals(value))
{
SelFilterDossier.MaxRecord = value;
- reportChange();
}
}
}
@@ -128,8 +106,6 @@ namespace MP.SPEC.Components
protected override async Task OnInitializedAsync()
{
- SelFilterDossier = new SelectDossierParams();
- SelFilterDossier.MaxRecord = 1000;
DateTime dtEnd = SelFilterDossier.DtEnd;
DateTime dtStart = dtEnd.Subtract(SelFilterDossier.DtStart).TotalDays < 15 ? SelFilterDossier.DtStart : dtEnd.AddDays(-14);
ListMacchine = await MDService.MacchineWithFluxAsync(dtStart, dtEnd);
@@ -137,6 +113,16 @@ namespace MP.SPEC.Components
await FilterChanged.InvokeAsync(SelFilterDossier);
}
+ protected void resetArticolo()
+ {
+ selArticolo = "*";
+ }
+
+ protected void resetMacchina()
+ {
+ selMacchina = "*";
+ }
+
protected void toggleParams()
{
showEditPar = !showEditPar;
@@ -147,21 +133,28 @@ namespace MP.SPEC.Components
#region Private Fields
private List? ListArticoli = null;
+
private List? ListMacchine = null;
#endregion Private Fields
#region Private Properties
+ private bool filtActive
+ {
+ get => selMacchina != "*" || selArticolo != "*";
+ }
+
private bool showEditPar { get; set; } = false;
#endregion Private Properties
#region Private Methods
- private void reportChange()
+ private Task ReportChangeAsync()
{
- FilterChanged.InvokeAsync(SelFilterDossier);
+ SelFilterDossier.CurrPage = 1;
+ return FilterChanged.InvokeAsync(SelFilterDossier);
}
private void toggleShowParams()
diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs
index dac1a05d..55e93867 100644
--- a/MP.SPEC/Components/ListODL.razor.cs
+++ b/MP.SPEC/Components/ListODL.razor.cs
@@ -398,6 +398,9 @@ namespace MP.SPEC.Components
_podlLocalCache.Clear();
if (SearchRecords != null)
{
+ var listIdx = SearchRecords.Select(x => x.IdxOdl).ToList();
+ _podlLocalCache = await MDService.PODL_getDictOdlPodl(listIdx);
+#if false
// 1. Popolo la cache locale in parallelo sfruttando la velocità di FusionCache
var tasks = SearchRecords.Select(async odl =>
{
@@ -413,7 +416,8 @@ namespace MP.SPEC.Components
var infoSalvate = await Task.WhenAll(tasks);
// 2. Trasformazione dei risultati in un dizionario per l'accesso immediato (O(1)) nell'HTML
- _podlLocalCache = infoSalvate.ToDictionary(x => x.IdxOdl, x => x.podl);
+ _podlLocalCache = infoSalvate.ToDictionary(x => x.IdxOdl, x => x.podl);
+#endif
}
}
diff --git a/MP.SPEC/Components/ParamsFilter.razor.cs b/MP.SPEC/Components/ParamsFilter.razor.cs
index f2507145..ad7246bb 100644
--- a/MP.SPEC/Components/ParamsFilter.razor.cs
+++ b/MP.SPEC/Components/ParamsFilter.razor.cs
@@ -109,7 +109,7 @@ namespace MP.SPEC.Components
SelFilter.CurrPage = 1;
SelFilter.IdxMacchina = value;
SelFilter.CodFlux = "*";
- ListFlux = MDService.ParametriGetFilt(selMacchina).Result;
+ ListFlux = MDService.ParametriGetFiltAsync(selMacchina).Result;
StateHasChanged();
Task.Delay(1);
reportChange();
@@ -182,7 +182,7 @@ namespace MP.SPEC.Components
DateTime dtStart = SelFilter.dtMin != null ? (DateTime)SelFilter.dtMin : DateTime.Now.AddMonths(-1);
DateTime dtEnd = SelFilter.dtMax != null ? (DateTime)SelFilter.dtMax : DateTime.Today.AddDays(1);
ListMacchine = await MDService.MacchineWithFluxAsync(dtStart, dtEnd);
- ListFlux = await MDService.ParametriGetFilt(selMacchina);
+ ListFlux = await MDService.ParametriGetFiltAsync(selMacchina);
var configData = await MDService.ConfigGetAllAsync();
var currRec = configData.FirstOrDefault(x => x.Chiave == "numOreAnticipoSnapshot");
diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs
index 844322fd..01c92078 100644
--- a/MP.SPEC/Data/MpDataService.cs
+++ b/MP.SPEC/Data/MpDataService.cs
@@ -28,6 +28,7 @@ namespace MP.SPEC.Data
_cache = cache;
// Verifica conf trace...
traceEnabled = _configuration.GetValue("Otel:EnableTracing", false);
+ slowLogThresh = _configuration.GetValue("ServerConf:slowLogThresh", 1);
Log.Info($"MpDataService | INIT | Trace enabled: {traceEnabled}");
// setup compoenti REDIS
@@ -389,7 +390,10 @@ namespace MP.SPEC.Data
}
activity?.SetTag("data.source", source);
activity?.Stop();
- LogTrace($"ArticoloDelEnabled | Cod: {codArticolo} | {source} | {activity?.Duration.TotalMilliseconds}ms");
+ if (activity?.Duration.TotalMilliseconds > slowLogThresh)
+ {
+ LogTrace($"ArticoloDelEnabled | Cod: {codArticolo} | {source} | {activity?.Duration.TotalMilliseconds}ms");
+ }
return !usato;
}
@@ -480,8 +484,10 @@ namespace MP.SPEC.Data
activity?.SetTag("data.source", source);
activity?.Stop();
-
- LogTrace($"ConfigTryGet Read from {source}: {activity?.Duration.TotalMilliseconds}ms");
+ if (activity?.Duration.TotalMilliseconds > slowLogThresh)
+ {
+ LogTrace($"ConfigTryGet | {keyName} | {source} | {activity?.Duration.TotalMilliseconds}ms");
+ }
return value ?? "";
}
@@ -501,8 +507,10 @@ namespace MP.SPEC.Data
activity?.SetTag("data.source", source);
activity?.Stop();
-
- LogTrace($"ConfigTryGetAsync | {keyName} | {source} | {activity?.Duration.TotalMilliseconds}ms");
+ if (activity?.Duration.TotalMilliseconds > slowLogThresh)
+ {
+ LogTrace($"ConfigTryGetAsync | {keyName} | {source} | {activity?.Duration.TotalMilliseconds}ms");
+ }
return value ?? "";
}
@@ -1754,35 +1762,16 @@ namespace MP.SPEC.Data
///
///