Added data pull for previous week and capability for production passdown to view previous week data, added tool state mapping json file and production passdown report shows owners, removed unnecessary jQuery package.

This commit is contained in:
Daniel Wathen
2022-12-07 10:44:11 -07:00
parent 3409ad58b7
commit 4592b035b6
16 changed files with 651 additions and 576 deletions

View File

@ -5,28 +5,29 @@ namespace ReportingServices.Models.ProductionReport
{
public class DailyReport
{
public List<ReactorOutsByDay> OutsByDay { get; set; }
public List<ScrapByDay> ScrapByDay { get; set; }
public DateTime StartDate { get; set; }
public YieldStatistics CurrentWeek { get; set; }
public YieldStatistics PreviousWeek { get; set; }
public Dictionary<string, List<EquipmentStateByDay>> ToolAvailibilityByType { get; set; }
public Dictionary<string, ToolStateByType> ToolStateByType { get; set; }
public List<ManualReportEntriesByDay> Entries { get; set; }
public Dictionary<string, List<string>> ToolStatesByOwner { get; set; }
public List<ManualReportEntries> PreviousEntries { get; set; }
public List<ManualReportEntries> CurrentEntries { get; set; }
public int NumberOfToolsWaferSize6IN { get; set; }
public int NumberOfToolsWaferSize8IN { get; set; }
public int NumberOfToolsWaferSize6INScheduled { get; set; }
public int NumberOfToolsWaferSize8INScheduled { get; set; }
public QuarterlyTargets QuarterlyTargets { get; set; }
public DailyReport()
{
ToolAvailibilityByType = new();
ToolStateByType = new();
}
public void SetOutsByDay(List<ReactorOutsByRDS> outs)
{
OutsByDay = GetReactorOutsByDay(outs);
}
public void SetScrapByDay(List<ScrapByDay> scrap)
{
ScrapByDay = scrap;
PreviousEntries = new();
CurrentEntries = new();
StartDate = DateTime.Parse(APIHelperFunctions.GetBeginningOfWeekAsAPIString());
CurrentWeek = new(StartDate, true);
PreviousWeek = new(StartDate.AddDays(-7), false);
}
public void AddToolAvailibilityByType(string key, List<EquipmentStateByDay> states)
@ -36,49 +37,15 @@ namespace ReportingServices.Models.ProductionReport
public void AddToolStateByType(string key, List<ToolStateCurrent> states)
{
ToolStateByType state = new ToolStateByType(states);
ToolStateByType state = new(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);
CurrentWeek.ScrapByDay = APIHelperFunctions.ReverseList(CurrentWeek.ScrapByDay);
PreviousWeek.ScrapByDay = APIHelperFunctions.ReverseList(PreviousWeek.ScrapByDay);
ToolAvailibilityByType["ASM"] = APIHelperFunctions.ReverseList(ToolAvailibilityByType["ASM"]);
ToolAvailibilityByType["EPP"] = APIHelperFunctions.ReverseList(ToolAvailibilityByType["EPP"]);

View File

@ -0,0 +1,63 @@
using ReportingServices.ReportingObjects;
namespace ReportingServices.Models.ProductionReport
{
public class YieldStatistics
{
public DateTime StartDate { get; set; }
public List<ReactorOutsByDay> OutsByDay { get; set; }
public List<ScrapByDay> ScrapByDay { get; set; }
public bool IsCurrentWeek { get; set; }
public YieldStatistics(DateTime startDate, bool isCurrentWeek)
{
StartDate = startDate;
IsCurrentWeek = isCurrentWeek;
}
public void SetOutsByDay(List<ReactorOutsByRDS> outs)
{
OutsByDay = GetReactorOutsByDay(outs);
}
public void SetScrapByDay(List<ScrapByDay> scrap)
{
ScrapByDay = scrap;
}
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;
}
}
}