From 7157ba1c10f1c384386f3b8e29713535fc71c8cb Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 9 May 2025 08:54:21 +0200 Subject: [PATCH] SPEC: - compoisiozne kit controlla rimozione reparto - uso nuova stored --- MP.Data/Controllers/MpSpecController.cs | 29 +++++++++++++ .../Components/ProdKit/KitPodlMan.razor.cs | 2 +- MP.SPEC/Components/SelFilterXDL.razor | 33 +++++++++++---- MP.SPEC/Components/SelFilterXDL.razor.cs | 3 ++ MP.SPEC/Data/MpDataService.cs | 42 +++++++++++++++++++ MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Pages/Podl2Kit.razor | 3 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 10 files changed, 105 insertions(+), 15 deletions(-) diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index 6ccddc81..08306519 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -1298,6 +1298,35 @@ namespace MP.Data.Controllers return dbResult; } + /// + /// Elenco PODLper composizione KIT non avviati filtrati x articolo, KeyRich (che contiene stato) + /// + /// Solo lanciati (1) o ancora disponibili (0) + /// KeyRich (parziale) da cercare (es cod stato x yacht) + /// Macchina + /// Gruppo + /// + public List ListPODL_KitFilt(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo, DateTime startDate, DateTime endDate) + { + List dbResult = new List(); + using (var dbCtx = new MoonProContext(_configuration)) + { + var Lanc = new SqlParameter("@Lanciato", lanciato); + var KeyRich = new SqlParameter("@KeyRich", keyRichPart); + var CodGrp = new SqlParameter("@CodGruppo", codGruppo); + var IdxMacc = new SqlParameter("@IdxMacchina", idxMacchina); + var DateFrom = new SqlParameter("@DtInizio", startDate); + var DateTo = new SqlParameter("@DtFine", endDate); + + dbResult = dbCtx + .DbSetPODLExp + .FromSqlRaw("EXEC stp_PODL_getByFiltSpecKit @Lanciato, @KeyRich, @CodGruppo, @IdxMacchina, @DtInizio, @DtFine", Lanc, KeyRich, CodGrp, IdxMacc, DateFrom, DateTo) + .AsNoTracking() + .ToList(); + } + return dbResult; + } + /// /// Elenco PODL non avviati filtrati x articolo, KeyRich (che contiene stato) /// diff --git a/MP.SPEC/Components/ProdKit/KitPodlMan.razor.cs b/MP.SPEC/Components/ProdKit/KitPodlMan.razor.cs index 72f71ef1..59610526 100644 --- a/MP.SPEC/Components/ProdKit/KitPodlMan.razor.cs +++ b/MP.SPEC/Components/ProdKit/KitPodlMan.razor.cs @@ -129,7 +129,7 @@ namespace MP.SPEC.Components.ProdKit { ListRecords = null; isLoading = true; - SearchRecords = await MDService.POdlListGetFiltAsync(hasOdl, StatoSel, macchina, reparto, selDtStart, selDtEnd); + SearchRecords = await MDService.POdlToKitListGetFiltAsync(hasOdl, StatoSel, macchina, reparto, selDtStart, selDtEnd); // rivedere filtro FixMe ToDo!!! // filtro tenendo SOLO se hanno keyRichiesta CodExt + ATTIVI + NON KIT | Hard Coded... diff --git a/MP.SPEC/Components/SelFilterXDL.razor b/MP.SPEC/Components/SelFilterXDL.razor index eb805158..fd67cd66 100644 --- a/MP.SPEC/Components/SelFilterXDL.razor +++ b/MP.SPEC/Components/SelFilterXDL.razor @@ -17,16 +17,33 @@
- + + @if (ListGruppiFase != null) { - + foreach (var item in ListGruppiFase) + { + + } } - } - + + } + else + { + + + }
diff --git a/MP.SPEC/Components/SelFilterXDL.razor.cs b/MP.SPEC/Components/SelFilterXDL.razor.cs index 9e34621b..96517c6b 100644 --- a/MP.SPEC/Components/SelFilterXDL.razor.cs +++ b/MP.SPEC/Components/SelFilterXDL.razor.cs @@ -24,6 +24,9 @@ namespace MP.SPEC.Components [Parameter] public List? ListStati { get; set; } = null; + [Parameter] + public bool ChangeGrpEnab { get; set; } = true; + #endregion Public Properties #region Protected Properties diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index c5926387..e982fd60 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -2107,6 +2107,48 @@ namespace MP.SPEC.Data return result; } + + /// + /// Elenco PODL per composizione KIT (Async) non avviati filtrati x articolo, KeyRich (che contiene stato) + /// + /// Solo lanciati (1) o ancora disponibili (0) + /// KeyRich (parziale) da cercare (es cod stato x yacht) + /// Macchina + /// Gruppo + /// Data inizio + /// Data fine + /// + public async Task> POdlToKitListGetFiltAsync(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo, DateTime startDate, DateTime endDate) + { + List? result = new List(); + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + string readType = "DB"; + string currKey = $"{Utils.redisPOdlList}_kit:{codGruppo}:{idxMacchina}:{keyRichPart}:{lanciato}:{startDate:yyyyMMdd_HHmmss}:{endDate:yyyyMMdd_HHmmss}"; + // cerco in redis dato valore sel idxMaccSel... + RedisValue rawData = redisDb.StringGet(currKey); + if (rawData.HasValue) + { + result = JsonConvert.DeserializeObject>($"{rawData}"); + readType = "REDIS"; + } + else + { + result = await Task.FromResult(dbController.ListPODL_KitFilt(lanciato, keyRichPart, idxMacchina, codGruppo, 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($"POdlToKitListGetFiltAsync | Read from {readType}: {ts.TotalMilliseconds}ms"); + return result; + } + /// /// Chiamata salvataggio ricetta + refresh REDIS /// diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 3ca10e60..fcaf1f3a 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2505.719 + 6.16.2505.908 1800a78a-6ff1-40f9-b490-87fb8bfc1394 en diff --git a/MP.SPEC/Pages/Podl2Kit.razor b/MP.SPEC/Pages/Podl2Kit.razor index a200f92b..761ea82f 100644 --- a/MP.SPEC/Pages/Podl2Kit.razor +++ b/MP.SPEC/Pages/Podl2Kit.razor @@ -37,13 +37,12 @@
- +
- @* *@
diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 998c31dc..36e7d84c 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2505.719

+

Versione: 6.16.2505.908


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 6484df3b..33b17944 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2505.719 +6.16.2505.908 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 084ef21d..3e9bba41 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2505.719 + 6.16.2505.908 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