Changed metric for determining wafers needed for quarter, included reactor log comments, made downed tools table larger, fixed bug in determining reactor capcity

This commit is contained in:
Daniel Wathen
2023-01-13 14:25:01 -07:00
parent 8d65b82af6
commit a2512b41e1
7 changed files with 104 additions and 57 deletions

View File

@ -65,6 +65,8 @@ public static class DailyReportHelper
Task<List<RDS>> rds = null; Task<List<RDS>> rds = null;
Task<DateTime> task3 = null; Task<DateTime> task3 = null;
Task<OutsAndScrapTotal> task4 = null; Task<OutsAndScrapTotal> task4 = null;
Task<OutsAndScrapTotal> task5 = null;
Task<OutsAndScrapTotal> task6 = null;
try try
{ {
@ -96,6 +98,8 @@ public static class DailyReportHelper
rds = ApiCaller.GetApi<List<RDS>>(baseUrlScrapeDb + "RDS?date=" + report.StartDate.ToString()); rds = ApiCaller.GetApi<List<RDS>>(baseUrlScrapeDb + "RDS?date=" + report.StartDate.ToString());
task4 = ApiCaller.GetApi<OutsAndScrapTotal>(baseUrlScrapeDb + "GetOutsAndScrapTotals?startDate=" + task3.Result + "&endDate=" + DateTime.Now.ToString()); task4 = ApiCaller.GetApi<OutsAndScrapTotal>(baseUrlScrapeDb + "GetOutsAndScrapTotals?startDate=" + task3.Result + "&endDate=" + DateTime.Now.ToString());
task5 = ApiCaller.GetApi<OutsAndScrapTotal>(baseUrlScrapeDb + "GetOutsAndScrapTotals?startDate=" + task3.Result + "&endDate=" + report.StartDate.ToString());
task6 = ApiCaller.GetApi<OutsAndScrapTotal>(baseUrlScrapeDb + "GetOutsAndScrapTotals?startDate=" + task3.Result + "&endDate=" + report.StartDate.AddDays(-7).ToString());
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -120,7 +124,7 @@ public static class DailyReportHelper
} }
report.ToolEvents = report.ToolEvents report.ToolEvents = report.ToolEvents
.Where(x => x.Reactor is not "100" and not "101" and not "47") .Where(x => x.Reactor is not "47")
.OrderBy(x => x.Reactor) .OrderBy(x => x.Reactor)
.ToList(); .ToList();
@ -133,11 +137,11 @@ public static class DailyReportHelper
report.CleanEvents = report.CleanEvents.Where(x => (x.TOOL_MODE != "PROD" || x.TOOL_MODE_DESC != "Production") && x.TOOL_MODE != "OUT").ToList(); report.CleanEvents = report.CleanEvents.Where(x => (x.TOOL_MODE != "PROD" || x.TOOL_MODE_DESC != "Production") && x.TOOL_MODE != "OUT").ToList();
report.MetrologyEvents = report.MetrologyEvents.Where(x => (x.TOOL_MODE != "PROD" || x.TOOL_MODE_DESC != "Production") && x.TOOL_MODE != "OUT").ToList(); report.MetrologyEvents = report.MetrologyEvents.Where(x => (x.TOOL_MODE != "PROD" || x.TOOL_MODE_DESC != "Production") && x.TOOL_MODE != "OUT").ToList();
report.CurrentWeek.SetYieldInformation(task1.Result, report.QuarterlyTargets);
report.PreviousWeek.SetYieldInformation(task2.Result, report.QuarterlyTargets);
report.QuarterStartDate = task3.Result; report.QuarterStartDate = task3.Result;
report.CurrentWeek.SetYieldInformation(task1.Result, report.QuarterlyTargets, report.QuarterStartDate, task5.Result.Outs - task5.Result.CustomerScrap - task5.Result.ManufacturingScrap - task5.Result.ProductionScrap);
report.PreviousWeek.SetYieldInformation(task2.Result, report.QuarterlyTargets, report.QuarterStartDate, task6.Result.Outs - task6.Result.CustomerScrap - task6.Result.ManufacturingScrap - task6.Result.ProductionScrap);
report.CurrentWeek.QTDOutsAndScrap = task4.Result; report.CurrentWeek.QTDOutsAndScrap = task4.Result;
report.PreviousWeek.QTDOutsAndScrap = task4.Result; report.PreviousWeek.QTDOutsAndScrap = task4.Result;
} }

View File

@ -8,8 +8,10 @@ public class ReactorEvent
public string REACT_NO { get; set; } public string REACT_NO { get; set; }
[JsonPropertyName("EVENT_DTM")] [JsonPropertyName("EVENT_DTM")]
public string EVENT_DTM { get; set; } public string EVENT_DTM { get; set; }
[JsonPropertyName("COMMENT")] [JsonPropertyName("REASON")]
public string COMMENT { get; set; } public string REASON { get; set; }
[JsonPropertyName("REACT_MODE")] [JsonPropertyName("REACT_MODE")]
public string REACT_MODE { get; set; } public string REACT_MODE { get; set; }
[JsonPropertyName("COMMENT")]
public string COMMENT { get; set; }
} }

View File

@ -206,7 +206,8 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
" FROM REACTOR " + " FROM REACTOR " +
" WHERE REACT_ASSIGNMENT IS NOT NULL " + " WHERE REACT_ASSIGNMENT IS NOT NULL " +
" AND REACT_ASSIGNMENT <> 'Out of Service' " + " AND REACT_ASSIGNMENT <> 'Out of Service' " +
" AND REACT_ASSIGNMENT<> ''"; " AND REACT_ASSIGNMENT <> '' " +
" AND CURR_MODE_KEY = ''";
cmd.CommandText = query; cmd.CommandText = query;
@ -311,24 +312,40 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
SqlCommand cmd = _connection.CreateCommand(); SqlCommand cmd = _connection.CreateCommand();
string query = "SELECT " + string query = "SELECT " +
" REACT_NO, " + " revnt.REACT_NO, " +
" EVENT_DTM, " + " EVENT_DTM, " +
" COMMENT, " + " COMMENT AS REASON, " +
" REACT_MODE " + " REACT_MODE, " +
" FROM REACT_EVENT " + " (SELECT TOP 1 NOTES " +
" FROM REACTOR_LOG_NOTES rnote " +
" WHERE rmode.START_RL_ID = rnote.SEQ " +
" ORDER BY MV_NO) AS COMMENT " +
" FROM REACT_EVENT revnt, REACT_MODE rmode " +
" WHERE EVENT_DTM > @startDate " + " WHERE EVENT_DTM > @startDate " +
" AND EVENT_DTM < @endDate " + " AND EVENT_DTM < @endDate " +
" AND REACT_NO = @reactorNumber " + " AND revnt.REACT_NO = @reactorNumber " +
" AND EVENT_DTM = START_DTM " +
" AND revnt.REACT_NO = rmode.REACT_NO " +
" AND LOGGED_BY = START_USER " +
" AND REACT_MODE = MODE " +
"UNION ALL " + "UNION ALL " +
"SELECT " + "SELECT * " +
" REACT_NO, " +
" EVENT_DTM, " +
" COMMENT, " +
" REACT_MODE " +
" FROM " + " FROM " +
" (SELECT TOP 1 * FROM REACT_EVENT " + " (SELECT TOP 1 " +
" revnt.REACT_NO, " +
" EVENT_DTM, COMMENT AS REASON, " +
" REACT_MODE, " +
" (SELECT TOP 1 NOTES " +
" FROM REACTOR_LOG_NOTES rnote " +
" WHERE rmode.START_RL_ID = rnote.SEQ " +
" ORDER BY MV_NO) AS COMMENT " +
" FROM REACT_EVENT revnt, REACT_MODE rmode " +
" WHERE EVENT_DTM < @startDate " + " WHERE EVENT_DTM < @startDate " +
" AND REACT_NO = @reactorNumber ORDER BY EVENT_DTM DESC) AS tbl1 " + " AND revnt.REACT_NO = @reactorNumber " +
" AND EVENT_DTM = START_DTM " +
" AND revnt.REACT_NO = rmode.REACT_NO " +
" AND LOGGED_BY = START_USER " +
" AND REACT_MODE = MODE ORDER BY EVENT_DTM DESC) AS tbl1 " +
"ORDER BY EVENT_DTM ASC "; "ORDER BY EVENT_DTM ASC ";
cmd.CommandText = query; cmd.CommandText = query;
@ -343,8 +360,9 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
{ {
REACT_NO = reader[0].ToString(), REACT_NO = reader[0].ToString(),
EVENT_DTM = reader[1].ToString(), EVENT_DTM = reader[1].ToString(),
COMMENT = reader[2].ToString(), REASON = reader[2].ToString(),
REACT_MODE = reader[3].ToString() REACT_MODE = reader[3].ToString(),
COMMENT = reader[4].ToString()
}); });
} }
@ -426,7 +444,16 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
public OutsAndScrapTotal GetOutsAndScrapTotals(string startDate, string endDate) public OutsAndScrapTotal GetOutsAndScrapTotals(string startDate, string endDate)
{ {
OutsAndScrapTotal totals = new(); OutsAndScrapTotal totals = new()
{
Outs = 0,
CustomerScrap = 0,
ManufacturingScrap = 0,
ProductionScrap = 0
};
if (startDate == endDate)
return totals;
OpenConnection(); OpenConnection();
@ -438,7 +465,7 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
" SUM(TW_PROD) AS PROD " + " SUM(TW_PROD) AS PROD " +
" FROM RDS " + " FROM RDS " +
" WHERE DATE_OUT >= @startDate " + " WHERE DATE_OUT >= @startDate " +
" AND DATE_OUT <= @endDate"; " AND DATE_OUT < @endDate";
cmd.CommandText = query; cmd.CommandText = query;
_ = cmd.Parameters.AddWithValue("@startDate", startDate); _ = cmd.Parameters.AddWithValue("@startDate", startDate);

View File

@ -9,6 +9,7 @@ public class YieldStatistics
public List<ScrapByDay> ScrapByDay { get; set; } public List<ScrapByDay> ScrapByDay { get; set; }
public OutsAndScrapTotal QTDOutsAndScrap { get; set; } public OutsAndScrapTotal QTDOutsAndScrap { get; set; }
public int DailyPlanWafers { get; set; } public int DailyPlanWafers { get; set; }
public int DailyWafersForQTR { get; set; }
public bool IsCurrentWeek { get; set; } public bool IsCurrentWeek { get; set; }
public YieldStatistics(DateTime startDate, bool isCurrentWeek) public YieldStatistics(DateTime startDate, bool isCurrentWeek)
@ -17,11 +18,18 @@ public class YieldStatistics
IsCurrentWeek = isCurrentWeek; IsCurrentWeek = isCurrentWeek;
} }
public void SetYieldInformation(YieldInformation yieldInformation, QuarterlyTargets targets) public void SetYieldInformation(YieldInformation yieldInformation, QuarterlyTargets targets, DateTime qtrStartDate, int yieldedOuts)
{ {
OutsByDay = GetReactorOutsByDay(yieldInformation.Outs); OutsByDay = GetReactorOutsByDay(yieldInformation.Outs);
ScrapByDay = yieldInformation.Scrap; ScrapByDay = yieldInformation.Scrap;
DailyPlanWafers = targets.Yield_Outs / targets.PlanWorkingDays; DailyPlanWafers = targets.Yield_Outs / targets.PlanWorkingDays;
int daysRemainingInQtr = (int)(qtrStartDate.AddDays(targets.PlanWorkingDays) - StartDate).TotalDays;
if (daysRemainingInQtr == targets.PlanWorkingDays)
DailyWafersForQTR = DailyPlanWafers;
else
DailyWafersForQTR = (targets.Yield_Outs - yieldedOuts) / daysRemainingInQtr;
} }
public static List<string> GetDistinctDatesFromReactorOuts(List<ReactorOutsByRDS> outs) public static List<string> GetDistinctDatesFromReactorOuts(List<ReactorOutsByRDS> outs)

View File

@ -100,18 +100,19 @@
<br /><br /> <br /><br />
<h5>Current Reactors Down(@Model.ToolEvents.Where(x => x.IsInProduction == false).Count()):</h5> <h5>Current Reactors Down(@Model.ToolEvents.Where(x => x.IsInProduction == false).Count()):</h5>
<div class="row"> <div class="row">
<div class="col-lg-6"> <div>
@{ @{
List<ToolEventView> asmTools = Model.ToolEvents.Where(x => x.IsInProduction == false && x.Type.Contains("ASM")).ToList(); List<ToolEventView> asmTools = Model.ToolEvents.Where(x => x.IsInProduction == false && x.Type.Contains("ASM")).ToList();
} }
ASM(@asmTools.Count()) ASM(@asmTools.Count())
<table class="table table-sm"> <table class="table table-sm text-center">
<thead> <thead>
<tr> <tr>
<th scope="col">Reactor</th> <th scope="col" style="width: 7%">Reactor</th>
<th scope="col">Owner</th> <th scope="col" style="width: 7%">Owner</th>
<th scope="col">Issue</th> <th scope="col" style="width: 38%" class="text-start">Issue</th>
<th scope="col">Downtime</th> <th scope="col" style="width: 10%">Downtime</th>
<th scope="col" style="width: 38%" class="text-start">Most Recent Comment</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -134,8 +135,9 @@
<tr class="@myClass"> <tr class="@myClass">
<td>@tool.Reactor</td> <td>@tool.Reactor</td>
<td>@owner</td> <td>@owner</td>
<td>@tool.MostRecentEvent.COMMENT</td> <td class="text-start">@tool.MostRecentEvent.REASON</td>
<td>@string.Format("{0:##,###.##}", tool.Downtime)</td> <td>@string.Format("{0:##,###.##}", tool.Downtime)</td>
<td class="text-start">@tool.MostRecentEvent.COMMENT</td>
</tr> </tr>
} }
</tbody> </tbody>
@ -143,18 +145,19 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-lg-6"> <div>
@{ @{
List<ToolEventView> eppTools = Model.ToolEvents.Where(x => x.IsInProduction == false && x.Type.Contains("EPP")).ToList(); List<ToolEventView> eppTools = Model.ToolEvents.Where(x => x.IsInProduction == false && x.Type.Contains("EPP")).ToList();
} }
EPP(@eppTools.Count()) EPP(@eppTools.Count())
<table class="table table-sm"> <table class="table table-sm text-center">
<thead> <thead>
<tr> <tr>
<th scope="col">Reactor</th> <th scope="col" style="width: 7%">Reactor</th>
<th scope="col">Owner</th> <th scope="col" style="width: 7%">Owner</th>
<th scope="col">Issue</th> <th scope="col" style="width: 38%" class="text-start">Issue</th>
<th scope="col">Downtime</th> <th scope="col" style="width: 10%">Downtime</th>
<th scope="col" style="width: 38%" class="text-start">Most Recent Comment</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -177,8 +180,9 @@
<tr class="@myClass"> <tr class="@myClass">
<td>@tool.Reactor</td> <td>@tool.Reactor</td>
<td>@owner</td> <td>@owner</td>
<td>@tool.MostRecentEvent.COMMENT</td> <td class="text-start">@tool.MostRecentEvent.REASON</td>
<td>@string.Format("{0:##,###.##}", tool.Downtime)</td> <td>@string.Format("{0:##,###.##}", tool.Downtime)</td>
<td class="text-start">@tool.MostRecentEvent.COMMENT</td>
</tr> </tr>
} }
</tbody> </tbody>
@ -186,18 +190,19 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-lg-6"> <div>
@{ @{
List<ToolEventView> htrTools = Model.ToolEvents.Where(x => x.IsInProduction == false && x.Type.Contains("HTR")).ToList(); List<ToolEventView> htrTools = Model.ToolEvents.Where(x => x.IsInProduction == false && x.Type.Contains("HTR")).ToList();
} }
HTR(@htrTools.Count()) HTR(@htrTools.Count())
<table class="table table-sm"> <table class="table table-sm text-center">
<thead> <thead>
<tr> <tr>
<th scope="col">Reactor</th> <th scope="col" style="width: 7%">Reactor</th>
<th scope="col">Owner</th> <th scope="col" style="width: 7%">Owner</th>
<th scope="col">Issue</th> <th scope="col" style="width: 38%" class="text-start">Issue</th>
<th scope="col">Downtime</th> <th scope="col" style="width: 10%">Downtime</th>
<th scope="col" style="width: 38%" class="text-start">Most Recent Comment</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -220,8 +225,9 @@
<tr class="@myClass"> <tr class="@myClass">
<td>@tool.Reactor</td> <td>@tool.Reactor</td>
<td>@owner</td> <td>@owner</td>
<td>@tool.MostRecentEvent.COMMENT</td> <td class="text-start">@tool.MostRecentEvent.REASON</td>
<td>@string.Format("{0:##,###.##}", tool.Downtime)</td> <td>@string.Format("{0:##,###.##}", tool.Downtime)</td>
<td class="text-start">@tool.MostRecentEvent.COMMENT</td>
</tr> </tr>
} }
</tbody> </tbody>

View File

@ -204,7 +204,7 @@
{ {
if (i < numberOfDaysInWeek) if (i < numberOfDaysInWeek)
{ {
int dayDelta = Model.OutsByDay[i].TotalWafers - Model.ScrapByDay[i].TOT_REJ_WFRS - 4500; int dayDelta = Model.OutsByDay[i].TotalWafers - Model.ScrapByDay[i].TOT_REJ_WFRS - Model.ScrapByDay[i].TW_PROD - Model.DailyWafersForQTR;
if (dayDelta < 0) if (dayDelta < 0)
myClass = "table-danger text-danger"; myClass = "table-danger text-danger";
@ -230,7 +230,7 @@
{ {
if (i < numberOfDaysInWeek) if (i < numberOfDaysInWeek)
{ {
int dayDelta = Model.OutsByDay[i].TotalWafers - Model.ScrapByDay[i].TOT_REJ_WFRS - 4500; int dayDelta = Model.OutsByDay[i].TotalWafers - Model.ScrapByDay[i].TOT_REJ_WFRS - Model.ScrapByDay[i].TW_PROD - Model.DailyPlanWafers;
if (dayDelta < 0) if (dayDelta < 0)
myClass = "table-danger text-danger"; myClass = "table-danger text-danger";
@ -252,14 +252,14 @@
</tr> </tr>
<tr> <tr>
<td scope="row">Wafers Needed to make QTR</td> <td scope="row">Wafers Needed to make QTR</td>
<td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td> <td class="text-center">@string.Format("{0:#,###}", Model.DailyWafersForQTR)</td>
<td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td> <td class="text-center">@string.Format("{0:#,###}", Model.DailyWafersForQTR)</td>
<td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td> <td class="text-center">@string.Format("{0:#,###}", Model.DailyWafersForQTR)</td>
<td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td> <td class="text-center">@string.Format("{0:#,###}", Model.DailyWafersForQTR)</td>
<td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td> <td class="text-center">@string.Format("{0:#,###}", Model.DailyWafersForQTR)</td>
<td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td> <td class="text-center">@string.Format("{0:#,###}", Model.DailyWafersForQTR)</td>
<td class="text-center">@string.Format("{0:#,###}", Model.DailyPlanWafers)</td> <td class="text-center">@string.Format("{0:#,###}", Model.DailyWafersForQTR)</td>
<td class="text-center">@string.Format("{0:##,###}", Model.DailyPlanWafers * 7)</td> <td class="text-center">@string.Format("{0:##,###}", Model.DailyWafersForQTR * 7)</td>
<td></td> <td></td>
<td>Number updated weekly</td> <td>Number updated weekly</td>
</tr> </tr>

View File

@ -1 +1 @@
[{"Date":"2023-01-09T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-10T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-11T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-12T00:00:00-07:00","ASM":7,"HTR":16}] [{"Date":"2023-01-09T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-10T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-11T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-12T00:00:00-07:00","ASM":7,"HTR":16},{"Date":"2023-01-13T00:00:00-07:00","ASM":7,"HTR":15}]