From d4f84f4226868f130c9c4d0d8adc0bd5cc666c4b Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 14 Dec 2023 16:16:56 +0100 Subject: [PATCH] Fix display post conferma prod --- MP-TAB-SERV/Components/ProdConfirm.razor | 1 - MP-TAB-SERV/Components/ProdConfirm.razor.cs | 443 +------------------- MP-TAB-SERV/MP-TAB-SERV.csproj | 2 +- MP-TAB-SERV/Resources/ChangeLog.html | 2 +- MP-TAB-SERV/Resources/VersNum.txt | 2 +- MP-TAB-SERV/Resources/manifest.xml | 2 +- 6 files changed, 5 insertions(+), 447 deletions(-) diff --git a/MP-TAB-SERV/Components/ProdConfirm.razor b/MP-TAB-SERV/Components/ProdConfirm.razor index d98992c6..33f11295 100644 --- a/MP-TAB-SERV/Components/ProdConfirm.razor +++ b/MP-TAB-SERV/Components/ProdConfirm.razor @@ -30,7 +30,6 @@ @if (showInnov) { - @*class="d-flex justify-content-between"*@
diff --git a/MP-TAB-SERV/Components/ProdConfirm.razor.cs b/MP-TAB-SERV/Components/ProdConfirm.razor.cs index 50763870..15d8818a 100644 --- a/MP-TAB-SERV/Components/ProdConfirm.razor.cs +++ b/MP-TAB-SERV/Components/ProdConfirm.razor.cs @@ -170,9 +170,9 @@ namespace MP_TAB_SERV.Components protected async Task SalvaConfPz() { isProcessing = true; - await Task.Delay(1); // effettua conferma con conf da DB del tipo (giorni / turni / periodo bool fatto = effettuaConfermaProd(); + await TabDServ.FlushCache("StatoProd"); // refresh tabella dati tablet... await TabDServ.RicalcMse(IdxMaccSel, 0); // rileggo e salvo.. @@ -188,8 +188,6 @@ namespace MP_TAB_SERV.Components lblOut = $"Confermata produzione {numPzConfermati - numPzLasciati} pezzi (+{numPzLasciati} pz lasciati, +{numPzScarto2Rec} pz scarto) |{dtReqUpdate:HH:mm:ss} | {dtReqUpdate:ddd yyyy.MM.dd}"; // cambio button conferma... showInnov = false; - // sollevo evento! - //dtReqUpdate = DateTime.Now; numPzLasciati = 0; await DoUpdate(); await Task.Delay(1); @@ -291,445 +289,6 @@ namespace MP_TAB_SERV.Components #endregion Private Methods -#if false - /// - /// restituisce css disabled SE odl NON OK... - /// - public string cssBtnConf - { - get - { - return odlOk ? "" : "disabled"; - } - } - - /// - /// Data-Ora ultimo update valori produzione - /// - public DateTime dtReqUpdate - { - get - { - DateTime answ = DateTime.Now; - DateTime.TryParse(hfDtReqUpdate.Value, out answ); - return answ; - } - set - { - hfDtReqUpdate.Value = $"{value}"; - } - } - - protected DateTime dtFine - { - set - { - lblFine.Text = value.ToString(); - } - } - - /// - /// Numero pezzi PRODOTTI da ultima conferma - /// - protected DateTime dtInizio - { - set - { - lblInizio.Text = value.ToString(); - } - } - - /// - /// Numero pezzi PRODOTTI da ultima conferma - /// - protected int numPz2Rec - { - set - { - lblPz2RecTot.Text = value.ToString(); - } - } - - /// - /// Numero pezzi BUONI già confermati - /// - protected int numPzBuoniConf - { - set - { - lblPzConfBuoni.Text = value.ToString(); - } - } - - /// - /// Numero pezzi confermati (buoni - scarto) - /// - protected int numPzConfermati - { - get - { - return numPzProdotti2Rec - numPzScarto2Rec; - } - } - - /// - /// Numero pezzi da LASCIARE non dichiarati - /// - protected int numPzLasciati - { - set - { - txtNumLasciati.Text = value.ToString(); - } - get - { - int answ = 0; - try - { - answ = Convert.ToInt32(txtNumLasciati.Text); - } - catch - { } - return answ; - } - } - - /// - /// Numero pezzi PRODOTTI GLOBALI - /// - protected int numPzProdotti - { - set - { - lblPzTotODL.Text = value.ToString(); - } - } - - /// - /// Numero pezzi PRODOTTI da registrare - /// - /// da ultima conferma - protected int numPzProdotti2Rec - { - set - { - txtNumPezzi.Text = value.ToString(); - } - get - { - int answ = 0; - try - { - answ = Convert.ToInt32(txtNumPezzi.Text); - } - catch - { } - return answ; - } - } - - /// - /// Numero pezzi SCARTO già confermati - /// - protected int numPzScaConf - { - set - { - lblPzConfScarto.Text = value.ToString(); - } - } - - /// - /// Numero pezzi SCARTATI da registrare - /// - protected int numPzScarto2Rec - { - set - { - lblPz2RecScarto.Text = value.ToString(); - memLayer.ML.setSessionVal("lblPz2RecScarto", value); - } - get - { - int answ = 0; - try - { - answ = memLayer.ML.IntSessionObj("lblPz2RecScarto"); - } - catch - { } - return answ; - } - } - - protected void ddlSubMacc_DataBound(object sender, EventArgs e) - { - // se ho in memoria un valore LO REIMPOSTO... - if (!string.IsNullOrEmpty(subMaccSel)) - { - // se è una SUB machcina (contiene "#") - if (subMaccSel.Contains("#")) - { - // provo a preselezionare... - try - { - ddlSubMacc.SelectedValue = subMaccSel; - } - catch - { } - } - // altrimenti salvo! - else - { - subMaccSel = ddlSubMacc.SelectedValue; - } - } - } - - protected void ddlSubMacc_SelectedIndexChanged(object sender, EventArgs e) - { - subMaccSel = ddlSubMacc.SelectedValue; - // salvo ODL - DataLayerObj.taMSE.getByIdxMaccAndSub(idxMacchinaSel, subMaccSel); - //altri controlli - checkAll(); - } - - /// - /// salvo produzione - /// - /// - /// - protected void lbtSalva_Click(object sender, EventArgs e) - { - // effettua conferma con conf da DB del tipo (giorni / turni / periodo - bool fatto = effettuaConfermaProd(); - // refresh tabella dati tablet... - DataLayerObj.taMSE.forceRecalc(0, idxMacchinaSel); - // mostro output - lblOut.Text = string.Format("Confermata la produzione per {0} pezzi! (+{1} pz scarto) alle {2:yyyy-MM-dd HH:mm:ss}", numPzConfermati, numPzScarto2Rec, dtReqUpdate); - // cambio button conferma... - switchBtnConferma(!txtNumPezzi.Enabled); - // sollevo evento! - if (eh_newVal != null) - { - eh_newVal(this, new EventArgs()); - } - dtReqUpdate = DateTime.Now; - doUpdate(); - } - - /// - /// caricamento pagina - /// - /// - /// - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - checkAll(); - if (isMulti) - { - // sollevo evento! - if (eh_reset != null) - { - eh_reset(this, new EventArgs()); - } - } - } - } - - /// - /// Update pz lasciati --> aggiorno! - /// - /// - /// - protected void txtNumLasciati_TextChanged(object sender, EventArgs e) - { - lblOut.Text = ""; - updatePzBuoni(); - } - - /// - /// update post modifica pz buoni - /// - /// - /// - protected void txtNumPezzi_TextChanged(object sender, EventArgs e) - { - lblOut.Text = ""; - updatePzBuoni(); - } - - /// - /// ODL correntemente sulla macchina - /// - cerca in Redis (TTL 5 sec) - /// - altrimenti recupera da DB... - /// - protected void updateOdl() - { - // userò ODL del turno - int answ = 0; - // cerco da redis... - int.TryParse(DataLayerObj.currODL(idxMacchinaSel, true), out answ); - // salvo! - idxOdl = answ; - } - - private void checkAll() - { - updateOdl(); - checkConfig(); - fixSelMacc(); - checkOdl(); - lblOut.Text = ""; - switchBtnConferma(false); - lbtShowConfProd.Visible = odlOk; - lblConfProd.Visible = !odlOk; - } - - /// - /// verifica config x modalità permesse - /// - private void checkConfig() - { - // verifico SE sia permesso gestire i "Pezzi lasciati" in macchina... - lblNumLasciati.Visible = enablePzProdLasciati; - txtNumLasciati.Visible = enablePzProdLasciati; - lblEmptyNumLasciati.Visible = !enablePzProdLasciati; - } - - /// - /// Verifica se abbia un ODL ATTIVO - /// - private void checkOdl() - { - lbtShowConfProd.Visible = odlOk; - lblConfProd.Visible = !odlOk; - lblMancaODL.Visible = !odlOk; - } - - /// - /// Registra conferma produzione in modalità nuova (con rettifica pezzi lasciati) o legacy - /// (con anticipo periodo) - /// - private bool effettuaConfermaProd() - { - bool fatto = false; - if (confRett) - { - // confermo al netto dei pezzi lasciati... - fatto = DataLayerObj.confermaProdMacchinaFull(idxMacchinaSel, memLayer.ML.CRI("modoConfProd"), numPzConfermati - numPzLasciati, numPzLasciati, numPzScarto2Rec, dtReqUpdate); - } - else - { - fatto = DataLayerObj.confermaProdMacchina(idxMacchinaSel, memLayer.ML.CRI("modoConfProd"), numPzConfermati, numPzScarto2Rec, dtReqUpdate); - } - return fatto; - } - - /// - /// Se la machcina è MULTI --> mostro selettore - /// - private void fixSelMacc() - { - divSelMacc.Visible = isMulti; - if (isMulti) - { - try - { - // salvo selezione submacc - ddlSubMacc.DataBind(); - subMaccSel = ddlSubMacc.SelectedValue; - } - catch - { } - } - updateOdl(); - } - - /// - /// Reset parametri x calcolo pezzi (no pezzi lasciati, dataora attuale...) - /// - private void resetParam() - { - dtReqUpdate = DateTime.Now; - numPzLasciati = 0; - } - - /// - /// determina comportamento btn conferma - /// - private void switchBtnConferma(bool showConf) - { - // aggiorno valori rilevati - resetParam(); - doUpdate(); - divInnovazioni.Visible = showConf; - if (showConf) - { - try - { - updatePzBuoni(); - // sollevo evento! - if (eh_inserting != null) - { - eh_inserting(this, new EventArgs()); - } - } - catch - { - txtNumPezzi.Text = "0"; - logger.lg.scriviLog(string.Format("Errore recupero pezzi da confermare per la macchina {0}", idxMacchinaSel), tipoLog.ERROR); - } - } - if (showConf) - { - lblShowConfProd.Text = "Nascondi Conferma"; - } - else - { - lblShowConfProd.Text = "Mostra Conferma"; - // sollevo evento! - if (eh_reset != null) - { - eh_reset(this, new EventArgs()); - } - } - } - - /// - /// aggiorna visualizzazione pz buoni /prodotti - scarti) - /// - private void updatePzBuoni() - { - if (confRett) - { - // cambio le qta di pezzi confermati... - lblPz2RecBuoni.Text = (numPzConfermati - numPzLasciati).ToString(); - } - else - { - // se ho dei pezzi lasciati RICALCOLO la data... - if (numPzLasciati > 0) - { - // calcolo la data.. - DS_ProdTempi.TempiCicloRilevatiDataTable tab = DataLayerObj.taTempiCicloRilevati.getLastPzByMaccQta(idxMacchinaSel, DateTime.Now, numPzLasciati); - if (tab.Rows.Count > 0) - { - dtReqUpdate = tab[0].DataOraRif.AddSeconds(1); - } - // aggiorno - doUpdate(); - } - lblPz2RecBuoni.Text = numPzConfermati.ToString(); - } - // aggiorno la data calcolo + pezzi buoni... - lblDtRec.Text = dtReqUpdate.ToString(); - } - -#endif } } \ No newline at end of file diff --git a/MP-TAB-SERV/MP-TAB-SERV.csproj b/MP-TAB-SERV/MP-TAB-SERV.csproj index 44ab1251..a661d908 100644 --- a/MP-TAB-SERV/MP-TAB-SERV.csproj +++ b/MP-TAB-SERV/MP-TAB-SERV.csproj @@ -3,7 +3,7 @@ net6.0 enable - 6.16.2312.1414 + 6.16.2312.1416 enable MP_TAB_SERV diff --git a/MP-TAB-SERV/Resources/ChangeLog.html b/MP-TAB-SERV/Resources/ChangeLog.html index c4b2ccc1..16d6d30f 100644 --- a/MP-TAB-SERV/Resources/ChangeLog.html +++ b/MP-TAB-SERV/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2312.1414

+

Versione: 6.16.2312.1416


Note di rilascio:
  • diff --git a/MP-TAB-SERV/Resources/VersNum.txt b/MP-TAB-SERV/Resources/VersNum.txt index e8a51188..4ed19b58 100644 --- a/MP-TAB-SERV/Resources/VersNum.txt +++ b/MP-TAB-SERV/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2312.1414 +6.16.2312.1416 diff --git a/MP-TAB-SERV/Resources/manifest.xml b/MP-TAB-SERV/Resources/manifest.xml index c52ac7f7..54d87b0d 100644 --- a/MP-TAB-SERV/Resources/manifest.xml +++ b/MP-TAB-SERV/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2312.1414 + 6.16.2312.1416 https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/MP-TAB-SERV.zip https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/ChangeLog.html false