diff --git a/MP.Data/Utils.cs b/MP.Data/Utils.cs index 56e56b6d..22baa93a 100644 --- a/MP.Data/Utils.cs +++ b/MP.Data/Utils.cs @@ -234,7 +234,8 @@ namespace MP.Data public const string redisGiacenzaList = redisBaseAddr + "Cache:GiacenzaList"; public const string redisMacByFlux = redisBaseAddr + "Cache:MacByFlux"; public const string redisMacList = redisBaseAddr + "Cache:MacList"; - public const string redisMacRecipe = redisBaseAddr + "Cache:Recipe"; + public const string redisMacRecipeConf = redisBaseAddr + "Cache:RecipeConf"; + public const string redisMacRecipePath = redisBaseAddr + "Cache:RecipePath"; public const string redisOdlByBatch = redisXdlData + "OdlByBatch"; public const string redisOdlCurrByMac = redisXdlData + "OdlByMac"; public const string redisOdlList = redisXdlData + "OdlList"; diff --git a/MP.SPEC/Components/ListPODL.razor b/MP.SPEC/Components/ListPODL.razor index 51187a54..b2e70b12 100644 --- a/MP.SPEC/Components/ListPODL.razor +++ b/MP.SPEC/Components/ListPODL.razor @@ -68,12 +68,18 @@ else } @if (MachineWithRecipe) { - @if (machineHasRecipe(record.IdxMacchina).Result) + @if (machineHasRecipeConf(record.IdxMacchina).Result) { } + @if (machineHasRecipeArch(record.IdxMacchina).Result) + { + + } } diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index 354367ca..b7dcf38a 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -111,9 +111,16 @@ namespace MP.SPEC.Components protected async Task doShowRecipe(PODLExpModel selRec) { currRecord = selRec; - currRecipePath = await MDService.MacchineRecipe(selRec.IdxMacchina); + currRecipePath = await MDService.MacchineRecipeConf(selRec.IdxMacchina); showRecipe = true; } + protected async Task doShowRecipeArch(PODLExpModel selRec) + { + currRecord = selRec; + currRecipeArchPath = await MDService.MacchineRecipeArchive(selRec.IdxMacchina); + showRecipe = true; + } + protected override async Task OnInitializedAsync() { @@ -228,6 +235,7 @@ namespace MP.SPEC.Components /// Percorso ricetta corrente /// private string currRecipePath = ""; + private string currRecipeArchPath = ""; private PODLExpModel? currRecord = null; @@ -426,12 +434,23 @@ namespace MP.SPEC.Components /// /// /// - private async Task machineHasRecipe(string idxMacchina) + private async Task machineHasRecipeConf(string idxMacchina) { - var recipePath = await MDService.MacchineRecipe(idxMacchina); + var recipePath = await MDService.MacchineRecipeConf(idxMacchina); return !string.IsNullOrEmpty(recipePath); } + /// + /// Verifica se la macchina abbia associata un path x ricette (elenco) + /// + /// + /// + private async Task machineHasRecipeArch(string idxMacchina) + { + var recipeArchive = await MDService.MacchineRecipeArchive(idxMacchina); + return !string.IsNullOrEmpty(recipeArchive); + } + /// /// processa evento richiesto /// diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index c5ac9da4..62948017 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -909,17 +909,17 @@ namespace MP.SPEC.Data } /// - /// Verifica se la macchina abbia un codice ricetta associato + /// Verifica se la macchina abbia un codice CONF ricetta associato /// /// /// - public async Task MacchineRecipe(string idxMacchina) + public async Task MacchineRecipeConf(string idxMacchina) { string? result = ""; Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); string readType = "DB"; - string currKey = $"{Utils.redisMacRecipe}:{idxMacchina}"; + string currKey = $"{Utils.redisMacRecipeConf}:{idxMacchina}"; // cerco in redis dato valore sel macchina... RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) @@ -939,7 +939,41 @@ namespace MP.SPEC.Data } stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Debug($"MacchineRecipe | Read from {readType}: {ts.TotalMilliseconds}ms"); + Log.Debug($"MacchineRecipeConf | Read from {readType}: {ts.TotalMilliseconds}ms"); + return result ?? ""; + } + /// + /// Verifica se la macchina abbia un codice PATH ricette associato + /// + /// + /// + public async Task MacchineRecipeArchive(string idxMacchina) + { + string? result = ""; + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + string readType = "DB"; + string currKey = $"{Utils.redisMacRecipePath}:{idxMacchina}"; + // cerco in redis dato valore sel macchina... + RedisValue rawData = redisDb.StringGet(currKey); + if (rawData.HasValue) + { + result = JsonConvert.DeserializeObject($"{rawData}"); + readType = "REDIS"; + } + else + { + //recupero elenco macchine... + var machineList = await MacchineGetFilt("*"); + var currMach = machineList.Where(x => x.IdxMacchina == idxMacchina).FirstOrDefault(); + result = currMach != null ? currMach.RecipeArchivePath : null; + // serializzo e salvo... + rawData = JsonConvert.SerializeObject(result); + redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache)); + } + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Debug($"MacchineRecipeArchive | Read from {readType}: {ts.TotalMilliseconds}ms"); return result ?? ""; } diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 6e619ef2..063d5738 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2303.3117 + 6.16.2304.317 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 79d0c356..52688d4d 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2303.3117

+

Versione: 6.16.2304.317


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 8433e4e0..4f915a88 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2303.3117 +6.16.2304.317 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 83c1b313..6b8483ce 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2303.3117 + 6.16.2304.317 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