Simplified Manual Report Entry

This commit is contained in:
Daniel Wathen
2023-01-04 16:34:31 -07:00
parent 83525d0149
commit 81f7e1a57b
9 changed files with 54 additions and 44 deletions

View File

@ -7,6 +7,7 @@ namespace ReportingServices.Shared.HelperClasses
public static class DailyReportHelper
{
private static readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json";
private static readonly string _SLLFilePath = "wwwroot/Assets/SLLTools.json";
private static readonly string _baseUrlFabtime = "https://localhost:7196/api/FabTime/";
private static readonly string _baseUrlScrapeDb = "https://localhost:7196/api/ScrapeDB/";
@ -14,7 +15,11 @@ namespace ReportingServices.Shared.HelperClasses
{
List<Task<List<EquipmentStateByDay>>> tasksEQState = new();
List<Task<List<ToolStateCurrent>>> tasksState = new();
DailyReport report = new();
DailyReport report = new()
{
SLLTools = JsonFileHandler.LoadJSONFile<List<SLLTool>>(_SLLFilePath),
ManualReportEntries = JsonFileHandler.LoadJSONFile<ManualReportEntries>(_dailyRptFilePath)
};
Task<YieldInformation> task1 = ApiCaller.GetApi<YieldInformation>(_baseUrlFabtime + "ReactorOuts?startDate=" + report.StartDate.ToString() + "&endDate=" + DateTime.Now.ToString());
Task<YieldInformation> task2 = ApiCaller.GetApi<YieldInformation>(_baseUrlFabtime + "ReactorOuts?startDate=" + report.StartDate.AddDays(-7).ToString() + "&endDate=" + report.StartDate.ToString());
@ -30,11 +35,6 @@ namespace ReportingServices.Shared.HelperClasses
report.QuarterlyTargets = await ApiCaller.GetApi<QuarterlyTargets>(_baseUrlScrapeDb + "Targets");
Dictionary<string, List<ManualReportEntries>> entries = JsonFileHandler.LoadJSONFile<Dictionary<string, List<ManualReportEntries>>>(_dailyRptFilePath);
report.CurrentEntries = entries["Current Week"];
report.PreviousEntries = entries["Previous Week"];
report.AddToolAvailibilityByType("ASM", tasksEQState[0].Result);
report.AddToolAvailibilityByType("EPP", tasksEQState[1].Result);
report.AddToolAvailibilityByType("HTR", tasksEQState[2].Result);
@ -53,9 +53,11 @@ namespace ReportingServices.Shared.HelperClasses
report.ReverseLists();
entries["Current Week"] = report.CurrentEntries;
ManualReportEntries entries = report.ManualReportEntries;
List<SLLTool> sll = report.SLLTools;
JsonFileHandler.SaveJSONFile(entries, _dailyRptFilePath);
JsonFileHandler.SaveJSONFile(sll, _SLLFilePath);
return report;
}

View File

@ -2,8 +2,6 @@
{
public class ManualReportEntries
{
public DayOfWeek Day { get; set; }
public DateTime Date { get; set; }
public int OperatorHeadcountDays { get; set; }
public int OperatorHeadcountNights { get; set; }
public int OperatorCallOutsDays { get; set; }
@ -19,9 +17,5 @@
public string BottleChanges { get; set; }
public string DailyPartChanges { get; set; }
public string WeeklyPartChanges { get; set; }
public int ASMSingleLoadLock { get; set; }
public int HTRSingleLoadLock { get; set; }
public int ASMUnloadTempsLessThan700 { get; set; }
public int HTRUnloadTempsLessThan700 { get; set; }
}
}

View File

@ -13,9 +13,9 @@ namespace ReportingServices.Shared.ViewModels.ProductionReport
public Dictionary<string, ToolStateByType> ToolStateByType { get; set; }
public Dictionary<string, List<string>> ToolStatesByOwner { get; set; }
public Dictionary<string, List<int>> DualLayerReactors { get; set; }
public List<ManualReportEntries> PreviousEntries { get; set; }
public List<ManualReportEntries> CurrentEntries { get; set; }
public ManualReportEntries ManualReportEntries { get; set; }
public List<UnloadTempsByDay> UnloadTempsByDay { get; set; }
public List<SLLTool> SLLTools { get; set; }
public int NumberOfToolsWaferSize6IN { get; set; }
public int NumberOfToolsWaferSize8IN { get; set; }
public int NumberOfToolsWaferSize6INScheduled { get; set; }
@ -26,8 +26,6 @@ namespace ReportingServices.Shared.ViewModels.ProductionReport
{
ToolAvailibilityByType = new();
ToolStateByType = new();
PreviousEntries = new();
CurrentEntries = new();
DualLayerReactors = new();
UnloadTempsByDay = new();
StartDate = DateTime.Parse(APIHelperFunctions.GetBeginningOfWeekAsAPIString());
@ -79,8 +77,22 @@ namespace ReportingServices.Shared.ViewModels.ProductionReport
int singleLoadlockASM = reactorsWithDisabledLoadlocks.Where(react => react.Type.Contains("ASM")).Count();
int singleLoadlockHTR = reactorsWithDisabledLoadlocks.Where(react => react.Type.Contains("HTR")).Count();
CurrentEntries[(int)DateTime.Now.DayOfWeek].ASMSingleLoadLock = singleLoadlockASM;
CurrentEntries[(int)DateTime.Now.DayOfWeek].HTRSingleLoadLock = singleLoadlockHTR;
foreach (SLLTool sll in SLLTools)
{
if (sll.Date.Date == DateTime.Now.Date)
{
sll.ASM = singleLoadlockASM;
sll.HTR = singleLoadlockHTR;
return;
}
}
SLLTools.Add(new SLLTool
{
Date = DateTime.Now.Date,
ASM = singleLoadlockASM,
HTR = singleLoadlockHTR
});
}
private void SetDualLayerReactors(List<RDS> rdsList)

View File

@ -0,0 +1,9 @@
namespace ReportingServices.Shared.ViewModels.ProductionReport
{
public class SLLTool
{
public DateTime Date { get; set; }
public int ASM { get; set; }
public int HTR { get; set; }
}
}