Refactored code, restructured project organization, and added new unit tests.
This commit is contained in:
parent
8f96e31121
commit
b5def3da89
@ -3,7 +3,7 @@ using ReportingServices.HelperClasses;
|
|||||||
namespace ReportingServices.Test
|
namespace ReportingServices.Test
|
||||||
{
|
{
|
||||||
[TestClass]
|
[TestClass]
|
||||||
public class UnitTest1
|
public class APIHelperTester
|
||||||
{
|
{
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void CheckShortDateWithPassedInDate()
|
public void CheckShortDateWithPassedInDate()
|
64
ReportingServices.Test/DailyReportTester.cs
Normal file
64
ReportingServices.Test/DailyReportTester.cs
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
using ReportingServices.ViewModels.ProductionReport;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ReportingServices.Test
|
||||||
|
{
|
||||||
|
[TestClass]
|
||||||
|
public class DailyReportTester
|
||||||
|
{
|
||||||
|
[TestMethod]
|
||||||
|
public void SetRDSInfo_InputData_CalculatedAndStoresCorrectly()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
DailyReport rpt = new();
|
||||||
|
rpt.CurrentEntries = TestingClass.ManualReportEntries;
|
||||||
|
Dictionary<string, List<int>> dualLayerReactors = new()
|
||||||
|
{
|
||||||
|
{ "ASM", new List<int>() { 24, 62 } },
|
||||||
|
{ "HTR", new List<int>() { } },
|
||||||
|
{ "EPP", new List<int>() { 40, 42, 44, 46 } },
|
||||||
|
};
|
||||||
|
int asmUnloadTempsLessThan700 = 3;
|
||||||
|
int htrUnloadTempsLessThan700 = 3;
|
||||||
|
|
||||||
|
// Act
|
||||||
|
rpt.SetRDSInfo(TestingClass.RDSList);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
CollectionAssert.AreEqual(dualLayerReactors["ASM"].ToList(), rpt.DualLayerReactors["ASM"].ToList());
|
||||||
|
CollectionAssert.AreEqual(dualLayerReactors["HTR"].ToList(), rpt.DualLayerReactors["HTR"].ToList());
|
||||||
|
CollectionAssert.AreEqual(dualLayerReactors["EPP"].ToList(), rpt.DualLayerReactors["EPP"].ToList());
|
||||||
|
Assert.AreEqual(asmUnloadTempsLessThan700, rpt.CurrentEntries[(int)DateTime.Now.DayOfWeek].ASMUnloadTempsLessThan700);
|
||||||
|
Assert.AreEqual(htrUnloadTempsLessThan700, rpt.CurrentEntries[(int)DateTime.Now.DayOfWeek].HTRUnloadTempsLessThan700);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void SetReactorInfo_InputData_CalculatedAndStoresCorrectly()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
DailyReport rpt = new();
|
||||||
|
rpt.CurrentEntries = TestingClass.ManualReportEntries;
|
||||||
|
int numberOfToolsWaferSize6IN = 11;
|
||||||
|
int numberOfToolsWaferSize8IN = 46;
|
||||||
|
int numberOfToolsWaferSize6INScheduled = 9;
|
||||||
|
int numberOfToolsWaferSize8INScheduled = 39;
|
||||||
|
int singleLoadLockASM = 5;
|
||||||
|
int singleLoadLockHTR = 14;
|
||||||
|
|
||||||
|
// Act
|
||||||
|
rpt.SetReactorInfo(TestingClass.Reactors, TestingClass.UnscheduledReactors);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.AreEqual(numberOfToolsWaferSize6IN, rpt.NumberOfToolsWaferSize6IN);
|
||||||
|
Assert.AreEqual(numberOfToolsWaferSize8IN, rpt.NumberOfToolsWaferSize8IN);
|
||||||
|
Assert.AreEqual(numberOfToolsWaferSize6INScheduled, rpt.NumberOfToolsWaferSize6INScheduled);
|
||||||
|
Assert.AreEqual(numberOfToolsWaferSize8INScheduled, rpt.NumberOfToolsWaferSize8INScheduled);
|
||||||
|
Assert.AreEqual(singleLoadLockASM, rpt.CurrentEntries[(int)DateTime.Now.DayOfWeek].ASMSingleLoadLock);
|
||||||
|
Assert.AreEqual(singleLoadLockHTR, rpt.CurrentEntries[(int)DateTime.Now.DayOfWeek].HTRSingleLoadLock);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
186
ReportingServices.Test/TestingClass.cs
Normal file
186
ReportingServices.Test/TestingClass.cs
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
using ReportingServices.Models.ProductionReport;
|
||||||
|
|
||||||
|
namespace ReportingServices.Test
|
||||||
|
{
|
||||||
|
internal static class TestingClass
|
||||||
|
{
|
||||||
|
public static readonly List<RDS> RDSList = new()
|
||||||
|
{
|
||||||
|
new RDS(79, "ASM+", new DateTime(2022, 12, 13), 600, "Standard 1 Layer"),
|
||||||
|
new RDS(45, "HTR", new DateTime(2022, 12, 13), 550, "Standard 1 Layer"),
|
||||||
|
new RDS(62, "ASM+", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(62, "ASM+", new DateTime(2022, 12, 13), 700, "Standard 2 Layer"),
|
||||||
|
new RDS(62, "ASM+", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(24, "ASM", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(24, "ASM", new DateTime(2022, 12, 13), 800, "Standard 2 Layer"),
|
||||||
|
new RDS(24, "ASM", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(66, "ASM+", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(28, "ASM", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(28, "ASM", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(63, "ASM+", new DateTime(2022, 12, 13), 800, "Standard 1 Layer"),
|
||||||
|
new RDS(63, "ASM+", new DateTime(2022, 12, 13), 800, "Standard 1 Layer"),
|
||||||
|
new RDS(23, "ASM", new DateTime(2022, 12, 13), 550, "Standard 1 Layer"),
|
||||||
|
new RDS(23, "ASM", new DateTime(2022, 12, 13), 550, "Standard 1 Layer"),
|
||||||
|
new RDS(32, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(58, "ASM", new DateTime(2022, 12, 13), 650, "Standard 1 Layer"),
|
||||||
|
new RDS(77, "ASM+", new DateTime(2022, 12, 13), 800, "Standard 1 Layer"),
|
||||||
|
new RDS(77, "ASM+", new DateTime(2022, 12, 13), 800, "Standard 1 Layer"),
|
||||||
|
new RDS(57, "ASM+", new DateTime(2022, 12, 13), 800, "Standard 1 Layer"),
|
||||||
|
new RDS(57, "ASM+", new DateTime(2022, 12, 13), 800, "Standard 1 Layer"),
|
||||||
|
new RDS(20, "ASM", new DateTime(2022, 12, 13), 800, "Standard 1 Layer"),
|
||||||
|
new RDS(20, "ASM", new DateTime(2022, 12, 13), 800, "Standard 1 Layer"),
|
||||||
|
new RDS(43, "ASM+", new DateTime(2022, 12, 13), 750, "Standard 1 Layer"),
|
||||||
|
new RDS(43, "ASM+", new DateTime(2022, 12, 13), 750, "Standard 1 Layer"),
|
||||||
|
new RDS(29, "ASM", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(25, "ASM", new DateTime(2022, 12, 13), 750, "Standard 1 Layer"),
|
||||||
|
new RDS(51, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(51, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(51, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(38, "HTR", new DateTime(2022, 12, 13), 550, "Standard 1 Layer"),
|
||||||
|
new RDS(38, "HTR", new DateTime(2022, 12, 13), 550, "Standard 1 Layer"),
|
||||||
|
new RDS(64, "ASM+", new DateTime(2022, 12, 13), 800, "Standard 1 Layer"),
|
||||||
|
new RDS(64, "ASM+", new DateTime(2022, 12, 13), 800, "Standard 1 Layer"),
|
||||||
|
new RDS(32, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(37, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(37, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(30, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(31, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(33, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(33, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(33, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(55, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(55, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(55, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(36, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(21, "ASM", new DateTime(2022, 12, 13), 800, "Standard 1 Layer"),
|
||||||
|
new RDS(21, "ASM", new DateTime(2022, 12, 13), 800, "Standard 1 Layer"),
|
||||||
|
new RDS(73, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(75, "ASM+", new DateTime(2022, 12, 13), 750, "Standard 1 Layer"),
|
||||||
|
new RDS(75, "ASM+", new DateTime(2022, 12, 13), 750, "Standard 1 Layer"),
|
||||||
|
new RDS(51, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(53, "ASM+", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(53, "ASM+", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(35, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(35, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(35, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(36, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(68, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(68, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(68, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(41, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(41, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(41, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(70, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(70, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(70, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(70, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(74, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(74, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(74, "HTR", new DateTime(2022, 12, 13), 700, "Standard 1 Layer"),
|
||||||
|
new RDS(61, "ASM+", new DateTime(2022, 12, 13), 800, "Standard 1 Layer"),
|
||||||
|
new RDS(61, "ASM+", new DateTime(2022, 12, 13), 800, "Standard 1 Layer"),
|
||||||
|
new RDS(49, "HTR", new DateTime(2022, 12, 13), 550, "Standard 1 Layer"),
|
||||||
|
new RDS(42, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(42, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(42, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(46, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(46, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(52, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 1 Layer"),
|
||||||
|
new RDS(48, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 1 Layer"),
|
||||||
|
new RDS(54, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 1 Layer"),
|
||||||
|
new RDS(50, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 1 Layer"),
|
||||||
|
new RDS(40, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(40, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(42, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(42, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(44, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(44, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(46, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(46, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(46, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 2 Layer"),
|
||||||
|
new RDS(48, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 1 Layer"),
|
||||||
|
new RDS(50, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 1 Layer"),
|
||||||
|
new RDS(52, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 1 Layer"),
|
||||||
|
new RDS(54, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 1 Layer"),
|
||||||
|
new RDS(48, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 1 Layer"),
|
||||||
|
new RDS(52, "EPP", new DateTime(2022, 12, 13), 1000, "Standard 1 Layer"),
|
||||||
|
};
|
||||||
|
|
||||||
|
public static readonly List<Reactor> Reactors = new()
|
||||||
|
{
|
||||||
|
new Reactor(20, "ASM", "200 mm 8 in", false),
|
||||||
|
new Reactor(21, "ASM", "200 mm 8 in", false),
|
||||||
|
new Reactor(22, "ASM", "200 mm 8 in", false),
|
||||||
|
new Reactor(23, "ASM", "200 mm 8 in", false),
|
||||||
|
new Reactor(24, "ASM", "200 mm 8 in", false),
|
||||||
|
new Reactor(25, "ASM", "200 mm 8 in", true),
|
||||||
|
new Reactor(26, "ASM", "200 mm 8 in", false),
|
||||||
|
new Reactor(27, "ASM", "200 mm 8 in", false),
|
||||||
|
new Reactor(28, "ASM", "150 mm 6 in", true),
|
||||||
|
new Reactor(29, "ASM", "200 mm 8 in", false),
|
||||||
|
new Reactor(30, "HTR", "200 mm 8 in", true),
|
||||||
|
new Reactor(31, "HTR", "200 mm 8 in", true),
|
||||||
|
new Reactor(32, "HTR", "200 mm 8 in", true),
|
||||||
|
new Reactor(33, "HTR", "200 mm 8 in", true),
|
||||||
|
new Reactor(34, "HTR", "200 mm 8 in", false),
|
||||||
|
new Reactor(35, "HTR", "200 mm 8 in", false),
|
||||||
|
new Reactor(36, "HTR", "200 mm 8 in", false),
|
||||||
|
new Reactor(37, "HTR", "200 mm 8 in", true),
|
||||||
|
new Reactor(38, "HTR", "200 mm 8 in", true),
|
||||||
|
new Reactor(39, "ASM+", "200 mm 8 in", false),
|
||||||
|
new Reactor(40, "EPP", "150 mm 6 in", false),
|
||||||
|
new Reactor(41, "HTR", "200 mm 8 in", true),
|
||||||
|
new Reactor(42, "EPP", "150 mm 6 in", false),
|
||||||
|
new Reactor(43, "ASM+", "200 mm 8 in", false),
|
||||||
|
new Reactor(44, "EPP", "150 mm 6 in", false),
|
||||||
|
new Reactor(45, "HTR", "200 mm 8 in", true),
|
||||||
|
new Reactor(46, "EPP", "150 mm 6 in", false),
|
||||||
|
new Reactor(47, "HTR", "150 mm 6 in", true),
|
||||||
|
new Reactor(48, "EPP", "200 mm 8 in", false),
|
||||||
|
new Reactor(49, "HTR", "200 mm 8 in", true),
|
||||||
|
new Reactor(50, "EPP", "200 mm 8 in", false),
|
||||||
|
new Reactor(51, "HTR", "150 mm 6 in", true),
|
||||||
|
new Reactor(52, "EPP", "200 mm 8 in", false),
|
||||||
|
new Reactor(53, "ASM+", "200 mm 8 in", false),
|
||||||
|
new Reactor(54, "EPP", "200 mm 8 in", false),
|
||||||
|
new Reactor(55, "HTR", "200 mm 8 in", true),
|
||||||
|
new Reactor(56, "ASM+", "200 mm 8 in", true),
|
||||||
|
new Reactor(57, "ASM+", "200 mm 8 in", false),
|
||||||
|
new Reactor(58, "ASM", "200 mm 8 in", false),
|
||||||
|
new Reactor(59, "ASM", "200 mm 8 in", false),
|
||||||
|
new Reactor(60, "ASM+", "200 mm 8 in", true),
|
||||||
|
new Reactor(61, "ASM+", "200 mm 8 in", false),
|
||||||
|
new Reactor(62, "ASM+", "200 mm 8 in", true),
|
||||||
|
new Reactor(63, "ASM+", "200 mm 8 in", false),
|
||||||
|
new Reactor(64, "ASM+", "200 mm 8 in", false),
|
||||||
|
new Reactor(65, "ASM+", "200 mm 8 in", false),
|
||||||
|
new Reactor(66, "ASM+", "200 mm 8 in", false),
|
||||||
|
new Reactor(68, "HTR", "200 mm 8 in", false),
|
||||||
|
new Reactor(70, "HTR", "150 mm 6 in", true),
|
||||||
|
new Reactor(72, "HTR", "200 mm 8 in", true),
|
||||||
|
new Reactor(73, "HTR", "200 mm 8 in", false),
|
||||||
|
new Reactor(74, "HTR", "150 mm 6 in", false),
|
||||||
|
new Reactor(75, "ASM+", "200 mm 8 in", false),
|
||||||
|
new Reactor(77, "ASM+", "200 mm 8 in", false),
|
||||||
|
new Reactor(79, "ASM+", "200 mm 8 in", false),
|
||||||
|
new Reactor(100, "ASM", "150 mm 6 in", false),
|
||||||
|
new Reactor(101, "ASM", "150 mm 6 in", false),
|
||||||
|
};
|
||||||
|
|
||||||
|
public static readonly List<int> UnscheduledReactors = new()
|
||||||
|
{
|
||||||
|
20, 25, 30, 32, 49, 55, 59, 67, 69, 70, 74
|
||||||
|
};
|
||||||
|
|
||||||
|
public static readonly List<ManualReportEntries> ManualReportEntries = new()
|
||||||
|
{
|
||||||
|
new ManualReportEntries(),
|
||||||
|
new ManualReportEntries(),
|
||||||
|
new ManualReportEntries(),
|
||||||
|
new ManualReportEntries(),
|
||||||
|
new ManualReportEntries(),
|
||||||
|
new ManualReportEntries(),
|
||||||
|
new ManualReportEntries(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -2,26 +2,22 @@
|
|||||||
using ReportingServices.Dependency_Injections;
|
using ReportingServices.Dependency_Injections;
|
||||||
using ReportingServices.HelperClasses;
|
using ReportingServices.HelperClasses;
|
||||||
using ReportingServices.Models.ProductionReport;
|
using ReportingServices.Models.ProductionReport;
|
||||||
using ReportingServices.ReportingObjects;
|
using ReportingServices.ViewModels.ProductionReport;
|
||||||
using System.Web;
|
|
||||||
|
|
||||||
namespace ReportingServices.Controllers
|
namespace ReportingServices.Controllers
|
||||||
{
|
{
|
||||||
public class ProductionReportController : Controller
|
public class ProductionReportController : Controller
|
||||||
{
|
{
|
||||||
private readonly IJsonFileHandler _jsonFileHandler;
|
|
||||||
private readonly IScrapeDatabaseRepository _scrapeDatabaseRepository;
|
private readonly IScrapeDatabaseRepository _scrapeDatabaseRepository;
|
||||||
private readonly IFabTimeReportingRepository _fabTimeReportingRepository;
|
private readonly IFabTimeReportingRepository _fabTimeReportingRepository;
|
||||||
private readonly ILogger<ProductionReportController> _logger;
|
private readonly ILogger<ProductionReportController> _logger;
|
||||||
private readonly int _reportIndex = (int)DateTime.Now.DayOfWeek;
|
private readonly int _reportIndex = (int)DateTime.Now.DayOfWeek;
|
||||||
private readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json";
|
private readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json";
|
||||||
private readonly string _toolStateOwnerFilePath = "wwwroot/Assets/ToolStates.json";
|
private readonly string _toolStateOwnerFilePath = "wwwroot/Assets/ToolStates.json";
|
||||||
private readonly string _toolFilter = "~R76%2C%20~R78%2C%20~R25%2C%20~R67%2C%20~R69%2C%20~R71%2C%20~R47%2C%20~R51%2C%20~R28";
|
|
||||||
|
|
||||||
public ProductionReportController(IJsonFileHandler jsonFileHandler, IScrapeDatabaseRepository scrapeDatabaseRepository,
|
public ProductionReportController(IScrapeDatabaseRepository scrapeDatabaseRepository,
|
||||||
IFabTimeReportingRepository fabTimeReportingRepository, ILogger<ProductionReportController> logger)
|
IFabTimeReportingRepository fabTimeReportingRepository, ILogger<ProductionReportController> logger)
|
||||||
{
|
{
|
||||||
_jsonFileHandler = jsonFileHandler;
|
|
||||||
_scrapeDatabaseRepository = scrapeDatabaseRepository;
|
_scrapeDatabaseRepository = scrapeDatabaseRepository;
|
||||||
_fabTimeReportingRepository = fabTimeReportingRepository;
|
_fabTimeReportingRepository = fabTimeReportingRepository;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
@ -37,8 +33,9 @@ namespace ReportingServices.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DailyReport dailyReport = SetUpDailyReport();
|
DailyReportHelper.SetRepositories(_fabTimeReportingRepository, _scrapeDatabaseRepository);
|
||||||
Dictionary<string, List<string>> toolStateOwners = _jsonFileHandler.LoadJSONFile<Dictionary<string, List<string>>>(_toolStateOwnerFilePath);
|
DailyReport dailyReport = DailyReportHelper.SetUpDailyReport();
|
||||||
|
Dictionary<string, List<string>> toolStateOwners = JsonFileHandler.LoadJSONFile<Dictionary<string, List<string>>>(_toolStateOwnerFilePath);
|
||||||
|
|
||||||
dailyReport.ToolStatesByOwner = toolStateOwners;
|
dailyReport.ToolStatesByOwner = toolStateOwners;
|
||||||
|
|
||||||
@ -54,7 +51,7 @@ namespace ReportingServices.Controllers
|
|||||||
|
|
||||||
public IActionResult EditDailyReport()
|
public IActionResult EditDailyReport()
|
||||||
{
|
{
|
||||||
Dictionary<string, List<ManualReportEntries>> entries = _jsonFileHandler.LoadJSONFile<Dictionary<string, List<ManualReportEntries>>>(_dailyRptFilePath);
|
Dictionary<string, List<ManualReportEntries>> entries = JsonFileHandler.LoadJSONFile<Dictionary<string, List<ManualReportEntries>>>(_dailyRptFilePath);
|
||||||
|
|
||||||
ManualReportEntries rpt = entries["Current Week"][_reportIndex];
|
ManualReportEntries rpt = entries["Current Week"][_reportIndex];
|
||||||
|
|
||||||
@ -64,136 +61,16 @@ namespace ReportingServices.Controllers
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public IActionResult EditDailyReport(ManualReportEntries rpt)
|
public IActionResult EditDailyReport(ManualReportEntries rpt)
|
||||||
{
|
{
|
||||||
Dictionary<string, List<ManualReportEntries>> report = _jsonFileHandler.LoadJSONFile<Dictionary<string, List<ManualReportEntries>>>(_dailyRptFilePath);
|
Dictionary<string, List<ManualReportEntries>> report = JsonFileHandler.LoadJSONFile<Dictionary<string, List<ManualReportEntries>>>(_dailyRptFilePath);
|
||||||
|
|
||||||
rpt.Date = DateTime.Parse(DateTime.Now.ToShortDateString());
|
rpt.Date = DateTime.Parse(DateTime.Now.ToShortDateString());
|
||||||
rpt.Day = DateTime.Now.DayOfWeek;
|
rpt.Day = DateTime.Now.DayOfWeek;
|
||||||
|
|
||||||
report["Current Week"][_reportIndex] = rpt;
|
report["Current Week"][_reportIndex] = rpt;
|
||||||
|
|
||||||
_jsonFileHandler.SaveJSONFile(report, _dailyRptFilePath);
|
JsonFileHandler.SaveJSONFile(report, _dailyRptFilePath);
|
||||||
|
|
||||||
return RedirectToAction("DailyReport");
|
return RedirectToAction("DailyReport");
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<ReactorOutsByRDS>> MovesTrendCaller(string startDate = "", string endDate = "")
|
|
||||||
{
|
|
||||||
string url = APIHelperFunctions.GenerateURLWithParameters(startDate: startDate, endDate: endDate, chart: "MOVESLOTLIST", areasLike: "CLEANROOM", operationsLike: "1UNLOAD");
|
|
||||||
|
|
||||||
List<ReactorOutsByRDS> outsByRDS = await _fabTimeReportingRepository.GetMovesTrendData(url);
|
|
||||||
|
|
||||||
return outsByRDS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<EquipmentStateByDay>> ToolStateTrendCaller(string toolType)
|
|
||||||
{
|
|
||||||
string url = APIHelperFunctions.GenerateURLWithParameters(chart: "TOOLSTATE", periodLen: "24", capacityTypesLike: toolType, toolsLike: _toolFilter);
|
|
||||||
|
|
||||||
List<EquipmentStateByDay> toolAvailability = await _fabTimeReportingRepository.GetToolStateTrendData(url);
|
|
||||||
|
|
||||||
return toolAvailability;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<ToolStateCurrent>> ToolStatesCaller(string toolType)
|
|
||||||
{
|
|
||||||
string capacityFilter = toolType == "ASM" ? toolType + "%2CASM%2B" : toolType;
|
|
||||||
string startDate = HttpUtility.UrlEncode(APIHelperFunctions.GetDateWithOffsetAsAPIString(DateTime.Now.ToString(), -12.5f));
|
|
||||||
|
|
||||||
string url = APIHelperFunctions.GenerateURLWithParameters(chart: "ToolStateGantt", periodLen: "24",
|
|
||||||
capacityTypesLike: capacityFilter, toolsLike: _toolFilter, startDate: startDate);
|
|
||||||
|
|
||||||
List<ToolStateCurrent> toolStates = await _fabTimeReportingRepository.GetToolStateData(url);
|
|
||||||
|
|
||||||
return toolStates;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DailyReport SetUpDailyReport()
|
|
||||||
{
|
|
||||||
DailyReport report = new();
|
|
||||||
|
|
||||||
Task<List<ReactorOutsByRDS>> task1 = MovesTrendCaller();
|
|
||||||
Task<List<ReactorOutsByRDS>> task2 = MovesTrendCaller(startDate: report.StartDate.AddDays(-7).ToString(), endDate: report.StartDate.ToString());
|
|
||||||
Task<List<EquipmentStateByDay>> task3 = ToolStateTrendCaller("ASM");
|
|
||||||
Task<List<EquipmentStateByDay>> task4 = ToolStateTrendCaller("EPP");
|
|
||||||
Task<List<EquipmentStateByDay>> task5 = ToolStateTrendCaller("HTR");
|
|
||||||
Task<List<ToolStateCurrent>> task6 = ToolStatesCaller("ASM");
|
|
||||||
Task<List<ToolStateCurrent>> task7 = ToolStatesCaller("EPP");
|
|
||||||
Task<List<ToolStateCurrent>> task8 = ToolStatesCaller("HTR");
|
|
||||||
Task<List<ToolStateCurrent>> task9 = ToolStatesCaller("Metrology");
|
|
||||||
Task<List<ToolStateCurrent>> task10 = ToolStatesCaller("Cleans");
|
|
||||||
|
|
||||||
report.AddToolAvailibilityByType("ASM", task3.Result);
|
|
||||||
report.AddToolAvailibilityByType("EPP", task4.Result);
|
|
||||||
report.AddToolAvailibilityByType("HTR", task5.Result);
|
|
||||||
report.AddToolStateByType("ASM", task6.Result);
|
|
||||||
report.AddToolStateByType("EPP", task7.Result);
|
|
||||||
report.AddToolStateByType("HTR", task8.Result);
|
|
||||||
report.AddToolStateByType("Metrology", task9.Result);
|
|
||||||
report.AddToolStateByType("Cleans", task10.Result);
|
|
||||||
|
|
||||||
report.CurrentWeek.SetOutsByDay(task1.Result);
|
|
||||||
report.PreviousWeek.SetOutsByDay(task2.Result);
|
|
||||||
|
|
||||||
List<ScrapByDay> scrap = _scrapeDatabaseRepository.GetScrapByDay(task1.Result);
|
|
||||||
List<ScrapByDay> previousScrap = _scrapeDatabaseRepository.GetScrapByDay(task2.Result);
|
|
||||||
|
|
||||||
report.CurrentWeek.SetScrapByDay(scrap);
|
|
||||||
report.PreviousWeek.SetScrapByDay(previousScrap);
|
|
||||||
|
|
||||||
report.ReverseLists();
|
|
||||||
|
|
||||||
report.QuarterlyTargets = _scrapeDatabaseRepository.GetQuarterlyTargets();
|
|
||||||
|
|
||||||
int[] toolsByWaferSize = _scrapeDatabaseRepository.GetNumberOfToolsByWaferSize("''");
|
|
||||||
|
|
||||||
report.NumberOfToolsWaferSize6IN = toolsByWaferSize[0];
|
|
||||||
report.NumberOfToolsWaferSize8IN = toolsByWaferSize[1];
|
|
||||||
|
|
||||||
string reactors = "";
|
|
||||||
|
|
||||||
foreach (KeyValuePair<string, ToolStateByType> keyValuePairs in report.ToolStateByType)
|
|
||||||
{
|
|
||||||
if (keyValuePairs.Key != "Metrology" && keyValuePairs.Key != "Cleans")
|
|
||||||
{
|
|
||||||
foreach (ToolStateCurrent tool in keyValuePairs.Value.ToolStateCurrents)
|
|
||||||
{
|
|
||||||
if (tool.BasicStateDescription != "Productive" && tool.ReactorStatus != "Out of Service")
|
|
||||||
{
|
|
||||||
reactors = reactors + "'" + tool.Tool.Substring(1) + "', ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
reactors = reactors.Substring(0, reactors.Length - 2);
|
|
||||||
|
|
||||||
report.DualLayerReactors = _scrapeDatabaseRepository.GetDualLayerReactors();
|
|
||||||
|
|
||||||
int[] toolsByWaferSizeScheduled = _scrapeDatabaseRepository.GetNumberOfToolsByWaferSize(reactors);
|
|
||||||
|
|
||||||
report.NumberOfToolsWaferSize6INScheduled = toolsByWaferSizeScheduled[0];
|
|
||||||
report.NumberOfToolsWaferSize8INScheduled = toolsByWaferSizeScheduled[1];
|
|
||||||
|
|
||||||
Dictionary<string, List<ManualReportEntries>> entries = _jsonFileHandler.LoadJSONFile<Dictionary<string, List<ManualReportEntries>>>(_dailyRptFilePath);
|
|
||||||
|
|
||||||
report.CurrentEntries = entries["Current Week"];
|
|
||||||
report.PreviousEntries = entries["Previous Week"];
|
|
||||||
|
|
||||||
int[] singleLoadLocks = _scrapeDatabaseRepository.GetNumberOfSingleLoadLocks();
|
|
||||||
|
|
||||||
report.CurrentEntries[_reportIndex].ASMSingleLoadLock = singleLoadLocks[0];
|
|
||||||
report.CurrentEntries[_reportIndex].HTRSingleLoadLock = singleLoadLocks[1];
|
|
||||||
|
|
||||||
int[] unloadTempsLessThan700 = _scrapeDatabaseRepository.GetNumberOfToolUnloadTempsLessThan700();
|
|
||||||
|
|
||||||
report.CurrentEntries[_reportIndex].ASMUnloadTempsLessThan700 = unloadTempsLessThan700[0];
|
|
||||||
report.CurrentEntries[_reportIndex].HTRUnloadTempsLessThan700 = unloadTempsLessThan700[1];
|
|
||||||
|
|
||||||
entries["Current Week"] = report.CurrentEntries;
|
|
||||||
|
|
||||||
_jsonFileHandler.SaveJSONFile(entries, _dailyRptFilePath);
|
|
||||||
|
|
||||||
return report;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
using ReportingServices.ReportingObjects;
|
|
||||||
using System.Text.Json;
|
|
||||||
|
|
||||||
namespace ReportingServices.Dependency_Injections
|
|
||||||
{
|
|
||||||
public class FabTimeReportingRepository : IFabTimeReportingRepository
|
|
||||||
{
|
|
||||||
public async Task<List<ReactorOutsByRDS>> GetMovesTrendData(string url)
|
|
||||||
{
|
|
||||||
return await GetJsonData<List<ReactorOutsByRDS>>(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<EquipmentStateByDay>> GetToolStateTrendData(string url)
|
|
||||||
{
|
|
||||||
return await GetJsonData<List<EquipmentStateByDay>>(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<ToolStateCurrent>> GetToolStateData(string url)
|
|
||||||
{
|
|
||||||
return await GetJsonData<List<ToolStateCurrent>>(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<T> GetJsonData<T>(string url)
|
|
||||||
{
|
|
||||||
T deserializedJson;
|
|
||||||
|
|
||||||
using (var client = new HttpClient())
|
|
||||||
{
|
|
||||||
using (HttpResponseMessage response = await client.GetAsync(url))
|
|
||||||
{
|
|
||||||
string apiResponse = await response.Content.ReadAsStringAsync();
|
|
||||||
deserializedJson = JsonSerializer.Deserialize<T>(apiResponse);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return deserializedJson;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using ReportingServices.ReportingObjects;
|
|
||||||
|
|
||||||
namespace ReportingServices.Dependency_Injections
|
|
||||||
{
|
|
||||||
public interface IFabTimeReportingRepository
|
|
||||||
{
|
|
||||||
public Task<List<ReactorOutsByRDS>> GetMovesTrendData(string url);
|
|
||||||
public Task<List<EquipmentStateByDay>> GetToolStateTrendData(string url);
|
|
||||||
public Task<List<ToolStateCurrent>> GetToolStateData(string url);
|
|
||||||
public Task<T> GetJsonData<T>(string url);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
using ReportingServices.ReportingObjects;
|
|
||||||
|
|
||||||
namespace ReportingServices.Dependency_Injections
|
|
||||||
{
|
|
||||||
public interface IJsonFileHandler
|
|
||||||
{
|
|
||||||
public void SaveJSONFile<T>(T obj, string file);
|
|
||||||
public T LoadJSONFile<T>(string file);
|
|
||||||
}
|
|
||||||
}
|
|
84
ReportingServices/HelperClasses/DailyReportHelper.cs
Normal file
84
ReportingServices/HelperClasses/DailyReportHelper.cs
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
using ReportingServices.Dependency_Injections;
|
||||||
|
using ReportingServices.Models.ProductionReport;
|
||||||
|
using ReportingServices.ViewModels.ProductionReport;
|
||||||
|
|
||||||
|
namespace ReportingServices.HelperClasses
|
||||||
|
{
|
||||||
|
public static class DailyReportHelper
|
||||||
|
{
|
||||||
|
private static IFabTimeReportingRepository _fabTimeReportingRepository;
|
||||||
|
private static IScrapeDatabaseRepository _scrapeDatabaseRepository;
|
||||||
|
private static readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json";
|
||||||
|
|
||||||
|
public static void SetRepositories(IFabTimeReportingRepository fabTimeReportingRepository, IScrapeDatabaseRepository scrapeDatabaseRepository)
|
||||||
|
{
|
||||||
|
_fabTimeReportingRepository = fabTimeReportingRepository;
|
||||||
|
_scrapeDatabaseRepository = scrapeDatabaseRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DailyReport SetUpDailyReport()
|
||||||
|
{
|
||||||
|
List<Task> tasks = new();
|
||||||
|
DailyReport report = new();
|
||||||
|
|
||||||
|
Task<List<ReactorOutsByRDS>> task1 = _fabTimeReportingRepository.GetMovesTrendData();
|
||||||
|
Task<List<ReactorOutsByRDS>> task2 = _fabTimeReportingRepository.GetMovesTrendData(startDate: report.StartDate.AddDays(-7).ToString(), endDate: report.StartDate.ToString());
|
||||||
|
tasks.Add(_fabTimeReportingRepository.GetToolStateTrendData(report, "ASM"));
|
||||||
|
tasks.Add(_fabTimeReportingRepository.GetToolStateTrendData(report, "EPP"));
|
||||||
|
tasks.Add(_fabTimeReportingRepository.GetToolStateTrendData(report, "HTR"));
|
||||||
|
tasks.Add(_fabTimeReportingRepository.GetToolStateData(report, "ASM"));
|
||||||
|
tasks.Add(_fabTimeReportingRepository.GetToolStateData(report, "EPP"));
|
||||||
|
tasks.Add(_fabTimeReportingRepository.GetToolStateData(report, "HTR"));
|
||||||
|
tasks.Add(_fabTimeReportingRepository.GetToolStateData(report, "Metrology"));
|
||||||
|
tasks.Add(_fabTimeReportingRepository.GetToolStateData(report, "Cleans"));
|
||||||
|
|
||||||
|
report.QuarterlyTargets = _scrapeDatabaseRepository.GetQuarterlyTargets();
|
||||||
|
|
||||||
|
Dictionary<string, List<ManualReportEntries>> entries = JsonFileHandler.LoadJSONFile<Dictionary<string, List<ManualReportEntries>>>(_dailyRptFilePath);
|
||||||
|
|
||||||
|
report.CurrentEntries = entries["Current Week"];
|
||||||
|
report.PreviousEntries = entries["Previous Week"];
|
||||||
|
|
||||||
|
report.SetRDSInfo(_scrapeDatabaseRepository.GetRDSForLastDay());
|
||||||
|
|
||||||
|
Task.WaitAll(tasks.ToArray());
|
||||||
|
|
||||||
|
report.SetReactorInfo(_scrapeDatabaseRepository.GetReactors(), GetUnscheduledReactors(report));
|
||||||
|
|
||||||
|
List<ScrapByDay> scrap = _scrapeDatabaseRepository.GetScrapByDay(task1.Result);
|
||||||
|
List<ScrapByDay> previousScrap = _scrapeDatabaseRepository.GetScrapByDay(task2.Result);
|
||||||
|
|
||||||
|
report.CurrentWeek.SetYieldInformation(task1.Result, scrap);
|
||||||
|
report.PreviousWeek.SetYieldInformation(task2.Result, previousScrap);
|
||||||
|
|
||||||
|
report.ReverseLists();
|
||||||
|
|
||||||
|
entries["Current Week"] = report.CurrentEntries;
|
||||||
|
|
||||||
|
JsonFileHandler.SaveJSONFile(entries, _dailyRptFilePath);
|
||||||
|
|
||||||
|
return report;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<int> GetUnscheduledReactors(DailyReport report)
|
||||||
|
{
|
||||||
|
List<int> reactors = new();
|
||||||
|
|
||||||
|
foreach (KeyValuePair<string, ToolStateByType> keyValuePairs in report.ToolStateByType)
|
||||||
|
{
|
||||||
|
if (keyValuePairs.Key != "Metrology" && keyValuePairs.Key != "Cleans")
|
||||||
|
{
|
||||||
|
foreach (ToolStateCurrent tool in keyValuePairs.Value.ToolStateCurrents)
|
||||||
|
{
|
||||||
|
if (tool.BasicStateDescription != "Productive" && tool.ReactorStatus != "Out of Service")
|
||||||
|
{
|
||||||
|
reactors.Add(int.Parse(tool.Tool.Substring(1)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return reactors;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,16 +1,16 @@
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace ReportingServices.Dependency_Injections
|
namespace ReportingServices.HelperClasses
|
||||||
{
|
{
|
||||||
public class JsonFileHandler : IJsonFileHandler
|
public static class JsonFileHandler
|
||||||
{
|
{
|
||||||
public T LoadJSONFile<T>(string file)
|
public static T LoadJSONFile<T>(string file)
|
||||||
{
|
{
|
||||||
string json = File.ReadAllText(file);
|
string json = File.ReadAllText(file);
|
||||||
return JsonSerializer.Deserialize<T>(json);
|
return JsonSerializer.Deserialize<T>(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveJSONFile<T>(T obj, string file)
|
public static void SaveJSONFile<T>(T obj, string file)
|
||||||
{
|
{
|
||||||
string json = JsonSerializer.Serialize(obj);
|
string json = JsonSerializer.Serialize(obj);
|
||||||
File.WriteAllText(file, json);
|
File.WriteAllText(file, json);
|
@ -1,56 +0,0 @@
|
|||||||
using ReportingServices.HelperClasses;
|
|
||||||
using ReportingServices.ReportingObjects;
|
|
||||||
|
|
||||||
namespace ReportingServices.Models.ProductionReport
|
|
||||||
{
|
|
||||||
public class DailyReport
|
|
||||||
{
|
|
||||||
public DateTime StartDate { get; set; }
|
|
||||||
public YieldStatistics CurrentWeek { get; set; }
|
|
||||||
public YieldStatistics PreviousWeek { get; set; }
|
|
||||||
public Dictionary<string, List<EquipmentStateByDay>> ToolAvailibilityByType { get; set; }
|
|
||||||
public Dictionary<string, ToolStateByType> ToolStateByType { get; set; }
|
|
||||||
public Dictionary<string, List<string>> ToolStatesByOwner { get; set; }
|
|
||||||
public Dictionary<string, List<string>> DualLayerReactors { get; set; }
|
|
||||||
public List<ManualReportEntries> PreviousEntries { get; set; }
|
|
||||||
public List<ManualReportEntries> CurrentEntries { get; set; }
|
|
||||||
public int NumberOfToolsWaferSize6IN { get; set; }
|
|
||||||
public int NumberOfToolsWaferSize8IN { get; set; }
|
|
||||||
public int NumberOfToolsWaferSize6INScheduled { get; set; }
|
|
||||||
public int NumberOfToolsWaferSize8INScheduled { get; set; }
|
|
||||||
public QuarterlyTargets QuarterlyTargets { get; set; }
|
|
||||||
|
|
||||||
public DailyReport()
|
|
||||||
{
|
|
||||||
ToolAvailibilityByType = new();
|
|
||||||
ToolStateByType = new();
|
|
||||||
PreviousEntries = new();
|
|
||||||
CurrentEntries = new();
|
|
||||||
StartDate = DateTime.Parse(APIHelperFunctions.GetBeginningOfWeekAsAPIString());
|
|
||||||
CurrentWeek = new(StartDate, true);
|
|
||||||
PreviousWeek = new(StartDate.AddDays(-7), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AddToolAvailibilityByType(string key, List<EquipmentStateByDay> states)
|
|
||||||
{
|
|
||||||
ToolAvailibilityByType.Add(key, states);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AddToolStateByType(string key, List<ToolStateCurrent> states)
|
|
||||||
{
|
|
||||||
ToolStateByType state = new(states);
|
|
||||||
|
|
||||||
ToolStateByType.Add(key, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ReverseLists()
|
|
||||||
{
|
|
||||||
CurrentWeek.ScrapByDay = APIHelperFunctions.ReverseList(CurrentWeek.ScrapByDay);
|
|
||||||
PreviousWeek.ScrapByDay = APIHelperFunctions.ReverseList(PreviousWeek.ScrapByDay);
|
|
||||||
|
|
||||||
ToolAvailibilityByType["ASM"] = APIHelperFunctions.ReverseList(ToolAvailibilityByType["ASM"]);
|
|
||||||
ToolAvailibilityByType["EPP"] = APIHelperFunctions.ReverseList(ToolAvailibilityByType["EPP"]);
|
|
||||||
ToolAvailibilityByType["HTR"] = APIHelperFunctions.ReverseList(ToolAvailibilityByType["HTR"]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
namespace ReportingServices.ReportingObjects
|
namespace ReportingServices.Models.ProductionReport
|
||||||
{
|
{
|
||||||
public class EquipmentStateByDay
|
public class EquipmentStateByDay
|
||||||
{
|
{
|
@ -1,4 +1,4 @@
|
|||||||
namespace ReportingServices.ReportingObjects
|
namespace ReportingServices.Models.ProductionReport
|
||||||
{
|
{
|
||||||
public class ManualReportEntries
|
public class ManualReportEntries
|
||||||
{
|
{
|
@ -1,4 +1,4 @@
|
|||||||
namespace ReportingServices.ReportingObjects
|
namespace ReportingServices.Models.ProductionReport
|
||||||
{
|
{
|
||||||
public class QuarterlyTargets
|
public class QuarterlyTargets
|
||||||
{
|
{
|
20
ReportingServices/Models/ProductionReport/RDS.cs
Normal file
20
ReportingServices/Models/ProductionReport/RDS.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
namespace ReportingServices.Models.ProductionReport
|
||||||
|
{
|
||||||
|
public class RDS
|
||||||
|
{
|
||||||
|
public int Reactor { get; set; }
|
||||||
|
public string ReactorType { get; set; }
|
||||||
|
public DateTime DateOut { get; set; }
|
||||||
|
public int UnloadTemp { get; set; }
|
||||||
|
public string LayerType { get; set; }
|
||||||
|
|
||||||
|
public RDS(int reactor, string reactorType, DateTime dateOut, int unloadTemp, string layerType)
|
||||||
|
{
|
||||||
|
Reactor = reactor;
|
||||||
|
ReactorType = reactorType;
|
||||||
|
DateOut = dateOut;
|
||||||
|
UnloadTemp = unloadTemp;
|
||||||
|
LayerType = layerType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
18
ReportingServices/Models/ProductionReport/Reactor.cs
Normal file
18
ReportingServices/Models/ProductionReport/Reactor.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
namespace ReportingServices.Models.ProductionReport
|
||||||
|
{
|
||||||
|
public class Reactor
|
||||||
|
{
|
||||||
|
public int ReactorNumber { get; set; }
|
||||||
|
public string Type { get; set; }
|
||||||
|
public string PocketSize { get; set; }
|
||||||
|
public bool HasDisabledLoadlock { get; set; }
|
||||||
|
|
||||||
|
public Reactor(int reactorNumber, string type, string pocketSize, bool hasDisabledLoadlock)
|
||||||
|
{
|
||||||
|
ReactorNumber = reactorNumber;
|
||||||
|
Type = type;
|
||||||
|
PocketSize = pocketSize;
|
||||||
|
HasDisabledLoadlock = hasDisabledLoadlock;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
namespace ReportingServices.ReportingObjects
|
namespace ReportingServices.Models.ProductionReport
|
||||||
{
|
{
|
||||||
public class ReactorOutsByDay
|
public class ReactorOutsByDay
|
||||||
{
|
{
|
@ -1,4 +1,4 @@
|
|||||||
namespace ReportingServices.ReportingObjects
|
namespace ReportingServices.Models.ProductionReport
|
||||||
{
|
{
|
||||||
public class ReactorOutsByRDS
|
public class ReactorOutsByRDS
|
||||||
{
|
{
|
@ -1,4 +1,4 @@
|
|||||||
namespace ReportingServices.ReportingObjects
|
namespace ReportingServices.Models.ProductionReport
|
||||||
{
|
{
|
||||||
public class ScrapByDay
|
public class ScrapByDay
|
||||||
{
|
{
|
@ -1,4 +1,4 @@
|
|||||||
namespace ReportingServices.ReportingObjects
|
namespace ReportingServices.Models.ProductionReport
|
||||||
{
|
{
|
||||||
public class ToolStateCurrent
|
public class ToolStateCurrent
|
||||||
{
|
{
|
@ -1,6 +1,4 @@
|
|||||||
using ReportingServices.ReportingObjects;
|
namespace ReportingServices.Models.ProductionReport
|
||||||
|
|
||||||
namespace ReportingServices.Models.ProductionReport
|
|
||||||
{
|
{
|
||||||
public class YieldStatistics
|
public class YieldStatistics
|
||||||
{
|
{
|
||||||
@ -15,13 +13,9 @@ namespace ReportingServices.Models.ProductionReport
|
|||||||
IsCurrentWeek = isCurrentWeek;
|
IsCurrentWeek = isCurrentWeek;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetOutsByDay(List<ReactorOutsByRDS> outs)
|
public void SetYieldInformation(List<ReactorOutsByRDS> outs, List<ScrapByDay> scrap)
|
||||||
{
|
{
|
||||||
OutsByDay = GetReactorOutsByDay(outs);
|
OutsByDay = GetReactorOutsByDay(outs);
|
||||||
}
|
|
||||||
|
|
||||||
public void SetScrapByDay(List<ScrapByDay> scrap)
|
|
||||||
{
|
|
||||||
ScrapByDay = scrap;
|
ScrapByDay = scrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using ReportingServices.Dependency_Injections;
|
using ReportingServices.Dependency_Injections;
|
||||||
|
using ReportingServices.HelperClasses;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
LoggerConfiguration loggerConfiguration = new();
|
LoggerConfiguration loggerConfiguration = new();
|
||||||
@ -13,7 +14,6 @@ Serilog.ILogger log = Log.ForContext<Program>();
|
|||||||
|
|
||||||
// Add services to the container.
|
// Add services to the container.
|
||||||
builder.Services.AddControllersWithViews();
|
builder.Services.AddControllersWithViews();
|
||||||
builder.Services.AddScoped<IJsonFileHandler, JsonFileHandler>();
|
|
||||||
builder.Services.AddScoped<IScrapeDatabaseRepository, ScrapeDatabaseRepository>();
|
builder.Services.AddScoped<IScrapeDatabaseRepository, ScrapeDatabaseRepository>();
|
||||||
builder.Services.AddScoped<IFabTimeReportingRepository, FabTimeReportingRepository>();
|
builder.Services.AddScoped<IFabTimeReportingRepository, FabTimeReportingRepository>();
|
||||||
|
|
||||||
|
@ -0,0 +1,60 @@
|
|||||||
|
using ReportingServices.HelperClasses;
|
||||||
|
using ReportingServices.Models.ProductionReport;
|
||||||
|
using ReportingServices.ViewModels.ProductionReport;
|
||||||
|
using System.Text.Json;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
|
namespace ReportingServices.Dependency_Injections
|
||||||
|
{
|
||||||
|
public class FabTimeReportingRepository : IFabTimeReportingRepository
|
||||||
|
{
|
||||||
|
private readonly string _toolFilter = "~R76%2C%20~R78%2C%20~R25%2C%20~R67%2C%20~R69%2C%20~R71%2C%20~R47%2C%20~R51%2C%20~R28";
|
||||||
|
|
||||||
|
public async Task<List<ReactorOutsByRDS>> GetMovesTrendData(string startDate = "", string endDate = "")
|
||||||
|
{
|
||||||
|
string url = APIHelperFunctions.GenerateURLWithParameters(startDate: startDate, endDate: endDate, chart: "MOVESLOTLIST", areasLike: "CLEANROOM", operationsLike: "1UNLOAD");
|
||||||
|
|
||||||
|
return await GetJsonData<List<ReactorOutsByRDS>>(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task GetToolStateTrendData(DailyReport rpt, string toolType)
|
||||||
|
{
|
||||||
|
string url = APIHelperFunctions.GenerateURLWithParameters(chart: "TOOLSTATE", periodLen: "24", capacityTypesLike: toolType, toolsLike: _toolFilter);
|
||||||
|
|
||||||
|
rpt.AddToolAvailibilityByType(toolType, await GetJsonData<List<EquipmentStateByDay>>(url));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task GetToolStateData(DailyReport rpt, string toolType)
|
||||||
|
{
|
||||||
|
string capacityFilter = toolType == "ASM" ? toolType + "%2CASM%2B" : toolType;
|
||||||
|
string startDate = HttpUtility.UrlEncode(APIHelperFunctions.GetDateWithOffsetAsAPIString(DateTime.Now.ToString(), -12.5f));
|
||||||
|
|
||||||
|
string url = APIHelperFunctions.GenerateURLWithParameters(chart: "ToolStateGantt", periodLen: "24",
|
||||||
|
capacityTypesLike: capacityFilter, toolsLike: _toolFilter, startDate: startDate);
|
||||||
|
|
||||||
|
rpt.AddToolStateByType(toolType, await GetJsonData<List<ToolStateCurrent>>(url));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<T> GetJsonData<T>(string url)
|
||||||
|
{
|
||||||
|
T deserializedJson;
|
||||||
|
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
using (HttpResponseMessage response = await client.GetAsync(url))
|
||||||
|
{
|
||||||
|
string apiResponse = await response.Content.ReadAsStringAsync();
|
||||||
|
deserializedJson = JsonSerializer.Deserialize<T>(apiResponse);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return deserializedJson;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
using Microsoft.Data.SqlClient;
|
using Microsoft.Data.SqlClient;
|
||||||
using ReportingServices.Models.PlanningReport;
|
using ReportingServices.Models.PlanningReport;
|
||||||
using ReportingServices.ReportingObjects;
|
using ReportingServices.Models.ProductionReport;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
|
||||||
namespace ReportingServices.Dependency_Injections
|
namespace ReportingServices.Dependency_Injections
|
||||||
@ -131,114 +131,6 @@ namespace ReportingServices.Dependency_Injections
|
|||||||
return weeklyPartChanges;
|
return weeklyPartChanges;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] GetNumberOfToolsByWaferSize(string reactors)
|
|
||||||
{
|
|
||||||
int[] singleLoadLocks = new int[2];
|
|
||||||
|
|
||||||
OpenConnection();
|
|
||||||
|
|
||||||
SqlCommand cmd = _connection.CreateCommand();
|
|
||||||
|
|
||||||
string query = "SELECT " +
|
|
||||||
" SUSC_POCKET_SIZE, " +
|
|
||||||
" COUNT(SUSC_POCKET_SIZE) " +
|
|
||||||
" FROM REACTOR " +
|
|
||||||
" WHERE REACT_ASSIGNMENT IS NOT NULL " +
|
|
||||||
" AND REACT_ASSIGNMENT <> 'Out of Service' " +
|
|
||||||
" AND REACT_ASSIGNMENT <> '' " +
|
|
||||||
" AND REACT_NO NOT IN (" + reactors + ") " +
|
|
||||||
"GROUP BY SUSC_POCKET_SIZE";
|
|
||||||
|
|
||||||
cmd.CommandText = query;
|
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
|
||||||
{
|
|
||||||
reader.Read();
|
|
||||||
|
|
||||||
singleLoadLocks[0] = int.Parse(reader[1].ToString());
|
|
||||||
|
|
||||||
reader.Read();
|
|
||||||
|
|
||||||
singleLoadLocks[1] = int.Parse(reader[1].ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Dispose();
|
|
||||||
|
|
||||||
CloseConnection();
|
|
||||||
|
|
||||||
return singleLoadLocks;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int[] GetNumberOfSingleLoadLocks()
|
|
||||||
{
|
|
||||||
int[] singleLoadLocks = new int[2];
|
|
||||||
|
|
||||||
OpenConnection();
|
|
||||||
|
|
||||||
SqlCommand cmd = _connection.CreateCommand();
|
|
||||||
|
|
||||||
string query = "SELECT REACT_TYPE, SUM(CASE WHEN ACTIVE_LL_DISABLED <> '' AND ACTIVE_LL_DISABLED IS NOT NULL THEN 1 ELSE 0 END) AS SLL" +
|
|
||||||
" FROM REACTOR " +
|
|
||||||
" WHERE REACT_ASSIGNMENT IS NOT NULL " +
|
|
||||||
" AND REACT_ASSIGNMENT <> 'Out of Service' " +
|
|
||||||
" AND REACT_ASSIGNMENT<> '' " +
|
|
||||||
" AND REACT_TYPE IN('ASM', 'HTR') " +
|
|
||||||
"GROUP BY REACT_TYPE";
|
|
||||||
|
|
||||||
cmd.CommandText = query;
|
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
|
||||||
{
|
|
||||||
reader.Read();
|
|
||||||
|
|
||||||
singleLoadLocks[0] = int.Parse(reader[1].ToString());
|
|
||||||
|
|
||||||
reader.Read();
|
|
||||||
|
|
||||||
singleLoadLocks[1] = int.Parse(reader[1].ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Dispose();
|
|
||||||
|
|
||||||
CloseConnection();
|
|
||||||
|
|
||||||
return singleLoadLocks;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int[] GetNumberOfToolUnloadTempsLessThan700()
|
|
||||||
{
|
|
||||||
int[] unloadTempTools = new int[2];
|
|
||||||
|
|
||||||
OpenConnection();
|
|
||||||
|
|
||||||
SqlCommand cmd = _connection.CreateCommand();
|
|
||||||
|
|
||||||
string query = "SELECT REACTOR_TYPE, COUNT(DISTINCT(REACTOR)) AS ULT FROM RDS " +
|
|
||||||
"INNER JOIN RDS_LAYER lay ON lay.RDS_NO = SEQ " +
|
|
||||||
"WHERE DATE_OUT > DATEADD(DAY, -1, SYSDATETIME()) " +
|
|
||||||
" AND UL_TEMP< 700 " +
|
|
||||||
"GROUP BY REACTOR_TYPE";
|
|
||||||
|
|
||||||
cmd.CommandText = query;
|
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
|
||||||
{
|
|
||||||
reader.Read();
|
|
||||||
|
|
||||||
unloadTempTools[0] = int.Parse(reader[1].ToString());
|
|
||||||
|
|
||||||
reader.Read();
|
|
||||||
|
|
||||||
unloadTempTools[1] = int.Parse(reader[1].ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Dispose();
|
|
||||||
|
|
||||||
CloseConnection();
|
|
||||||
|
|
||||||
return unloadTempTools;
|
|
||||||
}
|
|
||||||
|
|
||||||
public QuarterlyTargets GetQuarterlyTargets()
|
public QuarterlyTargets GetQuarterlyTargets()
|
||||||
{
|
{
|
||||||
Dictionary<string, float> targets = new();
|
Dictionary<string, float> targets = new();
|
||||||
@ -286,49 +178,63 @@ namespace ReportingServices.Dependency_Injections
|
|||||||
return quarterlyTargets;
|
return quarterlyTargets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Dictionary<string, List<string>> GetDualLayerReactors()
|
public List<Reactor> GetReactors()
|
||||||
{
|
{
|
||||||
Dictionary<string, List<string>> dualLayers = new();
|
List<Reactor> reactors = new();
|
||||||
|
|
||||||
dualLayers.Add("ASM", new List<string>());
|
|
||||||
dualLayers.Add("HTR", new List<string>());
|
|
||||||
dualLayers.Add("EPP", new List<string>());
|
|
||||||
|
|
||||||
OpenConnection();
|
OpenConnection();
|
||||||
|
|
||||||
SqlCommand cmd = _connection.CreateCommand();
|
SqlCommand cmd = _connection.CreateCommand();
|
||||||
|
|
||||||
string query = "SELECT REACTOR_TYPE, REACTOR FROM " +
|
string query = "SELECT " +
|
||||||
"(SELECT " +
|
" REACT_NO, REACT_TYPE, SUSC_POCKET_SIZE, CASE WHEN ACTIVE_LL_DISABLED <> '' THEN 'TRUE' ELSE 'FALSE' END AS \"LL_DISABLED\" " +
|
||||||
" REACTOR, " +
|
" FROM REACTOR " +
|
||||||
" rds.REACTOR_TYPE, " +
|
" WHERE REACT_ASSIGNMENT IS NOT NULL " +
|
||||||
" PROD_SPEC_ID, " +
|
" AND REACT_ASSIGNMENT <> 'Out of Service' " +
|
||||||
" SUM(CASE WHEN psn.LAYER_TYPE = 'Standard 2 Layer' THEN 1 ELSE 0 END) AS Dual " +
|
" AND REACT_ASSIGNMENT<> ''";
|
||||||
" FROM RDS " +
|
|
||||||
"INNER JOIN PROD_SPEC psn ON rds.PROD_SPEC_ID = psn.SEQ " +
|
|
||||||
" WHERE DATE_OUT BETWEEN DATEADD(DAY, -1, SYSDATETIME()) AND SYSDATETIME() " +
|
|
||||||
"GROUP BY REACTOR, PROD_SPEC_ID, rds.REACTOR_TYPE) res " +
|
|
||||||
"WHERE res.Dual > 0 " +
|
|
||||||
"ORDER BY 1, 2 ";
|
|
||||||
|
|
||||||
cmd.CommandText = query;
|
cmd.CommandText = query;
|
||||||
|
|
||||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
{
|
{
|
||||||
while (reader.Read())
|
while (reader.Read())
|
||||||
{
|
reactors.Add(new Reactor(int.Parse(reader[0].ToString()), reader[1].ToString(), reader[2].ToString(), bool.Parse(reader[3].ToString())));
|
||||||
if (reader[0].ToString() == "ASM+")
|
|
||||||
dualLayers["ASM"].Add("R" + reader[1].ToString());
|
|
||||||
else
|
|
||||||
dualLayers[reader[0].ToString()].Add("R" + reader[1].ToString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.Dispose();
|
cmd.Dispose();
|
||||||
|
|
||||||
CloseConnection();
|
CloseConnection();
|
||||||
|
|
||||||
return dualLayers;
|
return reactors;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<RDS> GetRDSForLastDay()
|
||||||
|
{
|
||||||
|
List<RDS> rdsList = new();
|
||||||
|
|
||||||
|
OpenConnection();
|
||||||
|
|
||||||
|
SqlCommand cmd = _connection.CreateCommand();
|
||||||
|
|
||||||
|
string query = "SELECT rds.REACTOR, rds.REACTOR_TYPE, rds.DATE_OUT, " +
|
||||||
|
"CASE WHEN lay.UL_TEMP IS NULL THEN '1000' ELSE lay.UL_TEMP END, psn.LAYER_TYPE FROM RDS " +
|
||||||
|
"INNER JOIN RDS_LAYER lay ON lay.RDS_NO = SEQ " +
|
||||||
|
"INNER JOIN PROD_SPEC psn ON rds.PROD_SPEC_ID = psn.SEQ " +
|
||||||
|
"WHERE DATE_OUT > DATEADD(DAY, -1, SYSDATETIME())";
|
||||||
|
|
||||||
|
cmd.CommandText = query;
|
||||||
|
|
||||||
|
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
rdsList.Add(new RDS(int.Parse(reader[0].ToString()), reader[1].ToString(), DateTime.Parse(reader[2].ToString()), int.Parse(reader[3].ToString()), reader[4].ToString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd.Dispose();
|
||||||
|
|
||||||
|
CloseConnection();
|
||||||
|
|
||||||
|
return rdsList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
using ReportingServices.Models.ProductionReport;
|
||||||
|
using ReportingServices.ViewModels.ProductionReport;
|
||||||
|
|
||||||
|
namespace ReportingServices.Dependency_Injections
|
||||||
|
{
|
||||||
|
public interface IFabTimeReportingRepository
|
||||||
|
{
|
||||||
|
public Task<List<ReactorOutsByRDS>> GetMovesTrendData(string startDate = "", string endDate = "");
|
||||||
|
public Task GetToolStateTrendData(DailyReport rpt, string toolType);
|
||||||
|
public Task GetToolStateData(DailyReport rpt, string toolType);
|
||||||
|
public Task<T> GetJsonData<T>(string url);
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
using ReportingServices.Models.PlanningReport;
|
using ReportingServices.Models.PlanningReport;
|
||||||
using ReportingServices.ReportingObjects;
|
using ReportingServices.Models.ProductionReport;
|
||||||
|
|
||||||
namespace ReportingServices.Dependency_Injections
|
namespace ReportingServices.Dependency_Injections
|
||||||
{
|
{
|
||||||
@ -10,10 +10,8 @@ namespace ReportingServices.Dependency_Injections
|
|||||||
public List<ScrapByDay> GetScrapByDay(List<ReactorOutsByRDS> outs);
|
public List<ScrapByDay> GetScrapByDay(List<ReactorOutsByRDS> outs);
|
||||||
public List<ReactorPSNWORuns> GetReactorPSNWORuns(string startDate, string endDate);
|
public List<ReactorPSNWORuns> GetReactorPSNWORuns(string startDate, string endDate);
|
||||||
public int GetNumberOfPartChanges(string startDate, string endDate);
|
public int GetNumberOfPartChanges(string startDate, string endDate);
|
||||||
public int[] GetNumberOfToolsByWaferSize(string reactors);
|
|
||||||
public int[] GetNumberOfSingleLoadLocks();
|
|
||||||
public int[] GetNumberOfToolUnloadTempsLessThan700();
|
|
||||||
public QuarterlyTargets GetQuarterlyTargets();
|
public QuarterlyTargets GetQuarterlyTargets();
|
||||||
public Dictionary<string, List<string>> GetDualLayerReactors();
|
public List<Reactor> GetReactors();
|
||||||
|
public List<RDS> GetRDSForLastDay();
|
||||||
}
|
}
|
||||||
}
|
}
|
132
ReportingServices/ViewModels/ProductionReport/DailyReport.cs
Normal file
132
ReportingServices/ViewModels/ProductionReport/DailyReport.cs
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
using ReportingServices.HelperClasses;
|
||||||
|
using ReportingServices.Models.ProductionReport;
|
||||||
|
|
||||||
|
namespace ReportingServices.ViewModels.ProductionReport
|
||||||
|
{
|
||||||
|
public class DailyReport
|
||||||
|
{
|
||||||
|
public DateTime StartDate { get; set; }
|
||||||
|
public YieldStatistics CurrentWeek { get; set; }
|
||||||
|
public YieldStatistics PreviousWeek { get; set; }
|
||||||
|
public Dictionary<string, List<EquipmentStateByDay>> ToolAvailibilityByType { get; set; }
|
||||||
|
public Dictionary<string, ToolStateByType> ToolStateByType { get; set; }
|
||||||
|
public Dictionary<string, List<string>> ToolStatesByOwner { get; set; }
|
||||||
|
public Dictionary<string, List<int>> DualLayerReactors { get; set; }
|
||||||
|
public List<ManualReportEntries> PreviousEntries { get; set; }
|
||||||
|
public List<ManualReportEntries> CurrentEntries { get; set; }
|
||||||
|
public int NumberOfToolsWaferSize6IN { get; set; }
|
||||||
|
public int NumberOfToolsWaferSize8IN { get; set; }
|
||||||
|
public int NumberOfToolsWaferSize6INScheduled { get; set; }
|
||||||
|
public int NumberOfToolsWaferSize8INScheduled { get; set; }
|
||||||
|
public QuarterlyTargets QuarterlyTargets { get; set; }
|
||||||
|
|
||||||
|
public DailyReport()
|
||||||
|
{
|
||||||
|
ToolAvailibilityByType = new();
|
||||||
|
ToolStateByType = new();
|
||||||
|
PreviousEntries = new();
|
||||||
|
CurrentEntries = new();
|
||||||
|
DualLayerReactors = new();
|
||||||
|
StartDate = DateTime.Parse(APIHelperFunctions.GetBeginningOfWeekAsAPIString());
|
||||||
|
CurrentWeek = new(StartDate, true);
|
||||||
|
PreviousWeek = new(StartDate.AddDays(-7), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddToolAvailibilityByType(string key, List<EquipmentStateByDay> states)
|
||||||
|
{
|
||||||
|
ToolAvailibilityByType.Add(key, states);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddToolStateByType(string key, List<ToolStateCurrent> states)
|
||||||
|
{
|
||||||
|
ToolStateByType state = new(states);
|
||||||
|
|
||||||
|
ToolStateByType.Add(key, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetReactorInfo(List<Reactor> reactors, List<int> unscheduledReactors)
|
||||||
|
{
|
||||||
|
SetToolsByPocketSize(reactors, unscheduledReactors);
|
||||||
|
SetDisabledLoadlocks(reactors);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetRDSInfo(List<RDS> rdsList)
|
||||||
|
{
|
||||||
|
SetDualLayerReactors(rdsList);
|
||||||
|
SetUnloadTempsLessThan700(rdsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetToolsByPocketSize(List<Reactor> reactors, List<int> unscheduledReactors)
|
||||||
|
{
|
||||||
|
NumberOfToolsWaferSize6IN = reactors.Where(react => react.PocketSize.Contains("150")).Count();
|
||||||
|
NumberOfToolsWaferSize8IN = reactors.Where(react => react.PocketSize.Contains("200")).Count();
|
||||||
|
|
||||||
|
NumberOfToolsWaferSize6INScheduled =
|
||||||
|
reactors.Where(react => !unscheduledReactors.Contains(react.ReactorNumber)
|
||||||
|
&& react.PocketSize.Contains("150")).Count();
|
||||||
|
NumberOfToolsWaferSize8INScheduled =
|
||||||
|
reactors.Where(react => !unscheduledReactors.Contains(react.ReactorNumber)
|
||||||
|
&& react.PocketSize.Contains("200")).Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetDisabledLoadlocks(List<Reactor> reactors)
|
||||||
|
{
|
||||||
|
List<Reactor> reactorsWithDisabledLoadlocks = reactors.Where(react => react.HasDisabledLoadlock).ToList();
|
||||||
|
|
||||||
|
int singleLoadlockASM = reactorsWithDisabledLoadlocks.Where(react => react.Type.Contains("ASM")).Count();
|
||||||
|
int singleLoadlockHTR = reactorsWithDisabledLoadlocks.Where(react => react.Type.Contains("HTR")).Count();
|
||||||
|
|
||||||
|
CurrentEntries[(int)DateTime.Now.DayOfWeek].ASMSingleLoadLock = singleLoadlockASM;
|
||||||
|
CurrentEntries[(int)DateTime.Now.DayOfWeek].HTRSingleLoadLock = singleLoadlockHTR;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetDualLayerReactors(List<RDS> rdsList)
|
||||||
|
{
|
||||||
|
List<RDS> rdsWithDualLayerPSN = rdsList.Where(rds => rds.LayerType.Contains("2 Layer")).ToList();
|
||||||
|
|
||||||
|
DualLayerReactors.Add("ASM", rdsWithDualLayerPSN.
|
||||||
|
Where(rds => rds.ReactorType.Contains("ASM")).
|
||||||
|
OrderBy(rds => rds.Reactor).
|
||||||
|
Select(rds => rds.Reactor).
|
||||||
|
Distinct().ToList());
|
||||||
|
DualLayerReactors.Add("HTR", rdsWithDualLayerPSN.
|
||||||
|
Where(rds => rds.ReactorType.Contains("HTR")).
|
||||||
|
OrderBy(rds => rds.Reactor).
|
||||||
|
Select(rds => rds.Reactor).
|
||||||
|
Distinct().ToList());
|
||||||
|
DualLayerReactors.Add("EPP", rdsWithDualLayerPSN.
|
||||||
|
Where(rds => rds.ReactorType.Contains("EPP")).
|
||||||
|
OrderBy(rds => rds.Reactor).
|
||||||
|
Select(rds => rds.Reactor).
|
||||||
|
Distinct().ToList());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetUnloadTempsLessThan700(List<RDS> rdsList)
|
||||||
|
{
|
||||||
|
List<RDS> rdsWithTempsLessThan700 = rdsList.Where(rds => rds.UnloadTemp < 700).ToList();
|
||||||
|
|
||||||
|
CurrentEntries[(int)DateTime.Now.DayOfWeek].ASMUnloadTempsLessThan700 =
|
||||||
|
rdsWithTempsLessThan700.
|
||||||
|
Where(rds => rds.ReactorType.
|
||||||
|
Contains("ASM")).
|
||||||
|
Select(rds => rds.Reactor).
|
||||||
|
Distinct().Count();
|
||||||
|
CurrentEntries[(int)DateTime.Now.DayOfWeek].HTRUnloadTempsLessThan700 =
|
||||||
|
rdsWithTempsLessThan700.
|
||||||
|
Where(rds => rds.ReactorType.
|
||||||
|
Contains("HTR")).
|
||||||
|
Select(rds => rds.Reactor).
|
||||||
|
Distinct().Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReverseLists()
|
||||||
|
{
|
||||||
|
CurrentWeek.ScrapByDay = APIHelperFunctions.ReverseList(CurrentWeek.ScrapByDay);
|
||||||
|
PreviousWeek.ScrapByDay = APIHelperFunctions.ReverseList(PreviousWeek.ScrapByDay);
|
||||||
|
|
||||||
|
ToolAvailibilityByType["ASM"] = APIHelperFunctions.ReverseList(ToolAvailibilityByType["ASM"]);
|
||||||
|
ToolAvailibilityByType["EPP"] = APIHelperFunctions.ReverseList(ToolAvailibilityByType["EPP"]);
|
||||||
|
ToolAvailibilityByType["HTR"] = APIHelperFunctions.ReverseList(ToolAvailibilityByType["HTR"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,6 @@
|
|||||||
namespace ReportingServices.ReportingObjects
|
using ReportingServices.Models.ProductionReport;
|
||||||
|
|
||||||
|
namespace ReportingServices.ViewModels.ProductionReport
|
||||||
{
|
{
|
||||||
public class ToolStateByType
|
public class ToolStateByType
|
||||||
{
|
{
|
@ -1,8 +1,7 @@
|
|||||||
@using ReportingServices.ReportingObjects
|
@using ReportingServices.ViewModels.ProductionReport
|
||||||
@model ReportingServices.Models.ProductionReport.DailyReport
|
@using ReportingServices.Models.ProductionReport
|
||||||
|
@model DailyReport
|
||||||
@{
|
@{
|
||||||
|
|
||||||
|
|
||||||
int ASMAvailablePct = 0;
|
int ASMAvailablePct = 0;
|
||||||
int EPPAvailablePct = 0;
|
int EPPAvailablePct = 0;
|
||||||
int HTRAvailablePct = 0;
|
int HTRAvailablePct = 0;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
@model ReportingServices.ReportingObjects.ManualReportEntries
|
@using ReportingServices.Models.ProductionReport
|
||||||
|
@model ManualReportEntries
|
||||||
|
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Edit Daily Passdown | Mesa Reporting Services";
|
ViewData["Title"] = "Edit Daily Passdown | Mesa Reporting Services";
|
||||||
|
@ -7,5 +7,8 @@
|
|||||||
},
|
},
|
||||||
"Serilog": {
|
"Serilog": {
|
||||||
"MinimumLevel": "Debug"
|
"MinimumLevel": "Debug"
|
||||||
|
},
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"DefaultConnection": "Server=MESTSV01EC.ec.local\\TEST1,50572;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
ReportingServices/appsettings.Release.json
Normal file
14
ReportingServices/appsettings.Release.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Serilog": {
|
||||||
|
"MinimumLevel": "Debug"
|
||||||
|
},
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"DefaultConnection": "Server=MESSV01EC.EC.LOCAL\\PROD1,53959;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true"
|
||||||
|
}
|
||||||
|
}
|
@ -6,7 +6,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"DefaultConnection": "Server=Messv01ec.ec.local\\PROD1,53959;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true"
|
"DefaultConnection": "Server=MESSV01EC.EC.LOCAL\\PROD1,53959;Database=LSL2SQL;User Id=srpadmin;Password=0okm9ijn;TrustServerCertificate=true"
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"Serilog": {
|
"Serilog": {
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user