Added Category Description to downed tools table

This commit is contained in:
Daniel Wathen
2023-01-18 12:19:35 -07:00
parent 9cccd00fed
commit 930360a7a9
5 changed files with 38 additions and 22 deletions

View File

@ -14,4 +14,6 @@ public class ReactorEvent
public string REACT_MODE { get; set; } public string REACT_MODE { get; set; }
[JsonPropertyName("COMMENT")] [JsonPropertyName("COMMENT")]
public string COMMENT { get; set; } public string COMMENT { get; set; }
[JsonPropertyName("CAT_PROB_DESC")]
public string CAT_PROB_DESC { get; set; }
} }

View File

@ -322,10 +322,15 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
" EVENT_DTM, " + " EVENT_DTM, " +
" COMMENT AS REASON, " + " COMMENT AS REASON, " +
" REACT_MODE, " + " REACT_MODE, " +
" (SELECT TOP 1 NOTES " + " (SELECT TOP 1 NOTES " +
" FROM REACTOR_LOG_NOTES rnote " + " FROM REACTOR_LOG_NOTES rnote " +
" WHERE rmode.START_RL_ID = rnote.SEQ " + " 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 " + " FROM REACT_EVENT revnt, REACT_MODE rmode " +
" WHERE EVENT_DTM > @startDate " + " WHERE EVENT_DTM > @startDate " +
" AND EVENT_DTM < @endDate " + " AND EVENT_DTM < @endDate " +
@ -336,15 +341,20 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
" AND REACT_MODE = MODE " + " AND REACT_MODE = MODE " +
"UNION ALL " + "UNION ALL " +
"SELECT * " + "SELECT * " +
" FROM " + " FROM " +
" (SELECT TOP 1 " + " (SELECT TOP 1 " +
" revnt.REACT_NO, " + " revnt.REACT_NO, " +
" EVENT_DTM, COMMENT AS REASON, " + " EVENT_DTM, COMMENT AS REASON, " +
" REACT_MODE, " + " REACT_MODE, " +
" (SELECT TOP 1 NOTES " + " (SELECT TOP 1 NOTES " +
" FROM REACTOR_LOG_NOTES rnote " + " FROM REACTOR_LOG_NOTES rnote " +
" WHERE rmode.START_RL_ID = rnote.SEQ " + " 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 " + " FROM REACT_EVENT revnt, REACT_MODE rmode " +
" WHERE EVENT_DTM < @startDate " + " WHERE EVENT_DTM < @startDate " +
" AND revnt.REACT_NO = @reactorNumber " + " AND revnt.REACT_NO = @reactorNumber " +
@ -352,7 +362,7 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
" AND revnt.REACT_NO = rmode.REACT_NO " + " AND revnt.REACT_NO = rmode.REACT_NO " +
" AND LOGGED_BY = START_USER " + " AND LOGGED_BY = START_USER " +
" AND REACT_MODE = MODE ORDER BY EVENT_DTM DESC) AS tbl1 " + " 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.CommandText = query;
_ = cmd.Parameters.AddWithValue("@startDate", startDate); _ = cmd.Parameters.AddWithValue("@startDate", startDate);
@ -368,7 +378,8 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
EVENT_DTM = reader[1].ToString(), EVENT_DTM = reader[1].ToString(),
REASON = reader[2].ToString(), REASON = reader[2].ToString(),
REACT_MODE = reader[3].ToString(), REACT_MODE = reader[3].ToString(),
COMMENT = reader[4].ToString() COMMENT = reader[4].ToString(),
CAT_PROB_DESC = reader[5].ToString()
}); });
} }

View File

@ -1,9 +1,6 @@
using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.AspNetCore.Mvc.Testing;
using ReportingServices.Shared.HelperClasses; using ReportingServices.Shared.HelperClasses;
using ReportingServices.Shared.Models.PlanningReport;
using ReportingServices.Shared.Models.ProductionReport;
using Serilog; using Serilog;
using System.Net.Http.Json;
namespace ReportingServices.Test; namespace ReportingServices.Test;

View File

@ -110,9 +110,10 @@
<tr> <tr>
<th scope="col" style="width: 7%">Reactor</th> <th scope="col" style="width: 7%">Reactor</th>
<th scope="col" style="width: 7%">Owner</th> <th scope="col" style="width: 7%">Owner</th>
<th scope="col" style="width: 38%" class="text-start">Issue</th> <th scope="col" style="width: 20%" class="text-start">Category Description</th>
<th scope="col" style="width: 28%" class="text-start">Issue</th>
<th scope="col" style="width: 10%">Downtime</th> <th scope="col" style="width: 10%">Downtime</th>
<th scope="col" style="width: 38%" class="text-start">Most Recent Comment</th> <th scope="col" style="width: 28%" class="text-start">Most Recent Comment</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -135,6 +136,7 @@
<tr class="@myClass"> <tr class="@myClass">
<td>@tool.Reactor</td> <td>@tool.Reactor</td>
<td>@owner</td> <td>@owner</td>
<td class="text-start">@tool.MostRecentEvent.CAT_PROB_DESC</td>
<td class="text-start">@tool.MostRecentEvent.REASON</td> <td class="text-start">@tool.MostRecentEvent.REASON</td>
<td>@string.Format("{0:##,###.##}", tool.Downtime)</td> <td>@string.Format("{0:##,###.##}", tool.Downtime)</td>
<td class="text-start">@tool.MostRecentEvent.COMMENT</td> <td class="text-start">@tool.MostRecentEvent.COMMENT</td>
@ -155,9 +157,10 @@
<tr> <tr>
<th scope="col" style="width: 7%">Reactor</th> <th scope="col" style="width: 7%">Reactor</th>
<th scope="col" style="width: 7%">Owner</th> <th scope="col" style="width: 7%">Owner</th>
<th scope="col" style="width: 38%" class="text-start">Issue</th> <th scope="col" style="width: 20%" class="text-start">Category Description</th>
<th scope="col" style="width: 28%" class="text-start">Issue</th>
<th scope="col" style="width: 10%">Downtime</th> <th scope="col" style="width: 10%">Downtime</th>
<th scope="col" style="width: 38%" class="text-start">Most Recent Comment</th> <th scope="col" style="width: 28%" class="text-start">Most Recent Comment</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -180,6 +183,7 @@
<tr class="@myClass"> <tr class="@myClass">
<td>@tool.Reactor</td> <td>@tool.Reactor</td>
<td>@owner</td> <td>@owner</td>
<td class="text-start">@tool.MostRecentEvent.CAT_PROB_DESC</td>
<td class="text-start">@tool.MostRecentEvent.REASON</td> <td class="text-start">@tool.MostRecentEvent.REASON</td>
<td>@string.Format("{0:##,###.##}", tool.Downtime)</td> <td>@string.Format("{0:##,###.##}", tool.Downtime)</td>
<td class="text-start">@tool.MostRecentEvent.COMMENT</td> <td class="text-start">@tool.MostRecentEvent.COMMENT</td>
@ -200,9 +204,10 @@
<tr> <tr>
<th scope="col" style="width: 7%">Reactor</th> <th scope="col" style="width: 7%">Reactor</th>
<th scope="col" style="width: 7%">Owner</th> <th scope="col" style="width: 7%">Owner</th>
<th scope="col" style="width: 38%" class="text-start">Issue</th> <th scope="col" style="width: 20%" class="text-start">Category Description</th>
<th scope="col" style="width: 28%" class="text-start">Issue</th>
<th scope="col" style="width: 10%">Downtime</th> <th scope="col" style="width: 10%">Downtime</th>
<th scope="col" style="width: 38%" class="text-start">Most Recent Comment</th> <th scope="col" style="width: 28%" class="text-start">Most Recent Comment</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -225,6 +230,7 @@
<tr class="@myClass"> <tr class="@myClass">
<td>@tool.Reactor</td> <td>@tool.Reactor</td>
<td>@owner</td> <td>@owner</td>
<td class="text-start">@tool.MostRecentEvent.CAT_PROB_DESC</td>
<td class="text-start">@tool.MostRecentEvent.REASON</td> <td class="text-start">@tool.MostRecentEvent.REASON</td>
<td>@string.Format("{0:##,###.##}", tool.Downtime)</td> <td>@string.Format("{0:##,###.##}", tool.Downtime)</td>
<td class="text-start">@tool.MostRecentEvent.COMMENT</td> <td class="text-start">@tool.MostRecentEvent.COMMENT</td>

View File

@ -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}] [{"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}]