From 779179299cad557145626201f05aa0edd54384f1 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 30 Jan 2020 09:00:38 +0100 Subject: [PATCH 1/2] Fix condizione display BIN/CART --- Jenkinsfile | 2 +- NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2ae6855..71605a7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=240']) { + withEnv(['NEXT_BUILD_NUMBER=241']) { // env.versionNumber = VersionNumber(versionNumberString : '0.9.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '0.9.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.versionNumberBeta = VersionNumber(versionNumberString : '0.9.${BUILD_DATE_FORMATTED, "yyMM"}-beta.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') diff --git a/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs b/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs index 4420365..efbc5f3 100644 --- a/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs @@ -360,11 +360,11 @@ namespace NKC_WF.WebUserControls // salvo che è in STATO 2 (picked up) DataLayer.man.taIL.updateStatus(itemRow.ItemID, 2, PlaceId); // verifico cosa devo mostrare come PROX passaggio... - showCart = itemRow.ProcessesReq == "0"; + showCart = itemRow.ProcessesReq == ""; // !!!CHECK ME!!! deve cercare #PaintFlag?!? - showBin = itemRow.ProcessesReq == "2"; + showBin = (itemRow.ProcessesReq.Contains("PaintFlag")); secOp = itemRow.PostProcList; - showSecOp = (secOp != "0"); + showSecOp = (secOp != ""); doUpdate(); break; case 3: @@ -468,7 +468,9 @@ namespace NKC_WF.WebUserControls // controllo SE HO cart if (currCartTab.Count == 1) { - lblDestination.Text = $"SEND TO CART {currCartTab[0].CartDtmx}"; + var cartRow = currCartTab[0]; + // imposto OUT + lblDestination.Text = $"SEND TO CART C{cartRow.CartIndex} ({cartRow.CartDtmx})"; } else { @@ -483,7 +485,8 @@ namespace NKC_WF.WebUserControls lblMessage.Text = "Item recognized"; if (currBinTab.Count == 1) { - lblDestination.Text = $"SEND TO BIN {currBinTab[0].BinDtmx}"; + var binRow = currBinTab[0]; + lblDestination.Text = $"SEND TO BIN B{binRow.BinIndex} ({binRow.BinDtmx})"; } else { From 13e1085f3b249c6975898af8ddc24cae84999c08 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 30 Jan 2020 10:11:22 +0100 Subject: [PATCH 2/2] Completato check UNLOAD SMART --- AppData/ComLib.cs | 4 +- NKC_WF/WebUserControls/cmp_MU_Items.ascx | 38 +++- NKC_WF/WebUserControls/cmp_MU_Items.ascx.cs | 30 +++ NKC_WF/WebUserControls/cmp_unloadSmart.ascx | 3 + .../WebUserControls/cmp_unloadSmart.ascx.cs | 199 +++++++++++------- .../cmp_unloadSmart.ascx.designer.cs | 27 +++ 6 files changed, 221 insertions(+), 80 deletions(-) diff --git a/AppData/ComLib.cs b/AppData/ComLib.cs index f4da12b..7f24a1e 100644 --- a/AppData/ComLib.cs +++ b/AppData/ComLib.cs @@ -1539,8 +1539,8 @@ namespace AppData { // aggiungoncomunque a lista generale... itemsAll.Add(item.ItemDtmx); - // controllo SE sia stato depositato... check null su campo data - if (!item.IsOnCartDateNull()) + // controllo SE sia stato depositato... check status 3/4 + if (item.StatusID == 3 || item.StatusID == 4) { itemsDepo.Add(item.ItemDtmx); } diff --git a/NKC_WF/WebUserControls/cmp_MU_Items.ascx b/NKC_WF/WebUserControls/cmp_MU_Items.ascx index f82675b..673fc66 100644 --- a/NKC_WF/WebUserControls/cmp_MU_Items.ascx +++ b/NKC_WF/WebUserControls/cmp_MU_Items.ascx @@ -10,15 +10,39 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - diff --git a/NKC_WF/WebUserControls/cmp_MU_Items.ascx.cs b/NKC_WF/WebUserControls/cmp_MU_Items.ascx.cs index 7b0acc3..3ec3810 100644 --- a/NKC_WF/WebUserControls/cmp_MU_Items.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_MU_Items.ascx.cs @@ -79,5 +79,35 @@ namespace NKC_WF.WebUserControls doUpdate(); } } + /// + /// Calcola css da statusID + /// + /// + /// + public string cssByStatus(object _statusID) + { + string answ = "text-secondary"; + int statusID = 0; + int.TryParse(_statusID.ToString(), out statusID); + switch (statusID) + { + case 1: + answ = "text-dark"; + break; + case 2: + answ = "text-warning"; + break; + case 3: + answ = "text-success"; + break; + case 4: + answ = "text-info"; + break; + default: + answ = "text-danger"; + break; + } + return answ; + } } } \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_unloadSmart.ascx b/NKC_WF/WebUserControls/cmp_unloadSmart.ascx index f4e051e..6cbc251 100644 --- a/NKC_WF/WebUserControls/cmp_unloadSmart.ascx +++ b/NKC_WF/WebUserControls/cmp_unloadSmart.ascx @@ -14,6 +14,9 @@ + + +
diff --git a/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs b/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs index efbc5f3..572f2f8 100644 --- a/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.cs @@ -6,9 +6,45 @@ namespace NKC_WF.WebUserControls { public partial class cmp_unloadSmart : BaseUserControl { - protected bool showBin = false; - protected bool showCart = false; - protected bool showSecOp = false; + protected bool showBin + { + set + { + hfShowBin.Value = value.ToString(); + } + get + { + bool answ = false; + bool.TryParse(hfShowBin.Value, out answ); + return answ; + } + } + protected bool showCart + { + set + { + hfShowCart.Value = value.ToString(); + } + get + { + bool answ = false; + bool.TryParse(hfShowCart.Value, out answ); + return answ; + } + } + protected bool showSecOp + { + set + { + hfShowSecOp.Value = value.ToString(); + } + get + { + bool answ = false; + bool.TryParse(hfShowSecOp.Value, out answ); + return answ; + } + } /// /// ID univoco da IP /// @@ -94,6 +130,7 @@ namespace NKC_WF.WebUserControls { if (!Page.IsPostBack) { + resetShowData(); resetIcons(); updateCurrData(); } @@ -104,6 +141,14 @@ namespace NKC_WF.WebUserControls lblMessage.Text = "----"; lblDestination.Text = "--"; } + + private void resetShowData() + { + showCart = false; + showBin = false; + showSecOp = false; + } + /// /// Comando barcode letto /// @@ -164,8 +209,7 @@ namespace NKC_WF.WebUserControls { case codeType.UNK: cmp_barcode.showOutput("text-danger", $"Unknown Data: {decoData.rawData} --> no action"); - // elimino item sel... - ComLib.resetItemPickup(SheetID, DeviceId); + resetSelection(true); doRaiseEv = true; break; case codeType.Item: @@ -204,8 +248,7 @@ namespace NKC_WF.WebUserControls break; default: cmp_barcode.showOutput("text-danger", $"Unknown Data: {decoData.rawData} --> no action"); - // elimino item sel... - ComLib.resetItemPickup(SheetID, DeviceId); + resetSelection(true); break; } @@ -263,42 +306,52 @@ namespace NKC_WF.WebUserControls } break; case codeType.Cart: - if (currCartTab.Count == 1) + // verifico NON SIA richiesto PAINT + if (showBin) { - // controllo se sia quello corretto - if (rawData != currCartTab[0].CartDtmx) + displError("PAINT: BIN REQUESTED: please retry", true); + } + else + { + if (currCartTab.Count == 1) { - lblErrorMsg.Text = "INCORRECT CART: please retry"; - itemIdSelected = 0; - divItemError.Visible = true; - } - else - { - // dichiaro che è depositato - DataLayer.man.taIL.updateStatus(itemIdSelected, 3, PlaceId); - lblDestination.Text = $"Item {itemIdSelected} PUT IN CART {rawData}"; - // elimino item sel... - ComLib.resetItemPickup(SheetID, DeviceId); + // controllo se sia quello corretto + if (rawData != currCartTab[0].CartDtmx) + { + displError("INCORRECT CART: please retry", true); + } + else + { + // dichiaro che è depositato + DataLayer.man.taIL.updateStatus(itemIdSelected, 3, PlaceId); + lblDestination.Text = $"Item {itemIdSelected} PUT IN CART {rawData}"; + resetSelection(false); + } } } break; case codeType.Bin: - if (currBinTab.Count == 1) + // verifico NON SIA richiesto PAINT + if (showCart) { - // controllo se sia quello corretto - if (rawData != currBinTab[0].BinDtmx) + displError("NOT PAINTED: CART REQUESTED: please retry", true); + } + else + { + if (currBinTab.Count == 1) { - lblErrorMsg.Text = "INCORRECT BIN: please retry"; - itemIdSelected = 0; - divItemError.Visible = true; - } - else - { - // dichiaro che è depositato - DataLayer.man.taIL.updateStatus(itemIdSelected, 4, PlaceId); - lblDestination.Text = $"Item {itemIdSelected} PUT IN BIN {rawData}"; - // elimino item sel... - ComLib.resetItemPickup(SheetID, DeviceId); + // controllo se sia quello corretto + if (rawData != currBinTab[0].BinDtmx) + { + displError("INCORRECT BIN: please retry", true); + } + else + { + // dichiaro che è depositato + DataLayer.man.taIL.updateStatus(itemIdSelected, 4, PlaceId); + lblDestination.Text = $"Item {itemIdSelected} PUT IN BIN {rawData}"; + resetSelection(false); + } } } break; @@ -318,13 +371,33 @@ namespace NKC_WF.WebUserControls // mostro output (compreso che mi aspetto entro 30 sec lettura cart/Bin) -#if false - icnCart.Attributes.Remove("class"); - icnCart.Attributes.Add("class", "btn btn-sm btn-block btn-success"); - lblMessage.Text = "Riconosciuto item"; - lblDestination.Text = "SEND TO CART CR00012"; - lblDestination.CssClass = "text-success"; -#endif + } + /// + /// Mostra errore ed effettua reset vari... + /// + /// + /// + protected void displError(string errorMessage, bool resetStatus) + { + lblErrorMsg.Text = errorMessage; + divItemError.Visible = true; + resetSelection(resetStatus); + } + /// + /// Reset selezione item + blocchi suggerimento + sel REDIS x pagina unload + /// + /// + protected void resetSelection(bool resetStatus) + { + if (resetStatus) + { + // riposto item a status 1... + DataLayer.man.taIL.updateStatus(itemIdSelected, 1, PlaceId); + } + // elimino item sel... + itemIdSelected = 0; + resetShowData(); + ComLib.resetItemPickup(SheetID, DeviceId); } /// /// Mostra o nasconde dettaglio su ITEM letto @@ -333,12 +406,12 @@ namespace NKC_WF.WebUserControls /// private void showItemDetail(bool showItem, DS_App.ItemListRow itemRow, bool showError) { + resetShowData(); divItemDet.Visible = showItem; divItemError.Visible = showError; if (showError) { - lblErrorMsg.Text = "Item not found"; - itemIdSelected = 0; + displError("Item not found",true); } if (showItem) { @@ -350,9 +423,7 @@ namespace NKC_WF.WebUserControls switch (itemRow.StatusID) { case 0: - lblErrorMsg.Text = "ERROR: Item not ready"; - itemIdSelected = 0; - divItemError.Visible = true; + displError("ERROR: Item not ready", false); break; case 1: case 2: @@ -361,42 +432,29 @@ namespace NKC_WF.WebUserControls DataLayer.man.taIL.updateStatus(itemRow.ItemID, 2, PlaceId); // verifico cosa devo mostrare come PROX passaggio... showCart = itemRow.ProcessesReq == ""; - // !!!CHECK ME!!! deve cercare #PaintFlag?!? showBin = (itemRow.ProcessesReq.Contains("PaintFlag")); secOp = itemRow.PostProcList; showSecOp = (secOp != ""); doUpdate(); break; case 3: - lblErrorMsg.Text = "Item already on CART!"; - itemIdSelected = 0; - divItemError.Visible = true; + displError("Item already on CART!", false); break; case 4: // fino a concorrenza qta richiesta sposto, POI do errori - lblErrorMsg.Text = "ALL Item already scanned on BIN!"; - itemIdSelected = 0; - divItemError.Visible = true; + displError("ALL Item already scanned on BIN!", false); break; case 5: - lblErrorMsg.Text = "Item already at KIT STATION!"; - itemIdSelected = 0; - divItemError.Visible = true; + displError("Item already at KIT STATION!", false); break; case 990: - lblErrorMsg.Text = "Item declared SCRAP!"; - itemIdSelected = 0; - divItemError.Visible = true; + displError("Item declared SCRAP!", false); break; case 991: - lblErrorMsg.Text = "Item declared SCRAP with CNC program created!"; - itemIdSelected = 0; - divItemError.Visible = true; + displError("Item declared SCRAP with CNC program created!",false); break; default: - lblErrorMsg.Text = "ERROR: Item status UNKNOWN!"; - itemIdSelected = 0; - divItemError.Visible = true; + displError("ERROR: Item status UNKNOWN!", false); break; } } @@ -510,7 +568,7 @@ namespace NKC_WF.WebUserControls { // resetto item selezionato... DataLayer.man.taIL.updateStatus(itemIdSelected, 1, PlaceId); - itemIdSelected = 0; + resetSelection(true); showItemDetail(false, null, false); } protected void lbtResetSel_Click(object sender, EventArgs e) @@ -518,9 +576,10 @@ namespace NKC_WF.WebUserControls var tabSheet = DataLayer.man.taSHL.getByItemID(itemIdSelected); if (tabSheet.Count == 1) { + resetShowData(); // resetto sheet selezionato... DataLayer.man.taIL.updateSheetStatusPU(tabSheet[0].SheetID, PlaceId); - itemIdSelected = 0; + resetSelection(true); showItemDetail(false, null, false); } } @@ -533,7 +592,7 @@ namespace NKC_WF.WebUserControls { // resetto item selezionato... DataLayer.man.taIL.updateStatus(itemIdSelected, 100, PlaceId); - itemIdSelected = 0; + resetSelection(true); showItemDetail(false, null, false); lblMessage.Text = "Item Parked"; } @@ -546,8 +605,6 @@ namespace NKC_WF.WebUserControls { // resetto item selezionato... DataLayer.man.taIL.updateStatus(itemIdSelected, 990, PlaceId); - //itemIdSelected = 0; - //showItemDetail(true, null, false); lblMessage.Text = "Item Set SCRAPPED"; // rirprocesso barcode... lastCmd = lastValidCmd; diff --git a/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.designer.cs b/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.designer.cs index 73d796d..13796bb 100644 --- a/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.designer.cs +++ b/NKC_WF/WebUserControls/cmp_unloadSmart.ascx.designer.cs @@ -68,6 +68,33 @@ namespace NKC_WF.WebUserControls /// protected global::System.Web.UI.WebControls.HiddenField hfLastValidBCode; + /// + /// Controllo hfShowCart. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.HiddenField hfShowCart; + + /// + /// Controllo hfShowBin. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.HiddenField hfShowBin; + + /// + /// Controllo hfShowSecOp. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.HiddenField hfShowSecOp; + /// /// Controllo divItemDet. ///