diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index e45e05e8..1b09a9c8 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -719,22 +719,7 @@ namespace MP.Data.Controllers g => g.IdxMacchina, m => m.IdxMacchina, (g, m) => m - - //(m, g) => new Macchine - //{ - // IdxMacchina = m.IdxMacchina, - // CodMacchina = m.CodMacchina, - // Descrizione = m.Descrizione, - // Nome = m.Nome, - // Note = m.Note, - // url = m.url, - // locazione = m.locazione, - // css = m.css, - // RowNum = m.RowNum, - // ColNum = m.ColNum - //} ) - //.Distinct() .AsNoTracking() .OrderBy(x => x.IdxMacchina) .ToList(); diff --git a/MP.SPEC/Components/ListDossiers.razor b/MP.SPEC/Components/ListDossiers.razor index 24efa151..8b233bdc 100644 --- a/MP.SPEC/Components/ListDossiers.razor +++ b/MP.SPEC/Components/ListDossiers.razor @@ -254,11 +254,14 @@ else
@record.IdxODL
- @if (record.IdxODL > 0) + @if (giacenzeConf == "true") { -
- APRI GIACENZE -
+ @if (record.IdxODL > 0) + { +
+ APRI GIACENZE +
+ } } diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs index 89106654..bfb14ba3 100644 --- a/MP.SPEC/Components/ListDossiers.razor.cs +++ b/MP.SPEC/Components/ListDossiers.razor.cs @@ -79,6 +79,7 @@ namespace MP.SPEC.Components #region Protected Fields protected string selAzienda = "*"; + protected string giacenzeConf = "false"; #endregion Protected Fields @@ -221,11 +222,18 @@ namespace MP.SPEC.Components } } + //prtected bool hasLic + //{ + // get => selAzienda == "GIACOVELLI"; + //} + protected override async Task OnInitializedAsync() { + await MDService.ConfigResetCache(); ListGruppiFase = await MDService.ElencoGruppiFase(); ListStati = await MDService.AnagStatiComm(); selAzienda = await MDService.tryGetConfig("AZIENDA"); + giacenzeConf = await MDService.tryGetConfig("SPEC_ShowGiacenze"); ListArticoli = await MDService.ArticoliGetSearch(100000, selAzienda, ""); ListMacchine = await MDService.MacchineGetFilt("*"); await reloadData(true); diff --git a/MP.SPEC/Components/ListGiacenze.razor b/MP.SPEC/Components/ListGiacenze.razor index 11fed2e6..64bb5423 100644 --- a/MP.SPEC/Components/ListGiacenze.razor +++ b/MP.SPEC/Components/ListGiacenze.razor @@ -2,13 +2,18 @@ - + @@ -25,13 +30,16 @@ { @foreach (var item in elencoGiacenze) { - +
# - Lotto @if (!string.IsNullOrEmpty(BatchSel)) { } + else + { + # + } + + Lotto Prodotto Tipo
@item.IdxRG - +
+ @item.IdentRG + +
diff --git a/MP.SPEC/Components/ListGiacenze.razor.cs b/MP.SPEC/Components/ListGiacenze.razor.cs index 4c3e19d4..dbe28f59 100644 --- a/MP.SPEC/Components/ListGiacenze.razor.cs +++ b/MP.SPEC/Components/ListGiacenze.razor.cs @@ -19,6 +19,22 @@ namespace MP.SPEC.Components #region Protected Properties + + public string checkSelect(AnagGiacenzeModel recordSel) + { + string answ = ""; + if (BatchSel != null) + { + try + { + answ = (BatchSel == recordSel.IdentRG) ? "table-info" : ""; + } + catch + { } + } + return answ; + } + protected List? elencoGiacenze { get; set; } = null; #endregion Protected Properties diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs index 35159bb7..a339bc42 100644 --- a/MP.SPEC/Components/ListODL.razor.cs +++ b/MP.SPEC/Components/ListODL.razor.cs @@ -1,7 +1,9 @@ using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.WebUtilities; using Microsoft.JSInterop; using MP.Data.DatabaseModels; using MP.SPEC.Data; +using MP.SPEC.Pages; using MP.SPEC.Services; using NLog; @@ -72,10 +74,15 @@ namespace MP.SPEC.Components [Inject] protected IOApiService MpIoApiCall { get; set; } = null!; + [Inject] + protected NavigationManager NavManager { get; set; } = null!; + #endregion Protected Properties #region Protected Methods + protected int odlCercato = 0; + /// /// Registra chiusura ODL alla data indicata /// @@ -138,6 +145,14 @@ namespace MP.SPEC.Components protected override async Task OnInitializedAsync() { + if (NavManager.Uri.Contains("ODL?")) + { + var uri = NavManager.ToAbsoluteUri(NavManager.Uri); + if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("IdxOdl", out var _idxOdl)) + { + odlCercato = int.Parse(_idxOdl); + } + } ListStati = await MDService.AnagStatiComm(); } @@ -411,7 +426,14 @@ namespace MP.SPEC.Components isLoading = true; SearchRecords = await MDService.ListODLFilt(currFilter.IsActive, currFilter.SearchVal, currFilter.CodFase, currFilter.CodReparto, currFilter.IdxMacchina, currFilter.DtStart, currFilter.DtEnd); totalCount = SearchRecords.Count; - ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); + if (NavManager.Uri.Contains("ODL?")) + { + ListRecords = SearchRecords.Where(x => x.IdxOdl == odlCercato).Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); + } + else + { + ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); + } await Task.Delay(1); await InvokeAsync(() => StateHasChanged()); isLoading = false; diff --git a/MP.SPEC/Components/ListOdlLotto.razor b/MP.SPEC/Components/ListOdlLotto.razor index b487dc46..810910bc 100644 --- a/MP.SPEC/Components/ListOdlLotto.razor +++ b/MP.SPEC/Components/ListOdlLotto.razor @@ -1,32 +1,31 @@  -
+
- - - - - - - - - @if (elencoODL == null || elencoODL.Count == 0) - { - - } - else - { + @if (elencoODL == null || elencoODL.Count == 0) + { + + } + else + { +
ODL
+ + + + + + @foreach (var item in elencoODL) { - + } - } - -
ODL
- + @item
+ +
+ } diff --git a/MP.SPEC/Components/ListOdlLotto.razor.cs b/MP.SPEC/Components/ListOdlLotto.razor.cs index 616e2bd3..6eede785 100644 --- a/MP.SPEC/Components/ListOdlLotto.razor.cs +++ b/MP.SPEC/Components/ListOdlLotto.razor.cs @@ -22,7 +22,7 @@ namespace MP.SPEC.Components { [Parameter] - public string BatchSel { get; set; } + public string BatchSel { get; set; } = null!; private List elencoODL { get; set; } = new List(); diff --git a/MP.SPEC/Components/SelFilterXDL.razor b/MP.SPEC/Components/SelFilterXDL.razor index 526b89cc..f3f26e8a 100644 --- a/MP.SPEC/Components/SelFilterXDL.razor +++ b/MP.SPEC/Components/SelFilterXDL.razor @@ -23,7 +23,7 @@ { foreach (var item in ListGruppiFase) { - + } } @@ -42,7 +42,7 @@ { foreach (var item in ListMacchine) { - + } } @@ -61,7 +61,7 @@ { foreach (var item in ListStati) { - + } } @@ -69,20 +69,20 @@ @if (!isActive || hasOdl) { -
- -
-
- - -
-
- -
-
- - -
+
+ +
+
+ + +
+
+ +
+
+ + +
} diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 7e766bdf..5cb0397d 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -177,7 +177,8 @@ namespace MP.SPEC.Data Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); string readType = "DB"; - string currKey = $"{redisArtList}:{azienda}"; + string sKey = string.IsNullOrEmpty(searchVal) ? "***" : searchVal; + string currKey = $"{redisArtList}:{azienda}:{sKey}"; // cerco in redis dato valore sel macchina... RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) @@ -1073,8 +1074,12 @@ namespace MP.SPEC.Data RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) { - result = JsonConvert.DeserializeObject($"{rawData}"); - readType = "REDIS"; + var rawResult = JsonConvert.DeserializeObject($"{rawData}"); + if (rawResult != null) + { + result = rawResult; + readType = "REDIS"; + } } else { diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 451d8288..b59041d0 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2211.3015 + 6.16.2212.113 diff --git a/MP.SPEC/Pages/Giacenze.razor b/MP.SPEC/Pages/Giacenze.razor index 707f13b9..6405b8bb 100644 --- a/MP.SPEC/Pages/Giacenze.razor +++ b/MP.SPEC/Pages/Giacenze.razor @@ -1,68 +1,77 @@ @page "/Giacenze" -
-
-
-
-

Giacenze

-
- @if (odlExp == null) - { - - } - else - { -
-
- ODL @(odlExp.IdxOdl.ToString(padCodXdl)) -
-
-
- @odlExp.DataInizio -
-
- >> -
-
- @odlExp.DataFine -
-
+@if (giacenzeConf == "false") +{ +
NOT ALLOWED
+} +else +{ +
+
+
+
+

Giacenze

-
-
- @odlExp.CodArticolo -
-
- @odlExp.DescArticolo -
- -
- } -
-
-
- @if (IdxOdl == 0) - { - - } - else - { -
-
- -
- @if (!string.IsNullOrEmpty(BatchSel)) + @if (odlExp == null) { -
- + + } + else + { +
+
+ ODL @(odlExp.IdxOdl.ToString(padCodXdl)) +
+
+
+ @odlExp.DataInizio +
+
+ >> +
+
+ @odlExp.DataFine +
+
+
+
+
+ @odlExp.CodArticolo +
+
+ @odlExp.DescArticolo +
+
}
- } -
- @* +
+ @if (IdxOdl == 0) + { + + } + else + { +
+
+
+ +
+ @if (!string.IsNullOrEmpty(BatchSel)) + { +
+ +
+ } +
+
+ } +
+ @**@ -
+
+} diff --git a/MP.SPEC/Pages/Giacenze.razor.cs b/MP.SPEC/Pages/Giacenze.razor.cs index 9469246a..8fed01fe 100644 --- a/MP.SPEC/Pages/Giacenze.razor.cs +++ b/MP.SPEC/Pages/Giacenze.razor.cs @@ -26,6 +26,8 @@ namespace MP.SPEC.Pages protected override async Task OnInitializedAsync() { + await MDService.ConfigResetCache(); + giacenzeConf = await MDService.tryGetConfig("SPEC_ShowGiacenze"); await Task.Delay(1); padCodXdl = await MDService.tryGetConfig("padCodXdl"); var uri = NavManager.ToAbsoluteUri(NavManager.Uri); @@ -47,6 +49,7 @@ namespace MP.SPEC.Pages private NavigationManager NavManager { get; set; } = null!; private string padCodXdl { get; set; } = "00000"; + private string giacenzeConf = "false"; [Inject] private ISessionStorageService sessionStorage { get; set; } = null!; diff --git a/MP.SPEC/Pages/PODL.razor b/MP.SPEC/Pages/PODL.razor index 7a9d707d..77590ffc 100644 --- a/MP.SPEC/Pages/PODL.razor +++ b/MP.SPEC/Pages/PODL.razor @@ -68,7 +68,7 @@
- Search + Ricerca
@@ -131,23 +131,11 @@
Gruppo - + @if (currGruppoSel != null) + { + + @* *@ + }
@@ -209,7 +197,7 @@
- @if (currRecord.CodArticolo != "" && currRecord.CodFase != "" && currRecord.CodGruppo != "" && currRecord.IdxMacchina != "") + @if (currRecord.CodArticolo != "" && currRecord.CodFase != "" && selReparto != "*" && currRecord.IdxMacchina != "") { } @@ -221,47 +209,46 @@
} - else if (addEnabled) + @* else if (addEnabled) { -
-
- @**@ -
- @if (reqNew) - { -
-
- Azienda - -
-
-
-
- Search - - Articolo - -
-
- } -
+
+
+
+ @if (reqNew) + { +
+
+ Azienda + +
+
+
+
+ Search + + Articolo + +
+
+ } +
+ }*@
diff --git a/MP.SPEC/Pages/PODL.razor.cs b/MP.SPEC/Pages/PODL.razor.cs index 19f3fd84..60108e89 100644 --- a/MP.SPEC/Pages/PODL.razor.cs +++ b/MP.SPEC/Pages/PODL.razor.cs @@ -109,7 +109,6 @@ namespace MP.SPEC.Pages ListGruppiFase = allGruppiData.Where(x => x.SelEnabled).ToList(); } ListStati = await MDService.AnagStatiComm(); - //ListArticoli = await MDService.ArticoliGetSearch(100, currAzienda, artSearch); currAzienda = await MDService.tryGetConfig("AZIENDA"); padCodXdl = await MDService.tryGetConfig("padCodXdl"); } @@ -138,16 +137,17 @@ namespace MP.SPEC.Pages /// protected async Task reqNewPODL() { +#if false if (ListArticoli != null && ListArticoli.Count > 0) { - //var firstArt = ListArticoli.FirstOrDefault(); - //currArticolo = firstArt != null ? firstArt.CodArticolo : ""; var firstArt = ListArticoli.FirstOrDefault(x => x.Azienda.StartsWith(currAzienda)); if (firstArt != null) { - currArticolo = firstArt.Azienda; + currArticolo = firstArt.CodArticolo; } - } + } +#endif + artSearch = ""; string codExt = $"{currFase}"; string codGruppo = ""; if (ListGruppiFase != null && ListGruppiFase.Count > 0) @@ -198,6 +198,7 @@ namespace MP.SPEC.Pages return; await Task.Delay(1); var clonedRec = MP.Data.Utils.POdlExt.convertToPOdl(selRec); + clonedRec.CodGruppo = currGruppoSel.CodGruppo; var done = await MDService.POdlUpdateRecord(clonedRec); await callSyncDb(clonedRec); currRecord = null; @@ -221,6 +222,8 @@ namespace MP.SPEC.Pages private PODLExpModel currRecordControlli = new PODLExpModel(); + private AnagGruppi currGruppoSel = new AnagGruppi(); + private List? ListArticoli; private List? ListAziende; @@ -231,8 +234,6 @@ namespace MP.SPEC.Pages private List? ListStati; - private List? SearchRecords; - #endregion Private Fields #region Private Properties @@ -338,7 +339,7 @@ namespace MP.SPEC.Pages set { _currRecord = value; - artSearch = value == null ? "" : value.CodArticolo; + artSearch = value == null ? "" : value.CodArticolo.Substring(0,2); } } @@ -421,9 +422,16 @@ namespace MP.SPEC.Pages { isLoading = true; await Task.Delay(1); - ListMacchine = await MDService.MacchineGetFilt(selReparto); ListArticoli = await MDService.ArticoliGetSearch(100, currAzienda, artSearch); + if (ListGruppiFase != null) + { + var firstGroup = ListGruppiFase.Where(x => x.CodGruppo == selReparto).FirstOrDefault(); + if (firstGroup != null) + { + currGruppoSel = firstGroup; + } + } isLoading = false; } protected string header diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index d541ddeb..8c8af378 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2211.3015

+

Versione: 6.16.2212.113


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 6b9d7ca4..f2e3a6f1 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2211.3015 +6.16.2212.113 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index a9c8ec9d..56f4d49c 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2211.3015 + 6.16.2212.113 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