From 60a0061cbe402ec9ae58443427332bd1c72235e6 Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Thu, 20 Apr 2023 11:31:35 -0700 Subject: [PATCH] Added MesEntity to file name for OI --- Adaptation/FileHandlers/OpenInsight/FileRead.cs | 9 +++------ Adaptation/Shared/FileRead.cs | 5 +++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Adaptation/FileHandlers/OpenInsight/FileRead.cs b/Adaptation/FileHandlers/OpenInsight/FileRead.cs index 057d70b..c9d45fa 100644 --- a/Adaptation/FileHandlers/OpenInsight/FileRead.cs +++ b/Adaptation/FileHandlers/OpenInsight/FileRead.cs @@ -191,20 +191,17 @@ public class FileRead : Shared.FileRead, IFileRead if (save && !string.IsNullOrEmpty(check)) { _LastLines = check; - int? count; long? subGroupId; long breakAfter = dateTime.AddSeconds(_BreakAfterSeconds).Ticks; long preWait = _FileConnectorConfiguration?.FileHandleWaitTime is null ? dateTime.AddMilliseconds(1234).Ticks : dateTime.AddMilliseconds(_FileConnectorConfiguration.FileHandleWaitTime.Value).Ticks; if (string.IsNullOrEmpty(descriptions[0].Reactor) || string.IsNullOrEmpty(descriptions[0].PSN)) - (subGroupId, count) = (null, null); + subGroupId = null; else - (subGroupId, count, string _) = FromIQS.GetCommandText(_IqsConnectionString, _Logistics, descriptions[0], breakAfter, preWait); + (subGroupId, int? _, string _) = FromIQS.GetCommandText(_IqsConnectionString, _Logistics, descriptions[0], breakAfter, preWait); if (subGroupId is null) collection.Add(new(new ScopeInfo(tests[0], _OpenInsightFilePattern), lines.Item1)); - else if (count is null) - collection.Add(new(new ScopeInfo(tests[0], $"{subGroupId.Value} {_OpenInsightFilePattern}"), lines.Item1)); else - collection.Add(new(new ScopeInfo(tests[0], $"{subGroupId.Value} E{count.Value} {_OpenInsightFilePattern}"), lines.Item1)); + collection.Add(new(new ScopeInfo(tests[0], $"{subGroupId.Value} {_OpenInsightFilePattern}"), lines.Item1)); string weekOfYear = _Calendar.GetWeekOfYear(_Logistics.DateTimeFromSequence, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00"); FromIQS.Save(_OpenInsightApiECDirectory, _OpenInsightApiIFXDirectory, _Logistics, reportFullPath, logistics, descriptions.First(), lines.Item1, subGroupId, weekOfYear); } diff --git a/Adaptation/Shared/FileRead.cs b/Adaptation/Shared/FileRead.cs index 48122f8..19bedc7 100644 --- a/Adaptation/Shared/FileRead.cs +++ b/Adaptation/Shared/FileRead.cs @@ -266,13 +266,14 @@ public class FileRead : Properties.IFileRead string rds; string dateValue; string rdsPlaceholder = "%RDS%"; + string mesEntityPlaceholder = "%MesEntity%"; if (!descriptions.Any() || string.IsNullOrEmpty(descriptions[0].RDS)) rds = logistics.MID; else rds = descriptions[0].RDS; string[] segments = scopeInfo.FileName.Split(new string[] { "DateTime:" }, StringSplitOptions.RemoveEmptyEntries); if (segments.Length == 0) - result = string.Concat(duplicateDirectory, @"\", scopeInfo.FileNameWithoutExtension.Replace(rdsPlaceholder, rds)); + result = string.Concat(duplicateDirectory, @"\", scopeInfo.FileNameWithoutExtension.Replace(rdsPlaceholder, rds).Replace(mesEntityPlaceholder, logistics.MesEntity)); else { segments = segments[1].Split('%'); @@ -284,7 +285,7 @@ public class FileRead : Properties.IFileRead continue; datePlaceholder = string.Concat('%', segment, '%'); } - result = string.Concat(duplicateDirectory, @"\", scopeInfo.FileName.Replace(rdsPlaceholder, rds).Replace(datePlaceholder, dateValue)); + result = string.Concat(duplicateDirectory, @"\", scopeInfo.FileName.Replace(rdsPlaceholder, rds).Replace(mesEntityPlaceholder, logistics.MesEntity).Replace(datePlaceholder, dateValue)); } if (result.Contains('%')) throw new Exception("Placeholder exists!");