Removed not needed properties from api
This commit is contained in:
parent
2614782d58
commit
c5e3acc3e4
@ -6,6 +6,7 @@ using System.Globalization;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Adaptation.FileHandlers.MoveAllFiles.ApiController;
|
namespace Adaptation.FileHandlers.MoveAllFiles.ApiController;
|
||||||
@ -49,6 +50,38 @@ public class BarcodeHelper
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Root? GetRoot(string rds)
|
||||||
|
{
|
||||||
|
HttpClient httpClient = new();
|
||||||
|
string url = $"{FileRead.OpenInsightApplicationProgrammingInterface}/materials/rds/{rds}";
|
||||||
|
string httpClientResult = httpClient.GetStringAsync(url).Result;
|
||||||
|
Root? root = JsonSerializer.Deserialize<Root>(httpClientResult);
|
||||||
|
httpClient.Dispose();
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SetQaMetTests(string toolClass, Root root, Dictionary<string, List<QaMetTest>> qaMetTests)
|
||||||
|
{
|
||||||
|
List<QaMetTest>? collection;
|
||||||
|
foreach (PrsStage prsStage in root.Rds.ProdSpec.PrsStages)
|
||||||
|
{
|
||||||
|
if (prsStage.QaMetTests is null)
|
||||||
|
continue;
|
||||||
|
foreach (QaMetTest qaMetTest in prsStage.QaMetTests)
|
||||||
|
{
|
||||||
|
if (qaMetTest.ToolClass != toolClass)
|
||||||
|
continue;
|
||||||
|
if (!qaMetTests.TryGetValue(prsStage.Stage, out collection))
|
||||||
|
{
|
||||||
|
qaMetTests.Add(prsStage.Stage, new());
|
||||||
|
if (!qaMetTests.TryGetValue(prsStage.Stage, out collection))
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
collection.Add(qaMetTest);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal static PostReplay? Post(string id, HttpContent? httpContent)
|
internal static PostReplay? Post(string id, HttpContent? httpContent)
|
||||||
{
|
{
|
||||||
PostReplay? result;
|
PostReplay? result;
|
||||||
@ -64,42 +97,20 @@ public class BarcodeHelper
|
|||||||
{
|
{
|
||||||
Job? job;
|
Job? job;
|
||||||
string? mid;
|
string? mid;
|
||||||
List<QaMetTest>? collection;
|
|
||||||
Dictionary<string, List<QaMetTest>> qaMetTests = new();
|
Dictionary<string, List<QaMetTest>> qaMetTests = new();
|
||||||
Write(TIBCO.FileRead.BarcodeHostFileShare, id, notification.Value);
|
Write(TIBCO.FileRead.BarcodeHostFileShare, id, notification.Value);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const string hyphen = "-";
|
const string hyphen = "-";
|
||||||
HttpClient httpClient = new();
|
|
||||||
job = GetJob(TIBCO.FileRead.LSL2SQLConnectionString, TIBCO.FileRead.MetrologyFileShare, TIBCO.FileRead.BarcodeHostFileShare, id, notification.Value);
|
job = GetJob(TIBCO.FileRead.LSL2SQLConnectionString, TIBCO.FileRead.MetrologyFileShare, TIBCO.FileRead.BarcodeHostFileShare, id, notification.Value);
|
||||||
mid = job.SpecName == hyphen || job.ProcessSpecName == hyphen ? $"{job.ProcessType}" : $"{job.ProcessType}.{job.SpecName}.{job.ProcessSpecName}";
|
mid = job.SpecName == hyphen || job.ProcessSpecName == hyphen ? $"{job.ProcessType}" : $"{job.ProcessType}.{job.SpecName}.{job.ProcessSpecName}";
|
||||||
string httpClientResult = httpClient.GetStringAsync($"{FileRead.OpenInsightApplicationProgrammingInterface}/materials/rds/{job.LotName}").Result;
|
Root? root = GetRoot(job.LotName);
|
||||||
Root? root = JsonSerializer.Deserialize<Root>(httpClientResult);
|
|
||||||
httpClient.Dispose();
|
|
||||||
if (root is not null)
|
if (root is not null)
|
||||||
{
|
SetQaMetTests(notification.Value.ToolClass, root, qaMetTests);
|
||||||
foreach (PrsStage prsStage in root.Rds.ProdSpec.PrsStages)
|
|
||||||
{
|
|
||||||
if (prsStage.QaMetTests is null)
|
|
||||||
continue;
|
|
||||||
foreach (QaMetTest qaMetTest in prsStage.QaMetTests)
|
|
||||||
{
|
|
||||||
if (qaMetTest.ToolClass != notification.Value.ToolClass)
|
|
||||||
continue;
|
|
||||||
if (!qaMetTests.TryGetValue(prsStage.Stage, out collection))
|
|
||||||
{
|
|
||||||
qaMetTests.Add(prsStage.Stage, new());
|
|
||||||
if (!qaMetTests.TryGetValue(prsStage.Stage, out collection))
|
|
||||||
throw new Exception();
|
|
||||||
}
|
|
||||||
collection.Add(qaMetTest);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
mid = null;
|
mid = string.Concat(ex.Message, Environment.NewLine, ex.StackTrace);
|
||||||
}
|
}
|
||||||
result = new(mid, qaMetTests); // .ProdSpec.PrsStages[0].QaMetTests[0].Recipe);
|
result = new(mid, qaMetTests); // .ProdSpec.PrsStages[0].QaMetTests[0].Recipe);
|
||||||
}
|
}
|
||||||
|
@ -5,44 +5,44 @@ namespace Adaptation.FileHandlers.MoveAllFiles.OpenInsight;
|
|||||||
|
|
||||||
public class ProdSpec
|
public class ProdSpec
|
||||||
{
|
{
|
||||||
[JsonPropertyName("keyId")]
|
// [JsonPropertyName("keyId")]
|
||||||
public int KeyId { get; set; }
|
// public int KeyId { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("specType")]
|
// [JsonPropertyName("specType")]
|
||||||
public string SpecType { get; set; }
|
// public string SpecType { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("status")]
|
// [JsonPropertyName("status")]
|
||||||
public string Status { get; set; }
|
// public string Status { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("minutesPerWafer")]
|
// [JsonPropertyName("minutesPerWafer")]
|
||||||
public double MinutesPerWafer { get; set; }
|
// public double MinutesPerWafer { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("proveInTime")]
|
// [JsonPropertyName("proveInTime")]
|
||||||
public double ProveInTime { get; set; }
|
// public double ProveInTime { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("layerType")]
|
// [JsonPropertyName("layerType")]
|
||||||
public string LayerType { get; set; }
|
// public string LayerType { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("reactorType")]
|
// [JsonPropertyName("reactorType")]
|
||||||
public string ReactorType { get; set; }
|
// public string ReactorType { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("susceptorType")]
|
// [JsonPropertyName("susceptorType")]
|
||||||
public string SusceptorType { get; set; }
|
// public string SusceptorType { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("tubePressureType")]
|
// [JsonPropertyName("tubePressureType")]
|
||||||
public string TubePressureType { get; set; }
|
// public string TubePressureType { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("recipeLayers")]
|
// [JsonPropertyName("recipeLayers")]
|
||||||
public List<RecipeLayer> RecipeLayers { get; set; }
|
// public List<RecipeLayer> RecipeLayers { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("prodVers")]
|
// [JsonPropertyName("prodVers")]
|
||||||
public List<ProdVer> ProdVers { get; set; }
|
// public List<ProdVer> ProdVers { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("epiPart")]
|
// [JsonPropertyName("epiPart")]
|
||||||
public EpiPart EpiPart { get; set; }
|
// public EpiPart EpiPart { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("custEpiParts")]
|
// [JsonPropertyName("custEpiParts")]
|
||||||
public List<CustEpiPart> CustEpiParts { get; set; }
|
// public List<CustEpiPart> CustEpiParts { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("prsStages")]
|
[JsonPropertyName("prsStages")]
|
||||||
public List<PrsStage> PrsStages { get; set; }
|
public List<PrsStage> PrsStages { get; set; }
|
||||||
|
@ -5,23 +5,23 @@ namespace Adaptation.FileHandlers.MoveAllFiles.OpenInsight;
|
|||||||
|
|
||||||
public class PrsStage
|
public class PrsStage
|
||||||
{
|
{
|
||||||
[JsonPropertyName("keyId")]
|
// [JsonPropertyName("keyId")]
|
||||||
public string KeyId { get; set; }
|
// public string KeyId { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("psn")]
|
// [JsonPropertyName("psn")]
|
||||||
public int Psn { get; set; }
|
// public int Psn { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("stage")]
|
[JsonPropertyName("stage")]
|
||||||
public string Stage { get; set; }
|
public string Stage { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("cleans")]
|
// [JsonPropertyName("cleans")]
|
||||||
public Cleans Cleans { get; set; }
|
// public Cleans Cleans { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("inspection")]
|
// [JsonPropertyName("inspection")]
|
||||||
public Inspection Inspection { get; set; }
|
// public Inspection Inspection { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("surfscan")]
|
// [JsonPropertyName("surfscan")]
|
||||||
public SurfScan Surfscan { get; set; }
|
// public SurfScan Surfscan { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("qaMetTests")]
|
[JsonPropertyName("qaMetTests")]
|
||||||
public List<QaMetTest> QaMetTests { get; set; }
|
public List<QaMetTest> QaMetTests { get; set; }
|
||||||
|
@ -11,87 +11,87 @@ public class Rds
|
|||||||
[JsonPropertyName("reactor")]
|
[JsonPropertyName("reactor")]
|
||||||
public int Reactor { get; set; }
|
public int Reactor { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("workOrder")]
|
// [JsonPropertyName("workOrder")]
|
||||||
public int WorkOrder { get; set; }
|
// public int WorkOrder { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("cassNo")]
|
// [JsonPropertyName("cassNo")]
|
||||||
public int CassNo { get; set; }
|
// public int CassNo { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("combStatus")]
|
// [JsonPropertyName("combStatus")]
|
||||||
public string CombStatus { get; set; }
|
// public string CombStatus { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("partNo")]
|
// [JsonPropertyName("partNo")]
|
||||||
public int PartNo { get; set; }
|
// public int PartNo { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("PSN")]
|
// [JsonPropertyName("PSN")]
|
||||||
public int PSN { get; set; }
|
// public int PSN { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("entryId")]
|
// [JsonPropertyName("entryId")]
|
||||||
public string EntryId { get; set; }
|
// public string EntryId { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("entryDtm")]
|
// [JsonPropertyName("entryDtm")]
|
||||||
public string EntryDtm { get; set; }
|
// public string EntryDtm { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("preEpiSig")]
|
// [JsonPropertyName("preEpiSig")]
|
||||||
public string PreEpiSig { get; set; }
|
// public string PreEpiSig { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("preEpiSigDtm")]
|
// [JsonPropertyName("preEpiSigDtm")]
|
||||||
public string PreEpiSigDtm { get; set; }
|
// public string PreEpiSigDtm { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("operatorIn")]
|
// [JsonPropertyName("operatorIn")]
|
||||||
public string OperatorIn { get; set; }
|
// public string OperatorIn { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("dtmIn")]
|
// [JsonPropertyName("dtmIn")]
|
||||||
public string DtmIn { get; set; }
|
// public string DtmIn { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("operatorOut")]
|
// [JsonPropertyName("operatorOut")]
|
||||||
public string OperatorOut { get; set; }
|
// public string OperatorOut { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("dtmOut")]
|
// [JsonPropertyName("dtmOut")]
|
||||||
public string DtmOut { get; set; }
|
// public string DtmOut { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("postEpiSig")]
|
// [JsonPropertyName("postEpiSig")]
|
||||||
public string PostEpiSig { get; set; }
|
// public string PostEpiSig { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("postEpiSigDtm")]
|
// [JsonPropertyName("postEpiSigDtm")]
|
||||||
public string PostEpiSigDtm { get; set; }
|
// public string PostEpiSigDtm { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("supVerSig")]
|
// [JsonPropertyName("supVerSig")]
|
||||||
public string SupVerSig { get; set; }
|
// public string SupVerSig { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("supVerSigDtm")]
|
// [JsonPropertyName("supVerSigDtm")]
|
||||||
public string SupVerSigDtm { get; set; }
|
// public string SupVerSigDtm { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("shipDtm")]
|
// [JsonPropertyName("shipDtm")]
|
||||||
public object ShipDtm { get; set; }
|
// public object ShipDtm { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("subPartNo")]
|
// [JsonPropertyName("subPartNo")]
|
||||||
public int SubPartNo { get; set; }
|
// public int SubPartNo { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("shipNo")]
|
// [JsonPropertyName("shipNo")]
|
||||||
public object ShipNo { get; set; }
|
// public object ShipNo { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("cassWaferQty")]
|
// [JsonPropertyName("cassWaferQty")]
|
||||||
public int CassWaferQty { get; set; }
|
// public int CassWaferQty { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("loadLockSide")]
|
// [JsonPropertyName("loadLockSide")]
|
||||||
public string LoadLockSide { get; set; }
|
// public string LoadLockSide { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("waferSize")]
|
// [JsonPropertyName("waferSize")]
|
||||||
public string WaferSize { get; set; }
|
// public string WaferSize { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("reactorType")]
|
// [JsonPropertyName("reactorType")]
|
||||||
public string ReactorType { get; set; }
|
// public string ReactorType { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("prodSpec")]
|
[JsonPropertyName("prodSpec")]
|
||||||
public ProdSpec ProdSpec { get; set; }
|
public ProdSpec ProdSpec { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("cleanInsp")]
|
// [JsonPropertyName("cleanInsp")]
|
||||||
public List<CleanInsp> CleanInsp { get; set; }
|
// public List<CleanInsp> CleanInsp { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("woMatQA")]
|
// [JsonPropertyName("woMatQA")]
|
||||||
public WoMatQA WoMatQA { get; set; }
|
// public WoMatQA WoMatQA { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("rdsLayers")]
|
// [JsonPropertyName("rdsLayers")]
|
||||||
public List<RdsLayer> RdsLayers { get; set; }
|
// public List<RdsLayer> RdsLayers { get; set; }
|
||||||
}
|
}
|
@ -47,7 +47,7 @@ public class API : LoggingUnitTesting, IDisposable
|
|||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
#if true
|
#if (!true)
|
||||||
[Ignore]
|
[Ignore]
|
||||||
#endif
|
#endif
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@ -56,7 +56,10 @@ public class API : LoggingUnitTesting, IDisposable
|
|||||||
MethodBase methodBase = new StackFrame().GetMethod();
|
MethodBase methodBase = new StackFrame().GetMethod();
|
||||||
#nullable enable
|
#nullable enable
|
||||||
HttpClient httpClient = new();
|
HttpClient httpClient = new();
|
||||||
string httpClientResult = httpClient.GetStringAsync($"{FileRead.OpenInsightApplicationProgrammingInterface}/materials/rds/601132").Result;
|
// string rds = "504162";
|
||||||
|
string rds = "601132";
|
||||||
|
string url = $"{FileRead.OpenInsightApplicationProgrammingInterface}/materials/rds/{rds}";
|
||||||
|
string httpClientResult = httpClient.GetStringAsync(url).Result;
|
||||||
FileHandlers.MoveAllFiles.OpenInsight.Root? root = JsonSerializer.Deserialize<FileHandlers.MoveAllFiles.OpenInsight.Root>(httpClientResult);
|
FileHandlers.MoveAllFiles.OpenInsight.Root? root = JsonSerializer.Deserialize<FileHandlers.MoveAllFiles.OpenInsight.Root>(httpClientResult);
|
||||||
httpClient.Dispose();
|
httpClient.Dispose();
|
||||||
Assert.IsNotNull(root?.Rds.ProdSpec.PrsStages);
|
Assert.IsNotNull(root?.Rds.ProdSpec.PrsStages);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user