Initial commit: JDE Scoping Tool migration project
Set up repository with legacy .NET Framework 4.8 source (OLD/), new .NET 10 Blazor solution (NEW/), OpenSpec specifications, documentation, and project configuration.
This commit is contained in:
+45
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Dapper;
|
||||
using DataModel.Helpers;
|
||||
using DataModel.Models;
|
||||
using Oracle.ManagedDataAccess.Client;
|
||||
|
||||
namespace DataModel.Process
|
||||
{
|
||||
/// <summary>
|
||||
/// Work order routing transaction tracking functionality for JDE interface
|
||||
/// </summary>
|
||||
public partial class JDE
|
||||
{
|
||||
/// <summary>
|
||||
/// Fetches updates for work order routings
|
||||
/// </summary>
|
||||
/// <param name="lastUpdateDT">Timestamp of last imported data</param>
|
||||
/// <returns>Streaming work order routings for lots</returns>
|
||||
public static IEnumerable<WorkOrderRouting> GetWorkOrderRoutings(DateTime? lastUpdateDT = null)
|
||||
{
|
||||
using (OracleConnection connection = GetConnection())
|
||||
{
|
||||
var results = lastUpdateDT.HasValue ?
|
||||
connection.Query<WorkOrderRouting>(queries["SQL_GET_WORKORDER_ROUTING_FILTERED"], new { dateUpdated = lastUpdateDT.Value.ToJDEDate(), timeUpdated = lastUpdateDT.Value.ToJDETime() }, buffered: false, commandTimeout: Config.QueryTimeout) :
|
||||
connection.Query<WorkOrderRouting>(queries["SQL_GET_WORKORDER_ROUTING"], buffered: false, commandTimeout: Config.QueryTimeout);
|
||||
|
||||
foreach (var result in results)
|
||||
{
|
||||
if (result.LastUpdateDT.Year < 1900 || result.LastUpdateDT.Year > 2500)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (result.TransactionDate.Year < 1900 || result.TransactionDate.Year > 2500)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
yield return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user