From dc8879d7c6656fc60cad2f2bc40b7956da745976 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 8 Oct 2024 18:30:25 +0200 Subject: [PATCH] TAB3: - gestione cache MP-IO che scade su operazioni da tab che riguardano ODL - fix gestione fine prod con evento inviato a IOB-WIN come task2exe --- MP-TAB3/Components/OdlMan.razor.cs | 67 ++++++++++++++++++-------- MP-TAB3/MP-TAB3.csproj | 2 +- MP-TAB3/Resources/ChangeLog.html | 2 +- MP-TAB3/Resources/VersNum.txt | 2 +- MP-TAB3/Resources/manifest.xml | 2 +- MP.Data/Controllers/MpTabController.cs | 1 - MP.Data/Services/TabDataService.cs | 19 +++++++- 7 files changed, 70 insertions(+), 25 deletions(-) diff --git a/MP-TAB3/Components/OdlMan.razor.cs b/MP-TAB3/Components/OdlMan.razor.cs index 015d405f..9b611fb4 100644 --- a/MP-TAB3/Components/OdlMan.razor.cs +++ b/MP-TAB3/Components/OdlMan.razor.cs @@ -102,9 +102,6 @@ namespace MP_TAB3.Components [Inject] protected MailService MailServ { get; set; } = null!; - [Inject] - protected StatusData SDService { get; set; } = null!; - [Inject] protected MessageService MsgServ { get; set; } = null!; @@ -119,6 +116,9 @@ namespace MP_TAB3.Components get => IdxOdl > 0; } + [Inject] + protected StatusData SDService { get; set; } = null!; + protected string SearchPodl { get => searchPodl; @@ -294,7 +294,6 @@ namespace MP_TAB3.Components await TabDServ.OdlClearSetup(idxODLCurr, IdxMaccSel); await advStep(currStep++); - // se è multi processo ANCHE x altra tavola... if (isMulti) { @@ -311,7 +310,6 @@ namespace MP_TAB3.Components } await advStep(currStep++); - // se è master --> chiamo update child! if (isMaster) { @@ -333,6 +331,7 @@ namespace MP_TAB3.Components await RefreshData(); await CheckAttr(); await advStep(currStep++); + await FlushMpIoOdlCache(); isProcessing = false; await InvokeAsync(StateHasChanged); } @@ -373,6 +372,7 @@ namespace MP_TAB3.Components await RefreshData(); await CheckAttr(); await advStep(currStep++); + await FlushMpIoOdlCache(); // chiudo update... isProcessing = false; } @@ -521,6 +521,7 @@ namespace MP_TAB3.Components await RefreshData(); await CheckAttr(); await advStep(currStep++); + await FlushMpIoOdlCache(); // chiudo update... isProcessing = false; await InvokeAsync(StateHasChanged); @@ -728,6 +729,7 @@ namespace MP_TAB3.Components await TabDServ.FlushOdlCache(); IdxPOdlSel = 0; RecMSE = null; + await FlushMpIoOdlCache(); await InvokeAsync(StateHasChanged); await RefreshData(); await CheckAttr(); @@ -799,7 +801,6 @@ namespace MP_TAB3.Components if (!await JSRuntime.InvokeAsync("confirm", $"Confermi fine produzione?")) return; - // prima di tutto svuoto dati prod SDService.MachProdStRem(IdxMaccSel); @@ -895,7 +896,22 @@ namespace MP_TAB3.Components NavMan.NavigateTo($"machine-detail"); } } + // aggiunto esplicita endProd + TabDServ.addTask4Machine(IdxMaccSel, taskType.endProd, ""); + if (isMaster) + { + // calcolo gli slave... + var slaveList = SMServ.ListM2S + .Where(x => x.IdxMacchina.Equals(IdxMaccSel, StringComparison.InvariantCultureIgnoreCase)) + .ToList(); + foreach (var machine in slaveList) + { + // invio task x end produzione... + TabDServ.addTask4Machine(machine.IdxMacchinaSlave, taskType.endProd, ""); + } + } await advStep(currStep++); + await FlushMpIoOdlCache(); // faccio refresh e riporto IdxPOdlSel = 0; RecMSE = null; @@ -1196,17 +1212,6 @@ namespace MP_TAB3.Components #region Private Properties - private string baseLang - { - get => MsgServ.UserPrefGet("Lang"); - } - - private bool cancelSetupEnabled - { - //get => inAttr && enableSchedaTecnica && enableAnnullaSetup; - get => inAttr && enableAnnullaSetup; - } - private bool annullaSetupVisible { get @@ -1233,6 +1238,17 @@ namespace MP_TAB3.Components } } + private string baseLang + { + get => MsgServ.UserPrefGet("Lang"); + } + + private bool cancelSetupEnabled + { + //get => inAttr && enableSchedaTecnica && enableAnnullaSetup; + get => inAttr && enableAnnullaSetup; + } + private string cssDetailOdl { get => IdxPOdlSel > 0 ? "bg-info text-light" : "bg-warning"; @@ -1372,8 +1388,8 @@ namespace MP_TAB3.Components catch { } - // ora verifico SE E SOLO SE è ANCORA in attrezzaggio ora verifico SE ALTRA - // TAVOLA ha ODL... + // ora verifico SE E SOLO SE è ANCORA in attrezzaggio ora verifico SE + // ALTRA TAVOLA ha ODL... if (dtChiusura.AddMinutes(gPeriodReopenOdlTav) > adesso) { answ = showReopenOdlTav; @@ -1574,6 +1590,19 @@ namespace MP_TAB3.Components } } + /// + /// Flush cache relativa a MP-IO x dati ODL + /// + /// + private async Task FlushMpIoOdlCache() + { + // svuoto dalla cache REDIS del server IO... + await TabDServ.ResetIoCache("CurrODL"); + await TabDServ.ResetIoCache("CurrOdlRow"); + await TabDServ.ResetIoCache("CurrStatoMacc"); + await TabDServ.ResetIoCache("DtMac"); + } + /// /// processa evento richiesto /// diff --git a/MP-TAB3/MP-TAB3.csproj b/MP-TAB3/MP-TAB3.csproj index 8a695a6d..eadb28f0 100644 --- a/MP-TAB3/MP-TAB3.csproj +++ b/MP-TAB3/MP-TAB3.csproj @@ -3,7 +3,7 @@ net6.0 enable - 6.16.2409.408 + 6.16.2410.818 enable MP_TAB3 diff --git a/MP-TAB3/Resources/ChangeLog.html b/MP-TAB3/Resources/ChangeLog.html index 5f90d708..8725fb91 100644 --- a/MP-TAB3/Resources/ChangeLog.html +++ b/MP-TAB3/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2409.408

+

Versione: 6.16.2410.818


Note di rilascio: