mesfs.infineon.com

Infineon.EAF.Runtime 2.52.0
pool name
Kanban
This commit is contained in:
2023-11-13 16:16:45 -07:00
parent d2e291fe64
commit 49d8e3b309
17 changed files with 617 additions and 46 deletions

View File

@ -94,17 +94,17 @@ public class ProcessData : IProcessData
if (@object is null)
value = string.Empty;
else
value = string.Concat(@object);
if (value.Contains("\""))
value = value.Replace("\"", "\\\"");
if (value.Contains("\n"))
value = value.Replace("\n", "<br>");
name = table.Columns[j].ColumnName.ToString().Trim();
if (name.Contains("\""))
name = name.Replace("\"", "\\\"");
if (name.Contains("\n"))
name = name.Replace("\n", "<br>");
_ = jsonString.Append('"').Append(name).Append("\":").Append('"').Append(value).Append('"');
value = JsonSerializer.Serialize(@object.ToString());
if (value.Contains("\\n"))
value = value.Replace("\\n", "<br>");
if (value.Contains("\\t"))
value = value.Replace("\\t", " ");
name = JsonSerializer.Serialize(table.Columns[j].ColumnName.ToString().Trim());
if (name.Contains("\\n"))
name = name.Replace("\\n", "<br>");
if (name.Contains("\\t"))
name = name.Replace("\\t", " ");
_ = jsonString.Append(name).Append(':').Append(value);
if (j < table.Columns.Count - 1)
_ = jsonString.Append(',');
}
@ -118,6 +118,34 @@ public class ProcessData : IProcessData
return jsonString.ToString();
}
private static List<FIBacklogMesa> Parse(IFileRead fileRead, JsonElement[] jsonElements)
{
string key;
string json;
FIBacklogMesa? fiBacklogMesa;
JsonProperty[] jsonProperties;
List<FIBacklogMesa> fiBacklogMesaCollection = new();
foreach (JsonElement jsonElement in jsonElements)
{
if (jsonElement.ValueKind != JsonValueKind.Object)
continue;
jsonProperties = jsonElement.EnumerateObject().ToArray();
if (jsonProperties.Length < 2)
continue;
key = jsonProperties[0].Value.ToString();
if (string.IsNullOrEmpty(key))
continue;
json = jsonElement.ToString();
if (!fileRead.IsEAFHosted)
File.WriteAllText(".json", json);
fiBacklogMesa = JsonSerializer.Deserialize<FIBacklogMesa>(json);
if (fiBacklogMesa is null)
throw new NullReferenceException();
fiBacklogMesaCollection.Add(fiBacklogMesa);
}
return fiBacklogMesaCollection;
}
private void Parse(IFileRead fileRead, Logistics logistics, List<FileInfo> fileInfoCollection, string sheet)
{
if (fileRead is null)
@ -129,10 +157,20 @@ public class ProcessData : IProcessData
if (dataTable.Rows.Count == 0)
throw new Exception("No rows");
string json = DataTableToJSON(dataTable);
FIBacklogMesa[]? fIBacklogMesaCollection = JsonSerializer.Deserialize<FIBacklogMesa[]>(json, new JsonSerializerOptions() { PropertyNameCaseInsensitive = true });
if (fIBacklogMesaCollection is null || !fIBacklogMesaCollection.Any())
if (!fileRead.IsEAFHosted)
File.WriteAllText(".json", json);
JsonElement[]? jsonElements = JsonSerializer.Deserialize<JsonElement[]>(json, new JsonSerializerOptions() { PropertyNameCaseInsensitive = true });
if (jsonElements is null || !jsonElements.Any())
throw new NullReferenceException();
json = JsonSerializer.Serialize(from l in fIBacklogMesaCollection orderby l.Req.Length, l.Req select l, new JsonSerializerOptions() { WriteIndented = true });
if (!fileRead.ReportFullPath.Contains("Backlog"))
json = JsonSerializer.Serialize(jsonElements, new JsonSerializerOptions() { WriteIndented = true });
else
{
List<FIBacklogMesa> fiBacklogMesaCollection = Parse(fileRead, jsonElements);
json = JsonSerializer.Serialize(from l in fiBacklogMesaCollection orderby l.Req.Length, l.Req select l, new JsonSerializerOptions() { WriteIndented = true });
}
if (!fileRead.IsEAFHosted)
File.WriteAllText(".json", json);
_Details.Add(json);
}