diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index 08306519..fe86cc4d 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -360,6 +360,28 @@ namespace MP.Data.Controllers return fatto; } + /// + /// Restitusice elenco articoli dato tipo (es KIT) + /// + /// + /// + /// + /// + public List ArticoliGetByTipo(string tipo, string azienda = "*") + { + List dbResult = new List(); + using (var dbCtx = new MoonProContext(_configuration)) + { + dbResult = dbCtx + .DbSetArticoli + .AsNoTracking() + .Where(x => x.Tipo.ToUpper() == tipo.ToUpper() && (azienda == "*" || x.Azienda.ToUpper() == azienda.ToUpper())) + .OrderBy(x => x.CodArticolo) + .ToList(); + } + return dbResult; + } + /// /// Elenco tabella Articoli da filtro /// @@ -397,7 +419,7 @@ namespace MP.Data.Controllers dbResult = dbCtx .DbSetArticoli .AsNoTracking() - .Where(x => (azienda == "*" || x.Azienda.ToLower().Equals(azienda.ToLower())) && (string.IsNullOrEmpty(searchVal) || x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal))) + .Where(x => (azienda == "*" || x.Azienda.ToUpper() == azienda.ToUpper()) && (string.IsNullOrEmpty(searchVal) || x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal))) .OrderBy(x => x.CodArticolo) .Take(numRecord) .ToList(); diff --git a/MP.SPEC/Components/ListPODL.razor b/MP.SPEC/Components/ListPODL.razor index b3b579cc..4b9d12e2 100644 --- a/MP.SPEC/Components/ListPODL.razor +++ b/MP.SPEC/Components/ListPODL.razor @@ -1,4 +1,5 @@ @using MP.SPEC.Components +@using MP.SPEC.Components.ProdKit @using MP.SPEC.Data @if (ListRecords == null || isLoading) @@ -13,6 +14,10 @@ else {
+ @if (showKitDetail) + { + + } @@ -109,7 +114,13 @@ else
- @record.CodArticolo +
+ @record.CodArticolo + @if (CheckIsKit(record.CodArticolo)) + { + + } +
@record.DescArticolo
diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index bc4dd3c0..5d930d12 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -95,6 +95,21 @@ namespace MP.SPEC.Components #region Protected Methods + /// + /// Verifica se sia un articolo di tipo "KIT" x mostrare show dettaglio + /// + /// + /// + protected bool CheckIsKit(string CodArticolo) + { + bool answ = false; + if (ListArtKit != null && ListArtKit.Count > 0) + { + answ = ListArtKit.Count(x => x.CodArticolo == CodArticolo) > 0; + } + return answ; + } + protected async Task cloneRecord(PODLExpModel selRec) { currRecord = null; @@ -145,9 +160,24 @@ namespace MP.SPEC.Components await RecordEdit.InvokeAsync(selRec); } + protected void KitToggleDetail(string? selCodArt) + { + CodArtParent = selCodArt ?? ""; + if (!string.IsNullOrEmpty(CodArtParent)) + { + ListKitTemplate = MDService.TemplateKitFilt(CodArtParent, ""); + } + else + { + ListKitTemplate = null; + } + showKitDetail = !showKitDetail; + } + protected override async Task OnInitializedAsync() { ListStati = await MDService.AnagStatiComm(); + ListArtKit = MDService.ArticoliGetByTipo("KIT", "*"); string strMachRecipe = await MDService.ConfigTryGetAsync("MachineWithRecipe"); if (!string.IsNullOrEmpty(strMachRecipe)) { @@ -299,7 +329,7 @@ namespace MP.SPEC.Components #region Private Fields private static Logger Log = LogManager.GetCurrentClassLogger(); - + private string CodArtParent = ""; private string currRecipeArchPath = ""; /// @@ -309,8 +339,17 @@ namespace MP.SPEC.Components private PODLExpModel? currRecord = null; + /// + /// Elenco articoli tipo KIT + /// + private List? ListArtKit; + + private List? ListKitTemplate = null; private List? ListRecords; + /// + /// Elenco stati + /// private List? ListStati; private bool MachineWithRecipe = false; @@ -326,7 +365,7 @@ namespace MP.SPEC.Components private List odlCurrList = new List(); private List? SearchRecords; - + private bool showKitDetail = false; private bool showRecipeArch = false; private bool showRecipeConf = false; diff --git a/MP.SPEC/Components/ProdKit/KitDetailModal.razor b/MP.SPEC/Components/ProdKit/KitDetailModal.razor new file mode 100644 index 00000000..98177bee --- /dev/null +++ b/MP.SPEC/Components/ProdKit/KitDetailModal.razor @@ -0,0 +1,79 @@ + + + + +@code { + + [Parameter] + public string CodArtParent { get; set; } = ""; + + [Parameter] + public EventCallback EC_Close { get; set; } + + + [Parameter] + public List? ListRecords { get; set; } = null; + + protected override void OnParametersSet() + { + // base.OnParametersSet(); + totalKitCount = ListRecords != null ? ListRecords.Count() : 0; + } + private int totalKitCount = 0; + + protected async void ReqClose() + { + await EC_Close.InvokeAsync(true); + } +} diff --git a/MP.SPEC/Components/ProdKit/KitPodlMan.razor.cs b/MP.SPEC/Components/ProdKit/KitPodlMan.razor.cs index 59610526..69937ca2 100644 --- a/MP.SPEC/Components/ProdKit/KitPodlMan.razor.cs +++ b/MP.SPEC/Components/ProdKit/KitPodlMan.razor.cs @@ -94,7 +94,9 @@ namespace MP.SPEC.Components.ProdKit protected override async Task OnInitializedAsync() { - string SPEC_PODL_gest = await MDService.ConfigTryGetAsync("SPEC_PODL_gest"); +#if false + string SPEC_PODL_gest = await MDService.ConfigTryGetAsync("SPEC_PODL_gest"); +#endif DateTime oggi = DateTime.Today; ActFilter = new SelectXdlParams() { diff --git a/MP.SPEC/Components/ProdKit/KitVerify.razor b/MP.SPEC/Components/ProdKit/KitVerify.razor index 1e72a3e5..0c44e5b7 100644 --- a/MP.SPEC/Components/ProdKit/KitVerify.razor +++ b/MP.SPEC/Components/ProdKit/KitVerify.razor @@ -16,60 +16,7 @@ { @if (doShowDetail) { - - - + } diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index e982fd60..e4725619 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -336,6 +336,44 @@ namespace MP.SPEC.Data return fatto; } + /// + /// Restitusice elenco articoli dato tipo (es KIT) + /// + /// + /// + /// + public List ArticoliGetByTipo(string tipo, string azienda = "*") + { + List? result = new List(); + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + string readType = "DB"; + string sKey = string.IsNullOrEmpty(tipo) ? "ALL" : tipo; + string currKey = $"{Utils.redisArtList}:{azienda}:Tipo:{sKey}"; + // cerco in redis dato valore sel idxMaccSel... + RedisValue rawData = redisDb.StringGet(currKey); + if (rawData.HasValue) + { + result = JsonConvert.DeserializeObject>($"{rawData}"); + readType = "REDIS"; + } + else + { + result = dbController.ArticoliGetByTipo(tipo); + // serializzo e salvo... + rawData = JsonConvert.SerializeObject(result); + redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache)); + } + if (result == null) + { + result = new List(); + } + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Debug($"ArticoliGetByTipo | Read from {readType}: {ts.TotalMilliseconds}ms"); + return result; + } + /// /// Restitusice elenco articoli cercati /// @@ -2107,7 +2145,6 @@ namespace MP.SPEC.Data return result; } - /// /// Elenco PODL per composizione KIT (Async) non avviati filtrati x articolo, KeyRich (che contiene stato) /// diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index fcaf1f3a..5be0eaa3 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2505.908 + 6.16.2505.1017 1800a78a-6ff1-40f9-b490-87fb8bfc1394 en diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 36e7d84c..8fc5119a 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2505.908

+

Versione: 6.16.2505.1017


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 33b17944..3f147e05 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2505.908 +6.16.2505.1017 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 3e9bba41..eb30cd1f 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2505.908 + 6.16.2505.1017 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