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 @@