Moved API and DB methods to interfaces in order to leverage Dependency Injection, disolved APICaller class, including functionality in several other functions, included Single Load Lock information into Production Passdown report, changed persistant data file to json instead of xml, and adjusted persistant data file to include a week's worth of data instead of a single day.
This commit is contained in:
@ -2,7 +2,7 @@ namespace ReportingServices.Models
|
||||
{
|
||||
public class ErrorViewModel
|
||||
{
|
||||
public string? RequestId { get; set; }
|
||||
public string RequestId { get; set; }
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
}
|
||||
|
16
ReportingServices/Models/PlanningReport/ReactorPSNWORuns.cs
Normal file
16
ReportingServices/Models/PlanningReport/ReactorPSNWORuns.cs
Normal file
@ -0,0 +1,16 @@
|
||||
namespace ReportingServices.Models.PlanningReport
|
||||
{
|
||||
public class ReactorPSNWORuns
|
||||
{
|
||||
public string REACTOR { get; set; }
|
||||
public string PSN { get; set; }
|
||||
public int WO_COUNT { get; set; }
|
||||
|
||||
public ReactorPSNWORuns(string reactor, string psn, int wo_count)
|
||||
{
|
||||
REACTOR = reactor;
|
||||
PSN = psn;
|
||||
WO_COUNT = wo_count;
|
||||
}
|
||||
}
|
||||
}
|
@ -2,15 +2,17 @@
|
||||
{
|
||||
public class WeeklyPartChanges
|
||||
{
|
||||
public string REACTOR { get; set; }
|
||||
public string PSN { get; set; }
|
||||
public int WO_COUNT { get; set; }
|
||||
public int TotalPartChanges { get; set; }
|
||||
public string StartDate { get; set; }
|
||||
public string EndDate { get; set; }
|
||||
public List<ReactorPSNWORuns> ReactorPSNWORuns { get; set; }
|
||||
|
||||
public WeeklyPartChanges(string reactor, string psn, int wo_count)
|
||||
public WeeklyPartChanges(int totalPartChanges, string startDate, string endDate, List<ReactorPSNWORuns> reactorPSNWORuns)
|
||||
{
|
||||
REACTOR = reactor;
|
||||
PSN = psn;
|
||||
WO_COUNT = wo_count;
|
||||
TotalPartChanges = totalPartChanges;
|
||||
StartDate = startDate;
|
||||
EndDate = endDate;
|
||||
ReactorPSNWORuns = reactorPSNWORuns;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using ReportingServices.ReportingObjects;
|
||||
using ReportingServices.HelperClasses;
|
||||
using ReportingServices.ReportingObjects;
|
||||
|
||||
namespace ReportingServices.Models.ProductionReport
|
||||
{
|
||||
@ -6,17 +7,80 @@ namespace ReportingServices.Models.ProductionReport
|
||||
{
|
||||
public List<ReactorOutsByDay> OutsByDay { get; set; }
|
||||
public List<ScrapByDay> ScrapByDay { get; set; }
|
||||
public Dictionary<string, ToolAvailibilityByType> ToolAvailibilityByType { get; set; }
|
||||
public Dictionary<string, List<EquipmentStateByDay>> ToolAvailibilityByType { get; set; }
|
||||
public Dictionary<string, ToolStateByType> ToolStateByType { get; set; }
|
||||
public List<ManualReportEntriesByDay> Entries { get; set; }
|
||||
|
||||
public DailyReport(List<ReactorOutsByDay> outsByDay, List<ScrapByDay> scrapByDay, Dictionary<string, ToolAvailibilityByType> toolAvailibilityByType, Dictionary<string, ToolStateByType> toolStateByType)
|
||||
public DailyReport()
|
||||
{
|
||||
OutsByDay = outsByDay;
|
||||
ScrapByDay = scrapByDay;
|
||||
ToolAvailibilityByType = toolAvailibilityByType;
|
||||
ToolStateByType = toolStateByType;
|
||||
ToolAvailibilityByType = new();
|
||||
ToolStateByType = new();
|
||||
}
|
||||
|
||||
public void SetOutsByDay(List<ReactorOutsByRDS> outs)
|
||||
{
|
||||
OutsByDay = GetReactorOutsByDay(outs);
|
||||
}
|
||||
|
||||
public void SetScrapByDay(List<ScrapByDay> scrap)
|
||||
{
|
||||
ScrapByDay = scrap;
|
||||
}
|
||||
|
||||
public void AddToolAvailibilityByType(string key, List<EquipmentStateByDay> states)
|
||||
{
|
||||
ToolAvailibilityByType.Add(key, states);
|
||||
}
|
||||
|
||||
public void AddToolStateByType(string key, List<ToolStateCurrent> states)
|
||||
{
|
||||
ToolStateByType state = new ToolStateByType(states);
|
||||
|
||||
ToolStateByType.Add(key, state);
|
||||
}
|
||||
|
||||
public static List<string> GetDistinctDatesFromReactorOuts(List<ReactorOutsByRDS> outs)
|
||||
{
|
||||
List<string> dates = new();
|
||||
|
||||
foreach (ReactorOutsByRDS rout in outs)
|
||||
{
|
||||
if (!dates.Contains(DateTime.Parse(rout.EndProcessTime).Date.ToString()))
|
||||
dates.Add(DateTime.Parse(rout.EndProcessTime).Date.ToString());
|
||||
}
|
||||
|
||||
return dates;
|
||||
}
|
||||
|
||||
public static List<ReactorOutsByDay> GetReactorOutsByDay(List<ReactorOutsByRDS> outs)
|
||||
{
|
||||
List<ReactorOutsByDay> outsByDay = new();
|
||||
|
||||
List<string> dates = GetDistinctDatesFromReactorOuts(outs);
|
||||
|
||||
foreach (string date in dates)
|
||||
{
|
||||
int waferCount = 0;
|
||||
|
||||
foreach (ReactorOutsByRDS rout in outs)
|
||||
{
|
||||
if (DateTime.Parse(rout.EndProcessTime).Date.ToString() == date)
|
||||
waferCount += (int)float.Parse(rout.Units);
|
||||
}
|
||||
|
||||
outsByDay.Add(new ReactorOutsByDay(date, waferCount));
|
||||
}
|
||||
|
||||
return outsByDay;
|
||||
}
|
||||
|
||||
public void ReverseLists()
|
||||
{
|
||||
ScrapByDay = APIHelperFunctions.ReverseList(ScrapByDay);
|
||||
|
||||
ToolAvailibilityByType["ASM"] = APIHelperFunctions.ReverseList(ToolAvailibilityByType["ASM"]);
|
||||
ToolAvailibilityByType["EPP"] = APIHelperFunctions.ReverseList(ToolAvailibilityByType["EPP"]);
|
||||
ToolAvailibilityByType["HTR"] = APIHelperFunctions.ReverseList(ToolAvailibilityByType["HTR"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user