From 158c60a930b446c5ac0d6e4de3bce6c312c4e5ea Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 17 Jan 2020 11:46:02 +0100 Subject: [PATCH] Update output stima/nest x dati su MongoDB --- AppData/ComLib.cs | 7 +- Jenkinsfile | 2 +- NKC_WF/Web.config | 1 + NKC_WF/WebUserControls/cmp_batchDetail.ascx | 9 ++- .../WebUserControls/cmp_batchDetail.ascx.cs | 28 +++++++ .../cmp_batchDetail.ascx.designer.cs | 75 +++++++++++-------- 6 files changed, 85 insertions(+), 37 deletions(-) diff --git a/AppData/ComLib.cs b/AppData/ComLib.cs index 6e8eb1d..80ad5b0 100644 --- a/AppData/ComLib.cs +++ b/AppData/ComLib.cs @@ -85,7 +85,7 @@ namespace AppData /// /// /// - public nestReplyBatchInitial geEstAnsw(int BatchID) + public nestReplyBatchInitial getEstAnsw(int BatchID) { nestReplyBatchInitial answ = null; try @@ -95,7 +95,7 @@ namespace AppData var filter = filtBuilder.Eq("BatchID", BatchID); var collRawData = database.GetCollection("EstimationArchive"); // recupero - answ = collRawData.Find(filter).FirstOrDefault(); + answ = collRawData.Find(filter).Project("{_id: 0}").FirstOrDefault(); } catch { } @@ -114,9 +114,10 @@ namespace AppData // definisco filtro var filtBuilder = Builders.Filter; var filter = filtBuilder.Eq("BatchID", BatchID); + FindOptions opz = new FindOptions { ShowRecordId = false }; var collRawData = database.GetCollection("NestingArchive"); // recupero - answ = collRawData.Find(filter).FirstOrDefault(); + answ = collRawData.Find(filter).Project("{_id: 0}").FirstOrDefault(); } catch { } diff --git a/Jenkinsfile b/Jenkinsfile index d524078..1e0ddab 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=183']) { + withEnv(['NEXT_BUILD_NUMBER=187']) { // env.versionNumber = VersionNumber(versionNumberString : '0.7.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '0.7.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.versionNumberBeta = VersionNumber(versionNumberString : '0.7.${BUILD_DATE_FORMATTED, "yyMM"}-beta.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') diff --git a/NKC_WF/Web.config b/NKC_WF/Web.config index 47a909f..838a0a3 100644 --- a/NKC_WF/Web.config +++ b/NKC_WF/Web.config @@ -71,6 +71,7 @@ + diff --git a/NKC_WF/WebUserControls/cmp_batchDetail.ascx b/NKC_WF/WebUserControls/cmp_batchDetail.ascx index ae5cfb7..92c56d7 100644 --- a/NKC_WF/WebUserControls/cmp_batchDetail.ascx +++ b/NKC_WF/WebUserControls/cmp_batchDetail.ascx @@ -64,7 +64,8 @@
- min + + min
@@ -78,3 +79,9 @@ + +
+
+ +
+
diff --git a/NKC_WF/WebUserControls/cmp_batchDetail.ascx.cs b/NKC_WF/WebUserControls/cmp_batchDetail.ascx.cs index 8985c52..c7e2c34 100644 --- a/NKC_WF/WebUserControls/cmp_batchDetail.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_batchDetail.ascx.cs @@ -1,6 +1,8 @@ using AppData; using NKC_SDK; +using SteamWare; using System; +using System.Text; namespace NKC_WF.WebUserControls { @@ -18,6 +20,32 @@ namespace NKC_WF.WebUserControls { hfBatchId.Value = value.ToString(); frmView.DataBind(); + if (memLayer.ML.CRB("enableMongo")) + { + // cerco da lista salvataggi Estim/Nest... + var estimAnsw = ComLib.man.getEstAnsw(value); + var nestAnsw = ComLib.man.getNestAnsw(value); + StringBuilder sb = new StringBuilder(); + if (estimAnsw != null) + { + try + { + sb.AppendLine($"ESTIM: EnvNum: {estimAnsw.EnvNum} | Worktime: {estimAnsw.EstimatedWorktime / 60:N2} min | Processing Runtime {estimAnsw.ProcessingRuntime / 60:N2} min | Parts #: {estimAnsw.PartList.Count}"); + } + catch + { } + } + if (nestAnsw != null) + { + try + { + sb.AppendLine($"NEST: EnvNum: {nestAnsw.EnvNum} | Worktime: {nestAnsw.EstimatedWorktime / 60:N2} min | Processing Runtime {nestAnsw.ProcessingRuntime / 60:N2} min | Bunks #: {nestAnsw.BunkList.Count} | Carts #: {nestAnsw.CartList.Count}"); + } + catch + { } + } + lblTestJson.Text = sb.Replace("\r\n", "
").ToString(); + } } get { diff --git a/NKC_WF/WebUserControls/cmp_batchDetail.ascx.designer.cs b/NKC_WF/WebUserControls/cmp_batchDetail.ascx.designer.cs index a37a0b4..aa15521 100644 --- a/NKC_WF/WebUserControls/cmp_batchDetail.ascx.designer.cs +++ b/NKC_WF/WebUserControls/cmp_batchDetail.ascx.designer.cs @@ -7,36 +7,47 @@ // //------------------------------------------------------------------------------ -namespace NKC_WF.WebUserControls { - - - public partial class cmp_batchDetail { - - /// - /// Controllo frmView. - /// - /// - /// 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.FormView frmView; - - /// - /// Controllo hfBatchId. - /// - /// - /// 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 hfBatchId; - - /// - /// Controllo ods. - /// - /// - /// 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.ObjectDataSource ods; - } +namespace NKC_WF.WebUserControls +{ + + + public partial class cmp_batchDetail + { + + /// + /// Controllo frmView. + /// + /// + /// 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.FormView frmView; + + /// + /// Controllo hfBatchId. + /// + /// + /// 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 hfBatchId; + + /// + /// Controllo ods. + /// + /// + /// 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.ObjectDataSource ods; + + /// + /// Controllo lblTestJson. + /// + /// + /// 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.Label lblTestJson; + } }