|
-
+
+
|
@record.CodArticolo
+ @record.ArticoloNav.DescArticolo
|
@tradFase(record.KeyRichiesta) |
@record.IdxMacchina
+ @record.MachineNav.Descrizione
|
@record.NumPezzi
@@ -49,6 +53,16 @@ else
@record.Tcassegnato.ToString("N3")
|
@record.Note |
+
+ @if (@record.Attivabile)
+ {
+
+ }
+ else
+ {
+
+ }
+ |
@if (POdlDelEnabled(record.IdxOdl))
{
diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs
index 6e3d1422..8b69b7a0 100644
--- a/MP.SPEC/Components/ListPODL.razor.cs
+++ b/MP.SPEC/Components/ListPODL.razor.cs
@@ -15,18 +15,21 @@ namespace MP.SPEC.Components
[Parameter]
public EventCallback RecordSel { get; set; }
+ [Parameter]
+ public EventCallback updateRecordCount { get; set; }
+
#endregion Public Properties
#region Public Methods
- public string checkSelect(string CodArticolo)
+ public string checkSelect(PODLModel record)
{
string answ = "";
if (currRecord != null)
{
try
{
- answ = (currRecord.CodArticolo == CodArticolo) ? "table-info" : "";
+ answ = ((currRecord.IdxMacchina == record.IdxMacchina) && (currRecord.CodArticolo == record.CodArticolo) && (currRecord.CodFase == record.CodFase)) ? "table-info" : "";
}
catch
{ }
@@ -51,6 +54,32 @@ namespace MP.SPEC.Components
#region Protected Methods
+ protected async Task cloneRecord(PODLModel selRec)
+ {
+ // creo record duplicato...
+ PODLModel newRec = new PODLModel()
+ {
+ Attivabile = selRec.Attivabile,
+ CodArticolo = selRec.CodArticolo,
+ CodCli = selRec.CodCli,
+ CodGruppo = selRec.CodGruppo,
+ DueDate = selRec.DueDate,
+ IdxMacchina = selRec.IdxMacchina,
+ IdxOdl = selRec.IdxOdl,
+ IdxPromessa = 0,
+ InsertDate = selRec.InsertDate,
+ KeyBCode = selRec.KeyBCode,
+ KeyRichiesta = selRec.KeyRichiesta,
+ Note = $"DUPLICATED - {selRec.Note}",
+ NumPezzi = selRec.NumPezzi,
+ Priorita = selRec.Priorita,
+ PzPallet = selRec.PzPallet,
+ Tcassegnato = selRec.Tcassegnato
+ };
+ currRecord = selRec;
+ await RecordSel.InvokeAsync(newRec);
+ }
+
///
/// Eliminazione record selezionato (previa conferma)
///
@@ -73,6 +102,10 @@ namespace MP.SPEC.Components
MsgService.EA_SearchUpdated += OnSeachUpdated;
MsgService.EA_StatoSearch += MsgService_EA_StatoSearch;
ListStati = await MDService.AnagStatiComm();
+ }
+
+ protected override async Task OnParametersSetAsync()
+ {
await reloadData();
}
@@ -94,11 +127,13 @@ namespace MP.SPEC.Components
protected async Task resetSel()
{
+ currRecord = null;
await RecordSel.InvokeAsync(null);
}
protected async Task selRecord(PODLModel selRec)
{
+ currRecord = selRec;
await RecordSel.InvokeAsync(selRec);
}
@@ -148,11 +183,7 @@ namespace MP.SPEC.Components
set => MsgService.StateSel = value;
}
- private int totalCount
- {
- get => MsgService.totalCount;
- set => MsgService.totalCount = value;
- }
+ private int totalCount { get; set; } = 0;
#endregion Private Properties
@@ -182,6 +213,7 @@ namespace MP.SPEC.Components
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
+ await updateRecordCount.InvokeAsync(totalCount);
isLoading = false;
}
diff --git a/MP.SPEC/Components/ParamsFilter.razor b/MP.SPEC/Components/ParamsFilter.razor
index 7642a4c3..1be0c622 100644
--- a/MP.SPEC/Components/ParamsFilter.razor
+++ b/MP.SPEC/Components/ParamsFilter.razor
@@ -98,14 +98,16 @@
}
}
- @if (dtMax == null)
+ @if (selDtMax == null)
{
}
else
{
-
-
+
+
+
+
}
diff --git a/MP.SPEC/Components/ParamsFilter.razor.cs b/MP.SPEC/Components/ParamsFilter.razor.cs
index 454b7827..9930b251 100644
--- a/MP.SPEC/Components/ParamsFilter.razor.cs
+++ b/MP.SPEC/Components/ParamsFilter.razor.cs
@@ -1,6 +1,5 @@
using Microsoft.AspNetCore.Components;
using MP.SPEC.Data;
-using System.Runtime.CompilerServices;
namespace MP.SPEC.Components
{
@@ -170,6 +169,14 @@ namespace MP.SPEC.Components
SelFilter = new SelectFluxParams();
ListMacchine = await MDService.MacchineWithFlux();
ListFlux = await MDService.ParametriGetFilt(selMacchina);
+
+ var configData = await MDService.ConfigGetAll();
+ var currRec = configData.FirstOrDefault(x => x.Chiave == "numOreAnticipoSnapshot");
+ if (currRec != null)
+ {
+ int.TryParse(currRec.Valore, out numOreAnticipoSnapshot);
+ }
+
await FilterChanged.InvokeAsync(SelFilter);
}
@@ -182,6 +189,7 @@ namespace MP.SPEC.Components
currFilt.CurrPage = 0;
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
currFilt.dtMax = RoundDatetime(5);
+ currFilt.dtMin = RoundDatetime(5).AddHours(-numOreAnticipoSnapshot);
SelFilter = currFilt;
}
@@ -195,22 +203,25 @@ namespace MP.SPEC.Components
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;
+ DateTime dtMax = selDtMax == null ? RoundDatetime(5) : (DateTime)selDtMax;
+ DateTime dtMin = selDtMin == null ? RoundDatetime(5).AddHours(-numOreAnticipoSnapshot) : (DateTime)selDtMin;
// aggiungo 2 sec
- dtRif = dtRif.AddSeconds(1);
- await MDService.DossiersTakeParamsSnapshot(selMacchina, 10, dtRif);
+ dtMax = dtMax.AddSeconds(15);
+ //dtMin = dtMin.AddMinutes(-30);
+ await MDService.DossiersTakeParamsSnapshotLast(selMacchina, dtMin, dtMax);
lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
+ // indico snapshot fatto
+ snapshotDone = true;
+ startTimer();
}
protected void toggleParams()
{
showEditPar = !showEditPar;
+ selDtMax = null;
}
protected async Task toggleUpdate()
@@ -223,7 +234,7 @@ namespace MP.SPEC.Components
}
else
{
- dtMax = null;
+ selDtMax = null;
}
}
@@ -233,16 +244,18 @@ namespace MP.SPEC.Components
private static System.Timers.Timer aTimer = new System.Timers.Timer();
private List? ListFlux = null;
-
private List? ListMacchine = null;
-
+ private int numOreAnticipoSnapshot = 5;
private bool snapshotDone = false;
#endregion Private Fields
#region Private Properties
- private DateTime? dtMax
+ [Inject]
+ private NavigationManager NavManager { get; set; } = null!;
+
+ private DateTime? selDtMax
{
get => SelFilter.dtMax;
set
@@ -262,8 +275,25 @@ namespace MP.SPEC.Components
}
}
- [Inject]
- private NavigationManager NavManager { get; set; } = null!;
+ private DateTime? selDtMin
+ {
+ get => SelFilter.dtMin;
+ set
+ {
+ if (SelFilter.dtMin != 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.dtMin = value;
+ SelFilter = currFilt;
+ reportChange();
+ }
+ }
+ }
private bool showEditPar { get; set; } = false;
diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs
index 9a4724e4..4f996326 100644
--- a/MP.SPEC/Data/MpDataService.cs
+++ b/MP.SPEC/Data/MpDataService.cs
@@ -369,6 +369,27 @@ namespace MP.SPEC.Data
return answ;
}
+ ///
+ /// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis
+ ///
+ /// macchina
+ /// NUm massimo secondi per recuperare dati correnti
+ /// DataOra riferimento x cui prendere valori antecedenti
+ ///
+ public async Task DossiersTakeParamsSnapshotLast(string IdxMacchina, DateTime dtMin, DateTime dtMax)
+ {
+ bool answ = false;
+ await Task.Delay(1);
+ // chiamo stored x salvare parametri
+ dbController.DossiersTakeParamsSnapshotLast(IdxMacchina, dtMin, dtMax);
+ // svuoto cache redis x macchina
+ string currKey = $"{redisDossByMac}:{IdxMacchina}";
+ redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1));
+ currKey = $"{redisDossByMac}:*";
+ redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1));
+ return answ;
+ }
+
///
/// Restitusice elenco aziende
///
@@ -400,35 +421,6 @@ namespace MP.SPEC.Data
return answ;
}
- ///
- /// Esegue flush memoria redis dato pattern
- ///
- ///
- ///
- private async Task ExecFlushRedisPattern(RedisValue pattern)
- {
- bool answ = false;
- var listEndpoints = redisConnAdmin.GetEndPoints();
- foreach (var endPoint in listEndpoints)
- {
- //var server = redisConnAdmin.GetServer(listEndpoints[0]);
- var server = redisConnAdmin.GetServer(endPoint);
- if (server != null)
- {
- 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;
- }
- }
-
- return answ;
- }
-
///
/// Elenco ultimi n record flux log dato macchina e flusso (ordinato x data registrazione)
///
@@ -649,15 +641,25 @@ namespace MP.SPEC.Data
#region Private Fields
private const string redisBaseAddr = "MP:";
+
private const string redisConfKey = redisBaseAddr + "SPEC:Cache:Config";
+
private const string redisDossByMac = redisBaseAddr + "SPEC:Cache:DossByMac";
+
private const string redisFluxByMac = redisBaseAddr + "SPEC:Cache:FluxByMac";
+
private const string redisMacByFlux = redisBaseAddr + "SPEC:Cache:MacByFlux";
+
private const string redisMacList = redisBaseAddr + "SPEC:Cache:MacList";
+
private const string redisStatoCom = redisBaseAddr + "SPEC:Cache:StatoCom";
+
private const string redisTipoArt = redisBaseAddr + "SPEC:Cache:TipoArt";
+
private static IConfiguration _configuration = null!;
+
private static ILogger _logger = null!;
+
private static Logger Log = LogManager.GetCurrentClassLogger();
///
@@ -678,5 +680,38 @@ namespace MP.SPEC.Data
private int redisLongTimeCache = 5;
#endregion Private Fields
+
+ #region Private Methods
+
+ ///
+ /// Esegue flush memoria redis dato pattern
+ ///
+ ///
+ ///
+ private async Task ExecFlushRedisPattern(RedisValue pattern)
+ {
+ bool answ = false;
+ var listEndpoints = redisConnAdmin.GetEndPoints();
+ foreach (var endPoint in listEndpoints)
+ {
+ //var server = redisConnAdmin.GetServer(listEndpoints[0]);
+ var server = redisConnAdmin.GetServer(endPoint);
+ if (server != null)
+ {
+ 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;
+ }
+ }
+
+ return answ;
+ }
+
+ #endregion Private Methods
}
}
\ No newline at end of file
diff --git a/MP.SPEC/Data/SelectFluxParams.cs b/MP.SPEC/Data/SelectFluxParams.cs
index 4f416c7a..bf17616f 100644
--- a/MP.SPEC/Data/SelectFluxParams.cs
+++ b/MP.SPEC/Data/SelectFluxParams.cs
@@ -15,6 +15,7 @@
public int CurrPage { get; set; } = 1;
public DateTime? dtRif { get; set; } = null;
public DateTime? dtMax { get; set; } = null;
+ public DateTime? dtMin { get; set; } = null;
public string IdxMacchina { get; set; } = "*";
public string lastUpdate { get; set; } = "-";
public bool LiveUpdate { get; set; } = true;
diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj
index 12679844..539ad3ac 100644
--- a/MP.SPEC/MP.SPEC.csproj
+++ b/MP.SPEC/MP.SPEC.csproj
@@ -5,7 +5,7 @@
enable
enable
MP.SPEC
- 6.16.2209.2714
+ 6.16.2210.511
diff --git a/MP.SPEC/Pages/Articoli.razor b/MP.SPEC/Pages/Articoli.razor
index 8e161a2b..2cc76697 100644
--- a/MP.SPEC/Pages/Articoli.razor
+++ b/MP.SPEC/Pages/Articoli.razor
@@ -135,7 +135,8 @@
{
|
-
+
+
|
@record.CodArticolo
diff --git a/MP.SPEC/Pages/Articoli.razor.cs b/MP.SPEC/Pages/Articoli.razor.cs
index 2dabf683..577db802 100644
--- a/MP.SPEC/Pages/Articoli.razor.cs
+++ b/MP.SPEC/Pages/Articoli.razor.cs
@@ -136,6 +136,10 @@ namespace MP.SPEC.Pages
}
ListAziende = await MDService.ElencoAziende();
ListTipoArt = await MDService.AnagTipoArtLV();
+ }
+
+ protected override async Task OnParametersSetAsync()
+ {
await reloadData();
}
@@ -155,6 +159,21 @@ namespace MP.SPEC.Pages
currRecord = selRec;
await Task.Delay(1);
}
+ protected async Task cloneRecord(AnagArticoli selRec)
+ {
+ // creo record duplicato...
+ AnagArticoli newRec = new AnagArticoli()
+ {
+ Azienda = selRec.Azienda,
+ CodArticolo = selRec.CodArticolo,
+ DescArticolo = $"CLONE - { selRec.DescArticolo }",
+ Disegno = selRec.Disegno,
+ Tipo=selRec.Tipo
+ };
+ currRecord = newRec;
+ await Task.Delay(1);
+ }
+
protected async Task update(AnagArticoli selRec)
{
diff --git a/MP.SPEC/Pages/PODL.razor b/MP.SPEC/Pages/PODL.razor
index 46c6fe3e..a890faa2 100644
--- a/MP.SPEC/Pages/PODL.razor
+++ b/MP.SPEC/Pages/PODL.razor
@@ -42,7 +42,7 @@
-
+
@if (currRecord != null)
{
@@ -77,6 +77,12 @@
+
+
+
+
@@ -195,7 +222,7 @@
}
else
{
-
+
}
| |