diff --git a/OLD/DataModel/App.config b/OLD/DataModel/App.config index 0a9b7c1..58db4b7 100755 --- a/OLD/DataModel/App.config +++ b/OLD/DataModel/App.config @@ -3,7 +3,6 @@
-
@@ -21,26 +20,4 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/OLD/DataModel/CmsQueries/SQL_GET_MIS_DATA.sql b/OLD/DataModel/CmsQueries/SQL_GET_MIS_DATA.sql deleted file mode 100755 index f83ad6b..0000000 --- a/OLD/DataModel/CmsQueries/SQL_GET_MIS_DATA.sql +++ /dev/null @@ -1,26 +0,0 @@ -SELECT DISTINCT - mis.P_PART_NUMBER AS ItemNumber, - mis.P_OPERATION_NUMBER AS SequenceNumber, - item.PITEM_ID AS MISNumber, - itemrev.PITEM_REVISION_ID AS RevID, - TRIM(mis.P_SITE) AS BranchCode, - zim_test_details.P_SEQ_NUMBER AS CharNumber, - zim_test_details.P_TEST_DESC AS TestDescription, - zim_test_details.P_SAMPL_TYPE AS SamplingType, - zim_test_details.P_SAMPL_VALUE AS SamplingValue, - zim_test_details.P_TOOLS AS ToolsGauges, - zim_test_details.P_WORK_INTR AS WorkInstructions, - Status.PNAME AS Status, - Status.PDATE_RELEASED AS ReleaseDate - FROM INFODBA.PITEM item - INNER JOIN INFODBA.PITEMREVISION itemrev ON (item.PUID = itemrev.RITEMS_TAGU) - INNER JOIN INFODBA.PRELEASE_STATUS_LIST listing ON (itemrev.PUID = listing.PUID) - INNER JOIN INFODBA.PRELEASESTATUS Status ON (listing.PVALU_0 = Status.PUID) - INNER JOIN INFODBA.PIMANRELATION imanrel ON (itemrev.PUID = imanrel.RPRIMARY_OBJECTU) - INNER JOIN INFODBA.PFORM form ON (imanrel.RSECONDARY_OBJECTU = form.PUID) - INNER JOIN INFODBA.PZIMMERMISDETAILS zim_mis ON (form.RDATA_FILEU = zim_mis.PUID) - INNER JOIN INFODBA.P_TEST_DETAILS test_details ON (zim_mis.PUID = test_details.PUID) - INNER JOIN INFODBA.P_PART_ASSOCIATION ppa ON (ppa.PUID = test_details.PUID) - INNER JOIN INFODBA.PMISDATAOBJECT mis ON (mis.PUID = ppa.PVALU_0) - INNER JOIN INFODBA.PZIMTESTDETAILS zim_test_details ON (test_details.PVALU_0 = zim_test_details.PUID) - WHERE Status.PNAME IN ('Current', 'BackLevel') \ No newline at end of file diff --git a/OLD/DataModel/CmsQueries/SQL_GET_MIS_DATA_FILTERED.sql b/OLD/DataModel/CmsQueries/SQL_GET_MIS_DATA_FILTERED.sql deleted file mode 100755 index 56fe734..0000000 --- a/OLD/DataModel/CmsQueries/SQL_GET_MIS_DATA_FILTERED.sql +++ /dev/null @@ -1,27 +0,0 @@ -SELECT DISTINCT - mis.P_PART_NUMBER AS ItemNumber, - mis.P_OPERATION_NUMBER AS SequenceNumber, - item.PITEM_ID AS MISNumber, - itemrev.PITEM_REVISION_ID AS RevID, - TRIM(mis.P_SITE) AS BranchCode, - zim_test_details.P_SEQ_NUMBER AS CharNumber, - zim_test_details.P_TEST_DESC AS TestDescription, - zim_test_details.P_SAMPL_TYPE AS SamplingType, - zim_test_details.P_SAMPL_VALUE AS SamplingValue, - zim_test_details.P_TOOLS AS ToolsGauges, - zim_test_details.P_WORK_INTR AS WorkInstructions, - Status.PNAME AS Status, - Status.PDATE_RELEASED AS ReleaseDate - FROM INFODBA.PITEM item - INNER JOIN INFODBA.PITEMREVISION itemrev ON (item.PUID = itemrev.RITEMS_TAGU) - INNER JOIN INFODBA.PRELEASE_STATUS_LIST listing ON (itemrev.PUID = listing.PUID) - INNER JOIN INFODBA.PRELEASESTATUS Status ON (listing.PVALU_0 = Status.PUID) - INNER JOIN INFODBA.PIMANRELATION imanrel ON (itemrev.PUID = imanrel.RPRIMARY_OBJECTU) - INNER JOIN INFODBA.PFORM form ON (imanrel.RSECONDARY_OBJECTU = form.PUID) - INNER JOIN INFODBA.PZIMMERMISDETAILS zim_mis ON (form.RDATA_FILEU = zim_mis.PUID) - INNER JOIN INFODBA.P_TEST_DETAILS test_details ON (zim_mis.PUID = test_details.PUID) - INNER JOIN INFODBA.P_PART_ASSOCIATION ppa ON (ppa.PUID = test_details.PUID) - INNER JOIN INFODBA.PMISDATAOBJECT mis ON (mis.PUID = ppa.PVALU_0) - INNER JOIN INFODBA.PZIMTESTDETAILS zim_test_details ON (test_details.PVALU_0 = zim_test_details.PUID) - WHERE Status.PNAME IN ('Current', 'BackLevel') AND - Status.PDATE_RELEASED >= :lastUpdateDT \ No newline at end of file diff --git a/OLD/DataModel/Commons.csproj b/OLD/DataModel/Commons.csproj index 0d4239f..38a8b35 100755 --- a/OLD/DataModel/Commons.csproj +++ b/OLD/DataModel/Commons.csproj @@ -45,10 +45,6 @@ ..\packages\Dapper.1.50.2\lib\net45\Dapper.dll - - False - ..\..\..\..\..\..\..\DDTek.Oracle.dll - ..\packages\fasterflect.2.1.3\lib\net40\Fasterflect.dll @@ -60,17 +56,10 @@ ..\packages\NLog.4.3.5\lib\net45\NLog.dll True - - ..\packages\Oracle.ManagedDataAccess.19.9.0\lib\net40\Oracle.ManagedDataAccess.dll - - - ..\packages\Sybase.AdoNet4.AseClient.1.0.0\lib\net45\Sybase.AdoNet4.AseClient.dll - - @@ -81,7 +70,6 @@ - @@ -116,59 +104,9 @@ - - - CMS.cs - - - JDE.cs - - - JDE.cs - - - JDE.cs - - - JDE.cs - - - JDE.cs - - - JDE.cs - - - JDE.cs - - - JDE.cs - - - JDE.cs - - - JDE.cs - - - JDE.cs - - - JDE.cs - - - JDE.cs - - - JDE.cs - - - JDE.cs - LotFinderDB.cs - @@ -177,7 +115,6 @@ - @@ -216,105 +153,6 @@ - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - diff --git a/OLD/TestApp/TestApp.csproj b/OLD/TestApp/TestApp.csproj index 633dd6b..a461214 100755 --- a/OLD/TestApp/TestApp.csproj +++ b/OLD/TestApp/TestApp.csproj @@ -42,9 +42,6 @@ ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll True - - ..\packages\Oracle.ManagedDataAccess.18.3.0\lib\net40\Oracle.ManagedDataAccess.dll - diff --git a/OLD/TestApp/packages.config b/OLD/TestApp/packages.config index 4dddeb1..2ba8ba8 100755 --- a/OLD/TestApp/packages.config +++ b/OLD/TestApp/packages.config @@ -3,5 +3,4 @@ - \ No newline at end of file diff --git a/OLD/WebInterface/Web.config b/OLD/WebInterface/Web.config index 472c173..4bb7006 100755 --- a/OLD/WebInterface/Web.config +++ b/OLD/WebInterface/Web.config @@ -2,7 +2,6 @@
-
@@ -65,10 +64,6 @@ - - - - @@ -99,17 +94,6 @@ - - - - - - - - - - - diff --git a/OLD/WebInterface/WebInterface.csproj b/OLD/WebInterface/WebInterface.csproj index 2064701..5dab7bf 100755 --- a/OLD/WebInterface/WebInterface.csproj +++ b/OLD/WebInterface/WebInterface.csproj @@ -123,10 +123,6 @@ ..\packages\NLog.4.3.5\lib\net45\NLog.dll True - - ..\packages\Oracle.ManagedDataAccess.12.1.24160419\lib\net40\Oracle.ManagedDataAccess.dll - True - ..\packages\Owin.1.0\lib\net40\Owin.dll True diff --git a/OLD/WebInterface/packages.config b/OLD/WebInterface/packages.config index d0da3ef..1b56e9e 100755 --- a/OLD/WebInterface/packages.config +++ b/OLD/WebInterface/packages.config @@ -38,7 +38,6 @@ - diff --git a/OLD/WorkerService/App.config b/OLD/WorkerService/App.config index cf0d523..873b18e 100755 --- a/OLD/WorkerService/App.config +++ b/OLD/WorkerService/App.config @@ -14,11 +14,6 @@ - - - - - @@ -29,8 +24,6 @@ - - diff --git a/OLD/WorkerService/Models/DataLoad.cs b/OLD/WorkerService/Models/DataLoad.cs deleted file mode 100755 index 2d35f60..0000000 --- a/OLD/WorkerService/Models/DataLoad.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace WorkerService.Models -{ - public class DataSource - { - public int DataSourceID { get; set; } - public string Name { get; set; } - public string HostName { get; set; } - public string Username { get; set; } - public string Password { get; set; } - - } - - public class DataLoad - { - public int DataLoadID { get; set; } - - public string Name { get; set; } - public int DataSourceID { get; set; } - - public bool IsEnabled { get; set; } - public List Schedules { get; set; } - } - - public class DataLoadSchedule - { - public int DataLoadScheduleID { get; set; } - public int DataLoadID { get; set; } - public string Name { get; set; } - - public bool PurgeBeforeLoad { get; set; } - public bool ReIndexAfterLoad { get; set; } - public bool IsDaily { get; set; } - } -} diff --git a/OLD/WorkerService/Models/DataSourceConfig.cs b/OLD/WorkerService/Models/DataSourceConfig.cs deleted file mode 100755 index 7e4f3b0..0000000 --- a/OLD/WorkerService/Models/DataSourceConfig.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using Newtonsoft.Json; -using WorkerService.Process; - -namespace WorkerService.Models -{ - /// - /// Database update configuration - /// - public class DataSourceConfig - { - /// - /// Name of source data system - /// - public string SourceSystem { get; set; } - - /// - /// Name of source data set - /// - public string SourceData { get; set; } - - /// - /// Name of table being updated - /// - public string TableName { get; set; } - - /// - /// Whether or not the data source is enabled - /// - public bool IsEnabled { get; set; } - - /// - /// Source data fetch function - /// - [JsonConverter(typeof(FunctionConverter>))] - public Func> DataFetchFunction { get; set; } - - /// - /// Post data update processing action - /// - [JsonConverter(typeof(ActionConverter))] - public Action PostProcessingAction { get; set; } - - /// - /// Data update entry for mass update typ - /// - public DataUpdateConfig MassUpdateConfig { get; set; } - - /// - /// Data update entry for daily update typ - /// - public DataUpdateConfig DailyUpdateConfig { get; set; } - - /// - /// Data update entry for hourly update typ - /// - public DataUpdateConfig HourlyUpdateConfig { get; set; } - } -} diff --git a/OLD/WorkerService/Models/DataUpdateConfig.cs b/OLD/WorkerService/Models/DataUpdateConfig.cs deleted file mode 100755 index 5fabac1..0000000 --- a/OLD/WorkerService/Models/DataUpdateConfig.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace WorkerService.Models -{ - /// - /// Database update entry - /// - public class DataUpdateConfig - { - /// - /// Whether or not the update config is enabled - /// - public bool Enabled { get; set; } - - /// - /// Interval (in minutes) between updates - /// - public int Interval { get; set; } - - /// - /// Whether or not the table should be purged prior to update - /// - public bool PrepurgeData { get; set; } - - /// - /// Whether or not the table should be re-indexed after update - /// - public bool ReIndexData { get; set; } - } -} \ No newline at end of file diff --git a/OLD/WorkerService/Models/DataUpdateTask.cs b/OLD/WorkerService/Models/DataUpdateTask.cs deleted file mode 100755 index 8b5f22c..0000000 --- a/OLD/WorkerService/Models/DataUpdateTask.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using DataModel.Models; - -namespace WorkerService.Models -{ - /// - /// Cached data update task - /// - public class DataUpdateTask - { - /// - /// Data update configuration - /// - public DataSourceConfig Configuration { get; set; } - - /// - /// Type of update needed - /// - public UpdateTypes UpdateType { get; set; } - - /// - /// Minimum timestamp to import changeset from - /// - public DateTime? MinimumDT { get; set; } - } -} diff --git a/OLD/WorkerService/Models/Index.cs b/OLD/WorkerService/Models/Index.cs deleted file mode 100755 index 60e0285..0000000 --- a/OLD/WorkerService/Models/Index.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace WorkerService.Models -{ - /// - /// Table index - /// - public class Index - { - /// - /// Name of index - /// - public string Name { get; set; } - - /// - /// Whether or not the index is a primary key - /// - public bool IsPrimaryKey { get; set; } - - /// - /// Whether or not the index is unique - /// - public bool IsUnique { get; set; } - - /// - /// Whether or not the index is unique constraint - /// - public bool IsUniqueConstraint { get; set; } - } -} diff --git a/OLD/WorkerService/Models/LastDataUpdate.cs b/OLD/WorkerService/Models/LastDataUpdate.cs deleted file mode 100755 index 76b33f5..0000000 --- a/OLD/WorkerService/Models/LastDataUpdate.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; - -namespace WorkerService.Models -{ - /// - /// Set of last successful data updates for table - /// - public class LastDataUpdate - { - /// - /// Data table name - /// - public string TableName { get; set; } - - /// - /// Timestamp of last successful mass data update - /// - public DateTime MassUpdateDT { get; set; } - - /// - /// Timestamp of last successful daily data update - /// - public DateTime DailyUpdateDT { get; set; } - - /// - /// Timestamp of last successful hourly data update - /// - public DateTime HourlyUpdateDT { get; set; } - } -} diff --git a/OLD/WorkerService/Process/UpdateProcessor.DataUpdateEntry.cs b/OLD/WorkerService/Process/UpdateProcessor.DataUpdateEntry.cs deleted file mode 100755 index 4899ff4..0000000 --- a/OLD/WorkerService/Process/UpdateProcessor.DataUpdateEntry.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data.SqlClient; -using System.Linq; -using Dapper; -using DataModel.Models; -using DataModel.Process; -using WorkerService.Models; - -namespace WorkerService.Process -{ - /// - /// Data update entry management functionality for data update processor - /// - public partial class UpdateProcessor - { - /// - /// SQL to close any open update entries (identified by number records = -2) - /// - private const string SQL_CLOSE_OPEN_UPDATE_ENTRIES = @" - UPDATE dbo.DataUpdate - SET EndDT = GETDATE(), WasSuccessful = 0, NumberRecords = -1 - WHERE NumberRecords = -2"; - - /// - /// Closes any open data update entries - /// - private static void CloseOpenUpdateEntries() - { - try - { - using (SqlConnection connection = LotFinderDB.GetConnection()) - { - //Close any open update entries - connection.Execute(SQL_CLOSE_OPEN_UPDATE_ENTRIES); - } - } - catch (Exception error) - { - //Log but do not forward error - logger.Error("CloseOpenUpdateEntries: failed to close open data update entries: {0}.", error.Message); - } - } - - /// - /// SQL to purge data update records - /// - private const string SQL_PURGE_UPDATE_ENTRIES = @" - DELETE FROM dbo.DataUpdate - WHERE StartDT < DATEADD(DAY, @maxAge * -1, GETDATE())"; - - /// - /// Purges any data update entries older than given max age - /// - /// Maximum entry age (in days) - private static void PurgeUpdateEntries(int maxAge) - { - try - { - using (SqlConnection connection = LotFinderDB.GetConnection()) - { - //Purge the records - connection.Execute(SQL_PURGE_UPDATE_ENTRIES, new { maxAge }); - } - } - catch (Exception error) - { - //Log but do not forward error - logger.Error("PurgeUpdateEntries: failed to purge data update entries older than {0} days: {1}.", maxAge, error.Message); - } - } - - /// - /// SQL to insert data update record - /// - private const string SQL_LOG_DATA_UPDATE_START = @" - INSERT INTO dbo.DataUpdate(SourceSystem, SourceData, TableName, StartDT, EndDT, UpdateType, WasSuccessful, NumberRecords) - OUTPUT INSERTED.* - VALUES(@sourceSystem, @sourceData, @tableName, GETDATE(), '1970-01-01', @updateType, 0, -2);"; - - /// - /// Logs the data update entry at the start of the update - /// - /// SQL connection to execute commands on - /// Data update entry to log - public static void LogDataUpdateStart(SqlConnection connection, DataUpdate dataUpdate) - { - try - { - //Update the record - DataUpdate inserted = connection.QueryFirst(SQL_LOG_DATA_UPDATE_START, - new - { - sourceSystem = dataUpdate.SourceSystem, - sourceData = dataUpdate.SourceData, - tableName = dataUpdate.TableName, - updateType = dataUpdate.UpdateType - }); - - //Copy output values to model - dataUpdate.ID = inserted.ID; - dataUpdate.StartDT = inserted.StartDT; - } - catch (Exception error) - { - //Log but do not forward error - logger.Error("LogDataUpdateStart: failed to log starting data update entry: {0}.", error.Message); - } - } - - /// - /// SQL to update data update record with results - /// - private const string SQL_LOG_DATA_UPDATE_END = @" - UPDATE dbo.DataUpdate - SET EndDT = GETDATE(), WasSuccessful = @wasSuccessful, NumberRecords = @numberRecords - OUTPUT INSERTED.* - WHERE ID = @id"; - - /// - /// Logs the data update entry at the end of the update - /// - /// SQL connection to execute commands on - /// Data update entry to log - public static void LogDataUpdateEnd(SqlConnection connection, DataUpdate dataUpdate) - { - try - { - //Update the record - DataUpdate updated = connection.QueryFirst(SQL_LOG_DATA_UPDATE_END, - new - { - id = dataUpdate.ID, - wasSuccessful = dataUpdate.WasSuccessful, - numberRecords = dataUpdate.NumberRecords - }); - - //Copy output values to model - dataUpdate.EndDT = updated.EndDT; - } - catch (Exception error) - { - //Log but do not forward error - logger.Error("LogDataUpdateEnd: failed to log ending data update entry: {0}.", error.Message); - } - } - - /// - /// Gets set of last successful data updates for all tables - /// - /// SQL connection to execute commands on - /// Set of last successful data updates for all tables - private static List GetLastDataUpdates(SqlConnection connection) - { - return connection.Query("SELECT * FROM dbo.LastDataUpdates").ToList(); - } - } -} diff --git a/OLD/WorkerService/Process/UpdateProcessor.TableManagement.cs b/OLD/WorkerService/Process/UpdateProcessor.TableManagement.cs deleted file mode 100755 index 34fbbbd..0000000 --- a/OLD/WorkerService/Process/UpdateProcessor.TableManagement.cs +++ /dev/null @@ -1,350 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data.SqlClient; -using System.Linq; -using System.Reflection; -using System.Text; -using Dapper; -using WorkerService.Models; - -namespace WorkerService.Process -{ - /// - /// Table management functionality for data update processor - /// - public partial class UpdateProcessor - { - /// - /// Creates staging table with matching column layout of given table - /// - /// SQL connection to execute commands on - /// Name of table to create staging table for - /// Name of created temporary table - public static string CreateStagingTable(SqlConnection connection, string tableName) - { - try - { - //Get table specification - TableSpec tableSpec = GetTableSpec(connection, tableName); - - //Drop temp table if it already exists - connection.Execute($"IF OBJECT_ID('tempdb..{tableSpec.StagingTableName}') IS NOT NULL DROP TABLE {tableSpec.StagingTableName};"); - - //Create temp table - connection.Execute($"CREATE TABLE {tableSpec.StagingTableName}({string.Join(",", tableSpec.Columns.Select(c => $"{c.Name} {c.Definition}"))});"); - - //Create indicies on temp table - StringBuilder builder = new StringBuilder(); - builder.Append($"CREATE INDEX IDX_STAGING_{tableSpec.Name} ON {tableSpec.StagingTableName}("); - builder.Append(string.Join(",", tableSpec.PrimaryKey.Select(c => $"{c.Name}"))); - if (tableSpec.Columns.Any(c => c.Name.Equals("LastUpdateDT", StringComparison.CurrentCultureIgnoreCase))) - { - builder.Append(", LastUpdateDT DESC"); - } - else if (tableSpec.Columns.Any(c => c.Name.Equals("ReleaseDate", StringComparison.CurrentCultureIgnoreCase))) - { - builder.Append(", ReleaseDate DESC"); - } - builder.Append(");"); - - connection.Execute(builder.ToString()); - - //Disable indicies on temp table - DisableIndicies(connection, tableSpec.StagingTableName); - - return tableSpec.StagingTableName; - } - catch (Exception error) - { - //Log and forward error - logger.Error("GetStagingTable: failed to create staging table for '{0}': {1}.", tableName, error.Message); - throw; - } - } - - /// - /// Creates temporary table with matching column layout of given table - /// - /// SQL connection to execute commands on - /// Name of table to create temporary table for - /// Name of created temporary table - public static string CreateTempTable(SqlConnection connection, string tableName) - { - try - { - //Get table specification - TableSpec tableSpec = GetTableSpec(connection, tableName); - - //Drop temp table if it already exists - connection.Execute($"IF OBJECT_ID('tempdb..{tableSpec.TempTableName}') IS NOT NULL DROP TABLE {tableSpec.TempTableName};"); - - //Create temp table - connection.Execute($"CREATE TABLE {tableSpec.TempTableName}({string.Join(",", tableSpec.Columns.Select(c => $"{c.Name} {c.Definition}"))}, CONSTRAINT PK_{tableSpec.TempTableName} PRIMARY KEY CLUSTERED({string.Join(",", tableSpec.PrimaryKey.Select(c => $"{c.Name}"))}));"); - - StringBuilder builder = new StringBuilder(); - - builder.AppendLine("WITH StagingCTE AS ("); - builder.Append($"SELECT st.*, ROW_NUMBER() OVER(PARTITION BY {string.Join(", ", tableSpec.PrimaryKey.Select(c=>c.Name))} ORDER BY {tableSpec.Columns.FirstOrDefault(c => c.Name.Equals("LastUpdateDT", StringComparison.CurrentCultureIgnoreCase) || c.Name.Equals("ReleaseDate", StringComparison.CurrentCultureIgnoreCase))?.Name}) RN FROM {tableSpec.StagingTableName} st"); - builder.AppendLine(")"); - builder.AppendLine($"INSERT INTO {tableSpec.TempTableName}({string.Join(", ", tableSpec.Columns.Select(c=>c.Name))})"); - builder.AppendLine($"SELECT {string.Join(", ", tableSpec.Columns.Select(c => c.Name))} FROM StagingCTE WHERE RN = 1 ORDER BY {string.Join(", ", tableSpec.PrimaryKey.Select(c=>c.Name))};"); - - connection.Execute(builder.ToString(),commandTimeout:600); - - return tableSpec.TempTableName; - } - catch (Exception error) - { - //Log and forward error - logger.Error("CreateTableTable: failed to create temporary table for '{0}': {1}.", tableName, error.Message); - throw; - } - } - - /// - /// Generates merge statement for given table - /// - /// SQL connection to execute commands on - /// Name of table to generate merge statement for - /// Merge statement for given table - private static string GenerateMerge(SqlConnection connection, string tableName) - { - try - { - //Get table specification - TableSpec tableSpec = GetTableSpec(connection, tableName); - - StringBuilder builder = new StringBuilder(); - - builder.AppendFormat("MERGE {0} AS TARGET", tableSpec.Name); - builder.AppendLine(""); - - builder.AppendFormat("USING {0} AS SOURCE ON({1})", tableSpec.TempTableName, string.Join(" AND ", tableSpec.PrimaryKey.Select(c => $"TARGET.{c.Name} = SOURCE.{c.Name}"))); - builder.AppendLine(""); - - builder.Append("WHEN MATCHED"); - if (tableSpec.Columns.Exists(c => c.Name.Equals("LastUpdateDT", StringComparison.CurrentCultureIgnoreCase))) - { - builder.Append(" AND TARGET.LastUpdateDT < SOURCE.LastUpdateDT"); - } - builder.AppendLine(" THEN"); - - builder.Append("UPDATE SET "); - builder.Append(string.Join(", ", tableSpec.Columns.Where(c => !tableSpec.PrimaryKey.Contains(c)).Select(c => $"TARGET.{c.Name} = SOURCE.{c.Name}"))); - builder.AppendLine(); - - builder.AppendLine("WHEN NOT MATCHED BY TARGET THEN"); - - builder.Append("INSERT("); - builder.Append(string.Join(", ", tableSpec.Columns.Select(c => c.Name))); - builder.AppendLine(")"); - - builder.Append("VALUES("); - builder.Append(string.Join(", ", tableSpec.Columns.Select(c => $"SOURCE.{c.Name}"))); - builder.AppendLine(");"); - - return builder.ToString(); - } - catch (Exception error) - { - //Log and forward error - logger.Error("GenerateMerge: failed to generate merge statement for '{0}': {1}.", tableName, error.Message); - throw; - } - } - - /// - /// Generates bulk copy specification for given table - /// - /// Data type being bulk copied - /// SQL connection to execute commands on - /// Name of table to generate bulk copy for - /// Bulk copy for given table - private static SqlBulkCopy GenerateBulkCopy(SqlConnection connection, string tableName) - { - return GenerateBulkCopy(connection, tableName, typeof(T)); - } - - /// - /// Generates bulk copy specification for given table - /// - /// SQL connection to execute commands on - /// Name of table to generate bulk copy for - /// Data type being bulk copied - /// Bulk copy for given table - private static SqlBulkCopy GenerateBulkCopy(SqlConnection connection, string tableName, Type type) - { - try - { - //Get table specification - TableSpec tableSpec = GetTableSpec(connection, tableName); - - //Get class properties - List properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public).Select(p => p.Name).ToList(); - - //Build bulk copy specification - SqlBulkCopy bulkCopy = new SqlBulkCopy(connection) - { - BatchSize = 10000, - NotifyAfter = 5000, - EnableStreaming = true, - DestinationTableName = tableSpec.StagingTableName - }; - - foreach (ColumnSpec columnSpec in tableSpec.Columns) - { - string property = properties.FirstOrDefault(p => p.Equals(columnSpec.Name, StringComparison.CurrentCultureIgnoreCase)); - if (!string.IsNullOrEmpty(property)) - { - bulkCopy.ColumnMappings.Add(property, columnSpec.Name); - } - } - - return bulkCopy; - } - catch (Exception error) - { - //Log and forward error - logger.Error("GenerateBulkCopy: failed to generate bulk copy for '{0}': {1}.", tableName, error.Message); - throw; - } - } - - /// - /// SQL to get the columns for the given table - /// - private const string SQL_GET_TABLE_COLUMNS = @" - SELECT c.name AS Name, - CASE t2.name - WHEN 'char' THEN 'CHAR(' + CAST(c.max_length AS VARCHAR(10)) + ')' - WHEN 'varchar' THEN 'VARCHAR(' + CASE c.max_length WHEN -1 THEN 'MAX' ELSE CAST(c.max_length AS VARCHAR(10)) END + ')' - WHEN 'decimal' THEN 'DECIMAL(' + CAST(c.precision AS VARCHAR(4)) + ',' + CAST(c.scale AS VARCHAR(4)) + ')' - ELSE UPPER(t2.name) - END AS Definition - FROM sys.columns c INNER JOIN - sys.types AS t2 ON (c.system_type_id = t2.system_type_id) INNER JOIN - sys.tables t ON (c.object_id = t.object_id) - WHERE t.name = @tableName - ORDER BY c.column_id"; - - /// - /// SQL to get the primary key columns for the given table - /// - private const string SQL_GET_TABLE_PRIMARY_KEY = @" - SELECT COLUMN_NAME AS Name - FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE - WHERE OBJECTPROPERTY(OBJECT_ID(CONSTRAINT_SCHEMA + '.' + QUOTENAME(CONSTRAINT_NAME)), 'IsPrimaryKey') = 1 AND - TABLE_NAME = @tableName - ORDER BY ORDINAL_POSITION"; - - /// - /// Gets the table specification for the given table - /// - /// SQL connection to execute commands on - /// Name of table to get specification for - /// Table specification for the given table - public static TableSpec GetTableSpec(SqlConnection connection, string tableName) - { - TableSpec tableSpec = new TableSpec() { Name = tableName }; - - //Load columns - tableSpec.Columns.AddRange(connection.Query(SQL_GET_TABLE_COLUMNS, new { tableName })); - - //Load primary key - tableSpec.PrimaryKey.AddRange(connection.Query(SQL_GET_TABLE_PRIMARY_KEY, new { tableName }).Select(cn => tableSpec.Columns.First(c => c.Name.Equals(cn, StringComparison.CurrentCultureIgnoreCase)))); - - return tableSpec; - } - - /// - /// Truncates given table - /// - /// SQL connection to execute commands on - /// Name of table to truncate - private static void TruncateTable(SqlConnection connection, string tableName) - { - try - { - logger.Debug("TruncateTable: truncating table '{0}'", tableName); - - //Generate and execute SQL to truncate table - string sql = $"TRUNCATE TABLE {tableName};"; - connection.Execute(sql); - } - catch (Exception error) - { - //Log but do not forward error - logger.Error("TruncateTable: failed to truncate table '{0}': {1}.", tableName, error.Message); - } - } - - /// - /// SQL to get indices on given table - /// - private const string SQL_GET_INDICES = @" - SELECT DISTINCT - ind.name AS Name, - ind.is_primary_key AS IsPrimaryKey, - ind.is_unique AS IsUnique, - ind.is_unique_constraint AS IsUniqueConstraint - FROM sys.indexes ind INNER JOIN - sys.index_columns ic ON (ind.object_id = ic.object_id AND ind.index_id = ic.index_id) INNER JOIN - sys.columns col ON (ic.object_id = col.object_id AND ic.column_id = col.column_id) INNER JOIN - sys.tables t ON (ind.object_id = t.object_id) - WHERE t.name = @tableName"; - - /// - /// Disables all non-PK indices on given table - /// - /// SQL connection to execute commands on - /// Name of table to disable non-PK indices for - private static void DisableIndicies(SqlConnection connection, string tableName) - { - try - { - //Get all indices on table - List indices = connection.Query(SQL_GET_INDICES, new { tableName }).ToList(); - - //Loop through all non-PK/non-cluster indices - foreach (Index index in indices.Where(i => !i.IsPrimaryKey && !i.IsUnique && !i.IsUniqueConstraint)) - { - //Generate and execute SQL to disable index - string sql = $"ALTER INDEX {index.Name} ON {tableName} DISABLE;"; - connection.Execute(sql); - } - } - catch (Exception error) - { - //Log but do not forward error - logger.Error("DisableIndicies: failed to disable non-PK indicies on table '{0}': {1}.", tableName, error.Message); - } - } - - /// - /// Rebuilds all indices on given table - /// - /// SQL connection to execute commands onSo - /// Name of table to rebuild indices for - private static void RebuildIndicies(SqlConnection connection, string tableName) - { - try - { - //Get all indices on table - List indices = connection.Query(SQL_GET_INDICES, new { tableName }).ToList(); - - //Loop through indices - foreach (Index index in indices.Where(i => !i.IsPrimaryKey && !i.IsUnique && !i.IsUniqueConstraint)) - { - //Generate and execute SQL to rebuild index - string sql = $"ALTER INDEX {index.Name} ON {tableName} REBUILD;"; - connection.Execute(sql); - } - } - catch (Exception error) - { - //Log but do not forward error - logger.Error("RebuildIndicies: failed to rebuild indicies on table '{0}': {1}.", tableName, error.Message); - } - } - } -} diff --git a/OLD/WorkerService/Process/UpdateProcessor.cs b/OLD/WorkerService/Process/UpdateProcessor.cs deleted file mode 100755 index d82e729..0000000 --- a/OLD/WorkerService/Process/UpdateProcessor.cs +++ /dev/null @@ -1,220 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Data.SqlClient; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Dapper; -using DataModel.Helpers; -using DataModel.Models; -using DataModel.Process; -using Newtonsoft.Json; -using NLog; -using WorkerService.Models; - -namespace WorkerService.Process -{ - /// - /// Data update processor - /// - public partial class UpdateProcessor - { - /// - /// Shared logger instance - /// - private static readonly Logger logger = LogManager.GetCurrentClassLogger(); - - /// - /// Collection of configured data source update configurations - /// - public static readonly List configs = new List(); - - /// - /// Static class initializer - /// - static UpdateProcessor() - { - foreach (string configFileName in Directory.GetFiles("dsconfig")) - { - //continue; - DataSourceConfig config = JsonConvert.DeserializeObject(File.ReadAllText(configFileName)); - - if (config.IsEnabled) { configs.Add(config); } - } - } - - public static void DoUpdate(string tableName, UpdateTypes updateType = UpdateTypes.Mass) - { - DataSourceConfig dataSourceConfig = configs.FirstOrDefault(c => c.TableName.Equals(tableName, StringComparison.CurrentCultureIgnoreCase)); - - //Get last data updates - List lastDataUpdates = null; - using (SqlConnection connection = LotFinderDB.GetConnection()) - { - lastDataUpdates = GetLastDataUpdates(connection); - } - - LastDataUpdate lastDataUpdate = lastDataUpdates.FirstOrDefault(ldu => ldu.TableName.Equals(dataSourceConfig.TableName)); - DateTime? minDT = null; - switch (updateType) - { - case UpdateTypes.Mass: - minDT = null; - break; - case UpdateTypes.Daily: - minDT = lastDataUpdate.DailyUpdateDT.AddMinutes(-3 * dataSourceConfig.DailyUpdateConfig.Interval); - break; - case UpdateTypes.Hourly: - minDT = lastDataUpdate.HourlyUpdateDT.AddMinutes(-3 * dataSourceConfig.HourlyUpdateConfig.Interval); - break; - } - - DoUpdate(dataSourceConfig, updateType, minDT); - } - - /// - /// Gets list of pending data update tasks - /// - /// Pending data update tasks - public static List GetPendingUpdateTasks() - { - List pending = new List(); - - using (SqlConnection connection = LotFinderDB.GetConnection()) - { - //Get last data updates - List lastDataUpdates = GetLastDataUpdates(connection); - - foreach (DataSourceConfig dataSourceConfig in configs) - { - LastDataUpdate lastDataUpdate = lastDataUpdates.FirstOrDefault(ldu => ldu.TableName.Equals(dataSourceConfig.TableName)); - - if (lastDataUpdate == null || (dataSourceConfig.MassUpdateConfig.Enabled && DateTime.Now > lastDataUpdate.MassUpdateDT.AddMinutes(dataSourceConfig.MassUpdateConfig.Interval))) - { - pending.Add(new DataUpdateTask() { Configuration = dataSourceConfig, UpdateType = UpdateTypes.Mass }); - } - else if (dataSourceConfig.DailyUpdateConfig.Enabled && DateTime.Now > lastDataUpdate.DailyUpdateDT.AddMinutes(dataSourceConfig.DailyUpdateConfig.Interval)) - { - pending.Add(new DataUpdateTask() { Configuration = dataSourceConfig, UpdateType = UpdateTypes.Daily, MinimumDT = lastDataUpdate.DailyUpdateDT.AddMinutes(-3 * dataSourceConfig.DailyUpdateConfig.Interval) }); - } - else if (dataSourceConfig.HourlyUpdateConfig.Enabled && DateTime.Now > lastDataUpdate.HourlyUpdateDT.AddMinutes(dataSourceConfig.HourlyUpdateConfig.Interval)) - { - pending.Add(new DataUpdateTask() { Configuration = dataSourceConfig, UpdateType = UpdateTypes.Hourly, MinimumDT = lastDataUpdate.DailyUpdateDT.AddMinutes(-3 * dataSourceConfig.DailyUpdateConfig.Interval) }); - } - } - } - - return pending; - } - - /// - /// Performs the data update - /// - /// Data update task to execute - /// Data update results - public static DataUpdate DoUpdate(DataUpdateTask dataUpdateTask) - { - logger.Info($"Starting [{dataUpdateTask.UpdateType}] data update for {dataUpdateTask.Configuration.TableName}..."); - return DoUpdate(dataUpdateTask.Configuration, dataUpdateTask.UpdateType, dataUpdateTask.MinimumDT); - } - - /// - /// Performs the data update - /// - /// Data source configuration - /// Type of update to perform - /// Minimum timestamp to update data from - /// Data update results - public static DataUpdate DoUpdate(DataSourceConfig config, UpdateTypes updateType, DateTime? minDT) - { - //Log start of data update - DataUpdate dataUpdate = new DataUpdate() - { - SourceSystem = config.SourceSystem, - SourceData = config.SourceData, - TableName = config.TableName, - UpdateType = updateType, - StartDT = DateTime.Now, - NumberRecords = 0 - }; - - //Get data update configuration details - DataUpdateConfig updateConfig; - switch (updateType) - { - case UpdateTypes.Hourly: - updateConfig = config.HourlyUpdateConfig; - break; - case UpdateTypes.Daily: - updateConfig = config.DailyUpdateConfig; - break; - case UpdateTypes.Mass: - updateConfig = config.MassUpdateConfig; - break; - default: - throw new ArgumentOutOfRangeException(nameof(updateType), updateType, null); - } - - using (SqlConnection connection = LotFinderDB.GetConnection()) - { - LogDataUpdateStart(connection, dataUpdate); - - //Clear destination table if needed - if (updateConfig.PrepurgeData) - { - TruncateTable(connection, config.TableName); - } - - Type sourceType = config.DataFetchFunction.Method.ReturnType.GenericTypeArguments[0]; - - //Fetch data - IEnumerable data = config.DataFetchFunction(minDT); - - //Generate SQL to merge temp data to destination table - string mergeSQL = GenerateMerge(connection, config.TableName); - - foreach (var batch in data.BatchGroup(1000000)) - { - //Setup temp table - string stagingTableName = CreateStagingTable(connection, config.TableName); - - //Copy data to temp table - SqlBulkCopy bulkCopy = GenerateBulkCopy(connection, config.TableName, sourceType); - IDataReader reader = new GenericListDataReader(batch, sourceType); - bulkCopy.WriteToServer(reader); - dataUpdate.NumberRecords += batch.Count; - - //Index temp table - RebuildIndicies(connection, stagingTableName); - - //Copy to temp table - string tempTableName = CreateTempTable(connection, config.TableName); - - //Merge data from temp table to destination table - connection.Execute(mergeSQL, commandTimeout: 6000); - - logger.Debug("DoUpdate: {0:n0} rows merged to {1}", dataUpdate.NumberRecords, config.TableName); - } - - //Run post processing action if configured - if (config.PostProcessingAction != null) - { - config.PostProcessingAction(); - } - - //Re-index destination table if needed - if (updateConfig.ReIndexData) - { - RebuildIndicies(connection, dataUpdate.TableName); - } - - //Update data update entry - dataUpdate.WasSuccessful = true; - LogDataUpdateEnd(connection, dataUpdate); - } - - return dataUpdate; - } - } -} diff --git a/OLD/WorkerService/Process/Updater.MisDataPrep.cs b/OLD/WorkerService/Process/Updater.MisDataPrep.cs deleted file mode 100755 index 00adb7e..0000000 --- a/OLD/WorkerService/Process/Updater.MisDataPrep.cs +++ /dev/null @@ -1,240 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data.SQLite; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Commons.Helpers; -using Commons.Models; -using Commons.Process; -using Dapper; - -namespace WorkerService.Process -{ - public partial class Updater - { - private const string SQL_GET_MIS_DATA = @" -select - ItemNumber, BranchCode, SequenceNumber, MisNumber, RevID, - CharNumber, TestGroup, TestDefinition, TestDescription, SamplingType, SamplingValue, ToolsGauges, WorkInstructions, - Status, ReleaseDate, ObsoleteDate -FROM infodb.MisInfo info INNER JOIN - relationdb.MisRelation rel ON (info.RevFK = rel.RevFK) INNER JOIN - detaildb.MisDetail det ON (rel.MisFK = det.MisFK) INNER JOIN - partdb.MisPart part ON (det.PartFK = part.PartFK) -ORDER BY ItemNumber, BranchCode, SequenceNumber, MisNumber, RevID, Status, CharNumber"; - - public static IEnumerable GetMisData() - { - Task misInfoTask = Task.Run(() => PrepareMisInfo()); - Task misRelationTask = Task.Run(() => PrepareMisRelation()); - Task misDetailTask = Task.Run(() => PrepareMisDetail()); - Task misPartTask = Task.Run(() => PrepareMisPart()); - - Task.WaitAll(misInfoTask, misRelationTask, misDetailTask, misPartTask); - - if (File.Exists("misdata.db")) - { - File.Delete("misdata.db"); - } - SQLiteConnection.CreateFile("misdata.db"); - using (SQLiteConnection sqlite = new SQLiteConnection(@"Data Source=misdata.db;Version=3;Journal Mode=Off;")) - { - sqlite.Open(); - - //Attach databases - sqlite.Execute("ATTACH DATABASE 'misinfo.db' AS infodb;"); - sqlite.Execute("ATTACH DATABASE 'misrelation.db' AS relationdb;"); - sqlite.Execute("ATTACH DATABASE 'misdetail.db' AS detaildb;"); - sqlite.Execute("ATTACH DATABASE 'mispart.db' AS partdb;"); - - foreach (MisData misData in sqlite.Query(SQL_GET_MIS_DATA, buffered: false)) - { - yield return misData; - } - } - } - - private static void PrepareMisInfo() - { - return; - if (File.Exists("misinfo.db")) - { - File.Delete("misinfo.db"); - } - SQLiteConnection.CreateFile("misinfo.db"); - - //Fetch MIS info - List misInfos = CMS.GetMisInfos().ToList(); - - //Lookup obsolete date by backlevel release - foreach (var group in misInfos.GroupBy(m => new { m.MisNumber, m.RevID })) - { - DateTime? obsoleteDate = group.Where(g => g.Status.Equals("BackLevel") && g.ReleaseDate != null).Select(g => g.ReleaseDate).FirstOrDefault(); - - foreach (MisInfo current in group.Where(g => g.Status.Equals("Current"))) - { - current.ObsoleteDate = obsoleteDate; - } - } - - //Lookup obsolete date by next revision release - var lookup = misInfos.Where(m => m.ReleaseDate != null).GroupBy(m => new { m.MisNumber, m.RevID, m.Status }).Select(g => new { g.Key.MisNumber, g.Key.RevID, g.Key.Status, ReleaseDate = g.Min(m => m.ReleaseDate) }).ToDictionary(g => new { g.MisNumber, g.RevID, g.Status }, g => g.ReleaseDate); - foreach (MisInfo misInfo in misInfos.Where(m => !m.ObsoleteDate.HasValue)) - { - DateTime? obsoleteDate; - if (lookup.TryGetValue(new { misInfo.MisNumber, misInfo.RevID, misInfo.Status }, out obsoleteDate)) - { - misInfo.ObsoleteDate = obsoleteDate; - } - } - - //Write MIS info to database - using (SQLiteConnection sqlite = new SQLiteConnection(@"Data Source=misinfo.db;Version=3;Journal Mode=Off;")) - { - sqlite.Open(); - - //Create table for MIS info - sqlite.Execute("CREATE TABLE MisInfo(RevFK TEXT, MisNumber TEXT, RevID Text, Status TEXT, ReleaseDate DATETIME, ObsoleteDate DATETIME);"); - - foreach (var batch in misInfos.BatchGroup(10000)) - { - using (SQLiteTransaction transaction = sqlite.BeginTransaction()) - { - foreach (MisInfo misInfo in batch) - { - sqlite.Execute("INSERT INTO MisInfo(RevFK, MisNumber, RevID, Status, ReleaseDate, ObsoleteDate) VALUES(@RevFK, @MisNumber, @RevID, @Status, @ReleaseDate, @ObsoleteDate)", misInfo); - } - - transaction.Commit(); - } - } - - //Add index on FK field - sqlite.Execute("CREATE INDEX IDX_MisInfo_RevFK ON MisInfo(RevFK);"); - - sqlite.Execute("VACUUM"); - } - } - - private static void PrepareMisRelation() - { - return; - if (File.Exists("misrelation.db")) - { - File.Delete("misrelation.db"); - } - SQLiteConnection.CreateFile("misrelation.db"); - - IEnumerable misRelations = CMS.GetMisRelations(); - - //Write MIS relation to database - using (SQLiteConnection sqlite = new SQLiteConnection(@"Data Source=misrelation.db;Version=3;Journal Mode=Off;")) - { - sqlite.Open(); - - //Create table for MIS relation - sqlite.Execute("CREATE TABLE MisRelation(RevFK TEXT, MisFK TEXT);"); - - foreach (var batch in misRelations.BatchGroup(10000)) - { - using (SQLiteTransaction transaction = sqlite.BeginTransaction()) - { - foreach (MisRelation misRelation in batch) - { - sqlite.Execute("INSERT INTO MisRelation(RevFK, MisFK) VALUES(@RevFK, @MisFK)", misRelation); - } - - transaction.Commit(); - } - } - - //Add indices on FK fields - sqlite.Execute("CREATE INDEX IDX_MisRelation_RevFK ON MisRelation(RevFK);"); - sqlite.Execute("CREATE INDEX IDX_MisRelation_MisFK ON MisRelation(MisFK);"); - - sqlite.Execute("VACUUM"); - } - } - - public static void PrepareMisDetail() - { - return; - if (File.Exists("misdetail.db")) - { - File.Delete("misdetail.db"); - } - SQLiteConnection.CreateFile("misdetail.db"); - - IEnumerable misDetails = CMS.GetMisDetails(); - - //Write MIS relation to database - using (SQLiteConnection sqlite = new SQLiteConnection(@"Data Source=misdetail.db;Version=3;Journal Mode=Off;")) - { - sqlite.Open(); - - //Create table for MIS detail - sqlite.Execute("CREATE TABLE MisDetail(MisFK TEXT, PartFK TEXT, CharNumber TEXT, TestGroup TEXT, TestDefinition TEXT, TestDescription TEXT, SamplingType TEXT, SamplingValue TEXT, ToolsGauges TEXT, WorkInstructions TEXT);"); - - foreach (var batch in misDetails.BatchGroup(250000)) - { - using (SQLiteTransaction transaction = sqlite.BeginTransaction()) - { - foreach (MisDetail misDetail in batch) - { - sqlite.Execute("INSERT INTO MisDetail(MisFK, PartFK, CharNumber, TestGroup, TestDefinition, TestDescription, SamplingType, SamplingValue, ToolsGauges, WorkInstructions) VALUES(@MisFK, @PartFK, @CharNumber, @TestGroup, @TestDefinition, @TestDescription, @SamplingType, @SamplingValue, @ToolsGauges, @WorkInstructions)", misDetail); - } - - transaction.Commit(); - } - } - - //Add indices on FK fields - sqlite.Execute("CREATE INDEX IDX_MisDetail_MisFK ON MisDetail(MisFK);"); - sqlite.Execute("CREATE INDEX IDX_MisDetail_PartFK ON MisDetail(PartFK);"); - - sqlite.Execute("VACUUM"); - } - } - - private static void PrepareMisPart() - { - return; - if (File.Exists("mispart.db")) - { - File.Delete("mispart.db"); - } - SQLiteConnection.CreateFile("mispart.db"); - - IEnumerable misParts = CMS.GetMisParts(); - - //Write MIS relation to database - using (SQLiteConnection sqlite = new SQLiteConnection(@"Data Source=mispart.db;Version=3;Journal Mode=Off;")) - { - sqlite.Open(); - - //Create table for MIS detail - sqlite.Execute("CREATE TABLE MisPart(PartFK TEXT, ItemNumber TEXT, BranchCode TEXT, SequenceNumber TEXT);"); - - foreach (var batch in misParts.BatchGroup(100000)) - { - using (SQLiteTransaction transaction = sqlite.BeginTransaction()) - { - foreach (MisPart misPart in batch) - { - sqlite.Execute("INSERT INTO MisPart(PartFK, ItemNumber, BranchCode, SequenceNumber) VALUES(@PartFK, @ItemNumber, @BranchCode, @SequenceNumber);", misPart); - } - - transaction.Commit(); - } - } - - //Add indices on FK fields - sqlite.Execute("CREATE INDEX IDX_MisPart_PartFK ON MisPart(PartFK);"); - - sqlite.Execute("VACUUM"); - } - } - } -} diff --git a/OLD/WorkerService/Process/WorkProcessor.cs b/OLD/WorkerService/Process/WorkProcessor.cs index 751fae1..9a18e96 100755 --- a/OLD/WorkerService/Process/WorkProcessor.cs +++ b/OLD/WorkerService/Process/WorkProcessor.cs @@ -1,10 +1,7 @@ using System; -using System.Collections.Generic; using System.Configuration; using System.IO; -using System.Linq; using System.Threading; -using System.Threading.Tasks; using DataModel.Models; using Microsoft.AspNet.SignalR.Client; using NLog; @@ -146,54 +143,44 @@ namespace WorkerService.Process { try { - //Verify all data sources up to date - List pending = UpdateProcessor.GetPendingUpdateTasks(); - if (pending.Any()) - { - Status = "Updating data cache"; - Parallel.ForEach(pending, new ParallelOptions() { MaxDegreeOfParallelism = 8 }, pendingTask => { UpdateProcessor.DoUpdate(pendingTask); }); - } - else - { - //Reset any partially completed searches - LotFinderDBExt.ResetPartialSearches(); + //Reset any partially completed searches + LotFinderDBExt.ResetPartialSearches(); - //Check for queued searches - Search search = LotFinderDBExt.GetNextSearch(); - if (search != null) + //Check for queued searches + Search search = LotFinderDBExt.GetNextSearch(); + if (search != null) + { + try { - try - { - Status = $"Processing search #{search.ID}"; + Status = $"Processing search #{search.ID}"; - //Start search - LotFinderDBExt.StartSearch(search); - PublishSearchUpdate(search); + //Start search + LotFinderDBExt.StartSearch(search); + PublishSearchUpdate(search); - //Do search - SearchModel searchModel = search.ToSearchModel(); - LotFinderDBExt.Search(searchModel); + //Do search + SearchModel searchModel = search.ToSearchModel(); + LotFinderDBExt.Search(searchModel); - //Record end timestamp - search.EndDT = DateTime.Now; + //Record end timestamp + search.EndDT = DateTime.Now; - //Generate output - search.Results = ExcelWriter.Generate(searchModel); + //Generate output + search.Results = ExcelWriter.Generate(searchModel); - File.WriteAllBytes($"search_{search.ID}.xlsx", search.Results); + File.WriteAllBytes($"search_{search.ID}.xlsx", search.Results); - //Complete search - LotFinderDBExt.CompleteSearch(search, true); - PublishSearchUpdate(search); - } - catch (Exception error) - { - //Log error and mark search as failed - logger.Error("DoWork: failed to process search: {0}.", error.Message); - search.EndDT = DateTime.Now; - LotFinderDBExt.CompleteSearch(search, false); - PublishSearchUpdate(search); - } + //Complete search + LotFinderDBExt.CompleteSearch(search, true); + PublishSearchUpdate(search); + } + catch (Exception error) + { + //Log error and mark search as failed + logger.Error("DoWork: failed to process search: {0}.", error.Message); + search.EndDT = DateTime.Now; + LotFinderDBExt.CompleteSearch(search, false); + PublishSearchUpdate(search); } } diff --git a/OLD/WorkerService/Program.cs b/OLD/WorkerService/Program.cs index 333a804..6c53ece 100755 --- a/OLD/WorkerService/Program.cs +++ b/OLD/WorkerService/Program.cs @@ -1,15 +1,10 @@ using System; -using System.Data.SqlClient; using System.IO; using System.Linq; using System.Reflection; -using System.Threading.Tasks; using Dapper; using DataModel; using Topshelf; -using WorkerService.Helpers; -using WorkerService.Models; -using WorkerService.Models.Reporting; using WorkerService.Process; namespace WorkerService @@ -32,20 +27,6 @@ namespace WorkerService SqlMapper.Settings.CommandTimeout = 1200 * 50; Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory); - DataSourceConfig dsConfig = UpdateProcessor.configs.FirstOrDefault(c => c.TableName.Contains("User")); - UpdateProcessor.DoUpdate(dsConfig.TableName); - - return; - - if (args.Length > 0 && args[0].Equals("REFRESH_ARCHIVE", StringComparison.CurrentCultureIgnoreCase)) - { - Parallel.ForEach(UpdateProcessor.configs.Where(c => c.TableName.Contains("Hist")), config => - { - UpdateProcessor.DoUpdate(config.TableName); - }); - return; - } - Host host = HostFactory.New(x => { x.UseNLog(); diff --git a/OLD/WorkerService/WorkerService.csproj b/OLD/WorkerService/WorkerService.csproj index b5e1869..886f6a2 100755 --- a/OLD/WorkerService/WorkerService.csproj +++ b/OLD/WorkerService/WorkerService.csproj @@ -83,10 +83,6 @@ ..\packages\Dapper.1.50.2\lib\net451\Dapper.dll - - False - ..\..\..\..\..\..\..\DDTek.Oracle.dll - ..\packages\EPPlus.4.1.0\lib\net40\EPPlus.dll True @@ -170,12 +166,6 @@ - - - - - - @@ -196,13 +186,6 @@ - - - UpdateProcessor.cs - - - UpdateProcessor.cs - @@ -226,72 +209,6 @@ Always - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - Designer diff --git a/OLD/WorkerService/dsconfig/Branch.json b/OLD/WorkerService/dsconfig/Branch.json deleted file mode 100755 index 7fe60f0..0000000 --- a/OLD/WorkerService/dsconfig/Branch.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "BRANCH", - "TableName": "Branch", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetBranches", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": true, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": true, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": true, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/FunctionCode.json b/OLD/WorkerService/dsconfig/FunctionCode.json deleted file mode 100755 index a2711b9..0000000 --- a/OLD/WorkerService/dsconfig/FunctionCode.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "FUNCTIONCODE", - "TableName": "FunctionCode", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetFunctionCodes", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": true, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": true, - "Interval": 1440, - "PrepurgeData": true, - "ReIndexData": true - }, - "HourlyUpdateConfig": { - "Enabled": true, - "Interval": 60, - "PrepurgeData": true, - "ReIndexData": true - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/Item.json b/OLD/WorkerService/dsconfig/Item.json deleted file mode 100755 index 2fb7f26..0000000 --- a/OLD/WorkerService/dsconfig/Item.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "ITEM", - "TableName": "Item", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetItems", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": true, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": true, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": true, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/JdeUser.json b/OLD/WorkerService/dsconfig/JdeUser.json deleted file mode 100755 index 0ee7651..0000000 --- a/OLD/WorkerService/dsconfig/JdeUser.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "USER", - "TableName": "JdeUser", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetUsers", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": true, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": true, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": true, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/Lot.json b/OLD/WorkerService/dsconfig/Lot.json deleted file mode 100755 index e439361..0000000 --- a/OLD/WorkerService/dsconfig/Lot.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "LOT", - "TableName": "Lot", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetLots", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": true, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": true, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": true, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/LotUsage.json b/OLD/WorkerService/dsconfig/LotUsage.json deleted file mode 100755 index 08ac885..0000000 --- a/OLD/WorkerService/dsconfig/LotUsage.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "LOTUSAGE", - "TableName": "LotUsage_Curr", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetLotUsages", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": true, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": true, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": true, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/LotUsage_Archive.json b/OLD/WorkerService/dsconfig/LotUsage_Archive.json deleted file mode 100755 index 924b807..0000000 --- a/OLD/WorkerService/dsconfig/LotUsage_Archive.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "LOTUSAGEARCHIVE", - "TableName": "LotUsage_Hist", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetLotUsagesArchive", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": false, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": false, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": false, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/MisData.json b/OLD/WorkerService/dsconfig/MisData.json deleted file mode 100755 index d19d78a..0000000 --- a/OLD/WorkerService/dsconfig/MisData.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "CMS", - "SourceData": "MISDATA", - "TableName": "MisData", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.CMS.GetMisData", - "PostProcessingAction": "Commons.Process.LotFinderDB.PostProcessMisData", - "MassUpdateConfig": { - "Enabled": true, - "Interval": 100800, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": true, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": false, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/OrgHierarchy.json b/OLD/WorkerService/dsconfig/OrgHierarchy.json deleted file mode 100755 index 86f5c20..0000000 --- a/OLD/WorkerService/dsconfig/OrgHierarchy.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "ORGHIERARCHY", - "TableName": "OrgHierarchy", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetOrgHierarchy", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": true, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": true, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": true, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/ProfitCenter.json b/OLD/WorkerService/dsconfig/ProfitCenter.json deleted file mode 100755 index 0ce8436..0000000 --- a/OLD/WorkerService/dsconfig/ProfitCenter.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "PROFITCENTER", - "TableName": "ProfitCenter", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetProfitCenters", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": true, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": true, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": true, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/RouteMaster.json b/OLD/WorkerService/dsconfig/RouteMaster.json deleted file mode 100755 index 50fe658..0000000 --- a/OLD/WorkerService/dsconfig/RouteMaster.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "ROUTEMASTER", - "TableName": "RouteMaster", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetRouteMasters", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": true, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": true, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": true, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/StatusCode.json b/OLD/WorkerService/dsconfig/StatusCode.json deleted file mode 100755 index 9006222..0000000 --- a/OLD/WorkerService/dsconfig/StatusCode.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "STATUSCODE", - "TableName": "StatusCode", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetStatusCodes", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": true, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": true, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": true, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/WorkCenter.json b/OLD/WorkerService/dsconfig/WorkCenter.json deleted file mode 100755 index 1754fa6..0000000 --- a/OLD/WorkerService/dsconfig/WorkCenter.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "WORKCENTER", - "TableName": "WorkCenter", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetWorkCenters", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": true, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": true, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": true, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/WorkOrder.json b/OLD/WorkerService/dsconfig/WorkOrder.json deleted file mode 100755 index 4499273..0000000 --- a/OLD/WorkerService/dsconfig/WorkOrder.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "WORKORDER", - "TableName": "WorkOrder_Curr", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetWorkOrders", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": true, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": true, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": true, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/WorkOrderComponent.json b/OLD/WorkerService/dsconfig/WorkOrderComponent.json deleted file mode 100755 index 6f5d9e1..0000000 --- a/OLD/WorkerService/dsconfig/WorkOrderComponent.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "WORKORDERCOMPONENT", - "TableName": "WorkOrderComponent_Curr", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetWorkOrderComponents", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": true, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": true, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": true, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/WorkOrderComponent_Archive.json b/OLD/WorkerService/dsconfig/WorkOrderComponent_Archive.json deleted file mode 100755 index 60b6d4f..0000000 --- a/OLD/WorkerService/dsconfig/WorkOrderComponent_Archive.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "WORKORDERCOMPONENTARCHIVE", - "TableName": "WorkOrderComponent_Hist", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetWorkOrderComponentsArchive", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": false, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": false, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": false, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/WorkOrderRouting.json b/OLD/WorkerService/dsconfig/WorkOrderRouting.json deleted file mode 100755 index 337d94c..0000000 --- a/OLD/WorkerService/dsconfig/WorkOrderRouting.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "WORKORDERROUTING", - "TableName": "WorkOrderRouting", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetWorkOrderRoutings", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": true, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": true, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": true, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/WorkOrderStep.json b/OLD/WorkerService/dsconfig/WorkOrderStep.json deleted file mode 100755 index a14bb4e..0000000 --- a/OLD/WorkerService/dsconfig/WorkOrderStep.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "WORKORDERSTEP", - "TableName": "WorkOrderStep_Curr", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetWorkOrderSteps", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": true, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": true, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": true, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/WorkOrderStep_Archive.json b/OLD/WorkerService/dsconfig/WorkOrderStep_Archive.json deleted file mode 100755 index 3ed9a98..0000000 --- a/OLD/WorkerService/dsconfig/WorkOrderStep_Archive.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "WORKORDERSTEPARCHIVE", - "TableName": "WorkOrderStep_Hist", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetWorkOrderStepsArchive", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": false, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": false, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": false, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/WorkOrderTime.json b/OLD/WorkerService/dsconfig/WorkOrderTime.json deleted file mode 100755 index 62e59d9..0000000 --- a/OLD/WorkerService/dsconfig/WorkOrderTime.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "WORKORDERTIME", - "TableName": "WorkOrderTime_Curr", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetWorkOrderTimes", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": true, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": true, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": true, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/WorkOrderTime_Archive.json b/OLD/WorkerService/dsconfig/WorkOrderTime_Archive.json deleted file mode 100755 index 2a747e7..0000000 --- a/OLD/WorkerService/dsconfig/WorkOrderTime_Archive.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "WORKORDERTIMEARCHIVE", - "TableName": "WorkOrderTime_Hist", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetWorkOrderTimesArchive", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": false, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": false, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": false, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file diff --git a/OLD/WorkerService/dsconfig/WorkOrder_Archive.json b/OLD/WorkerService/dsconfig/WorkOrder_Archive.json deleted file mode 100755 index 2ef51ab..0000000 --- a/OLD/WorkerService/dsconfig/WorkOrder_Archive.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "SourceSystem": "JDE", - "SourceData": "WORKORDERARCHIVE", - "TableName": "WorkOrder_Hist", - "IsEnabled": true, - "DataFetchFunction": "Commons.Process.JDE.GetWorkOrdersArchive", - "PostProcessingAction": null, - "MassUpdateConfig": { - "Enabled": false, - "Interval": 10080, - "PrepurgeData": true, - "ReIndexData": true - }, - "DailyUpdateConfig": { - "Enabled": false, - "Interval": 1440, - "PrepurgeData": false, - "ReIndexData": false - }, - "HourlyUpdateConfig": { - "Enabled": false, - "Interval": 60, - "PrepurgeData": false, - "ReIndexData": false - } -} \ No newline at end of file