@@ -99,7 +99,7 @@ else
@record.IdxMacchina
- @record.MachineNav.Descrizione
+ @record.Nome
|
N° pezzi: @record.NumPezzi
diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs
index 7e776432..63a6533b 100644
--- a/MP.SPEC/Components/ListODL.razor.cs
+++ b/MP.SPEC/Components/ListODL.razor.cs
@@ -162,7 +162,7 @@ namespace MP.SPEC.Components
await reloadData();
}
- protected async Task selectStatRecord(ODLModel? currRec)
+ protected async Task selectStatRecord(ODLExpModel? currRec)
{
showStats = true;
await Task.Delay(1);
@@ -178,7 +178,7 @@ namespace MP.SPEC.Components
}
}
- protected async Task selRecord(ODLModel? currRec)
+ protected async Task selRecord(ODLExpModel? currRec)
{
await Task.Delay(1);
selDtFine = DateTime.Now;
@@ -210,19 +210,19 @@ namespace MP.SPEC.Components
private static Logger Log = LogManager.GetCurrentClassLogger();
- private ODLModel? currRecord = null;
+ private ODLExpModel? currRecord = null;
private List? ListOdlStats;
private List? ListOdlStatsNetto;
- private List? ListRecords;
+ private List? ListRecords;
private List? ListStati;
- private List? SearchRecords;
+ private List? SearchRecords;
- private ODLModel? statRecord = null;
+ private ODLExpModel? statRecord = null;
#endregion Private Fields
@@ -409,7 +409,7 @@ namespace MP.SPEC.Components
private async Task reloadData()
{
isLoading = true;
- SearchRecords = await MDService.ListODLFilt(currFilter.IsActive, currFilter.SearchVal, currFilter.CodStato, currFilter.IdxMacchina, currFilter.DtStart, currFilter.DtEnd);
+ SearchRecords = await MDService.ListODLFilt(currFilter.IsActive, currFilter.SearchVal, currFilter.CodStato, currFilter.CodReparto, currFilter.IdxMacchina, currFilter.DtStart, currFilter.DtEnd);
totalCount = SearchRecords.Count;
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
await Task.Delay(1);
@@ -417,7 +417,7 @@ namespace MP.SPEC.Components
isLoading = false;
}
- private async Task reloadStatsData(ODLModel? currRec)
+ private async Task reloadStatsData(ODLExpModel? currRec)
{
showStats = true;
if (currRec != null)
diff --git a/MP.SPEC/Components/SelFilterXDL.razor.cs b/MP.SPEC/Components/SelFilterXDL.razor.cs
index c48621e8..3cfd8408 100644
--- a/MP.SPEC/Components/SelFilterXDL.razor.cs
+++ b/MP.SPEC/Components/SelFilterXDL.razor.cs
@@ -11,6 +11,9 @@ namespace MP.SPEC.Components
[Parameter]
public SelectOdlParams currFilter { get; set; } = new SelectOdlParams();
+ [Parameter]
+ public EventCallback FilterChanged { get; set; }
+
[Parameter]
public List? ListGruppiFase { get; set; } = null;
@@ -18,7 +21,7 @@ namespace MP.SPEC.Components
public List? ListMacchine { get; set; } = null;
[Parameter]
- public List? ListStati { get; set; } = null;
+ public List? ListStati { get; set; } = null;
#endregion Public Properties
@@ -27,7 +30,6 @@ namespace MP.SPEC.Components
protected bool isActive
{
get => currFilter.IsActive;
- set => currFilter.IsActive = value;
}
protected DateTime selDtEnd
@@ -38,6 +40,8 @@ namespace MP.SPEC.Components
if (currFilter.DtEnd != value)
{
currFilter.DtEnd = value;
+ Task.Delay(1);
+ reportChange();
}
}
}
@@ -50,6 +54,8 @@ namespace MP.SPEC.Components
if (currFilter.DtStart != value)
{
currFilter.DtStart = value;
+ Task.Delay(1);
+ reportChange();
}
}
}
@@ -61,20 +67,54 @@ namespace MP.SPEC.Components
private string selMacchina
{
get => currFilter.IdxMacchina;
- set => currFilter.IdxMacchina = value;
+ set
+ {
+ if (currFilter.IdxMacchina != value)
+ {
+ currFilter.IdxMacchina = value;
+ Task.Delay(1);
+ reportChange();
+ }
+ }
}
private string selReparto
{
get => currFilter.CodReparto;
- set => currFilter.CodReparto = value;
+ set
+ {
+ if (currFilter.CodReparto != value)
+ {
+ currFilter.CodReparto = value;
+ Task.Delay(1);
+ reportChange();
+ }
+ }
}
+
private string selStato
{
get => currFilter.CodStato;
- set => currFilter.CodStato = value;
+ set
+ {
+ if (currFilter.CodStato != value)
+ {
+ currFilter.CodStato = value;
+ Task.Delay(1);
+ reportChange();
+ }
+ }
}
#endregion Private Properties
+
+ #region Private Methods
+
+ private void reportChange()
+ {
+ FilterChanged.InvokeAsync(currFilter);
+ }
+
+ #endregion Private Methods
}
}
\ No newline at end of file
diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs
index 366df473..99265065 100644
--- a/MP.SPEC/Data/MpDataService.cs
+++ b/MP.SPEC/Data/MpDataService.cs
@@ -651,11 +651,43 @@ namespace MP.SPEC.Data
/// Stato ODL: true=in corso/completato
/// Cod articolo
/// KeyRich (parziale) da cercare (es cod stato x yacht)
- /// id macchina da cercare
+ /// Reparto selezionato
+ /// Macchina selezionata
+ /// Data inizio
+ /// Data fine
///
- public async Task> ListODLFilt(bool inCorso, string codArt, string keyRichPart, string IdxMacchina, DateTime startDate, DateTime endDate)
+ public async Task> ListODLFilt(bool inCorso, string codArt, string keyRichPart, string Reparto, string IdxMacchina, DateTime startDate, DateTime endDate)
{
- return await Task.FromResult(dbController.ListODLFilt(inCorso, codArt, keyRichPart, IdxMacchina, startDate, endDate));
+ List? result = new List();
+ Stopwatch stopWatch = new Stopwatch();
+ stopWatch.Start();
+ string readType = "DB";
+ string currKey = $"{redisOdlList}:{inCorso}:{codArt}:{keyRichPart}:{Reparto}:{IdxMacchina}:{startDate:yyyyMMdd_HHmmss}:{endDate:yyyyMMdd_HHmmss}";
+ // cerco in redis dato valore sel macchina...
+ RedisValue rawData = redisDb.StringGet(currKey);
+ if (rawData.HasValue)
+ {
+ result = JsonConvert.DeserializeObject>($"{rawData}");
+ readType = "REDIS";
+ }
+ else
+ {
+ result = await Task.FromResult(dbController.ListODLFilt(inCorso, codArt, keyRichPart, Reparto, IdxMacchina, startDate, endDate));
+ // serializzo e salvo...
+ rawData = JsonConvert.SerializeObject(result);
+ redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisShortTimeCache));
+ }
+ if (result == null)
+ {
+ result = new List();
+ }
+ stopWatch.Stop();
+ TimeSpan ts = stopWatch.Elapsed;
+ Log.Debug($"ListODLFilt | Read from {readType}: {ts.TotalMilliseconds}ms");
+ return result;
+
+
+ //return await Task.FromResult(dbController.ListODLFilt(inCorso, codArt, keyRichPart, Reparto, IdxMacchina, startDate, endDate));
}
///
@@ -683,7 +715,7 @@ namespace MP.SPEC.Data
result = await Task.FromResult(dbController.ListPODLFilt(codArt, keyRichPart));
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
- redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(3));
+ redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisShortTimeCache));
}
if (result == null)
{
@@ -961,7 +993,7 @@ namespace MP.SPEC.Data
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
- Log.Debug($"PODL_getByKey | Read from {readType}: {ts.TotalMilliseconds}ms");
+ Log.Trace($"PODL_getByKey | Read from {readType}: {ts.TotalMilliseconds}ms");
}
else
{
@@ -1004,7 +1036,7 @@ namespace MP.SPEC.Data
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
- Log.Debug($"PODL_getByOdl | Read from {readType}: {ts.TotalMilliseconds}ms");
+ Log.Trace($"PODL_getByOdl | Read from {readType}: {ts.TotalMilliseconds}ms");
}
else
{
@@ -1200,6 +1232,7 @@ namespace MP.SPEC.Data
private const string redisMacList = redisBaseAddr + "SPEC:Cache:MacList";
private const string redisOdlCurrByMac = redisBaseAddr + "SPEC:Cache:OdlByMac";
+ private const string redisOdlList = redisBaseAddr + "SPEC:Cache:OdlList";
private const string redisPOdlByOdl = redisBaseAddr + "SPEC:Cache:POdlByOdl";
private const string redisPOdlByPOdl = redisBaseAddr + "SPEC:Cache:POdlByPOdl";
@@ -1238,6 +1271,7 @@ namespace MP.SPEC.Data
private IDatabase redisDb = null!;
private int redisLongTimeCache = 5;
+ private int redisShortTimeCache = 4;
#endregion Private Fields
diff --git a/MP.SPEC/Data/SelectOdlParams.cs b/MP.SPEC/Data/SelectOdlParams.cs
index 89742f21..522eba5b 100644
--- a/MP.SPEC/Data/SelectOdlParams.cs
+++ b/MP.SPEC/Data/SelectOdlParams.cs
@@ -13,17 +13,17 @@ namespace MP.SPEC.Data
#region Public Properties
+ public bool IsActive { get; set; } = true;
public string CodReparto { get; set; } = "*";
public string CodStato { get; set; } = "*";
public string IdxMacchina { get; set; } = "*";
- public int CurrPage { get; set; } = 1;
- public int NumRec { get; set; } = 10;
- public int TotCount { get; set; } = 0;
- public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5);
- public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-10);
public int MaxRecord { get; set; } = 100;
- public bool IsActive { get; set; } = true;
+ public int NumRec { get; set; } = 10;
+ public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-10);
+ public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5);
+ public int CurrPage { get; set; } = 1;
public string SearchVal { get; set; } = "*";
+ public int TotCount { get; set; } = 0;
#endregion Public Properties
@@ -37,6 +37,9 @@ namespace MP.SPEC.Data
if (IsActive != item.IsActive)
return false;
+ if (CodReparto != item.CodReparto)
+ return false;
+
if (CodStato != item.CodStato)
return false;
diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj
index 21a97290..4acf7c6b 100644
--- a/MP.SPEC/MP.SPEC.csproj
+++ b/MP.SPEC/MP.SPEC.csproj
@@ -5,7 +5,7 @@
enable
enable
MP.SPEC
- 6.16.2211.2411
+ 6.16.2211.2415
diff --git a/MP.SPEC/NLog.config b/MP.SPEC/NLog.config
index b32ba10a..3e4185f4 100644
--- a/MP.SPEC/NLog.config
+++ b/MP.SPEC/NLog.config
@@ -39,7 +39,7 @@
Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f"
-->
-
+
diff --git a/MP.SPEC/Pages/ODL.razor b/MP.SPEC/Pages/ODL.razor
index a32fd4ae..406a3ea0 100644
--- a/MP.SPEC/Pages/ODL.razor
+++ b/MP.SPEC/Pages/ODL.razor
@@ -41,7 +41,7 @@
-
+
@*
|