diff --git a/MP.SPEC/Components/ListDossiers.razor b/MP.SPEC/Components/ListDossiers.razor index 1728533c..43b8c986 100644 --- a/MP.SPEC/Components/ListDossiers.razor +++ b/MP.SPEC/Components/ListDossiers.razor @@ -17,7 +17,7 @@ else - + Articolo Fase @@ -75,15 +75,15 @@ else - + @@ -91,7 +91,7 @@ else @foreach (var record in listaFlux) { - + @@ -105,8 +105,15 @@ else @record.CodFlux } diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs index 09b6ee5b..43af9a38 100644 --- a/MP.SPEC/Components/ListDossiers.razor.cs +++ b/MP.SPEC/Components/ListDossiers.razor.cs @@ -6,7 +6,7 @@ using MP.SPEC.Data; namespace MP.SPEC.Components { - public partial class ListDossiers: IDisposable + public partial class ListDossiers : IDisposable { #region Public Properties @@ -26,6 +26,24 @@ namespace MP.SPEC.Components #region Public Methods + private FluxLogDTO? currFluxLogDto = null; + + + public string checkSelPar(FluxLogDTO recordSel) + { + string answ = ""; + if (currFluxLogDto != null) + { + try + { + answ = (currFluxLogDto.CodFlux == recordSel.CodFlux && currFluxLogDto.dtEvento== recordSel.dtEvento) ? "table-info" : ""; + } + catch + { } + } + return answ; + } + public string checkSelect(Dossiers recordSel) { string answ = ""; @@ -87,6 +105,7 @@ namespace MP.SPEC.Components protected async Task editRecord(FluxLogDTO selRec) { + currFluxLogDto = selRec; // indico record selezionato await RecordSelFlux.InvokeAsync(selRec); } @@ -234,8 +253,9 @@ namespace MP.SPEC.Components return answ; } - private async Task unToggleTableFlux() + private async Task closeTableFlux() { + currFluxLogDto = null; currRecord = null; visualizzaFlux = true; await Task.Delay(1); diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index 52150c77..2b04387f 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -13,8 +13,6 @@ namespace MP.SPEC.Components [Parameter] public SelectPOdlParams actFilter { get; set; } = new SelectPOdlParams(); - private SelectPOdlParams lastFilter { get; set; } = new SelectPOdlParams() { CurrPage = -1 }; - [Parameter] public EventCallback PagerResetReq { get; set; } @@ -43,8 +41,6 @@ namespace MP.SPEC.Components return answ; } - #endregion Public Methods - public void Dispose() { currRecord = null; @@ -54,6 +50,8 @@ namespace MP.SPEC.Components GC.Collect(); } + #endregion Public Methods + #region Protected Properties [Inject] @@ -212,11 +210,8 @@ namespace MP.SPEC.Components #region Private Fields private PODLModel? currRecord = null; - private List? ListRecords; - private List? ListStati; - private List? SearchRecords; #endregion Private Fields @@ -232,6 +227,7 @@ namespace MP.SPEC.Components } private bool isLoading { get; set; } = false; + private SelectPOdlParams lastFilter { get; set; } = new SelectPOdlParams() { CurrPage = -1 }; private int numRecord { @@ -325,8 +321,15 @@ namespace MP.SPEC.Components /// private bool canStartOdl(string idxMacchina) { - var listOdlCurr = MDService.OdlGetCurrent(); - bool answ = !listOdlCurr.Contains(idxMacchina); + // controllo se lista scaduta... + bool answ = false; + DateTime adesso = DateTime.Now; + if (adesso > odlCurrExp || odlCurrList == null || odlCurrList.Count == 0) + { + odlCurrList = MDService.OdlGetCurrent(); + odlCurrExp = adesso.AddSeconds(2); + } + answ = !odlCurrList.Contains(idxMacchina); return answ; } @@ -376,6 +379,16 @@ namespace MP.SPEC.Components isLoading = false; } + /// + /// scadenza validità lista ODL correnti + /// + private DateTime odlCurrExp = DateTime.Now.AddMinutes(-1); + + /// + /// Elenco ODL correnti... + /// + private List odlCurrList = new List(); + private string tradFase(string codFase) { string answ = codFase; diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 84547397..1d0b157f 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -82,7 +82,7 @@ namespace MP.SPEC.Data else { result = await Task.FromResult(dbController.AnagStatiComm()); - // serializzp e salvo... + // serializzo e salvo... rawData = JsonConvert.SerializeObject(result); await redisDb.StringSetAsync(redisStatoCom, rawData, getRandTOut(redisLongTimeCache)); stopWatch.Stop(); @@ -113,7 +113,7 @@ namespace MP.SPEC.Data else { result = await Task.FromResult(dbController.AnagTipoArtLV()); - // serializzp e salvo... + // serializzo e salvo... rawData = JsonConvert.SerializeObject(result); await redisDb.StringSetAsync(redisTipoArt, rawData, getRandTOut(redisLongTimeCache)); stopWatch.Stop(); @@ -148,7 +148,7 @@ namespace MP.SPEC.Data else { result = await Task.FromResult(dbController.ArticleWithDossier()); - // serializzp e salvo... + // serializzo e salvo... rawData = JsonConvert.SerializeObject(result); redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache)); } @@ -277,7 +277,7 @@ namespace MP.SPEC.Data else { result = await Task.FromResult(dbController.ConfigGetAll()); - // serializzp e salvo... + // serializzo e salvo... rawData = JsonConvert.SerializeObject(result); await redisDb.StringSetAsync(redisConfKey, rawData, getRandTOut(redisLongTimeCache)); stopWatch.Stop(); @@ -361,7 +361,7 @@ namespace MP.SPEC.Data else { result = await Task.FromResult(dbController.DossiersGetLastFilt(IdxMacchina, CodArticolo, DtRef, MaxRec)); - // serializzp e salvo... + // serializzo e salvo... rawData = JsonConvert.SerializeObject(result); redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache / 5)); } @@ -546,7 +546,35 @@ namespace MP.SPEC.Data /// public async Task> ListPODLFilt(string codArt, string keyRichPart) { - return await Task.FromResult(dbController.ListPODLFilt(codArt, keyRichPart)); + List? result = new List(); + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + string readType = "DB"; + string currKey = $"{redisPOdlList}:{codArt}:{keyRichPart}"; + // 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.ListPODLFilt(codArt, keyRichPart)); + // serializzo e salvo... + rawData = JsonConvert.SerializeObject(result); + redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(3)); + } + if (result == null) + { + result = new List(); + } + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Debug($"ListPODLFilt | Read from {readType}: {ts.TotalMilliseconds}ms"); + return result; + + } /// @@ -570,7 +598,7 @@ namespace MP.SPEC.Data else { result = await Task.FromResult(dbController.MacchineGetAll()); - // serializzp e salvo... + // serializzo e salvo... rawData = JsonConvert.SerializeObject(result); redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache)); } @@ -605,7 +633,7 @@ namespace MP.SPEC.Data else { result = await dbController.MacchineWithFlux(); - // serializzp e salvo... + // serializzo e salvo... rawData = JsonConvert.SerializeObject(result); redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache)); } @@ -728,7 +756,7 @@ namespace MP.SPEC.Data else { result = await Task.FromResult(dbController.ParametriGetFilt(IdxMacchina)); - // serializzp e salvo... + // serializzo e salvo... rawData = JsonConvert.SerializeObject(result); redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache)); } @@ -779,7 +807,12 @@ namespace MP.SPEC.Data /// public async Task POdlUpdateRecord(PODLModel currRec) { - return await dbController.PODLUpdateRecord(currRec); + var dbResult = await dbController.PODLUpdateRecord(currRec); + // elimino cache redis... + RedisValue pattern = new RedisValue($"{redisPOdlList}:*"); + bool answ = await ExecFlushRedisPattern(pattern); + + return dbResult; } /// @@ -868,6 +901,7 @@ namespace MP.SPEC.Data private const string redisMacByFlux = redisBaseAddr + "SPEC:Cache:MacByFlux"; private const string redisMacList = redisBaseAddr + "SPEC:Cache:MacList"; + private const string redisPOdlList = redisBaseAddr + "SPEC:Cache:POdlList"; private const string redisStatoCom = redisBaseAddr + "SPEC:Cache:StatoCom"; diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index bd297fa3..fb3ad326 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2210.1817 + 6.16.2210.1818 diff --git a/MP.SPEC/Pages/PODL.razor.cs b/MP.SPEC/Pages/PODL.razor.cs index b9699f04..36a85db2 100644 --- a/MP.SPEC/Pages/PODL.razor.cs +++ b/MP.SPEC/Pages/PODL.razor.cs @@ -150,6 +150,9 @@ namespace MP.SPEC.Pages await callSyncDb(selRec); currRecord = null; await reloadData(); + // forzo update parametri + await Task.Delay(1); + currFase = "*"; await Task.Delay(1); } diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 64a26b06..fef946a2 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2210.1817

+

Versione: 6.16.2210.1818


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 458a9aa8..f58cd2c0 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.1817 +6.16.2210.1818 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 4f3dec63..f35138a3 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.1817 + 6.16.2210.1818 https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html false
+ + Macchina Data Data Type
Valore - -
-
Modificato: @record.ValoreEdit
-
Originale: @record.Valore
+ @if (record.ValoreEdit != record.Valore) + { +
@record.ValoreEdit
+
(@record.Valore)
+ } + else + { +
@record.ValoreEdit
+ }