From aebae6b4065b2767a37cdf726d41aef9910f97ad Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 18 Oct 2022 20:01:53 +0200 Subject: [PATCH] Update selezione dossier: - selezione x periodo - ancora check ottimizzazione sel distinct --- MP.Data/Controllers/MpSpecController.cs | 9 ++++---- MP.SPEC/Components/DossiersFilter.razor | 19 ++++++++++++++-- MP.SPEC/Components/DossiersFilter.razor.cs | 23 +++++++++++++++++-- MP.SPEC/Components/ListDossiers.razor.cs | 8 +++++-- MP.SPEC/Components/ParamsFilter.razor | 1 - MP.SPEC/Components/ParamsFilter.razor.cs | 7 +++--- MP.SPEC/Data/MpDataService.cs | 10 ++++----- MP.SPEC/Data/SelectDossierParams.cs | 4 +--- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Pages/DOSS.razor | 26 ++++++++++------------ MP.SPEC/Pages/PARAMS.razor | 2 -- MP.SPEC/Pages/PARAMS.razor.cs | 2 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 15 files changed, 74 insertions(+), 45 deletions(-) diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index bd8d87de..535274d2 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -333,10 +333,10 @@ namespace MP.Data.Controllers /// /// * = tutte, altrimenti solo x una data macchina /// * = tutti, altrimenti solo x un dato articolo - /// Data di riferimento (Massima) per estrazioen records - /// numero massimo record da restituire + /// Data minima per estrazione records + /// Data Massima per estrazione records /// - public List DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtRef, int MaxRec) + public List DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtStart, DateTime DtEnd) { List dbResult = new List(); using (var dbCtx = new MoonProContext(_configuration)) @@ -344,12 +344,11 @@ namespace MP.Data.Controllers dbResult = dbCtx .DbSetDossiers .AsNoTracking() - .Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && (CodArticolo == "*" || x.OdlNav.CodArticolo == CodArticolo) && x.DtRif <= DtRef) + .Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && (CodArticolo == "*" || x.OdlNav.CodArticolo == CodArticolo) && (x.DtRif >= DtStart && x.DtRif <= DtEnd)) .Include(m => m.MachineNav) .Include(o => o.OdlNav) .Include(a => a.OdlNav.ArticoloNav) .OrderByDescending(x => x.DtRif) - .Take(MaxRec) .ToList(); } return dbResult; diff --git a/MP.SPEC/Components/DossiersFilter.razor b/MP.SPEC/Components/DossiersFilter.razor index 9d549e93..7a6a8689 100644 --- a/MP.SPEC/Components/DossiersFilter.razor +++ b/MP.SPEC/Components/DossiersFilter.razor @@ -37,7 +37,22 @@ } -
+ +
+ +
+
+ + +
+
+ +
+
+ + +
+ @*
@@ -49,7 +64,7 @@ -
+ *@ diff --git a/MP.SPEC/Components/DossiersFilter.razor.cs b/MP.SPEC/Components/DossiersFilter.razor.cs index 3e5694c1..f5dd2bbe 100644 --- a/MP.SPEC/Components/DossiersFilter.razor.cs +++ b/MP.SPEC/Components/DossiersFilter.razor.cs @@ -39,7 +39,7 @@ namespace MP.SPEC.Components } } - protected DateTime selDtRef + protected DateTime selDtMax { get { @@ -56,6 +56,23 @@ namespace MP.SPEC.Components } } + protected DateTime selDtMin + { + get + { + return SelFilterDossier.DtStart; + } + + set + { + if (!SelFilterDossier.DtStart.Equals(value)) + { + SelFilterDossier.DtStart = value; + reportChange(); + } + } + } + protected string selMacchina { get @@ -101,7 +118,9 @@ namespace MP.SPEC.Components protected override async Task OnInitializedAsync() { SelFilterDossier = new SelectDossierParams(); - ListMacchine = await MDService.MacchineWithFlux(SelFilterDossier.DtStart, SelFilterDossier.DtEnd); + DateTime dtEnd = SelFilterDossier.DtEnd; + DateTime dtStart = dtEnd.Subtract(SelFilterDossier.DtStart).TotalDays < 15 ? SelFilterDossier.DtStart : dtEnd.AddDays(-14); + ListMacchine = await MDService.MacchineWithFlux(dtStart, dtEnd); ListArticoli = await MDService.ArticleWithDossier(); await FilterChanged.InvokeAsync(SelFilterDossier); } diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs index 99255735..b3882a7b 100644 --- a/MP.SPEC/Components/ListDossiers.razor.cs +++ b/MP.SPEC/Components/ListDossiers.razor.cs @@ -185,10 +185,14 @@ namespace MP.SPEC.Components get => SelFilter.CodArticolo; } - private DateTime SelDtRef + private DateTime SelDtEnd { get => SelFilter.DtEnd; } + private DateTime SelDtStart + { + get => SelFilter.DtStart; + } private string SelMacchina { @@ -222,7 +226,7 @@ namespace MP.SPEC.Components private async Task reloadData(bool setChanged) { isLoading = true; - SearchRecords = await MDService.DossiersGetLastFilt(SelMacchina, SelArticolo, SelDtRef, MaxRecord); + SearchRecords = await MDService.DossiersGetLastFilt(SelMacchina, SelArticolo, SelDtStart, SelDtEnd); totalCount = SearchRecords.Count; ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); await Task.Delay(1); diff --git a/MP.SPEC/Components/ParamsFilter.razor b/MP.SPEC/Components/ParamsFilter.razor index 06434455..769761eb 100644 --- a/MP.SPEC/Components/ParamsFilter.razor +++ b/MP.SPEC/Components/ParamsFilter.razor @@ -1,7 +1,6 @@
- @if (!liveUpdate) {
} + @if (isLoading) + { + + } + else + { + + } +
+ - @if (isLoading) - { - - } - else - { - - }
- - - diff --git a/MP.SPEC/Pages/PARAMS.razor b/MP.SPEC/Pages/PARAMS.razor index 8b4777f0..43c1c7b9 100644 --- a/MP.SPEC/Pages/PARAMS.razor +++ b/MP.SPEC/Pages/PARAMS.razor @@ -32,5 +32,3 @@ - - diff --git a/MP.SPEC/Pages/PARAMS.razor.cs b/MP.SPEC/Pages/PARAMS.razor.cs index 8d05027f..e30c73ad 100644 --- a/MP.SPEC/Pages/PARAMS.razor.cs +++ b/MP.SPEC/Pages/PARAMS.razor.cs @@ -128,7 +128,7 @@ namespace MP.SPEC.Pages if (newParams.CurrPage == 0) { newParams.CurrPage = 1; - newParams.LiveUpdate = false; + //newParams.LiveUpdate = false; } else { diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 8de38dd8..38873420 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2210.1819

+

Versione: 6.16.2210.1820


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 4782147c..57be2c69 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.1819 +6.16.2210.1820 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index eb0c777c..c55595cd 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.1819 + 6.16.2210.1820 https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html false