Compare commits

...

10 Commits

14 changed files with 235 additions and 34 deletions

View File

@ -33,7 +33,7 @@ public class ScrapeDBController : ControllerBase
public int GetNumberOfPartChanges(string startDate, string endDate) => _scrapeDBRepository.GetNumberOfPartChanges(startDate, endDate);
[HttpGet("Targets")]
public QuarterlyTargets GetQuarterlyTargets() => _scrapeDBRepository.GetQuarterlyTargets();
public QuarterlyTargets GetQuarterlyTargets(string startDate) => _scrapeDBRepository.GetQuarterlyTargets(startDate);
[HttpGet("Reactors")]
public List<Reactor> GetReactors() => _scrapeDBRepository.GetReactors();

View File

@ -1,5 +1,5 @@
{
"ConnectionString": "Server=MESSV01EC.EC.LOCAL\\PROD1,53959;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true",
"ConnectionString": "Server=MESSQLEC1.infineon.com\\PROD1,53959;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true",
"IsDevelopment": true,
"MonAResource": "ReportingServicesApiIfx",
"Serilog": {

View File

@ -2,7 +2,7 @@
"AllowedHosts": "*",
"BuildNumber": "1",
"Company": "Infineon Technologies Americas Corp.",
"ConnectionString": "Server=MESSV01EC.EC.LOCAL\\PROD1,53959;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true",
"ConnectionString": "Server=MESSQLEC1.infineon.com\\PROD1,53959;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true",
"GitCommitSeven": "1234567",
"Logging": {
"LogLevel": {

View File

@ -112,13 +112,20 @@ public static class DailyReportHelper
task2 = ApiCaller.GetApi<YieldInformation>(baseUrlScrapeDb + "ReactorOuts?startDate=" + report.StartDate.AddDays(-7).ToString() + "&endDate=" + report.StartDate.ToString());
task3 = ApiCaller.GetApi<DateTime>(baseUrlScrapeDb + "GetQuarterStartDate");
task12 = ApiCaller.GetApi<DateTime>(baseUrlScrapeDb + "GetPreviousQuarterStartDate");
targets = ApiCaller.GetApi<QuarterlyTargets>(baseUrlScrapeDb + "Targets");
previousTargets = ApiCaller.GetApi<QuarterlyTargets>(baseUrlScrapeDb + "Targets");
targets = ApiCaller.GetApi<QuarterlyTargets>(baseUrlScrapeDb + "Targets?startDate=" + report.StartDate.ToString());
previousTargets = ApiCaller.GetApi<QuarterlyTargets>(baseUrlScrapeDb + "Targets?startDate=" + report.StartDate.AddDays(-7).ToString());
rds = ApiCaller.GetApi<List<RDS>>(baseUrlScrapeDb + "RDS?date=" + report.StartDate.ToString());
task4 = ApiCaller.GetApi<OutsAndScrapTotal>(baseUrlScrapeDb + "GetOutsAndScrapTotals?startDate=" + task3.Result + "&endDate=" + currentDateTime.ToString());
task13 = ApiCaller.GetApi<OutsAndScrapTotal>(baseUrlScrapeDb + "GetOutsAndScrapTotals?startDate=" + task12.Result + "&endDate=" + report.StartDate.ToString());
task5 = ApiCaller.GetApi<OutsAndScrapTotal>(baseUrlScrapeDb + "GetOutsAndScrapTotals?startDate=" + task3.Result + "&endDate=" + report.StartDate.ToString());
if (task3.Result > report.StartDate)
{
task5 = ApiCaller.GetApi<OutsAndScrapTotal>(baseUrlScrapeDb + "GetOutsAndScrapTotals?startDate=" + task3.Result + "&endDate=" + currentDateTime.ToString());
}
else
{
task5 = ApiCaller.GetApi<OutsAndScrapTotal>(baseUrlScrapeDb + "GetOutsAndScrapTotals?startDate=" + task3.Result + "&endDate=" + report.StartDate.ToString());
}
string newStartTime = "";
@ -216,7 +223,7 @@ public static class DailyReportHelper
logger.LogCritical(ex, "Failed to retrieve data back from Scrape DB endpoints.");
}
report.ReverseLists();
//report.ReverseLists();
ManualReportEntries entries = report.ManualReportEntries;
List<SLLTool> sll = report.SLLTools;

View File

@ -200,7 +200,7 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
return weeklyPartChanges;
}
public QuarterlyTargets GetQuarterlyTargets()
public QuarterlyTargets GetQuarterlyTargets(string startDate)
{
Dictionary<string, float> targets = new();
@ -212,18 +212,16 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
" WHERE THRU_GROUP = 'TOT' " +
" AND FISCAL_YR = " +
" (SELECT FISCAL_YR FROM FISCAL_QTR " +
" WHERE START_DT < SYSDATETIME() " +
" AND END_DT > SYSDATETIME()) " +
" WHERE '" + startDate + "' BETWEEN START_DT AND END_DT) " +
" AND FISCAL_QTR = " +
" (SELECT FISCAL_QTR FROM FISCAL_QTR " +
" WHERE START_DT < SYSDATETIME() " +
" AND END_DT > SYSDATETIME()) " +
" WHERE '" + startDate + "' BETWEEN START_DT AND END_DT) " +
"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";
" WHERE '" + startDate + "' BETWEEN START_DT AND END_DT";
cmd.CommandText = query;
@ -576,13 +574,49 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
SqlCommand cmd = _connection.CreateCommand();
string query = "SELECT SUM(WFRS_OUT) AS OUTS, " +
" SUM(CUST_TOT_REJ) AS CUST, " +
" SUM(LSL_TOT_REJ) AS MANU, " +
" SUM(CASE WHEN REACTOR_TYPE <> 'EPP' THEN TW_PROD ELSE 0 END) AS PROD " +
" FROM RDS " +
" WHERE DATE_OUT >= @startDate " +
" AND DATE_OUT < @endDate";
//string query = "SELECT SUM(WFRS_OUT) AS OUTS, " +
// " SUM(CUST_TOT_REJ) AS CUST, " +
// " SUM(LSL_TOT_REJ) AS MANU, " +
// " SUM(CASE WHEN REACTOR_TYPE <> 'EPP' THEN TW_PROD ELSE 0 END) AS PROD " +
// " FROM RDS " +
// " WHERE DATE_OUT >= @startDate " +
// " AND DATE_OUT < @endDate";
string query = "SELECT " +
"CASE " +
"WHEN SUM(WFRS_OUT) IS NULL THEN 0 " +
"WHEN SUM(WFRS_OUT) IS NOT NULL THEN SUM(WFRS_OUT) END " +
"AS OUTS, " +
"CASE " +
"WHEN SUM(CUST_TOT_REJ) IS NULL THEN 0 " +
"WHEN SUM(CUST_TOT_REJ) IS NOT NULL THEN SUM(CUST_TOT_REJ) END " +
"AS CUST, " +
"CASE " +
"WHEN SUM(LSL_TOT_REJ) IS NULL THEN 0 " +
"WHEN SUM(LSL_TOT_REJ) IS NOT NULL THEN SUM(LSL_TOT_REJ) END " +
"AS MANU, " +
"CASE WHEN( " +
"CASE " +
"WHEN SUM(CASE WHEN REACTOR_TYPE <> 'EPP' " +
"THEN TW_PROD ELSE 0 END) IS NULL THEN 0 " +
"WHEN " +
"SUM(CASE WHEN REACTOR_TYPE <> 'EPP' " +
"THEN TW_PROD ELSE 0 END) > 0 THEN SUM(CASE WHEN REACTOR_TYPE<> 'EPP' " +
"THEN TW_PROD ELSE 0 END) END " +
") IS NULL THEN 0 ELSE " +
"(" +
"CASE " +
"WHEN SUM(CASE WHEN REACTOR_TYPE<> 'EPP' " +
"THEN TW_PROD ELSE 0 END) IS NULL THEN 0 " +
"WHEN " +
"SUM(CASE WHEN REACTOR_TYPE <> 'EPP' " +
"THEN TW_PROD ELSE 0 END) > 0 THEN SUM(CASE WHEN REACTOR_TYPE<> 'EPP' " +
"THEN TW_PROD ELSE 0 END) END" +
")" +
"END " +
"AS PROD " +
"FROM RDS " +
"WHERE DATE_OUT >= @startDate " +
"AND DATE_OUT< @endDate";
cmd.CommandText = query;
_ = cmd.Parameters.AddWithValue("@startDate", startDate);
@ -617,8 +651,8 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
string query = "SELECT START_DT " +
" FROM FISCAL_QTR " +
" WHERE START_DT < SYSDATETIME() " +
" AND END_DT > SYSDATETIME()";
" WHERE START_DT <= SYSDATETIME() " +
" AND END_DT >= DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE()))";
cmd.CommandText = query;
@ -646,10 +680,10 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
string query = "SELECT START_DT FROM FISCAL_QTR " +
" WHERE FISCAL_QTR = " +
" (SELECT CASE WHEN ls.FISCAL_QTR - 1 = 0 THEN 4 ELSE ls.FISCAL_QTR - 1 END " +
" FROM (SELECT * FROM FISCAL_QTR WHERE START_DT < SYSDATETIME() AND END_DT > SYSDATETIME()) AS ls) " +
" FROM (SELECT * FROM FISCAL_QTR WHERE START_DT <= SYSDATETIME() AND END_DT >= DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE()))) AS ls) " +
" AND FISCAL_YR = " +
" (SELECT CASE WHEN ls.FISCAL_QTR - 1 = 0 THEN ls.FISCAL_YR - 1 ELSE ls.FISCAL_YR END " +
" FROM (SELECT * FROM FISCAL_QTR WHERE START_DT < SYSDATETIME() AND END_DT > SYSDATETIME()) AS ls)";
" FROM (SELECT * FROM FISCAL_QTR WHERE START_DT <= SYSDATETIME() AND END_DT >= DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE()))) AS ls)";
cmd.CommandText = query;

View File

@ -10,7 +10,7 @@ public interface IScrapeDatabaseRepository
public List<ScrapByDay> GetScrapByDay(List<ReactorOutsByRDS> outs);
public List<ReactorPSNWORuns> GetReactorPSNWORuns(string startDate, string endDate);
public int GetNumberOfPartChanges(string startDate, string endDate);
public QuarterlyTargets GetQuarterlyTargets();
public QuarterlyTargets GetQuarterlyTargets(string startDate);
public QuarterlyTargets GetPreviousQuarterlyTargets();
public List<Reactor> GetReactors();
public List<RDS> GetRDSForLastDay(string date);

View File

@ -1,4 +1,6 @@
using ReportingServices.Shared.Models.ProductionReport;
using System.Collections.Generic;
using System.Linq;
namespace ReportingServices.Shared.ViewModels.ProductionReport;
@ -21,7 +23,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 +44,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 = dates.OrderBy(x => DateTime.Parse(x)).ToList();
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 +90,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;
}
}

View File

@ -560,4 +560,48 @@
</tr>
</tbody>
</table>
</div>
</div>
<div class="table-responsive" style="margin-top:40px;" id="eppTempOffsets">
<table class="table">
<thead>
<tr>
<th scope="col">Day Shift</th>
<th scope="col">State</th>
<th scope="col">Loaded RDS</th>
<th scope="col">Average Temperature</th>
<th scope="col">Offset %</th>
<th scope="col">Time Collected</th>
<th scope="col">Hours</th>
<th scope="col">&nbsp;</th>
<th scope="col">Night Shift</th>
<th scope="col">State</th>
<th scope="col">Loaded RDS</th>
<th scope="col">Average Temperature</th>
<th scope="col">Offset %</th>
<th scope="col">Time Collected</th>
<th scope="col">Hours</th>
</tr>
</thead>
<tbody id ="EpiProTempVerification">
<tr>
<td id="loadingRow" colspan="16">Loading EPP Temperature Data...
<div class="spinner-border text-danger" role="status">
<span class="sr-only">Loading...</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<script>
$(document).ready(function () {
loadEPPTempOffsets();
});
</script>

View File

@ -4,7 +4,7 @@
<partial name="_BreadCrumbs" />
<div class="row">
<div class="row gy-4">
<div class="col-3 d-grid">
<a class="btn btn-outline-secondary text-start" asp-controller="ProductionReport" asp-action="DailyReport" onclick="displayBusyIndicator()"><span class="float-start"><i class="fa-regular fa-file-alt fa-4x buttonImage align-middle"></i> Production Passdown Report</span></a>
</div>
@ -15,7 +15,10 @@
<a class="btn btn-outline-secondary text-start" asp-controller="ProductionReport" asp-action="NCRReport" onclick="displayBusyIndicator()"><span class="float-start"><i class="fa-regular fa-file-alt fa-4x buttonImage align-middle"></i> Open NCR Report</span></a>
</div>
<div class="col-3 d-grid">
<a class="btn btn-outline-secondary text-start" href="http://goto.infineon.com/mesassrreport" onclick="displayBusyIndicator()"><span class="float-start"><i class="fa-regular fa-file-alt fa-4x buttonImage align-middle"></i> Mesa SSR Report</span></a>
<a class="btn btn-outline-secondary text-start" href="http://goto.infineon.com/mesassrreport" target="_blank"><span class="float-start"><i class="fa-regular fa-file-alt fa-4x buttonImage align-middle"></i> Mesa SSR Report</span></a>
</div>
<div class="col-3 d-grid">
<a class="btn btn-outline-secondary text-start" href="http://goto.infineon.com/mesamuinvreport" target="_blank"><span class="float-start"><i class="fa-regular fa-file-alt fa-4x buttonImage align-middle"></i> Makeup Inventory Report</span></a>
</div>
</div>

View File

@ -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>

View File

@ -1,6 +1,6 @@
{
"IsDevelopment": true,
"BaseAPIAddress": "https://localhost:7196/api/ScrapeDB/",
"BaseAPIAddress": "http://messa020ec.infineon.com:50201/api/ScrapeDB/",
"MonAResource": "ReportingServicesUiIfx",
"Serilog": {
"Using": [

View File

@ -1,6 +1,6 @@
{
"AllowedHosts": "*",
"BaseAPIAddress": "http://localhost:50201/api/ScrapeDB/",
"BaseAPIAddress": "http://messa020ec.infineon.com:50201/api/ScrapeDB/",
"BuildNumber": "1",
"Company": "Infineon Technologies Americas Corp.",
"DailyReportFilePath": "wwwroot/Assets/DailyReportInfo.json",

View File

@ -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-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-10-27T00:00:00-07:00","ASM":3,"HTR":7},{"Date":"2023-11-10T00:00:00-07:00","ASM":3,"HTR":8}]

View File

@ -152,7 +152,7 @@ function expandYield() {
icons[i].classList.toggle("fa-minus-circle");
}
}
function toggleWeek() {
@ -223,3 +223,25 @@ function compareStrings(isDate, dir, string1, string2) {
return false;
}
function loadEPPTempOffsets() {
const tbody = document.getElementById("EpiProTempVerification");
$.ajax({
type: "GET",
url: 'https://oi-metrology-viewer-prod.mes.infineon.com/api/InfinityQSV3/epi-pro-temp-verification/?night=44&night=46&night=52&night=54',
success: function (r) {
if (r == null) {
r = "<tr><td colspan='16'>Error getting EPP Temp Offset data...</td></tr>"
tbody.innerHTML = r;
}
else {
tbody.innerHTML = r;
}
},
error: function (e, _ajaxOptions, ex) {
r = "<tr><td colspan='16'>Error getting EPP Temp Offset data...</td></tr>"
tbody.innerHTML = r;
}
});
}