From a963525b4317654f4f77f75e60e213d76404c51d Mon Sep 17 00:00:00 2001 From: Daniel Wathen Date: Wed, 18 Jan 2023 16:03:42 -0700 Subject: [PATCH] Added Hot Work Order information into downed tool table and as a line item in the daily report. --- .../Controllers/ScrapeDBController.cs | 3 + .../DailyReport.Designer.cs | 137 ------- ReportingServices.Desktop/DailyReport.cs | 344 ------------------ ReportingServices.Desktop/DailyReport.resx | 60 --- ReportingServices.Desktop/Form1.Designer.cs | 60 --- ReportingServices.Desktop/Form1.cs | 31 -- ReportingServices.Desktop/Form1.resx | 60 --- ReportingServices.Desktop/Program.cs | 32 -- .../ReportingServices.Desktop.csproj | 15 - .../HelperClasses/DailyReportHelper.cs | 5 +- .../ScrapeDatabaseRepository.cs | 31 ++ .../Interfaces/IScrapeDatabaseRepository.cs | 1 + .../ProductionReport/DailyReport.cs | 1 + .../Views/ProductionReport/DailyReport.cshtml | 26 +- 14 files changed, 63 insertions(+), 743 deletions(-) delete mode 100644 ReportingServices.Desktop/DailyReport.Designer.cs delete mode 100644 ReportingServices.Desktop/DailyReport.cs delete mode 100644 ReportingServices.Desktop/DailyReport.resx delete mode 100644 ReportingServices.Desktop/Form1.Designer.cs delete mode 100644 ReportingServices.Desktop/Form1.cs delete mode 100644 ReportingServices.Desktop/Form1.resx delete mode 100644 ReportingServices.Desktop/Program.cs delete mode 100644 ReportingServices.Desktop/ReportingServices.Desktop.csproj diff --git a/ReportingServices.API/Controllers/ScrapeDBController.cs b/ReportingServices.API/Controllers/ScrapeDBController.cs index c9ba479..1f92ba9 100644 --- a/ReportingServices.API/Controllers/ScrapeDBController.cs +++ b/ReportingServices.API/Controllers/ScrapeDBController.cs @@ -58,4 +58,7 @@ public class ScrapeDBController : ControllerBase [HttpGet("GetCurrentHoldLots")] public List GetCurrentHoldLots() => _scrapeDBRepository.GetCurrentHoldLots(); + + [HttpGet("GetCurrentHotWORunning")] + public List GetCurrentHotWORunning() => _scrapeDBRepository.GetCurrentHotWORunning(); } \ No newline at end of file diff --git a/ReportingServices.Desktop/DailyReport.Designer.cs b/ReportingServices.Desktop/DailyReport.Designer.cs deleted file mode 100644 index 6ff5541..0000000 --- a/ReportingServices.Desktop/DailyReport.Designer.cs +++ /dev/null @@ -1,137 +0,0 @@ -namespace ReportingServices.Desktop -{ - partial class DailyReport - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.label1 = new System.Windows.Forms.Label(); - this.btnPrevious = new System.Windows.Forms.Button(); - this.btnNext = new System.Windows.Forms.Button(); - this.dgvCurrentWeek = new System.Windows.Forms.DataGridView(); - this.rtbManualEntries = new System.Windows.Forms.RichTextBox(); - this.dgvPreviousWeek = new System.Windows.Forms.DataGridView(); - ((System.ComponentModel.ISupportInitialize)(this.dgvCurrentWeek)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.dgvPreviousWeek)).BeginInit(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Segoe UI", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.label1.Location = new System.Drawing.Point(786, 5); - this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(271, 37); - this.label1.TabIndex = 0; - this.label1.Text = "Production Passdown"; - // - // btnPrevious - // - this.btnPrevious.Location = new System.Drawing.Point(64, 37); - this.btnPrevious.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.btnPrevious.Name = "btnPrevious"; - this.btnPrevious.Size = new System.Drawing.Size(179, 56); - this.btnPrevious.TabIndex = 1; - this.btnPrevious.Text = "Previous Button"; - this.btnPrevious.UseVisualStyleBackColor = true; - this.btnPrevious.Click += new System.EventHandler(this.btnPrevious_Click); - // - // btnNext - // - this.btnNext.Location = new System.Drawing.Point(1651, 37); - this.btnNext.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.btnNext.Name = "btnNext"; - this.btnNext.Size = new System.Drawing.Size(179, 56); - this.btnNext.TabIndex = 2; - this.btnNext.Text = "Next Button"; - this.btnNext.UseVisualStyleBackColor = true; - this.btnNext.Visible = false; - this.btnNext.Click += new System.EventHandler(this.btnNext_Click); - // - // dgvCurrentWeek - // - this.dgvCurrentWeek.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dgvCurrentWeek.Location = new System.Drawing.Point(64, 119); - this.dgvCurrentWeek.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.dgvCurrentWeek.Name = "dgvCurrentWeek"; - this.dgvCurrentWeek.RowHeadersWidth = 62; - this.dgvCurrentWeek.RowTemplate.Height = 33; - this.dgvCurrentWeek.Size = new System.Drawing.Size(1765, 378); - this.dgvCurrentWeek.TabIndex = 3; - // - // rtbManualEntries - // - this.rtbManualEntries.Location = new System.Drawing.Point(64, 527); - this.rtbManualEntries.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.rtbManualEntries.Name = "rtbManualEntries"; - this.rtbManualEntries.Size = new System.Drawing.Size(576, 395); - this.rtbManualEntries.TabIndex = 4; - this.rtbManualEntries.Text = ""; - // - // dgvPreviousWeek - // - this.dgvPreviousWeek.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dgvPreviousWeek.Location = new System.Drawing.Point(64, 119); - this.dgvPreviousWeek.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.dgvPreviousWeek.Name = "dgvPreviousWeek"; - this.dgvPreviousWeek.RowHeadersWidth = 62; - this.dgvPreviousWeek.RowTemplate.Height = 33; - this.dgvPreviousWeek.Size = new System.Drawing.Size(1765, 378); - this.dgvPreviousWeek.TabIndex = 5; - this.dgvPreviousWeek.Visible = false; - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1925, 853); - this.Controls.Add(this.dgvPreviousWeek); - this.Controls.Add(this.rtbManualEntries); - this.Controls.Add(this.dgvCurrentWeek); - this.Controls.Add(this.btnNext); - this.Controls.Add(this.btnPrevious); - this.Controls.Add(this.label1); - this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.Name = "Form1"; - this.Text = "Form1"; - ((System.ComponentModel.ISupportInitialize)(this.dgvCurrentWeek)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.dgvPreviousWeek)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private Label label1; - private Button btnPrevious; - private Button btnNext; - private DataGridView dgvCurrentWeek; - private RichTextBox rtbManualEntries; - private DataGridView dgvPreviousWeek; - } -} \ No newline at end of file diff --git a/ReportingServices.Desktop/DailyReport.cs b/ReportingServices.Desktop/DailyReport.cs deleted file mode 100644 index cdf16ff..0000000 --- a/ReportingServices.Desktop/DailyReport.cs +++ /dev/null @@ -1,344 +0,0 @@ -using Microsoft.Extensions.Logging; -using ReportingServices.Shared.HelperClasses; -using ReportingServices.Shared.ViewModels.ProductionReport; -using System.Data; -using System.Reflection; - -namespace ReportingServices.Desktop -{ - public partial class DailyReport : Form - { - - private DataTable currentWeek = new(); - private DataTable previousWeek = new(); - - private readonly ILogger _logger; - private readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json"; - private readonly string _toolStateOwnerFilePath = "wwwroot/Assets/ToolStates.json"; - private readonly string _baseFTUrl; - private readonly string _baseDBUrl; - - public DailyReport(ILogger logger) - { - _logger = logger; - _baseFTUrl = "http://mestsa008:50201/api/"; - _baseDBUrl = "https://localhost:7196/api/"; - - _logger.LogInformation("Base FabTime Address: {baseUrl}", _baseFTUrl); - _logger.LogInformation("Base Database Address: {baseUrl}", _baseDBUrl); - - InitializeComponent(); - - string baseFabTimeUrl = _baseFTUrl + "FabTime/"; - string baseScrapeDbUrl = _baseDBUrl + "ScrapeDB/"; - - try - { - Shared.ViewModels.ProductionReport.DailyReport dailyReport = DailyReportHelper.SetUpDailyReport(_logger, baseFabTimeUrl, baseScrapeDbUrl); - Dictionary> toolStateOwners = JsonFileHandler.LoadJSONFile>>(_toolStateOwnerFilePath); - - dailyReport.ToolStatesByOwner = toolStateOwners; - - SetupWeekView(dailyReport.CurrentWeek, currentWeek); - SetupWeekView(dailyReport.PreviousWeek, previousWeek); - - dgvCurrentWeek.DataSource = currentWeek; - dgvPreviousWeek.DataSource = previousWeek; - } - catch (Exception ex) - { - _logger.LogCritical(ex, "Failed to load report"); - } - } - - public void SetupWeekView(YieldStatistics rpt, DataTable dt) - { - dt.Columns.Add("SIOperations"); - dt.Columns.Add("Monday"); - dt.Columns.Add("Tuesday"); - dt.Columns.Add("Wednesday"); - dt.Columns.Add("Thursday"); - dt.Columns.Add("Friday"); - dt.Columns.Add("Saturday"); - dt.Columns.Add("Sunday"); - dt.Columns.Add("Weekly Total"); - dt.Columns.Add("Comment"); - - AddDates(rpt, dt); - AddTargets(rpt, dt); - AddOuts(rpt, dt); - AddYieldedWafers(rpt, dt); - AddCustomerScrap(rpt, dt); - AddManufacturingScrap(rpt, dt); - AddProductionScrap(rpt, dt); - AddYield(rpt, dt); - AddDeltaToCommit(rpt, dt); - AddDeltaToTarget(rpt, dt); - AddNeededTarget(rpt, dt); - } - - public void AddDates(YieldStatistics rpt, DataTable dt) - { - DataRow dr = dt.NewRow(); - - for (int i = 0; i < 7; i++) - { - dr[1 + i] = rpt.StartDate.AddDays(i).ToString("MM/dd/yyyy"); - } - - dt.Rows.Add(dr); - } - - public void AddTargets(YieldStatistics rpt, DataTable dt) - { - DataRow dr = dt.NewRow(); - - dr["SIOperations"] = "Commited Target to meet Shipment Requirements"; - - for (int i = 0; i < 7; i++) - { - dr[1 + i] = string.Format("{0:#,###}", rpt.DailyPlanWafers); - } - - dr["WeeklyTotal"] = string.Format("{0:##,###}", rpt.DailyPlanWafers * 7); - dr["Comment"] = "Number updated quarterly"; - - dt.Rows.Add(dr); - } - - public void AddOuts(YieldStatistics rpt, DataTable dt) - { - int counter = 0; - - DataRow dr = dt.NewRow(); - - dr["SIOperations"] = "Actual Reactor Out"; - - for (int i = 0; i < 7; i++) - { - if (i < rpt.OutsByDay.Count) - { - dr[1 + i] = string.Format("{0:#,###}", rpt.OutsByDay[i].TotalWafers); - - counter += rpt.OutsByDay[i].TotalWafers; - } - } - - dr["WeeklyTotal"] = string.Format("{0:##,###}", counter); - dr["Comment"] = "Before Scrap"; - - dt.Rows.Add(dr); - } - - public void AddYieldedWafers(YieldStatistics rpt, DataTable dt) - { - int counter = 0; - - DataRow dr = dt.NewRow(); - - dr["SIOperations"] = "Actual Yielded Wafers Out"; - - for (int i = 0; i < 7; i++) - { - if (i < rpt.OutsByDay.Count) - { - dr[1 + i] = string.Format("{0:#,###}", rpt.OutsByDay[i].TotalWafers - rpt.ScrapByDay[i].TOT_REJ_WFRS - rpt.ScrapByDay[i].TW_PROD); - - counter += rpt.OutsByDay[i].TotalWafers - rpt.ScrapByDay[i].TOT_REJ_WFRS - rpt.ScrapByDay[i].TW_PROD; - } - } - - dr["WeeklyTotal"] = string.Format("{0:##,###}", counter); - dr["Comment"] = "After Scrap"; - - dt.Rows.Add(dr); - } - - public void AddCustomerScrap(YieldStatistics rpt, DataTable dt) - { - int counter = 0; - - DataRow dr = dt.NewRow(); - - dr["SIOperations"] = "Customer Scrap"; - - for (int i = 0; i < 7; i++) - { - if (i < rpt.OutsByDay.Count) - { - dr[1 + i] = string.Format("{0:#,###}", rpt.ScrapByDay[i].TOT_REJ_CUST); - - counter += rpt.ScrapByDay[i].TOT_REJ_CUST; - } - } - - dr["WeeklyTotal"] = string.Format("{0:##,###}", counter); - - dt.Rows.Add(dr); - } - - public void AddManufacturingScrap(YieldStatistics rpt, DataTable dt) - { - int counter = 0; - - DataRow dr = dt.NewRow(); - - dr["SIOperations"] = "Manufacturing Scrap"; - - for (int i = 0; i < 7; i++) - { - if (i < rpt.OutsByDay.Count) - { - dr[1 + i] = string.Format("{0:#,###}", rpt.ScrapByDay[i].TOT_REJ_MANU); - - counter += rpt.ScrapByDay[i].TOT_REJ_MANU; - } - } - - dr["WeeklyTotal"] = string.Format("{0:##,###}", counter); - - dt.Rows.Add(dr); - } - - public void AddProductionScrap(YieldStatistics rpt, DataTable dt) - { - int counter = 0; - - DataRow dr = dt.NewRow(); - - dr["SIOperations"] = "Production Scrap"; - - for (int i = 0; i < 7; i++) - { - if (i < rpt.OutsByDay.Count) - { - dr[1 + i] = string.Format("{0:#,###}", rpt.ScrapByDay[i].TW_PROD); - - counter += rpt.ScrapByDay[i].TW_PROD; - } - } - - dr["WeeklyTotal"] = string.Format("{0:##,###}", counter); - - dt.Rows.Add(dr); - } - - public void AddYield(YieldStatistics rpt, DataTable dt) - { - int totalOuts = 0; - int totalScrap = 0; - - DataRow dr = dt.NewRow(); - - dr["SIOperations"] = "Yield"; - - for (int i = 0; i < 7; i++) - { - if (i < rpt.OutsByDay.Count) - { - float yield = ((float)rpt.OutsByDay[i].TotalWafers - (float)rpt.ScrapByDay[i].TOT_REJ_WFRS) / (float)rpt.OutsByDay[i].TotalWafers; - - dr[1 + i] = string.Format("{0:P2}", rpt.ScrapByDay[i].TW_PROD); - - totalOuts += rpt.OutsByDay[i].TotalWafers; - totalScrap += rpt.ScrapByDay[i].TOT_REJ_CUST + rpt.ScrapByDay[i].TOT_REJ_MANU; - } - } - - dr["WeeklyTotal"] = string.Format("{0:P2}", (float)(totalOuts - totalScrap) / (float)totalOuts); - dr["Comment"] = "After Scrap"; - - dt.Rows.Add(dr); - } - - public void AddDeltaToCommit(YieldStatistics rpt, DataTable dt) - { - int counter = 0; - - DataRow dr = dt.NewRow(); - - dr["SIOperations"] = "Delta to commit"; - - for (int i = 0; i < 7; i++) - { - if (i < rpt.OutsByDay.Count) - { - int delta = rpt.OutsByDay[i].TotalWafers - rpt.ScrapByDay[i].TOT_REJ_WFRS - rpt.DailyPlanWafers; - - dr[1 + i] = string.Format("{0:#,###}", delta); - - counter += delta; - } - } - - dr["WeeklyTotal"] = string.Format("{0:##,###}", counter); - dr["Comment"] = "Difference to commitment"; - - dt.Rows.Add(dr); - } - - public void AddDeltaToTarget(YieldStatistics rpt, DataTable dt) - { - int counter = 0; - - DataRow dr = dt.NewRow(); - - dr["SIOperations"] = "Delta to the Plan"; - - for (int i = 0; i < 7; i++) - { - if (i < rpt.OutsByDay.Count) - { - int delta = rpt.OutsByDay[i].TotalWafers - rpt.ScrapByDay[i].TOT_REJ_WFRS - rpt.DailyPlanWafers; - - dr[1 + i] = string.Format("{0:#,###}", delta); - - counter += delta; - } - } - - dr["WeeklyTotal"] = string.Format("{0:##,###}", counter); - dr["Comment"] = "Difference to Target"; - - dt.Rows.Add(dr); - } - - public void AddNeededTarget(YieldStatistics rpt, DataTable dt) - { - DataRow dr = dt.NewRow(); - - dr["SIOperations"] = "Wafers Needed to make QTR"; - - for (int i = 0; i < 7; i++) - { - if (i < rpt.OutsByDay.Count) - { - dr[1 + i] = string.Format("{0:#,###}", rpt.DailyPlanWafers); - } - } - - dr["WeeklyTotal"] = string.Format("{0:##,###}", rpt.DailyPlanWafers * 7); - dr["Comment"] = "Number updated Weekly"; - - dt.Rows.Add(dr); - } - - private void btnPrevious_Click(object sender, EventArgs e) - { - btnNext.Visible = true; - btnPrevious.Visible = false; - - dgvCurrentWeek.Visible = false; - dgvPreviousWeek.Visible = true; - } - - private void btnNext_Click(object sender, EventArgs e) - { - btnNext.Visible = false; - btnPrevious.Visible = true; - - dgvCurrentWeek.Visible = true; - dgvPreviousWeek.Visible = false; - } - } -} \ No newline at end of file diff --git a/ReportingServices.Desktop/DailyReport.resx b/ReportingServices.Desktop/DailyReport.resx deleted file mode 100644 index f298a7b..0000000 --- a/ReportingServices.Desktop/DailyReport.resx +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/ReportingServices.Desktop/Form1.Designer.cs b/ReportingServices.Desktop/Form1.Designer.cs deleted file mode 100644 index 9a5f116..0000000 --- a/ReportingServices.Desktop/Form1.Designer.cs +++ /dev/null @@ -1,60 +0,0 @@ -namespace ReportingServices.Desktop -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.btnDailyReport = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // btnDailyReport - // - this.btnDailyReport.Location = new System.Drawing.Point(98, 12); - this.btnDailyReport.Name = "btnDailyReport"; - this.btnDailyReport.Size = new System.Drawing.Size(140, 65); - this.btnDailyReport.TabIndex = 0; - this.btnDailyReport.Text = "Daily Report"; - this.btnDailyReport.UseVisualStyleBackColor = true; - this.btnDailyReport.Click += new System.EventHandler(this.btnDailyReport_Click); - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Controls.Add(this.btnDailyReport); - this.Name = "Form1"; - this.Text = "Form1"; - this.ResumeLayout(false); - - } - - #endregion - - private Button btnDailyReport; - } -} \ No newline at end of file diff --git a/ReportingServices.Desktop/Form1.cs b/ReportingServices.Desktop/Form1.cs deleted file mode 100644 index 94a12a2..0000000 --- a/ReportingServices.Desktop/Form1.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace ReportingServices.Desktop -{ - public partial class Form1 : Form - { - ILogger _logger; - - public Form1(ILogger logger) - { - _logger = logger; - InitializeComponent(); - } - - private void btnDailyReport_Click(object sender, EventArgs e) - { - DailyReport report = new DailyReport(_logger); - this.Hide(); - report.Show(); - } - } -} diff --git a/ReportingServices.Desktop/Form1.resx b/ReportingServices.Desktop/Form1.resx deleted file mode 100644 index f298a7b..0000000 --- a/ReportingServices.Desktop/Form1.resx +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/ReportingServices.Desktop/Program.cs b/ReportingServices.Desktop/Program.cs deleted file mode 100644 index 91a5ca8..0000000 --- a/ReportingServices.Desktop/Program.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace ReportingServices.Desktop -{ - internal static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.SetHighDpiMode(HighDpiMode.SystemAware); - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - var services = new ServiceCollection(); - ConfigureServices(services); - using (ServiceProvider serviceProvider = services.BuildServiceProvider()) - { - var form1 = serviceProvider.GetRequiredService(); - Application.Run(form1); - } - } - - private static void ConfigureServices(ServiceCollection services) - { - services.AddSingleton() - .AddLogging(configure => configure.AddConsole()); - } - } -} \ No newline at end of file diff --git a/ReportingServices.Desktop/ReportingServices.Desktop.csproj b/ReportingServices.Desktop/ReportingServices.Desktop.csproj deleted file mode 100644 index ec5cd8b..0000000 --- a/ReportingServices.Desktop/ReportingServices.Desktop.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - WinExe - net6.0-windows - enable - true - enable - - - - - - - \ No newline at end of file diff --git a/ReportingServices.Shared/HelperClasses/DailyReportHelper.cs b/ReportingServices.Shared/HelperClasses/DailyReportHelper.cs index d60474b..ccf7225 100644 --- a/ReportingServices.Shared/HelperClasses/DailyReportHelper.cs +++ b/ReportingServices.Shared/HelperClasses/DailyReportHelper.cs @@ -75,6 +75,7 @@ public static class DailyReportHelper Task task4 = null; Task task5 = null; Task task6 = null; + Task> task7 = null; try { @@ -108,6 +109,7 @@ public static class DailyReportHelper task4 = ApiCaller.GetApi(baseUrlScrapeDb + "GetOutsAndScrapTotals?startDate=" + task3.Result + "&endDate=" + currentDateTime.ToString()); task5 = ApiCaller.GetApi(baseUrlScrapeDb + "GetOutsAndScrapTotals?startDate=" + task3.Result + "&endDate=" + report.StartDate.ToString()); task6 = ApiCaller.GetApi(baseUrlScrapeDb + "GetOutsAndScrapTotals?startDate=" + task3.Result + "&endDate=" + report.StartDate.AddDays(-7).ToString()); + task7 = ApiCaller.GetApi>(baseUrlScrapeDb + "GetCurrentHotWORunning"); } catch (Exception ex) { @@ -133,7 +135,6 @@ public static class DailyReportHelper report.SetReactorInfo(reactors, GetUnscheduledReactors(report)); report.ToolEvents = report.ToolEvents - .Where(x => x.Reactor is not "47") .OrderBy(x => x.Reactor) .ToList(); @@ -153,6 +154,8 @@ public static class DailyReportHelper report.CurrentWeek.QTDOutsAndScrap = task4.Result; report.PreviousWeek.QTDOutsAndScrap = task4.Result; + + report.CurrentHotWORunning = task7.Result; } catch (Exception ex) { diff --git a/ReportingServices.Shared/Repositories/Implementations/ScrapeDatabaseRepository.cs b/ReportingServices.Shared/Repositories/Implementations/ScrapeDatabaseRepository.cs index c24f5d1..b6fb68c 100644 --- a/ReportingServices.Shared/Repositories/Implementations/ScrapeDatabaseRepository.cs +++ b/ReportingServices.Shared/Repositories/Implementations/ScrapeDatabaseRepository.cs @@ -578,4 +578,35 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository return lots; } + + public List GetCurrentHotWORunning() + { + List lots = new(); + + OpenConnection(); + + SqlCommand cmd = _connection.CreateCommand(); + + string query = "SELECT REACT_NO " + + " FROM SCHED_DET_NG schd " + + "INNER JOIN WO_LOG wlog ON WO = WO_NO " + + " WHERE STOP_DTM > SYSDATETIME() " + + " AND START_DTM < SYSDATETIME() " + + " AND HOT_FLAG = 1 " + + "ORDER BY REACT_NO"; + + cmd.CommandText = query; + + using (SqlDataReader reader = cmd.ExecuteReader()) + { + while (reader.Read()) + lots.Add("R" + reader[0].ToString()); + } + + cmd.Dispose(); + + CloseConnection(); + + return lots; + } } \ No newline at end of file diff --git a/ReportingServices.Shared/Repositories/Interfaces/IScrapeDatabaseRepository.cs b/ReportingServices.Shared/Repositories/Interfaces/IScrapeDatabaseRepository.cs index 74b1df3..43e9003 100644 --- a/ReportingServices.Shared/Repositories/Interfaces/IScrapeDatabaseRepository.cs +++ b/ReportingServices.Shared/Repositories/Interfaces/IScrapeDatabaseRepository.cs @@ -20,4 +20,5 @@ public interface IScrapeDatabaseRepository public OutsAndScrapTotal GetOutsAndScrapTotals(string startDate, string endDate); public DateTime GetQuarterStartDate(); public List GetCurrentHoldLots(); + public List GetCurrentHotWORunning(); } \ No newline at end of file diff --git a/ReportingServices.Shared/ViewModels/ProductionReport/DailyReport.cs b/ReportingServices.Shared/ViewModels/ProductionReport/DailyReport.cs index 46f268f..32b1a4c 100644 --- a/ReportingServices.Shared/ViewModels/ProductionReport/DailyReport.cs +++ b/ReportingServices.Shared/ViewModels/ProductionReport/DailyReport.cs @@ -17,6 +17,7 @@ public class DailyReport public ManualReportEntries ManualReportEntries { get; set; } public List UnloadTempsByDay { get; set; } public List SLLTools { get; set; } + public List CurrentHotWORunning { get; set; } public int NumberOfToolsWaferSize6IN { get; set; } public int NumberOfToolsWaferSize8IN { get; set; } public int NumberOfToolsWaferSize6INScheduled { get; set; } diff --git a/ReportingServices.UI/Views/ProductionReport/DailyReport.cshtml b/ReportingServices.UI/Views/ProductionReport/DailyReport.cshtml index 4c03399..25e4510 100644 --- a/ReportingServices.UI/Views/ProductionReport/DailyReport.cshtml +++ b/ReportingServices.UI/Views/ProductionReport/DailyReport.cshtml @@ -94,6 +94,7 @@
  • Bottle Change (@bottleChanges): @bottle
  • Daily Part Changes (@dailyPartChanges): @daily
  • Weekly Part Changes (@weeklyPartChanges): @weekly
  • +
  • Red Hot Work Orders (@Model.CurrentHotWORunning.Count()): @string.Join(", ", Model.CurrentHotWORunning)

  • Edit @@ -120,6 +121,7 @@ @foreach (ToolEventView tool in asmTools) { string owner = ""; + string hot = ""; if (Model.ToolStatesByOwner["Maintenance"].Contains(tool.MostRecentEvent.REACT_MODE)) owner = "Maint"; @@ -134,7 +136,13 @@ myClass = ""; - @tool.Reactor + + @if (Model.CurrentHotWORunning.Contains("R" + tool.Reactor)) + myClass = "table-danger text-danger"; + else + myClass = ""; + + @tool.Reactor @owner @tool.MostRecentEvent.CAT_PROB_DESC @tool.MostRecentEvent.REASON @@ -181,7 +189,13 @@ myClass = ""; - @tool.Reactor + + @if (Model.CurrentHotWORunning.Contains("R" + tool.Reactor)) + myClass = "table-danger text-danger"; + else + myClass = ""; + + @tool.Reactor @owner @tool.MostRecentEvent.CAT_PROB_DESC @tool.MostRecentEvent.REASON @@ -228,7 +242,13 @@ myClass = ""; - @tool.Reactor + + @if (Model.CurrentHotWORunning.Contains("R" + tool.Reactor)) + myClass = "table-danger text-danger"; + else + myClass = ""; + + @tool.Reactor @owner @tool.MostRecentEvent.CAT_PROB_DESC @tool.MostRecentEvent.REASON