From 06fa9c782a222efa59fa78be03672af1b9673eb4 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 12 Aug 2020 18:57:16 +0200 Subject: [PATCH 1/2] VAri fix x ripristino funzionamento css selezione --- AppData/ComLib.cs | 21 ++++++++++++------- NKC_WF/Controllers/getMUCssController.cs | 16 +++++++++++--- NKC_WF/WebUserControls/cmp_MU_svgViewer.ascx | 8 +++---- .../WebUserControls/cmp_MU_svgViewer.ascx.cs | 2 -- NKC_WF/site/MachineUnload.aspx | 8 +------ NKC_WF/site/MachineUnload.aspx.cs | 13 ++++++------ 6 files changed, 38 insertions(+), 30 deletions(-) diff --git a/AppData/ComLib.cs b/AppData/ComLib.cs index 5e34bb6..39bdaaf 100644 --- a/AppData/ComLib.cs +++ b/AppData/ComLib.cs @@ -1928,6 +1928,7 @@ namespace AppData List itemsBin = new List(); List itemsSecOp = new List(); List itemsScrap = new List(); + List itemsSelect = new List(); //se ho items... if (tabItems.Count > 0) @@ -1960,6 +1961,11 @@ namespace AppData { itemsSecOp.Add(item.ItemDtmx); } + // se selezionato status 2... + if (item.StatusID == 2) + { + itemsSelect.Add(item.ItemDtmx); + } } } @@ -1980,7 +1986,8 @@ namespace AppData answ = updateCssByItemList(answ, redKeyBase, "ItemsScrap", itemsScrap, dataCacheTTL); // FIXED SEL da array oggetti selezionati... - answ = updateCssByPickedItems(answ, redKeyBase, "ItemsSel", dataCacheTTL); + answ = updateCssByItemList(answ, redKeyBase, "ItemsSel", itemsSelect, dataCacheTTL); + //answ = updateCssByPickedItems(answ, redKeyBase, "ItemsSel", dataCacheTTL); // INFINE serializzo e salvo tutti gli items trovati... @@ -2010,12 +2017,12 @@ namespace AppData bool answ = false; string rawData = memLayer.ML.getRSV($"{redKeyBase}:ItemsSel"); Dictionary dictData = new Dictionary(); - if (!string.IsNullOrEmpty(rawData)) - { - dictData = JsonConvert.DeserializeObject>(rawData); - } try { + if (!string.IsNullOrEmpty(rawData)) + { + dictData = JsonConvert.DeserializeObject>(rawData); + } // cerco chiave device... if (dictData.ContainsKey(deviceId)) { @@ -2064,12 +2071,12 @@ namespace AppData rawData = JsonConvert.SerializeObject(dictData); memLayer.ML.setRSV($"{redKeyBase}:ItemsSel", rawData); answ = true; - // reset memoria redis del CSS x obbligare refresh... - memLayer.ML.setRSV($"{redKeyBase}:Css", ""); } catch { } } + // reset memoria redis del CSS x obbligare refresh... + memLayer.ML.setRSV($"{redKeyBase}:Css", ""); return answ; } diff --git a/NKC_WF/Controllers/getMUCssController.cs b/NKC_WF/Controllers/getMUCssController.cs index c1e012d..5b6844e 100644 --- a/NKC_WF/Controllers/getMUCssController.cs +++ b/NKC_WF/Controllers/getMUCssController.cs @@ -40,14 +40,24 @@ namespace NKC_WF.Controllers string answ = ""; if (sheetID > 0) { + // TTL standard + int dataCacheTTL = memLayer.ML.cdvi("cssCacheTTL"); + dataCacheTTL = dataCacheTTL <= 0 ? 60 : dataCacheTTL; // recupero da REDIS! string redKey = $"{ComLib.machineUnloadArea(sheetID)}:Css"; // se vuoto scrivo VUOTO... - if (!memLayer.ML.redKeyPresent(redKey)) + if (memLayer.ML.redKeyPresent(redKey)) { - memLayer.ML.setRSV(redKey, answ); + answ = memLayer.ML.getRSV(redKey); } - answ = memLayer.ML.getRSV(redKey); + //if (!memLayer.ML.redKeyPresent(redKey)) + //{ + // memLayer.ML.setRSV(redKey, answ, dataCacheTTL / 2); + //} + //else + //{ + // answ = memLayer.ML.getRSV(redKey); + //} // RICALCOLO SOLO SE non trovo in REDIS (perché invalidato) if (string.IsNullOrEmpty(answ)) // se vuoto lo calcolo... diff --git a/NKC_WF/WebUserControls/cmp_MU_svgViewer.ascx b/NKC_WF/WebUserControls/cmp_MU_svgViewer.ascx index b0a65ed..947f555 100644 --- a/NKC_WF/WebUserControls/cmp_MU_svgViewer.ascx +++ b/NKC_WF/WebUserControls/cmp_MU_svgViewer.ascx @@ -25,8 +25,8 @@ if (data != lastVal) { $('#uplTavola').load(location.href + ' #dynCss'); document.getElementById('<%=hfCurrRev.ClientID%>').value = data; - } - }); + } + }); // qui leggo la versione del BUNK (con cambio foglio...) $.ajax({ url: "../api/getMUSheetRev/" + BunkId @@ -36,8 +36,8 @@ // ricarico intera pagina! location.reload(); document.getElementById('<%=hfCurrBunkRev.ClientID%>').value = data; - } - }); + } + }); } diff --git a/NKC_WF/WebUserControls/cmp_MU_svgViewer.ascx.cs b/NKC_WF/WebUserControls/cmp_MU_svgViewer.ascx.cs index 70faaaa..86d3f89 100644 --- a/NKC_WF/WebUserControls/cmp_MU_svgViewer.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_MU_svgViewer.ascx.cs @@ -18,7 +18,6 @@ namespace NKC_WF.WebUserControls if (hfBatchId.Value != value.ToString()) { hfBatchId.Value = value.ToString(); - //doUpdate(); } } get @@ -38,7 +37,6 @@ namespace NKC_WF.WebUserControls if (hfSheetId.Value != value.ToString()) { hfSheetId.Value = value.ToString(); - doUpdate(); } } get diff --git a/NKC_WF/site/MachineUnload.aspx b/NKC_WF/site/MachineUnload.aspx index 2fc76c2..204cd5e 100644 --- a/NKC_WF/site/MachineUnload.aspx +++ b/NKC_WF/site/MachineUnload.aspx @@ -2,7 +2,6 @@ <%@ Register Src="~/WebUserControls/cmp_MU_svgViewer.ascx" TagPrefix="uc1" TagName="cmp_MU_svgViewer" %> <%@ Register Src="~/WebUserControls/cmp_MU_stats.ascx" TagPrefix="uc1" TagName="cmp_MU_stats" %> -<%@ Register Src="~/WebUserControls/cmp_MU_suggestions.ascx" TagPrefix="uc1" TagName="cmp_MU_suggestions" %> <%@ Register Src="~/WebUserControls/cmp_MU_bins.ascx" TagPrefix="uc1" TagName="cmp_MU_bins" %> <%@ Register Src="~/WebUserControls/cmp_MU_carts.ascx" TagPrefix="uc1" TagName="cmp_MU_carts" %> @@ -14,7 +13,7 @@
- + @@ -43,11 +42,6 @@
- <%-- - - - - --%> diff --git a/NKC_WF/site/MachineUnload.aspx.cs b/NKC_WF/site/MachineUnload.aspx.cs index b326a32..416f0a6 100644 --- a/NKC_WF/site/MachineUnload.aspx.cs +++ b/NKC_WF/site/MachineUnload.aspx.cs @@ -11,8 +11,6 @@ namespace NKC_WF if (!Page.IsPostBack) { ((SiteMaster)this.Master).showSearch = false; - // svuoto redis... - memLayer.ML.redFlushKey(ComLib.redMachUnloadCount); doUpdate(); } } @@ -64,6 +62,7 @@ namespace NKC_WF cmp_MU_carts.BatchId = BatchId; cmp_MU_svgViewer.BatchId = BatchId; cmp_MU_svgViewer.SheetId = SheetId; + cmp_MU_svgViewer.doUpdate(); } } /// @@ -111,22 +110,22 @@ namespace NKC_WF int counter = numWaitSvg; doUpdate(); // ogni x cicli - if (counter % 4 == 0) + if (counter % 5 == 0) { cmp_MU_stats.doUpdate(); - upnlStats.DataBind(); + +#if false // verifico se c'è richiesta reload UNLOAD... if (!string.IsNullOrEmpty(memLayer.ML.getRSV(redProdForceReload))) { Response.Redirect(Request.RawUrl); - } + } +#endif } if (counter % 2 == 0) { cmp_MU_carts.doUpdate(); - upnlCarts.DataBind(); cmp_MU_bins.doUpdate(); - upnlCarts.DataBind(); } incrNumWait(); } From f676296e4cf3155b91dd98f6656314cd8455041a Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 12 Aug 2020 18:57:34 +0200 Subject: [PATCH 2/2] New rel --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d83e1d5..8cbf4c9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { steps { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=324']) { + withEnv(['NEXT_BUILD_NUMBER=325']) { // env.versionNumber = VersionNumber(versionNumberString : '1.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '1.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.versionNumberBeta = VersionNumber(versionNumberString : '1.1.${BUILD_DATE_FORMATTED, "yyMM"}-beta.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')