inizio aggiunta mostra filtri +
filtro x data funzionante
This commit is contained in:
@@ -600,7 +600,7 @@ namespace MP.Data.Controllers
|
||||
/// <param name="idxMacchina">Macchina</param>
|
||||
/// <param name="codGruppo">Gruppo</param>
|
||||
/// <returns></returns>
|
||||
public List<PODLExpModel> ListPODLFilt(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo)
|
||||
public List<PODLExpModel> ListPODLFilt(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo, DateTime startDate, DateTime endDate)
|
||||
{
|
||||
|
||||
List<PODLExpModel> dbResult = new List<PODLExpModel>();
|
||||
@@ -610,10 +610,12 @@ namespace MP.Data.Controllers
|
||||
var KeyRich = new SqlParameter("@KeyRich", keyRichPart);
|
||||
var IdxMacc = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
var CodGrp = new SqlParameter("@CodGruppo", codGruppo);
|
||||
var DateFrom = new SqlParameter("@DateFrom", startDate);
|
||||
var DateTo = new SqlParameter("@DateTo", endDate);
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetPODLExp
|
||||
.FromSqlRaw("EXEC stp_PODL_getByFiltSpec @Lanciato, @KeyRich, @CodGruppo, @IdxMacchina", Lanc, KeyRich, CodGrp, IdxMacc)
|
||||
.FromSqlRaw("EXEC stp_PODL_getByFiltSpec @Lanciato, @KeyRich, @CodGruppo, @IdxMacchina, @DateFrom, @DateFrom", Lanc, KeyRich, CodGrp, IdxMacc, DateFrom, DateTo)
|
||||
.AsNoTracking()
|
||||
//.AsEnumerable()
|
||||
.ToList();
|
||||
|
||||
@@ -221,6 +221,31 @@ namespace MP.SPEC.Components
|
||||
|
||||
#region Private Properties
|
||||
|
||||
|
||||
private DateTime selDtStart
|
||||
{
|
||||
get => actFilter.DtStart;
|
||||
set
|
||||
{
|
||||
if (!actFilter.DtStart.Equals(value))
|
||||
{
|
||||
actFilter.DtStart = value;
|
||||
currPage = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
private DateTime selDtEnd
|
||||
{
|
||||
get => actFilter.DtEnd;
|
||||
set
|
||||
{
|
||||
if (!actFilter.DtEnd.Equals(value))
|
||||
{
|
||||
actFilter.DtEnd = value;
|
||||
currPage = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
private int _totalCount { get; set; } = 0;
|
||||
|
||||
private int currPage
|
||||
@@ -393,7 +418,7 @@ namespace MP.SPEC.Components
|
||||
{
|
||||
ListRecords = null;
|
||||
isLoading = true;
|
||||
SearchRecords = await MDService.ListPODLFilt(hasOdl, StatoSel, macchina, reparto);
|
||||
SearchRecords = await MDService.ListPODLFilt(hasOdl, StatoSel, macchina, reparto, selDtStart, selDtEnd);
|
||||
totalCount = SearchRecords.Count;
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
|
||||
@@ -701,14 +701,16 @@ namespace MP.SPEC.Data
|
||||
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
|
||||
/// <param name="idxMacchina">Macchina</param>
|
||||
/// <param name="codGruppo">Gruppo</param>
|
||||
/// <param name="startDate">Data inizio</param>
|
||||
/// <param name="endDate">Data fine</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<PODLExpModel>> ListPODLFilt(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo)
|
||||
public async Task<List<PODLExpModel>> ListPODLFilt(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo, DateTime startDate, DateTime endDate)
|
||||
{
|
||||
List<PODLExpModel>? result = new List<PODLExpModel>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
string readType = "DB";
|
||||
string currKey = $"{redisPOdlList}:{codGruppo}:{idxMacchina}:{keyRichPart}:{lanciato}";
|
||||
string currKey = $"{redisPOdlList}:{codGruppo}:{idxMacchina}:{keyRichPart}:{lanciato}:{startDate:yyyyMMdd_HHmmss}:{endDate:yyyyMMdd_HHmmss}";
|
||||
// cerco in redis dato valore sel macchina...
|
||||
RedisValue rawData = redisDb.StringGet(currKey);
|
||||
if (rawData.HasValue)
|
||||
@@ -718,7 +720,7 @@ namespace MP.SPEC.Data
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(dbController.ListPODLFilt(lanciato, keyRichPart, idxMacchina, codGruppo));
|
||||
result = await Task.FromResult(dbController.ListPODLFilt(lanciato, keyRichPart, idxMacchina, codGruppo, startDate, endDate));
|
||||
// serializzo e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(redisShortTimeCache));
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP.SPEC</RootNamespace>
|
||||
<Version>6.16.2211.2908</Version>
|
||||
<Version>6.16.2211.2910</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -142,9 +142,11 @@ namespace MP.SPEC.Pages
|
||||
}
|
||||
protected void setDtMax()
|
||||
{
|
||||
// copio il filtro
|
||||
currFilter.DtEnd = RoundDatetime(5);
|
||||
currFilter.DtStart = RoundDatetime(5).AddDays(-10);
|
||||
if (currFilter.HasOdl == true)
|
||||
{
|
||||
currFilter.DtEnd = RoundDatetime(5);
|
||||
currFilter.DtStart = RoundDatetime(5).AddDays(-10);
|
||||
}
|
||||
}
|
||||
|
||||
protected void UpdateTotCount(int newTotCount)
|
||||
|
||||
+42
-45
@@ -3,57 +3,54 @@
|
||||
|
||||
<div class="card mb-5">
|
||||
<div class="card-header table-primary">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="col-6 col-lg-8">
|
||||
<div class="d-flex">
|
||||
<div class="px-2 col-5">
|
||||
<h3><b>P</b>romesse <b>ODL</b></h3>
|
||||
</div>
|
||||
<div class="col-4 align-content-center">
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-text">
|
||||
<span class="me-1" title="Elenco PODL disponibili da produrre">Da Produrre</span>
|
||||
<div class="form-check form-check-sm form-switch py-1" title="Parameter View Mode (RealTime / LogData)">
|
||||
<input class="form-check-input" type="checkbox" name="setupAlarms" @onclick="()=> toggleClosed()">
|
||||
</div>
|
||||
<span class="" title="Elenco PODL già lanciati/prodotti">Lanciati</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between col-12">
|
||||
<div class="px-2 col-3">
|
||||
<h3><b>P</b>romesse <b>ODL</b></h3>
|
||||
</div>
|
||||
<div class="col-3 d-flex justify-content-between">
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-text">
|
||||
<span class="me-1" title="Elenco PODL disponibili da produrre">Da Produrre</span>
|
||||
<div class="form-check form-check-sm form-switch py-1" title="Parameter View Mode (RealTime / LogData)">
|
||||
<input class="form-check-input" type="checkbox" name="setupAlarms" @onclick="()=> toggleClosed()">
|
||||
</div>
|
||||
|
||||
<span class="" title="Elenco PODL già lanciati/prodotti">Lanciati</span>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
@if (addEnabled)
|
||||
@if (addEnabled)
|
||||
{
|
||||
<button class="btn btn-success" @onclick="() => reqNewPODL()">Nuovo PODL <i class="bi bi-plus-square"></i></button>
|
||||
}
|
||||
</div>
|
||||
|
||||
@* <div class="px-2">
|
||||
|
||||
</div>*@
|
||||
</div>
|
||||
<div class="col-6">
|
||||
@if (filtActive)
|
||||
{
|
||||
<div class=" rounded small d-flex justify-content-between" title="Filtri attivi">
|
||||
@*<i class="fas fa-exclamation text-warning"></i>*@
|
||||
@if (selReparto != "*")
|
||||
{
|
||||
<button class="btn btn-success" @onclick="() => reqNewPODL()">Nuovo PODL <i class="bi bi-plus-square"></i></button>
|
||||
<button class="btn btn-outline-primary btn-sm mx-2" @onclick="()=>resetReparto()" title="Rimuovi Filtro Reparto"><i class="fa-solid fa-building"></i>   <i class="fa-solid fa-xmark text-warning"></i></button>
|
||||
}
|
||||
@if (macchina != "*")
|
||||
{
|
||||
<button class="btn btn-outline-primary btn-sm mx-2" @onclick="()=>resetMacchina()" title="Rimuovi Filtro Impianto"><i class="fa-solid fa-hard-drive"></i>   <i class="fa-solid fa-xmark text-warning"></i></button>
|
||||
}
|
||||
@if (StatoSel != "*")
|
||||
{
|
||||
<button class="btn btn-outline-primary btn-sm mx-2" @onclick="()=>resetFase()" title="Rimuovi Filtro Parametro"><i class="fa-solid fa-sliders"></i>   <i class="fa-solid fa-xmark text-warning"></i></button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-5 col-lg-4">
|
||||
}
|
||||
@if (hasOdl)
|
||||
{
|
||||
<span class="badge bg-secondary mx-2 text-nowrap" title="Filtro Data inizio attivo">@selDtStart   <i class="fa-solid fa-calendar-days"></i></span>
|
||||
<span class="badge bg-secondary mx-2 text-nowrap" title="Filtro Data fine attivo">@selDtEnd   <i class="fa-solid fa-calendar-days"></i></span>
|
||||
}
|
||||
<div class="input-group input-group-sm d-flex flex-row-reverse">
|
||||
@*<label class="input-group-text" for="maxRecord" title="Selezionare l'azienda da visualizzare"><i class="fa-solid fa-industry"></i></label>
|
||||
<select @bind="@currAzienda" class="form-select" title="Selezionare l'azienda da visualizzare">
|
||||
@if (ListAziende != null)
|
||||
{
|
||||
foreach (var item in ListAziende)
|
||||
{
|
||||
<option value="@item.CodGruppo">@item.DescrGruppo</option>
|
||||
}
|
||||
}
|
||||
</select>*@
|
||||
@*<label class="input-group-text" for="maxRecord" title="Selezionare la fase da visualizzare"><i class="fa-solid fa-screwdriver-wrench"></i></label>
|
||||
<select @bind="@currFase" class="form-select" title="Selezionare la fase da visualizzare">
|
||||
<option value="*">--- Tutti ---</option>
|
||||
@if (ListStati != null)
|
||||
{
|
||||
|
||||
foreach (var item in ListStati)
|
||||
{
|
||||
<option value="@item.value">@item.label</option>
|
||||
}
|
||||
}
|
||||
</select>*@
|
||||
@*<SelFilterPODL currFilter="@currFilter" ListMacchine="@ListMacchine" ListStati="@ListStati" ListGruppiFase="@ListGruppiFase" FilterChanged="updateFilter"></SelFilterPODL>*@
|
||||
<SelFilterXDL currFilter="@currFilter" ListMacchine="@ListMacchine" ListStati="@ListStati" ListGruppiFase="@ListGruppiFase" FilterChanged="updateFilter"></SelFilterXDL>
|
||||
<div class="p-2">
|
||||
<a class="pt-2 text-dark" data-bs-toggle="offcanvas" data-bs-target="#paramsFilterExample" aria-controls="paramsFilterExample">
|
||||
|
||||
@@ -60,6 +60,20 @@ namespace MP.SPEC.Pages
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
protected void resetFase()
|
||||
{
|
||||
StatoSel = "*";
|
||||
}
|
||||
|
||||
protected void resetMacchina()
|
||||
{
|
||||
macchina = "*";
|
||||
}
|
||||
protected void resetReparto()
|
||||
{
|
||||
selReparto = "*";
|
||||
}
|
||||
|
||||
protected void ForceReload(int newNum)
|
||||
{
|
||||
numRecord = newNum;
|
||||
@@ -96,7 +110,7 @@ namespace MP.SPEC.Pages
|
||||
}
|
||||
ListMacchine = await MDService.MacchineGetAll();
|
||||
ListStati = await MDService.AnagStatiComm();
|
||||
SearchRecords = await MDService.ListPODLFilt(hasOdl, StatoSel, macchina, selReparto);
|
||||
//SearchRecords = await MDService.ListPODLFilt(hasOdl, StatoSel, macchina, selReparto, selDtStart, selDtEnd);
|
||||
currAzienda = await MDService.tryGetConfig("AZIENDA");
|
||||
padCodXdl = await MDService.tryGetConfig("padCodXdl");
|
||||
// carico dati
|
||||
@@ -189,6 +203,8 @@ namespace MP.SPEC.Pages
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void UpdateTotCount(int newTotCount)
|
||||
{
|
||||
totalCount = newTotCount;
|
||||
@@ -282,6 +298,30 @@ namespace MP.SPEC.Pages
|
||||
}
|
||||
}
|
||||
}
|
||||
private DateTime selDtStart
|
||||
{
|
||||
get => currFilter.DtStart;
|
||||
set
|
||||
{
|
||||
if (!currFilter.DtStart.Equals(value))
|
||||
{
|
||||
currFilter.DtStart = value;
|
||||
currPage = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
private DateTime selDtEnd
|
||||
{
|
||||
get => currFilter.DtEnd;
|
||||
set
|
||||
{
|
||||
if (!currFilter.DtEnd.Equals(value))
|
||||
{
|
||||
currFilter.DtEnd = value;
|
||||
currPage = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private SelectXdlParams currFilter { get; set; } = new SelectXdlParams();
|
||||
|
||||
@@ -347,6 +387,11 @@ namespace MP.SPEC.Pages
|
||||
set => currFilter.TotCount = value;
|
||||
}
|
||||
|
||||
private bool filtActive
|
||||
{
|
||||
get => macchina != "*" || StatoSel != "*" || selReparto != "*";
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2211.2908</h4>
|
||||
<h4>Versione: 6.16.2211.2910</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2211.2908
|
||||
6.16.2211.2910
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2211.2908</version>
|
||||
<version>6.16.2211.2910</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user