diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index d9dc302b..04a91d61 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -600,7 +600,7 @@ namespace MP.Data.Controllers /// Macchina /// Gruppo /// - public List ListPODLFilt(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo) + public List ListPODLFilt(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo, DateTime startDate, DateTime endDate) { List dbResult = new List(); @@ -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(); diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index 5ee60510..61b074d0 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -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); diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index e9357190..9fcf22f3 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -701,14 +701,16 @@ namespace MP.SPEC.Data /// KeyRich (parziale) da cercare (es cod stato x yacht) /// Macchina /// Gruppo + /// Data inizio + /// Data fine /// - public async Task> ListPODLFilt(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo) + public async Task> ListPODLFilt(bool lanciato, string keyRichPart, string idxMacchina, string codGruppo, DateTime startDate, DateTime endDate) { List? result = new List(); 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)); diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index ecdd0715..fe3ed6c3 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2211.2908 + 6.16.2211.2910 diff --git a/MP.SPEC/Pages/ODL.razor.cs b/MP.SPEC/Pages/ODL.razor.cs index 5a4ee2de..fb11ee4f 100644 --- a/MP.SPEC/Pages/ODL.razor.cs +++ b/MP.SPEC/Pages/ODL.razor.cs @@ -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) diff --git a/MP.SPEC/Pages/PODL.razor b/MP.SPEC/Pages/PODL.razor index c9a05e53..196b07e5 100644 --- a/MP.SPEC/Pages/PODL.razor +++ b/MP.SPEC/Pages/PODL.razor @@ -3,57 +3,54 @@
-
-
-
-
-

Promesse ODL

-
-
-
-
- Da Produrre -
- -
- Lanciati -
+
+
+

Promesse ODL

+
+
+
+
+ Da Produrre +
+
- + Lanciati
-
- @if (addEnabled) + @if (addEnabled) + { + + } +
+ + @*
+ +
*@ +
+
+ @if (filtActive) + { +
+ @**@ + @if (selReparto != "*") { - + + } + @if (macchina != "*") + { + + } + @if (StatoSel != "*") + { + }
-
-
-
+ } + @if (hasOdl) + { + @selDtStart   + @selDtEnd   + }
- @* - *@ - @* - *@ - @**@
diff --git a/MP.SPEC/Pages/PODL.razor.cs b/MP.SPEC/Pages/PODL.razor.cs index 92b1d249..4b106ce5 100644 --- a/MP.SPEC/Pages/PODL.razor.cs +++ b/MP.SPEC/Pages/PODL.razor.cs @@ -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 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index b3a9c38b..8936904e 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2211.2908

+

Versione: 6.16.2211.2910


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index b1afe6a1..56715376 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2211.2908 +6.16.2211.2910 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 969aadea..f4c4f84c 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2211.2908 + 6.16.2211.2910 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