Added calculation for daily planned wafer outs and display on production report.

This commit is contained in:
Daniel Wathen
2023-01-04 19:26:33 -07:00
parent 03668e1335
commit 9f08d6630c
5 changed files with 24 additions and 13 deletions

View File

@ -52,8 +52,8 @@ namespace ReportingServices.Shared.HelperClasses
report.SetRDSInfo(rds.Result);
report.SetReactorInfo(reactors.Result, GetUnscheduledReactors(report));
report.CurrentWeek.SetYieldInformation(task1.Result);
report.PreviousWeek.SetYieldInformation(task2.Result);
report.CurrentWeek.SetYieldInformation(task1.Result, report.QuarterlyTargets);
report.PreviousWeek.SetYieldInformation(task2.Result, report.QuarterlyTargets);
report.ReverseLists();

View File

@ -12,5 +12,7 @@ namespace ReportingServices.Shared.Models.ProductionReport
public int IFX_Scrap { get; set; }
[JsonPropertyName("Yield")]
public float Yield { get; set; }
[JsonPropertyName("PlanWorkingDays")]
public int PlanWorkingDays { get; set; }
}
}

View File

@ -160,7 +160,13 @@ namespace ReportingServices.Shared.Repositories
" AND FISCAL_QTR = " +
" (SELECT FISCAL_QTR FROM FISCAL_QTR " +
" WHERE START_DT < SYSDATETIME() " +
" AND END_DT > SYSDATETIME()) ";
" AND END_DT > SYSDATETIME()) " +
"UNION " +
"SELECT 'PlanWorkingDays' As THRU_TARGET," +
" PLAN_WORKING_DAYS AS THRU_QTY," +
" NULL AS THRU_PCNT" +
" FROM FISCAL_QTR " +
" WHERE SYSDATETIME() BETWEEN START_DT AND END_DT";
cmd.CommandText = query;
@ -184,7 +190,8 @@ namespace ReportingServices.Shared.Repositories
Reactor_Outs = (int)targets["Reactor_Outs"],
Yield_Outs = (int)targets["Yield_Outs"],
IFX_Scrap = (int)targets["IFX_Scrap"],
Yield = targets["Yield"]
Yield = targets["Yield"],
PlanWorkingDays = (int)targets["PlanWorkingDays"]
};
return quarterlyTargets;

View File

@ -7,6 +7,7 @@ namespace ReportingServices.Shared.ViewModels.ProductionReport
public DateTime StartDate { get; set; }
public List<ReactorOutsByDay> OutsByDay { get; set; }
public List<ScrapByDay> ScrapByDay { get; set; }
public int DailyPlanWafers { get; set; }
public bool IsCurrentWeek { get; set; }
public YieldStatistics(DateTime startDate, bool isCurrentWeek)
@ -15,10 +16,11 @@ namespace ReportingServices.Shared.ViewModels.ProductionReport
IsCurrentWeek = isCurrentWeek;
}
public void SetYieldInformation(YieldInformation yieldInformation)
public void SetYieldInformation(YieldInformation yieldInformation, QuarterlyTargets targets)
{
OutsByDay = GetReactorOutsByDay(yieldInformation.Outs);
ScrapByDay = yieldInformation.Scrap;
DailyPlanWafers = targets.Yield_Outs / targets.PlanWorkingDays;
}
public static List<string> GetDistinctDatesFromReactorOuts(List<ReactorOutsByRDS> outs)