From a4d74ffa4ac9e13d2ff463fb57d11cd8efd23f77 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 17 Nov 2023 19:32:07 +0100 Subject: [PATCH] Aggiunto note x test soitaab --- IOB-WIN-NEXT/DATA/CONF/SIMUL_01.ini | 2 +- IOB-WIN-NEXT/Iob/Generic.cs | 11 +---- IOB-WIN-NEXT/Iob/Simula.cs | 7 ++- IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs | 62 ++------------------------ 4 files changed, 9 insertions(+), 73 deletions(-) diff --git a/IOB-WIN-NEXT/DATA/CONF/SIMUL_01.ini b/IOB-WIN-NEXT/DATA/CONF/SIMUL_01.ini index 707d5cc4..c7e77f6e 100644 --- a/IOB-WIN-NEXT/DATA/CONF/SIMUL_01.ini +++ b/IOB-WIN-NEXT/DATA/CONF/SIMUL_01.ini @@ -85,7 +85,7 @@ MAX_PZ_INCR_PERC=1000 ; conf parametri memoria READ/WRITE PARAM_CONF=SIMUL_01.json ;test gestione logfile (eg: soitaab) -EnabelPodlManFull=false +EnabelPodlManFull=true CodGruppoIob=STEAMWARE-SIM-FASE-01 ;conf test FTP diff --git a/IOB-WIN-NEXT/Iob/Generic.cs b/IOB-WIN-NEXT/Iob/Generic.cs index ae313ee3..3055ec3d 100644 --- a/IOB-WIN-NEXT/Iob/Generic.cs +++ b/IOB-WIN-NEXT/Iob/Generic.cs @@ -4339,15 +4339,8 @@ namespace IOB_WIN_NEXT.Iob protected string lastArtDescr { - get - { - string answ = redisMan.getRSV(redKeyProdLastArt); - return answ; - } - set - { - redisMan.setRSV(redKeyProdLastArt, value); - } + get => redisMan.getRSV(redKeyProdLastArt); + set => redisMan.setRSV(redKeyProdLastArt, value); } protected List ListaArticoli { get; set; } = new List(); diff --git a/IOB-WIN-NEXT/Iob/Simula.cs b/IOB-WIN-NEXT/Iob/Simula.cs index 52f516fc..a78ad537 100644 --- a/IOB-WIN-NEXT/Iob/Simula.cs +++ b/IOB-WIN-NEXT/Iob/Simula.cs @@ -654,7 +654,6 @@ namespace IOB_WIN_NEXT.Iob bool answ = false; // leggo direttamente il file di test in area c:\temp - if (Directory.Exists(logDirPath)) { string filePath = Path.Combine(logDirPath, $"Report-{DateTime.Today.Day}.txt"); @@ -1426,13 +1425,13 @@ namespace IOB_WIN_NEXT.Iob { // per prima cosa fluxLog a prescindere... sVal = $"[LOGFILE]{currData[0]}|{currData[1]}"; - // ...e chiamo accodamento + // ...e chiamo accodamento, ridonante?!? accodaFLog(sVal, qEncodeFLog(fLog2send.dtRif, currData[0], currData[1])); switch (currData[0]) { case "END": - // se è un end --> è comunque NON + runnning + // se è un end --> è comunque NON + running isRunningState = false; // chiudo batch precedente + in elenco (SE era valido...) if (!string.IsNullOrEmpty(lastProdBatch.codArt)) { @@ -1510,7 +1509,7 @@ namespace IOB_WIN_NEXT.Iob // se trovato --> invio start/stop PODL if (listPOdl != null && listPOdl.Count > 0) { - var currPodl = listPOdl.FirstOrDefault(); + var currPodl = listPOdl.OrderBy(x => x.IdxPromessa).FirstOrDefault(); if (currPodl != null) { currIdxPOdl = currPodl.IdxPromessa; diff --git a/IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs b/IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs index f4cd18d8..72150c87 100644 --- a/IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs +++ b/IOB-WIN-NEXT/IobFile/IobFileSoitaab.cs @@ -358,65 +358,6 @@ namespace IOB_WIN_NEXT.IobFile private bool processProdDataTable(DateTime adesso) { bool fatto = false; -#if false - string tabNameIn = "ProdData"; - string tabNameOut = "ProdDataToMes"; - // cerco info sui SignLog (ToMes e letti) - var currSignLogRead = elencoSyncState.FirstOrDefault(x => x.TableName == tabNameIn); - // se nullo inizializzo - if (currSignLogRead == null) - { - currSignLogRead = new SyncStateModel() - { - LastIdx = 0, - LastUpdate = adesso, - TableName = tabNameIn, - Note = "Init" - }; - } - var currSignLogSent = elencoSyncState.FirstOrDefault(x => x.TableName == tabNameOut); - // se nullo inizializzo - if (currSignLogSent == null) - { - currSignLogSent = new SyncStateModel() - { - LastIdx = 0, - LastUpdate = adesso, - TableName = tabNameOut, - Note = "Init" - }; - } - // verifica se ci siano dati da trasmettere (sui valori LastIdx) - if (currSignLogRead.LastIdx > currSignLogSent.LastIdx) - { - // recupero i dati dal DB... - var data2send = dbProxy.MachProdDataGetNew(currSignLogSent.LastIdx); - // se ho dati preparo invio - if (data2send != null && data2send.Count > 0) - { - foreach (var sLog2send in data2send) - { - // se il record è apertura PODL chiamo apertura - - trySetupPODL(0); - - // se il record è chiusura PODL chiamo chiusura... DOPO aver cercato PODL - // --> ODL - tryClosePODL(0); - } - } - - // aggiorno idx inviato... - currSignLogSent.Note = $"Updated from {currSignLogRead.LastIdx}"; - currSignLogSent.LastUpdate = adesso; - currSignLogSent.LastIdx = currSignLogRead.LastIdx; - fatto = true; - } - - // alla fine aggiorno i dati inviati! - dbProxy.SyncStateUpsert(currSignLogSent); -#endif - return fatto; } @@ -450,6 +391,7 @@ namespace IOB_WIN_NEXT.IobFile // ora prendo SOLAMENTE le righe nuove logNew = logAct .Where(x => x.dtRif > fileLastEnd.dtRif) + .OrderBy(x => x.dtRif) .ToList(); } else @@ -468,6 +410,7 @@ namespace IOB_WIN_NEXT.IobFile // estraggo solo info x sig log sigLogData = logNew .Where(x => x.valString.StartsWith("START") || x.valString.StartsWith("HOLD") || x.valString.StartsWith("END")) + .OrderBy(x => x.dtRif) .ToList(); // processo le righe nuove trasformando al volo SOLO eventi... @@ -652,6 +595,7 @@ namespace IOB_WIN_NEXT.IobFile // salvo in last il valore di act... redisMan.setRSV(redKeyLogfileLast, fileAct); + // calcolo B_input valido var lastRec = sigLogData.LastOrDefault(); if (lastRec != null)