From c39831ca5e3aff8b0f4d5ebbc6a4956c5ff37ec1 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 2 Apr 2025 19:10:42 +0200 Subject: [PATCH] update con listaEv + traduzione in tab --- MP-TAB3/Components/InsManual.razor | 48 ++++++++++++++++--------- MP-TAB3/Components/InsManual.razor.cs | 51 +++++++++++++++++++-------- MP-TAB3/MP-TAB3.csproj | 2 +- MP-TAB3/Pages/ProdStop.razor.cs | 2 +- MP-TAB3/Resources/ChangeLog.html | 2 +- MP-TAB3/Resources/VersNum.txt | 2 +- MP-TAB3/Resources/manifest.xml | 2 +- MP.Data/Services/TabDataService.cs | 6 ++-- 8 files changed, 77 insertions(+), 38 deletions(-) diff --git a/MP-TAB3/Components/InsManual.razor b/MP-TAB3/Components/InsManual.razor index 7a7e5067..1bbb071c 100644 --- a/MP-TAB3/Components/InsManual.razor +++ b/MP-TAB3/Components/InsManual.razor @@ -10,22 +10,22 @@
@if (DayMinTot < 1440) { -
+
-
+
-
+
} else { -
+
} -
+
@@ -77,19 +77,19 @@
-
+
-
+
- +
-
+
@@ -100,13 +100,25 @@ else {
-
+
- + + @* *@
-
+
+
+ + +
+
+
@@ -124,7 +136,6 @@ Macc - Comm. Stato Art. Ora @@ -140,9 +151,14 @@ @item.IdxMacchina - @item.KeyRichiesta - @item.IdxTipoEv - @item.CodArticolo + @(EvDescript(item.IdxTipoEv)) + + @item.CodArticolo + @if (!string.IsNullOrEmpty(item.KeyRichiesta)) + { + @item.KeyRichiesta + } + {item.FineStato:yyyy.MM.dd HH:mm:ss}")">@($"{item.InizioStato:HH:mm}") @item.PzBuoni @($"{item.TCiclo:f2}") diff --git a/MP-TAB3/Components/InsManual.razor.cs b/MP-TAB3/Components/InsManual.razor.cs index 5c689748..d76a03a5 100644 --- a/MP-TAB3/Components/InsManual.razor.cs +++ b/MP-TAB3/Components/InsManual.razor.cs @@ -13,7 +13,6 @@ namespace MP_TAB3.Components { #region Public Properties - [Parameter] public MappaStatoExpl? RecMSE { @@ -75,14 +74,6 @@ namespace MP_TAB3.Components }; } } - /// - /// imposta record x editing - /// - /// - protected void DoEdit(InsManualiModel? selRec) - { - EditRecord = selRec; - } /// /// impossta record x eliminazione @@ -100,6 +91,15 @@ namespace MP_TAB3.Components RecalcDayData(dtCurr); } + /// + /// imposta record x editing + /// + /// + protected void DoEdit(InsManualiModel? selRec) + { + EditRecord = selRec; + } + protected async Task DoSave() { // solo se ho record... @@ -136,6 +136,25 @@ namespace MP_TAB3.Components } } + /// + /// traduzione evento da lista... + /// + /// + /// + protected string EvDescript(int idxTipoEv) + { + string answ = "-"; + if (ListEvents != null) + { + var rSel = ListEvents.FirstOrDefault(x => x.value == idxTipoEv); + if (rSel != null) + { + answ = rSel.label; + } + } + return answ; + } + protected async Task FixMissing() { if (!await JSRuntime.InvokeAsync("confirm", $"Sicuro di voler riempire i periodi mancanti?")) @@ -193,13 +212,10 @@ namespace MP_TAB3.Components private bool confProdActive { get; set; } = false; private MappaStatoExpl? currRecMSE { get; set; } = null; - private DateTime dtCurr { get; set; } = DateTime.Today; - private List? ListDay { get; set; } = new List(); - private List? ListDTO { get; set; } = new List(); - + private List ListEvents { get; set; } = new List(); private List? ListPeriod { get; set; } = new List(); private bool showDetail { get; set; } = false; @@ -333,9 +349,16 @@ namespace MP_TAB3.Components ListDTO = new List(); if (RecMSE != null) { + string IdxMacc = RecMSE.IdxMacchina; + var eventsAll = TabDServ.AnagEventiGetByMacch(IdxMacc); + if (eventsAll != null) + { + ListEvents = eventsAll.Where(x => x.EventoTablet).ToList(); + } + DateTime MeseStart = new DateTime(dtCurr.Year, dtCurr.Month, 1); DateTime MeseEnd = MeseStart.AddMonths(1); - ListPeriod = TabDServ.InsManFilt(RecMSE.IdxMacchina, MeseStart, MeseEnd); + ListPeriod = TabDServ.InsManFilt(IdxMacc, MeseStart, MeseEnd); ListDTO = TabDServ.InsManDayDto(ListPeriod); DateCheck = new Dictionary(); DateCFF = new Dictionary(); diff --git a/MP-TAB3/MP-TAB3.csproj b/MP-TAB3/MP-TAB3.csproj index cfebd9aa..ccf4ac05 100644 --- a/MP-TAB3/MP-TAB3.csproj +++ b/MP-TAB3/MP-TAB3.csproj @@ -3,7 +3,7 @@ net6.0 enable - 6.16.2504.218 + 6.16.2504.219 enable MP_TAB3 diff --git a/MP-TAB3/Pages/ProdStop.razor.cs b/MP-TAB3/Pages/ProdStop.razor.cs index 2570996d..af7bfeaf 100644 --- a/MP-TAB3/Pages/ProdStop.razor.cs +++ b/MP-TAB3/Pages/ProdStop.razor.cs @@ -238,7 +238,7 @@ namespace MP_TAB3.Pages { await base.ReloadData(); // recupero eventi - var eventsAll = await TabDServ.AnagEventiGetByMacch(IdxMacc); + var eventsAll = TabDServ.AnagEventiGetByMacch(IdxMacc); if (eventsAll != null) { events2show = eventsAll.Where(x => x.EventoTablet).ToList(); diff --git a/MP-TAB3/Resources/ChangeLog.html b/MP-TAB3/Resources/ChangeLog.html index 752cadc2..2cb0c692 100644 --- a/MP-TAB3/Resources/ChangeLog.html +++ b/MP-TAB3/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2504.218

+

Versione: 6.16.2504.219


Note di rilascio:
  • diff --git a/MP-TAB3/Resources/VersNum.txt b/MP-TAB3/Resources/VersNum.txt index ed23e05c..a0848d3a 100644 --- a/MP-TAB3/Resources/VersNum.txt +++ b/MP-TAB3/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2504.218 +6.16.2504.219 diff --git a/MP-TAB3/Resources/manifest.xml b/MP-TAB3/Resources/manifest.xml index 077a120b..39876006 100644 --- a/MP-TAB3/Resources/manifest.xml +++ b/MP-TAB3/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2504.218 + 6.16.2504.219 https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html false diff --git a/MP.Data/Services/TabDataService.cs b/MP.Data/Services/TabDataService.cs index 0abccbde..0070ec2a 100644 --- a/MP.Data/Services/TabDataService.cs +++ b/MP.Data/Services/TabDataService.cs @@ -262,7 +262,7 @@ namespace MP.Data.Services /// Elenco EVENTI validi x macchina ///
/// - public async Task> AnagEventiGetByMacch(string IdxMacch) + public List AnagEventiGetByMacch(string IdxMacch) { // setup parametri costanti DateTime startDate = new DateTime(2000, 1, 1); @@ -273,7 +273,7 @@ namespace MP.Data.Services List? result = new List(); // cerco in redis... string currKey = $"{redisBaseKey}:VSEB:{IdxMacch}"; - RedisValue rawData = await redisDb.StringGetAsync(currKey); + RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) { result = JsonConvert.DeserializeObject>($"{rawData}"); @@ -284,7 +284,7 @@ namespace MP.Data.Services result = dbTabController.AnagEventiGetByMacc(IdxMacch); // serializzo e salvo... rawData = JsonConvert.SerializeObject(result); - await redisDb.StringSetAsync(currKey, rawData, LongCache); + redisDb.StringSet(currKey, rawData, LongCache); } if (result == null) {