diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs index 2da19533..d91907a0 100644 --- a/MP.SPEC/Components/ListDossiers.razor.cs +++ b/MP.SPEC/Components/ListDossiers.razor.cs @@ -76,6 +76,12 @@ namespace MP.SPEC.Components #endregion Public Methods + #region Protected Fields + + protected string selAzienda = "*"; + + #endregion Protected Fields + #region Protected Properties [Inject] @@ -219,7 +225,8 @@ namespace MP.SPEC.Components { ListGruppiFase = await MDService.ElencoGruppiFase(); ListStati = await MDService.AnagStatiComm(); - ListArticoli = await MDService.ArticoliGetSearch(100000, "BAGLIETTO", ""); + selAzienda = await MDService.tryGetConfig("AZIENDA"); + ListArticoli = await MDService.ArticoliGetSearch(100000, selAzienda, ""); ListMacchine = await MDService.MacchineGetAll(); await reloadData(true); } diff --git a/MP.SPEC/Components/SelFilterXDL.razor b/MP.SPEC/Components/SelFilterXDL.razor new file mode 100644 index 00000000..725429e9 --- /dev/null +++ b/MP.SPEC/Components/SelFilterXDL.razor @@ -0,0 +1,89 @@ + +
+
+

FILTRI

+ +
+
+
+
+ Seleziona i filtri per: +
+
+
+ +
+ +
+
+ + +
+
+
+ +
+ +
+
+ + +
+
+
+ +
+ +
+
+ + +
+
+ @if (!isActive) + { +
+ +
+
+ + +
+
+ +
+
+ + +
+ } +
+
+ diff --git a/MP.SPEC/Components/SelFilterXDL.razor.cs b/MP.SPEC/Components/SelFilterXDL.razor.cs new file mode 100644 index 00000000..c48621e8 --- /dev/null +++ b/MP.SPEC/Components/SelFilterXDL.razor.cs @@ -0,0 +1,80 @@ +using Microsoft.AspNetCore.Components; +using MP.Data.DatabaseModels; +using MP.SPEC.Data; + +namespace MP.SPEC.Components +{ + public partial class SelFilterXDL + { + #region Public Properties + + [Parameter] + public SelectOdlParams currFilter { get; set; } = new SelectOdlParams(); + + [Parameter] + public List? ListGruppiFase { get; set; } = null; + + [Parameter] + public List? ListMacchine { get; set; } = null; + + [Parameter] + public List? ListStati { get; set; } = null; + + #endregion Public Properties + + #region Protected Properties + + protected bool isActive + { + get => currFilter.IsActive; + set => currFilter.IsActive = value; + } + + protected DateTime selDtEnd + { + get => currFilter.DtEnd; + set + { + if (currFilter.DtEnd != value) + { + currFilter.DtEnd = value; + } + } + } + + protected DateTime selDtStart + { + get => currFilter.DtStart; + set + { + if (currFilter.DtStart != value) + { + currFilter.DtStart = value; + } + } + } + + #endregion Protected Properties + + #region Private Properties + + private string selMacchina + { + get => currFilter.IdxMacchina; + set => currFilter.IdxMacchina = value; + } + + private string selReparto + { + get => currFilter.CodReparto; + set => currFilter.CodReparto = value; + } + private string selStato + { + get => currFilter.CodStato; + set => currFilter.CodStato = value; + } + + #endregion Private Properties + } +} \ No newline at end of file diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index e76e0a6b..366df473 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -499,7 +499,36 @@ namespace MP.SPEC.Data /// public Task> ElencoGruppiFase() { - return Task.FromResult(dbController.AnagGruppiFase()); +#if false + return Task.FromResult(dbController.AnagGruppiFase()); +#endif + List result = new List(); + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + string readType = "DB"; + string currKey = $"{redisAnagGruppi}"; + // cerco in redis dato valore sel macchina... + RedisValue rawData = redisDb.StringGet(currKey); + if (rawData.HasValue) + { + result = JsonConvert.DeserializeObject>($"{rawData}"); + readType = "REDIS"; + } + else + { + result = dbController.AnagGruppiFase(); + // serializzo e salvo... + rawData = JsonConvert.SerializeObject(result); + redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache / 5)); + } + if (result == null) + { + result = new List(); + } + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Debug($"ElencoGruppiFase | Read from {readType}: {ts.TotalMilliseconds}ms"); + return Task.FromResult(result); } public Task> ElencoLink() @@ -1150,6 +1179,8 @@ namespace MP.SPEC.Data #region Private Fields + private const string redisAnagGruppi = redisBaseAddr + "SPEC:Cache:AnagGruppi"; + private const string redisArtByDossier = redisBaseAddr + "SPEC:Cache:ArtByDossier"; private const string redisArtList = redisBaseAddr + "SPEC:Cache:ArtList"; diff --git a/MP.SPEC/Data/SelectOdlParams.cs b/MP.SPEC/Data/SelectOdlParams.cs index 87f4defe..89742f21 100644 --- a/MP.SPEC/Data/SelectOdlParams.cs +++ b/MP.SPEC/Data/SelectOdlParams.cs @@ -13,6 +13,7 @@ namespace MP.SPEC.Data #region Public Properties + public string CodReparto { get; set; } = "*"; public string CodStato { get; set; } = "*"; public string IdxMacchina { get; set; } = "*"; public int CurrPage { get; set; } = 1; diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 45554cf4..21a97290 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2211.2410 + 6.16.2211.2411 diff --git a/MP.SPEC/Pages/ODL.razor b/MP.SPEC/Pages/ODL.razor index bd021744..a32fd4ae 100644 --- a/MP.SPEC/Pages/ODL.razor +++ b/MP.SPEC/Pages/ODL.razor @@ -41,7 +41,8 @@ -
+ + @*

FILTRI

@@ -55,17 +56,17 @@
- +
- - - @if (ListStati != null) + @if (ListMacchine != null) { - foreach (var item in ListStati) + foreach (var item in ListMacchine) { - + } } @@ -90,6 +91,25 @@
+
+ +
+ +
+
+ + +
+
@if (!isActive) {
@@ -108,7 +128,7 @@
}
-
+
*@ diff --git a/MP.SPEC/Pages/ODL.razor.cs b/MP.SPEC/Pages/ODL.razor.cs index 155410dc..f17bc964 100644 --- a/MP.SPEC/Pages/ODL.razor.cs +++ b/MP.SPEC/Pages/ODL.razor.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; +using MP.Data.DatabaseModels; using MP.SPEC.Components; using MP.SPEC.Data; @@ -94,8 +95,14 @@ namespace MP.SPEC.Pages currPage = newNum; } + private List? ListGruppiFase { get; set; } = null; protected override async Task OnInitializedAsync() { + var allGruppiData = await MDService.ElencoGruppiFase(); + if (allGruppiData != null) + { + ListGruppiFase = allGruppiData.Where(x => x.SelEnabled).ToList(); + } ListStati = await MDService.AnagStatiComm(); ListMacchine = await MDService.MacchineWithFlux(currFilter.DtStart, currFilter.DtEnd); padCodXdl = await MDService.tryGetConfig("padCodXdl"); diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 5d01359d..722d911f 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2211.2410

+

Versione: 6.16.2211.2411


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index ca2c4e8f..0e38d7fa 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2211.2410 +6.16.2211.2411 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 96f7f037..8b5ee031 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2211.2410 + 6.16.2211.2411 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