Daily Report adds zeros for down days
This commit is contained in:
parent
00042711dd
commit
c50a3e103b
@ -21,7 +21,7 @@ public class YieldStatistics
|
||||
public void SetYieldInformation(YieldInformation yieldInformation, QuarterlyTargets targets, DateTime qtrStartDate, int yieldedOuts)
|
||||
{
|
||||
OutsByDay = GetReactorOutsByDay(yieldInformation.Outs);
|
||||
ScrapByDay = yieldInformation.Scrap;
|
||||
ScrapByDay = GetReactorScrapByDay(yieldInformation.Scrap);
|
||||
DailyPlanWafers = targets.Yield_Outs / targets.PlanWorkingDays;
|
||||
|
||||
int daysRemainingInQtr = (int)(qtrStartDate.AddDays(targets.PlanWorkingDays) - StartDate).TotalDays;
|
||||
@ -42,6 +42,28 @@ public class YieldStatistics
|
||||
dates.Add(DateTime.Parse(rout.EndProcessTime).Date.ToString());
|
||||
}
|
||||
|
||||
List<DateTime> dateTimes = new List<DateTime>();
|
||||
foreach (string date in dates)
|
||||
{
|
||||
dateTimes.Add(DateTime.Parse(date));
|
||||
}
|
||||
|
||||
dateTimes.Sort();
|
||||
dates.Sort();
|
||||
|
||||
DateTime currentDateTime = dateTimes.ElementAt(0);
|
||||
for (int i = 1; i < dateTimes.Count; i++)
|
||||
{
|
||||
DateTime nextDateTime = dateTimes[i];
|
||||
int dayDiff = (nextDateTime - currentDateTime).Days;
|
||||
if (dayDiff > 1)
|
||||
{
|
||||
dateTimes.Insert(i, currentDateTime.AddDays(1));
|
||||
dates.Insert(i, dateTimes.ElementAt(i).ToString("MM/dd/yyyy hh:mm:ss tt"));
|
||||
}
|
||||
currentDateTime = dateTimes[i];
|
||||
}
|
||||
|
||||
return dates;
|
||||
}
|
||||
|
||||
@ -66,4 +88,66 @@ public class YieldStatistics
|
||||
|
||||
return outsByDay;
|
||||
}
|
||||
|
||||
public static List<string> GetDistinctDatesFromReactorScrap(List<ScrapByDay> scraps)
|
||||
{
|
||||
List<string> dates = new();
|
||||
|
||||
foreach (ScrapByDay scrap in scraps)
|
||||
{
|
||||
if (!dates.Contains(DateTime.Parse(scrap.StartDate).Date.ToString()))
|
||||
dates.Add(DateTime.Parse(scrap.StartDate).Date.ToString());
|
||||
}
|
||||
|
||||
List<DateTime> dateTimes = new List<DateTime>();
|
||||
foreach (string date in dates)
|
||||
{
|
||||
dateTimes.Add(DateTime.Parse(date));
|
||||
}
|
||||
|
||||
dateTimes.Sort();
|
||||
dates.Sort();
|
||||
|
||||
DateTime currentDateTime = dateTimes.ElementAt(0);
|
||||
for (int i = 1; i < dateTimes.Count; i++)
|
||||
{
|
||||
DateTime nextDateTime = dateTimes[i];
|
||||
int dayDiff = (nextDateTime - currentDateTime).Days;
|
||||
if (dayDiff > 1)
|
||||
{
|
||||
dateTimes.Insert(i, currentDateTime.AddDays(1));
|
||||
dates.Insert(i, dateTimes.ElementAt(i).ToString("MM/dd/yyyy hh:mm:ss tt"));
|
||||
}
|
||||
currentDateTime = dateTimes[i];
|
||||
}
|
||||
|
||||
return dates;
|
||||
}
|
||||
|
||||
public static List<ScrapByDay> GetReactorScrapByDay(List<ScrapByDay> scrap)
|
||||
{
|
||||
List<ScrapByDay> sortedScrap = scrap.OrderBy(s => s.StartDate).ToList();
|
||||
|
||||
List<ScrapByDay> scrapByDay = new();
|
||||
|
||||
List<string> dates = GetDistinctDatesFromReactorScrap(scrap);
|
||||
|
||||
int scrapIdx = 0;
|
||||
for (int i = 0; i < dates.Count; i++)
|
||||
{
|
||||
ScrapByDay currentScrap = sortedScrap.ElementAtOrDefault(scrapIdx);
|
||||
string currentDate = dates[i];
|
||||
if (currentScrap != null && currentScrap.StartDate == currentDate)
|
||||
{
|
||||
scrapByDay.Add(currentScrap);
|
||||
scrapIdx++;
|
||||
}
|
||||
else
|
||||
{
|
||||
scrapByDay.Add(new ScrapByDay() { StartDate = dates[i] });
|
||||
}
|
||||
}
|
||||
|
||||
return scrapByDay;
|
||||
}
|
||||
}
|
@ -183,7 +183,12 @@
|
||||
{
|
||||
if (i < numberOfDaysInWeek)
|
||||
{
|
||||
float yield = ((float)Model.OutsByDay[i].TotalWafers - (float)Model.ScrapByDay[i].TOT_REJ_MANU) / (float)Model.OutsByDay[i].TotalWafers;
|
||||
int yieldLessScrap = Model.OutsByDay[i].TotalWafers - Model.ScrapByDay[i].TOT_REJ_MANU;
|
||||
float yield = 0;
|
||||
if (yieldLessScrap != 0)
|
||||
{
|
||||
yield = ((float)Model.OutsByDay[i].TotalWafers - (float)Model.ScrapByDay[i].TOT_REJ_MANU) / (float)Model.OutsByDay[i].TotalWafers;
|
||||
}
|
||||
|
||||
<td class="text-center">@(string.Format("{0:P2}", yield))</td>
|
||||
|
||||
|
@ -1 +1 @@
|
||||
[{"Date":"2023-01-23T00:00:00-07:00","ASM":7,"HTR":16},{"Date":"2023-01-24T00:00:00-07:00","ASM":7,"HTR":15},{"Date":"2023-01-26T00:00:00-07:00","ASM":7,"HTR":14},{"Date":"2023-02-20T00:00:00-07:00","ASM":3,"HTR":8},{"Date":"2023-03-01T00:00:00-07:00","ASM":3,"HTR":8},{"Date":"2023-03-03T00:00:00-07:00","ASM":3,"HTR":8},{"Date":"2023-04-03T00:00:00-07:00","ASM":2,"HTR":6},{"Date":"2023-05-25T00:00:00-07:00","ASM":2,"HTR":8},{"Date":"2023-06-12T00:00:00-07:00","ASM":2,"HTR":7},{"Date":"2023-07-05T00:00:00-07:00","ASM":0,"HTR":8},{"Date":"2023-10-12T00:00:00-07:00","ASM":2,"HTR":7},{"Date":"2023-10-13T00:00:00-07:00","ASM":4,"HTR":8}]
|
||||
[{"Date":"2023-01-22T23:00:00-08:00","ASM":7,"HTR":16},{"Date":"2023-01-23T23:00:00-08:00","ASM":7,"HTR":15},{"Date":"2023-01-25T23:00:00-08:00","ASM":7,"HTR":14},{"Date":"2023-02-19T23:00:00-08:00","ASM":3,"HTR":8},{"Date":"2023-02-28T23:00:00-08:00","ASM":3,"HTR":8},{"Date":"2023-03-02T23:00:00-08:00","ASM":3,"HTR":8},{"Date":"2023-04-03T00:00:00-07:00","ASM":2,"HTR":6},{"Date":"2023-05-25T00:00:00-07:00","ASM":2,"HTR":8},{"Date":"2023-06-12T00:00:00-07:00","ASM":2,"HTR":7},{"Date":"2023-07-05T00:00:00-07:00","ASM":0,"HTR":8},{"Date":"2023-10-12T00:00:00-07:00","ASM":2,"HTR":7},{"Date":"2023-10-13T00:00:00-07:00","ASM":4,"HTR":8},{"Date":"2023-10-27T00:00:00-07:00","ASM":3,"HTR":7}]
|
Loading…
x
Reference in New Issue
Block a user