From 8d1e61ec8ba073c30a40beb75bfb1792b8032277 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 25 May 2026 17:14:38 +0200 Subject: [PATCH] UPdate spec x gestione PODL --- MP.Data/Controllers/MpSpecController.cs | 56 +++++++++++++++++++++++++ MP.Data/DbModels/PODLExpModel.cs | 4 +- MP.IOC/Controllers/IOBController.cs | 8 ++-- MP.IOC/MP.IOC.csproj | 2 +- MP.IOC/Resources/ChangeLog.html | 2 +- MP.IOC/Resources/VersNum.txt | 2 +- MP.IOC/Resources/manifest.xml | 2 +- MP.SPEC/Components/ListPODL.razor | 11 +++++ MP.SPEC/Data/MpDataService.cs | 10 ++--- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Pages/Articoli.razor | 2 +- MP.SPEC/Pages/Articoli.razor.cs | 16 ++----- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 15 files changed, 90 insertions(+), 33 deletions(-) diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index efa33086..ddebcdc9 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -1415,6 +1415,34 @@ namespace MP.Data.Controllers } return dbResult; } + /// + /// Elenco PODL per 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 async Task> ListPODL_KitFiltAsync(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo, DateTime startDate, DateTime endDate) + { + List dbResult = new List(); + using (var dbCtx = new MoonProContext(options)) + { + 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 = await dbCtx + .DbSetPODLExp + .FromSqlRaw("EXEC stp_PODL_getByFiltSpecKit @Lanciato, @KeyRich, @CodGruppo, @IdxMacchina, @DtInizio, @DtFine", Lanc, KeyRich, CodGrp, IdxMacc, DateFrom, DateTo) + .AsNoTracking() + .ToListAsync(); + } + return dbResult; + } /// /// Elenco PODL non avviati filtrati x articolo, KeyRich (che contiene stato) @@ -1444,6 +1472,34 @@ namespace MP.Data.Controllers } return dbResult; } + /// + /// Elenco PODL non avviati filtrati x articolo, KeyRich (che contiene stato) - ASYNC + /// + /// Solo lanciati (1) o ancora disponibili (0) + /// KeyRich (parziale) da cercare (es cod stato x yacht) + /// Macchina + /// Gruppo + /// + public async Task> ListPODLFiltAsync(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo, DateTime startDate, DateTime endDate) + { + List dbResult = new List(); + using (var dbCtx = new MoonProContext(options)) + { + 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 = await dbCtx + .DbSetPODLExp + .FromSqlRaw("EXEC stp_PODL_getByFiltSpec @Lanciato, @KeyRich, @CodGruppo, @IdxMacchina, @DtInizio, @DtFine", Lanc, KeyRich, CodGrp, IdxMacc, DateFrom, DateTo) + .AsNoTracking() + .ToListAsync(); + } + return dbResult; + } /// /// Elenco valori ammessi x tabella/colonna diff --git a/MP.Data/DbModels/PODLExpModel.cs b/MP.Data/DbModels/PODLExpModel.cs index 05617844..8f37c529 100644 --- a/MP.Data/DbModels/PODLExpModel.cs +++ b/MP.Data/DbModels/PODLExpModel.cs @@ -39,6 +39,8 @@ namespace MP.Data.DbModels public DateTime InsertDate { get; set; } = DateTime.Now; [MaxLength(500)] public string Recipe { get; set; } = ""; + public bool IsKitParent { get; set; } = false; + public bool IsKitChild { get; set; } = false; [NotMapped] public string CodFase @@ -66,7 +68,7 @@ namespace MP.Data.DbModels [NotMapped] public bool IsKit { - get => KeyRichiesta.StartsWith("KIT"); + get => IsKitParent || IsKitChild; // KeyRichiesta.StartsWith("KIT"); } /// diff --git a/MP.IOC/Controllers/IOBController.cs b/MP.IOC/Controllers/IOBController.cs index 4a486ff9..f0ebee6c 100644 --- a/MP.IOC/Controllers/IOBController.cs +++ b/MP.IOC/Controllers/IOBController.cs @@ -147,7 +147,7 @@ namespace MP.IOC.Controllers /// /// Sistema Dossier/Snapshot giornalieri x impianto indicato, andando a generare 1 Dossier /// giornaliero x ogni giornata dall'ultimo registrato alla data corrente - /// es: http://url_site/MP/IO/IOB/fixDailyDossier/SIMUL_03 + /// es: http://url_site/MP/IOC/api/IOB/fixDailyDossier/SIMUL_03 /// /// /// @@ -174,7 +174,7 @@ namespace MP.IOC.Controllers /// /// Sistema ODL giornalieri x impianto indicato, andando a generare 1 ODL giornaliero x ogni /// giornata dall'ultimo ODL aperto alla data corrente - /// es: http://url_site/MP/IO/IOB/fixDailyOdl/SIMUL_03 + /// es: http://url_site/MP/IOC/api/IOB/fixDailyOdl/SIMUL_03 /// /// /// @@ -218,7 +218,7 @@ namespace MP.IOC.Controllers /// Sistema ODL giornalieri x impianto indicato, andando a generare 1 ODL giornaliero x ogni /// giornata dall'ultimo ODL aperto alla data corrente + conferma pezzi (es TFT x ODL /// giornalieri energia) - /// es: http://url_site/MP/IO/IOB/fixDailyOdlConfPzCount/SIMUL_03 + /// es: http://url_site/MP/IOC/api/IOB/fixDailyOdlConfPzCount/SIMUL_03 /// /// /// @@ -525,7 +525,7 @@ namespace MP.IOC.Controllers /// /// Restituisce data-ora inizio dell'odl correntemente in lavorazione sulla macchina... - /// es: http://url_site/MP/IO/IOB/getCurrOdlStart/SIMUL_03 + /// es: http://url_site/MP/IOC/api/IOB/getCurrOdlStart/SIMUL_03 /// /// /// diff --git a/MP.IOC/MP.IOC.csproj b/MP.IOC/MP.IOC.csproj index ec21f95d..272dc386 100644 --- a/MP.IOC/MP.IOC.csproj +++ b/MP.IOC/MP.IOC.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 8.16.2605.1119 + 8.16.2605.1208 diff --git a/MP.IOC/Resources/ChangeLog.html b/MP.IOC/Resources/ChangeLog.html index 480c59fb..755b20eb 100644 --- a/MP.IOC/Resources/ChangeLog.html +++ b/MP.IOC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MP-IOC -

Versione: 8.16.2605.1119

+

Versione: 8.16.2605.1208


Note di rilascio:
  • diff --git a/MP.IOC/Resources/VersNum.txt b/MP.IOC/Resources/VersNum.txt index 282e9dc7..032d5246 100644 --- a/MP.IOC/Resources/VersNum.txt +++ b/MP.IOC/Resources/VersNum.txt @@ -1 +1 @@ -8.16.2605.1119 +8.16.2605.1208 diff --git a/MP.IOC/Resources/manifest.xml b/MP.IOC/Resources/manifest.xml index 0bbcd7eb..c6da8756 100644 --- a/MP.IOC/Resources/manifest.xml +++ b/MP.IOC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 8.16.2605.1119 + 8.16.2605.1208 https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/MP.IOC.zip https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/ChangeLog.html false diff --git a/MP.SPEC/Components/ListPODL.razor b/MP.SPEC/Components/ListPODL.razor index a651fcdf..e505b2c9 100644 --- a/MP.SPEC/Components/ListPODL.razor +++ b/MP.SPEC/Components/ListPODL.razor @@ -28,6 +28,7 @@ else } Cod + Kit Articolo Fase @if (!(showRecipeConf || showRecipeArch)) @@ -127,6 +128,16 @@ else } + + @if (record.IsKitParent) + { + P. + } + else if (record.IsKitChild) + { + .C + } +
    @record.CodArticolo diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index c0b1514c..ebbec626 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -1,7 +1,5 @@ -using DnsClient.Protocol; -using EgwCoreLib.Utils; +using EgwCoreLib.Utils; using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Options; using MP.Core.Conf; using MP.Core.DTO; using MP.Core.Objects; @@ -10,13 +8,11 @@ using MP.Data.Controllers; using MP.Data.DbModels; using MP.Data.MgModels; using MP.Data.Services; -using MP.SPEC.Components.ProdKit; using Newtonsoft.Json; using NLog; using StackExchange.Redis; using System.Data; using System.Diagnostics; -using ZXing; namespace MP.SPEC.Data { @@ -2463,7 +2459,7 @@ namespace MP.SPEC.Data } else { - result = await Task.FromResult(dbController.ListPODLFilt(lanciato, keyRichPart, idxMacchina, codGruppo, startDate, endDate)); + result = await dbController.ListPODLFiltAsync(lanciato, keyRichPart, idxMacchina, codGruppo, startDate, endDate); // serializzo e salvo... rawData = JsonConvert.SerializeObject(result); redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisShortTimeCache)); @@ -2504,7 +2500,7 @@ namespace MP.SPEC.Data } else { - result = await Task.FromResult(dbController.ListPODL_KitFilt(lanciato, keyRichPart, idxMacchina, codGruppo, startDate, endDate)); + result = await dbController.ListPODL_KitFiltAsync(lanciato, keyRichPart, idxMacchina, codGruppo, startDate, endDate); // serializzo e salvo... rawData = JsonConvert.SerializeObject(result); redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisShortTimeCache)); diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 72831ad8..9deac4d1 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 8.16.2604.2718 + 8.16.2605.2517 1800a78a-6ff1-40f9-b490-87fb8bfc1394 en diff --git a/MP.SPEC/Pages/Articoli.razor b/MP.SPEC/Pages/Articoli.razor index 2130edd8..a2a3c7e7 100644 --- a/MP.SPEC/Pages/Articoli.razor +++ b/MP.SPEC/Pages/Articoli.razor @@ -150,7 +150,7 @@ @foreach (var record in ListRecords) { - + diff --git a/MP.SPEC/Pages/Articoli.razor.cs b/MP.SPEC/Pages/Articoli.razor.cs index 754d6211..e3b23914 100644 --- a/MP.SPEC/Pages/Articoli.razor.cs +++ b/MP.SPEC/Pages/Articoli.razor.cs @@ -9,19 +9,11 @@ namespace MP.SPEC.Pages { #region Public Methods - public string checkSelect(string CodArticolo) + public string CheckSelect(string codArticolo) { - string answ = ""; - if (currRecord != null) - { - try - { - answ = (currRecord.CodArticolo == CodArticolo) ? "table-info" : ""; - } - catch - { } - } - return answ; + return currRecord?.CodArticolo == codArticolo + ? "table-info" + : ""; } private SelectArticoliParams currFilter = new SelectArticoliParams(); diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 133a7fea..9388728b 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

    Versione: 8.16.2604.2718

    +

    Versione: 8.16.2605.2517


    Note di rilascio:
    • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 87ec763e..45a6b113 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -8.16.2604.2718 +8.16.2605.2517 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 6abb2dad..73dad968 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 8.16.2604.2718 + 8.16.2605.2517 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