diff --git a/ReportingServices.Shared/Models/ProductionReport/ReactorEvent.cs b/ReportingServices.Shared/Models/ProductionReport/ReactorEvent.cs index 8641f6a..d549f75 100644 --- a/ReportingServices.Shared/Models/ProductionReport/ReactorEvent.cs +++ b/ReportingServices.Shared/Models/ProductionReport/ReactorEvent.cs @@ -14,4 +14,6 @@ public class ReactorEvent public string REACT_MODE { get; set; } [JsonPropertyName("COMMENT")] public string COMMENT { get; set; } + [JsonPropertyName("CAT_PROB_DESC")] + public string CAT_PROB_DESC { get; set; } } \ No newline at end of file diff --git a/ReportingServices.Shared/Repositories/Implementations/ScrapeDatabaseRepository.cs b/ReportingServices.Shared/Repositories/Implementations/ScrapeDatabaseRepository.cs index 60ce065..c24f5d1 100644 --- a/ReportingServices.Shared/Repositories/Implementations/ScrapeDatabaseRepository.cs +++ b/ReportingServices.Shared/Repositories/Implementations/ScrapeDatabaseRepository.cs @@ -322,10 +322,15 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository " EVENT_DTM, " + " COMMENT AS REASON, " + " REACT_MODE, " + - " (SELECT TOP 1 NOTES " + - " FROM REACTOR_LOG_NOTES rnote " + + " (SELECT TOP 1 NOTES " + + " FROM REACTOR_LOG_NOTES rnote " + " WHERE rmode.START_RL_ID = rnote.SEQ " + - " ORDER BY MV_NO) AS COMMENT " + + " ORDER BY MV_NO DESC) AS COMMENT, " + + " (SELECT TOP 1 CONCAT(PROB_CAT_ID, ' - ', PROB_CAT_DESC) " + + " FROM REACT_MODE_SERV_INFO srv " + + " WHERE rmode.REACT_NO = srv.REACT_NO " + + " AND rmode.START_DTM = srv.START_DTM " + + " ORDER BY MV_NO DESC) AS CATEGORY " + " FROM REACT_EVENT revnt, REACT_MODE rmode " + " WHERE EVENT_DTM > @startDate " + " AND EVENT_DTM < @endDate " + @@ -336,15 +341,20 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository " AND REACT_MODE = MODE " + "UNION ALL " + "SELECT * " + - " FROM " + - " (SELECT TOP 1 " + + " FROM " + + " (SELECT TOP 1 " + " revnt.REACT_NO, " + " EVENT_DTM, COMMENT AS REASON, " + - " REACT_MODE, " + - " (SELECT TOP 1 NOTES " + - " FROM REACTOR_LOG_NOTES rnote " + - " WHERE rmode.START_RL_ID = rnote.SEQ " + - " ORDER BY MV_NO) AS COMMENT " + + " REACT_MODE, " + + " (SELECT TOP 1 NOTES " + + " FROM REACTOR_LOG_NOTES rnote " + + " WHERE rmode.START_RL_ID = rnote.SEQ " + + " ORDER BY MV_NO DESC) AS COMMENT, " + + " (SELECT TOP 1 CONCAT(PROB_CAT_ID, ' - ', PROB_CAT_DESC) " + + " FROM REACT_MODE_SERV_INFO srv " + + " WHERE rmode.REACT_NO = srv.REACT_NO " + + " AND rmode.START_DTM = srv.START_DTM " + + " ORDER BY MV_NO DESC) AS CATEGORY " + " FROM REACT_EVENT revnt, REACT_MODE rmode " + " WHERE EVENT_DTM < @startDate " + " AND revnt.REACT_NO = @reactorNumber " + @@ -352,7 +362,7 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository " AND revnt.REACT_NO = rmode.REACT_NO " + " AND LOGGED_BY = START_USER " + " AND REACT_MODE = MODE ORDER BY EVENT_DTM DESC) AS tbl1 " + - "ORDER BY EVENT_DTM ASC "; + "ORDER BY EVENT_DTM ASC"; cmd.CommandText = query; _ = cmd.Parameters.AddWithValue("@startDate", startDate); @@ -368,7 +378,8 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository EVENT_DTM = reader[1].ToString(), REASON = reader[2].ToString(), REACT_MODE = reader[3].ToString(), - COMMENT = reader[4].ToString() + COMMENT = reader[4].ToString(), + CAT_PROB_DESC = reader[5].ToString() }); } diff --git a/ReportingServices.Test/APIHelperTester.cs b/ReportingServices.Test/APIHelperTester.cs index 9e59ecb..703c536 100644 --- a/ReportingServices.Test/APIHelperTester.cs +++ b/ReportingServices.Test/APIHelperTester.cs @@ -1,9 +1,6 @@ using Microsoft.AspNetCore.Mvc.Testing; using ReportingServices.Shared.HelperClasses; -using ReportingServices.Shared.Models.PlanningReport; -using ReportingServices.Shared.Models.ProductionReport; using Serilog; -using System.Net.Http.Json; namespace ReportingServices.Test; diff --git a/ReportingServices.UI/Views/ProductionReport/DailyReport.cshtml b/ReportingServices.UI/Views/ProductionReport/DailyReport.cshtml index aef273a..4c03399 100644 --- a/ReportingServices.UI/Views/ProductionReport/DailyReport.cshtml +++ b/ReportingServices.UI/Views/ProductionReport/DailyReport.cshtml @@ -110,9 +110,10 @@ Reactor Owner - Issue + Category Description + Issue Downtime - Most Recent Comment + Most Recent Comment @@ -135,6 +136,7 @@ @tool.Reactor @owner + @tool.MostRecentEvent.CAT_PROB_DESC @tool.MostRecentEvent.REASON @string.Format("{0:##,###.##}", tool.Downtime) @tool.MostRecentEvent.COMMENT @@ -155,9 +157,10 @@ Reactor Owner - Issue + Category Description + Issue Downtime - Most Recent Comment + Most Recent Comment @@ -180,6 +183,7 @@ @tool.Reactor @owner + @tool.MostRecentEvent.CAT_PROB_DESC @tool.MostRecentEvent.REASON @string.Format("{0:##,###.##}", tool.Downtime) @tool.MostRecentEvent.COMMENT @@ -200,9 +204,10 @@ Reactor Owner - Issue + Category Description + Issue Downtime - Most Recent Comment + Most Recent Comment @@ -225,6 +230,7 @@ @tool.Reactor @owner + @tool.MostRecentEvent.CAT_PROB_DESC @tool.MostRecentEvent.REASON @string.Format("{0:##,###.##}", tool.Downtime) @tool.MostRecentEvent.COMMENT diff --git a/ReportingServices.UI/wwwroot/Assets/SLLTools.json b/ReportingServices.UI/wwwroot/Assets/SLLTools.json index 76f28fb..79d6877 100644 --- a/ReportingServices.UI/wwwroot/Assets/SLLTools.json +++ b/ReportingServices.UI/wwwroot/Assets/SLLTools.json @@ -1 +1 @@ -[{"Date":"2023-01-09T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-10T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-11T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-12T00:00:00-07:00","ASM":7,"HTR":16},{"Date":"2023-01-13T00:00:00-07:00","ASM":7,"HTR":15},{"Date":"2023-01-14T00:00:00-07:00","ASM":8,"HTR":15},{"Date":"2023-01-15T00:00:00-07:00","ASM":9,"HTR":15},{"Date":"2023-01-17T00:00:00-07:00","ASM":9,"HTR":15}] \ No newline at end of file +[{"Date":"2023-01-09T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-10T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-11T00:00:00-07:00","ASM":8,"HTR":16},{"Date":"2023-01-12T00:00:00-07:00","ASM":7,"HTR":16},{"Date":"2023-01-13T00:00:00-07:00","ASM":7,"HTR":15},{"Date":"2023-01-14T00:00:00-07:00","ASM":8,"HTR":15},{"Date":"2023-01-15T00:00:00-07:00","ASM":9,"HTR":15},{"Date":"2023-01-17T00:00:00-07:00","ASM":9,"HTR":15},{"Date":"2023-01-18T00:00:00-07:00","ASM":9,"HTR":15}] \ No newline at end of file