diff --git a/AppData/ComLib.cs b/AppData/ComLib.cs index dde2d5c..d0ef66f 100644 --- a/AppData/ComLib.cs +++ b/AppData/ComLib.cs @@ -2369,6 +2369,11 @@ namespace AppData // preparo il contenuto della busta ed invio i messaggi... try { + // preliminare: se รจ stima EXT --> riporto pezzi su ordine ORIGINALE... + if (pType == 3) + { + DLMan.taOLT.setBatchSplit(BatchID, false); + } // in base allo stato del BATCH corrente determino il tempo e le opzioni da inviare... var batch = DLMan.taBL.getByKey(BatchID); int mTime = 1; diff --git a/NKC_SDK/Objects.cs b/NKC_SDK/Objects.cs index 672fd0f..1000fa9 100644 --- a/NKC_SDK/Objects.cs +++ b/NKC_SDK/Objects.cs @@ -110,6 +110,7 @@ namespace NKC_SDK /// Tipo di processing richiesto /// 1 = stima /// 2 = nesting + /// 3 = stima extended /// public int ProcType { get; set; } diff --git a/NKC_WF/Controllers/BatchProcController.cs b/NKC_WF/Controllers/BatchProcController.cs index 01074d6..502e011 100644 --- a/NKC_WF/Controllers/BatchProcController.cs +++ b/NKC_WF/Controllers/BatchProcController.cs @@ -495,11 +495,21 @@ namespace NKC_WF.Controllers DLMan.taBL.resetTree(rispNest.BatchID); // SALVO info riguardo al batch completato DLMan.taBL.updateStatus(rispNest.BatchID, bStatus, rispNest.EnvNum, (decimal)rispNest.EstimatedWorktime / 60); + // salvo info riguardo ai vari Bunk / Sheets / Items... - ComLib.updateBunksFromNesting(rispNest.BatchID, rispNest.BunkList); + if (rispNest.BunkList != null && rispNest.BunkList.Count > 0) + { + ComLib.updateBunksFromNesting(rispNest.BatchID, rispNest.BunkList); + } // salvo info x CART & BINS previsti - ComLib.updateBinsFromNesting(rispNest.BatchID, rispNest.BinList); - ComLib.updateCartsFromNesting(rispNest.BatchID, rispNest.CartList); + if (rispNest.BinList != null && rispNest.BinList.Count > 0) + { + ComLib.updateBinsFromNesting(rispNest.BatchID, rispNest.BinList); + } + if (rispNest.CartList != null && rispNest.CartList.Count > 0) + { + ComLib.updateCartsFromNesting(rispNest.BatchID, rispNest.CartList); + } isSplitReq = ComLib.checkSendBatchSplit(rispNest.BatchID); } diff --git a/NKC_WF/WebUserControls/cmp_batchDetail.ascx.cs b/NKC_WF/WebUserControls/cmp_batchDetail.ascx.cs index 271239f..a323da7 100644 --- a/NKC_WF/WebUserControls/cmp_batchDetail.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_batchDetail.ascx.cs @@ -104,7 +104,7 @@ namespace NKC_WF.WebUserControls { // ri-assegnazione ordini/kit a batch ancestor DLMan.taOLT.setBatchSplit(BatchId, false); - // registro accettazione Nesting + // registro reset Nesting DLMan.taBL.refuseNesting(BatchId, DLMan.CodSoggCurrUser); raiseEvent(); } @@ -115,11 +115,38 @@ namespace NKC_WF.WebUserControls ComLib.sendMaterials(); ComLib.sendBatchReq(BatchId, "Estimation", 3, false, 0); + + // ri-assegnazione ordini/kit a batch ancestor + if (BatchIsAncestor) + { + DLMan.taOLT.setBatchSplit(BatchId, false); + // registro reset Nesting + DLMan.taBL.refuseNesting(BatchId, DLMan.CodSoggCurrUser); + // resetto i batch child a 0 se presenti + resetChildBatch(); + // elimino gli orderExtTree + DLMan.taOLT.deleteByBatch(BatchId); + } + // registro su DB nesting iniziato... DLMan.taBL.updateStatus(BatchId, (int)BatchStatus.EstimationRequested, "", 0); raiseEvent(); } + private void resetChildBatch() + { + var tabDesc = ComLib.BatchDescendant(BatchId); + if (tabDesc != null && tabDesc.Count > 0) + { + foreach (var item in tabDesc) + { + DLMan.taBL.updateStatus(item.BatchID, (int)BatchStatus.Imported, "", -1); + // elimino order tree eventuale... + DLMan.taOLT.deleteByBatch(item.BatchID); + } + } + } + protected void lbtSendNesting_Click(object sender, EventArgs e) { // invia a redis a a richiesta... @@ -150,14 +177,7 @@ namespace NKC_WF.WebUserControls DLMan.taBL.updateStatus(BatchId, (int)BatchStatus.Imported, "", -1); if (BatchIsAncestor) { - var tabDesc = ComLib.BatchDescendant(BatchId); - if (tabDesc != null && tabDesc.Count > 0) - { - foreach (var item in tabDesc) - { - DLMan.taBL.updateStatus(item.BatchID, (int)BatchStatus.Imported, "", -1); - } - } + resetChildBatch(); } raiseEvent(); }