Minor changes for Max RDS
This commit is contained in:
@ -14,12 +14,19 @@ namespace OI.Metrology.Archive.Repositories;
|
||||
public class RdsMaxRepo : IRdsMaxRepo
|
||||
{
|
||||
|
||||
private readonly IMemoryCache _Cache;
|
||||
private readonly IMemoryCache _MemoryCache;
|
||||
private readonly Models.AppSettings _AppSettings;
|
||||
|
||||
public RdsMaxRepo(Models.AppSettings appSettings, IMemoryCache memoryCache)
|
||||
{
|
||||
_Cache = memoryCache;
|
||||
_MemoryCache = memoryCache;
|
||||
_AppSettings = appSettings;
|
||||
}
|
||||
|
||||
public RdsMaxRepo(string json, IMemoryCache memoryCache)
|
||||
{
|
||||
_MemoryCache = memoryCache;
|
||||
Models.AppSettings appSettings = System.Text.Json.JsonSerializer.Deserialize<Models.AppSettings>(json);
|
||||
_AppSettings = appSettings;
|
||||
}
|
||||
|
||||
@ -27,7 +34,7 @@ public class RdsMaxRepo : IRdsMaxRepo
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("CacheItem: " + key);
|
||||
|
||||
_ = _Cache.Set(key, v, new MemoryCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(1)));
|
||||
_ = _MemoryCache.Set(key, v, new MemoryCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(1)));
|
||||
}
|
||||
|
||||
private static string GetMaxRdsSql()
|
||||
@ -40,7 +47,8 @@ public class RdsMaxRepo : IRdsMaxRepo
|
||||
Append(" , rt.zone ").
|
||||
Append(" , rr.load_lock_side ").
|
||||
Append(" , rr.rds_no ").
|
||||
Append(" , rt.ps_no ").
|
||||
Append(" , rr.wo_no ").
|
||||
Append(" , rr.ps_no ").
|
||||
Append(" , rr.recipe_name ").
|
||||
Append(" , rr.recipe_no ").
|
||||
Append(" , rr.spec_type ").
|
||||
@ -51,7 +59,6 @@ public class RdsMaxRepo : IRdsMaxRepo
|
||||
Append(" , rt.spec_cres_mtool ").
|
||||
Append(" , rt.spec_cres_mrecipe ").
|
||||
Append(" , ci.ci_no ").
|
||||
Append(" , ci.spec_clean_tool ").
|
||||
Append(" , cr.mv_no ").
|
||||
Append(" , cr.scan_tool ").
|
||||
Append(" , cr.spec_surfscan_recipe ").
|
||||
@ -70,8 +77,9 @@ public class RdsMaxRepo : IRdsMaxRepo
|
||||
Append(" ) as qc ").
|
||||
Append(" inner join lsl2sql.dbo.react_run rr ").
|
||||
Append(" on qc.rds_no = rr.rds_no ").
|
||||
Append(" left join [lsl2sql].[dbo].[rds_test] rt ").
|
||||
Append(" inner join [lsl2sql].[dbo].[rds_test] rt ").
|
||||
Append(" on rr.rds_no = rt.rds_no ").
|
||||
Append(" and rr.ps_no = rt.ps_no ").
|
||||
Append(" left join [lsl2sql].[dbo].[clean_insp] ci ").
|
||||
Append(" on rr.rds_no = ci.rds_no ").
|
||||
Append(" and ci.stage = 'LWI' ").
|
||||
@ -109,7 +117,7 @@ public class RdsMaxRepo : IRdsMaxRepo
|
||||
{
|
||||
Max[] cached;
|
||||
string cacheKey = "GetMaxRDS";
|
||||
if (_Cache.TryGetValue(cacheKey, out cached))
|
||||
if (_MemoryCache.TryGetValue(cacheKey, out cached))
|
||||
return cached;
|
||||
|
||||
string loadSigDTM = DateTime.Now.AddDays(-90).ToString("yyyy-MM-dd 00:00:00.000");
|
||||
@ -246,7 +254,7 @@ public class RdsMaxRepo : IRdsMaxRepo
|
||||
List<string> thick = new();
|
||||
List<string> centerRes = new();
|
||||
StringBuilder stringBuilder = new();
|
||||
_ = stringBuilder.Append($"Reactor\tReactorType\tRDS\tPSN\tName\tSpecType\tRes\tThick\tCenter Res\tClean");
|
||||
_ = stringBuilder.Append($"Reactor\tReactorType\tRDS\tPSN\tName\tSpecType\tRes\tThick\tCenter Res\tScan");
|
||||
row = stringBuilder.ToString().Split('\t');
|
||||
results.Add(row);
|
||||
Dictionary<int, List<Max>> reactorToRecords = GetReactorToRecords(collection);
|
||||
|
Reference in New Issue
Block a user