From 9e4822d529ae00e28544dbafe38966a7fcc7829c Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Mon, 17 Oct 2022 09:09:43 +0200 Subject: [PATCH 1/9] Aggiunta filtro per macchine ODL --- MP.Data/Controllers/MpSpecController.cs | 4 ++-- MP.SPEC/Components/ListODL.razor.cs | 2 +- MP.SPEC/Data/MpDataService.cs | 5 +++-- MP.SPEC/Data/SelectOdlParams.cs | 4 ++++ MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Pages/ODL.razor | 21 ++++++++++++++++++++- MP.SPEC/Pages/ODL.razor.cs | 7 +++++++ MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- MP.Stats/MP.Stats.csproj | 2 +- MP.Stats/Resources/ChangeLog.html | 2 +- MP.Stats/Resources/VersNum.txt | 2 +- MP.Stats/Resources/manifest.xml | 2 +- 14 files changed, 45 insertions(+), 14 deletions(-) diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index 1eddded3..40531e07 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -497,14 +497,14 @@ namespace MP.Data.Controllers /// Data inizio /// Data fine /// - public List ListODLFilt(bool inCorso, string codArt, string keyRichPart, DateTime startDate, DateTime endDate) + public List ListODLFilt(bool inCorso, string codArt, string keyRichPart, string IdxMacchina, DateTime startDate, DateTime endDate) { List dbResult = new List(); using (var dbCtx = new MoonProContext(_configuration)) { dbResult = dbCtx .DbSetODL - .Where(x => ((inCorso && x.DataFine == null) || ((!inCorso && x.DataFine != null) && x.DataInizio >= startDate && x.DataInizio <= endDate)) && (x.KeyRichiesta.Contains(keyRichPart) || keyRichPart == "*") && (codArt == "*" || x.CodArticolo.Contains(codArt))) + .Where(x => ((inCorso && x.DataFine == null) || ((!inCorso && x.DataFine != null) && x.DataInizio >= startDate && x.DataInizio <= endDate)) && (x.KeyRichiesta.Contains(keyRichPart) || keyRichPart == "*") && (x.IdxMacchina.Contains(IdxMacchina) || IdxMacchina == "*") && (codArt == "*" || x.CodArticolo.Contains(codArt))) .AsNoTracking() .Include(m => m.MachineNav) .Include(a => a.ArticoloNav) diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs index 62c2dc58..26e9220d 100644 --- a/MP.SPEC/Components/ListODL.razor.cs +++ b/MP.SPEC/Components/ListODL.razor.cs @@ -170,7 +170,7 @@ namespace MP.SPEC.Components private async Task reloadData() { isLoading = true; - SearchRecords = await MDService.ListODLFilt(currFilter.IsActive, currFilter.SearchVal, currFilter.CodStato, currFilter.DtStart, currFilter.DtEnd); + SearchRecords = await MDService.ListODLFilt(currFilter.IsActive, currFilter.SearchVal, currFilter.CodStato, currFilter.IdxMacchina, currFilter.DtStart, currFilter.DtEnd); 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 261bd042..6d6d2480 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -537,10 +537,11 @@ namespace MP.SPEC.Data /// Stato ODL: true=in corso/completato /// Cod articolo /// KeyRich (parziale) da cercare (es cod stato x yacht) + /// id macchina da cercare /// - public async Task> ListODLFilt(bool inCorso, string codArt, string keyRichPart, DateTime startDate, DateTime endDate) + public async Task> ListODLFilt(bool inCorso, string codArt, string keyRichPart, string IdxMacchina, DateTime startDate, DateTime endDate) { - return await Task.FromResult(dbController.ListODLFilt(inCorso, codArt, keyRichPart, startDate, endDate)); + return await Task.FromResult(dbController.ListODLFilt(inCorso, codArt, keyRichPart, IdxMacchina, startDate, endDate)); } /// diff --git a/MP.SPEC/Data/SelectOdlParams.cs b/MP.SPEC/Data/SelectOdlParams.cs index c2e9de0f..47a23ad0 100644 --- a/MP.SPEC/Data/SelectOdlParams.cs +++ b/MP.SPEC/Data/SelectOdlParams.cs @@ -14,6 +14,7 @@ namespace MP.SPEC.Data #region Public Properties public string CodStato { get; set; } = "*"; + public string IdxMacchina { get; set; } = "*"; public int CurrPage { get; set; } = 1; public int NumRec { get; set; } = 10; public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5); @@ -37,6 +38,9 @@ namespace MP.SPEC.Data if (CodStato != item.CodStato) return false; + if (IdxMacchina != item.IdxMacchina) + return false; + if (MaxRecord != item.MaxRecord) return false; diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 1692824a..ef80ede2 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2210.1417 + 6.16.2210.1709 diff --git a/MP.SPEC/Pages/ODL.razor b/MP.SPEC/Pages/ODL.razor index 0e9fba25..c4a78b2b 100644 --- a/MP.SPEC/Pages/ODL.razor +++ b/MP.SPEC/Pages/ODL.razor @@ -37,7 +37,7 @@
- +
@@ -53,6 +53,25 @@
+
+ +
+ +
+
+ + +
+
@if (!isActive) {
diff --git a/MP.SPEC/Pages/ODL.razor.cs b/MP.SPEC/Pages/ODL.razor.cs index 48cd0004..a9b5aba2 100644 --- a/MP.SPEC/Pages/ODL.razor.cs +++ b/MP.SPEC/Pages/ODL.razor.cs @@ -92,6 +92,7 @@ namespace MP.SPEC.Pages // resetto search MsgService.SearchVal = ""; ListStati = await MDService.AnagStatiComm(); + ListMacchine = await MDService.MacchineWithFlux(); #if false // carico dati await reloadData(); @@ -123,6 +124,7 @@ namespace MP.SPEC.Pages #region Private Fields private List? ListStati; + private List? ListMacchine; #endregion Private Fields @@ -159,6 +161,11 @@ namespace MP.SPEC.Pages get => currFilter.CodStato; set => currFilter.CodStato = value; } + private string selMacchina + { + get => currFilter.IdxMacchina; + set => currFilter.IdxMacchina = value; + } private int totalCount { diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 6f4a2e82..b34b31a7 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2210.1417

+

Versione: 6.16.2210.1709


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index d3fb3511..d8ccb01e 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.1417 +6.16.2210.1709 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index b1bfc31c..f1531117 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.1417 + 6.16.2210.1709 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 diff --git a/MP.Stats/MP.Stats.csproj b/MP.Stats/MP.Stats.csproj index 5f4b8d39..d7726462 100644 --- a/MP.Stats/MP.Stats.csproj +++ b/MP.Stats/MP.Stats.csproj @@ -4,7 +4,7 @@ net6.0 MP.Stats 826e877c-ba70-4253-84cb-d0b1cafd4440 - 6.16.2210.0716 + 6.16.2210.1708 diff --git a/MP.Stats/Resources/ChangeLog.html b/MP.Stats/Resources/ChangeLog.html index 3686ecab..476f07b6 100644 --- a/MP.Stats/Resources/ChangeLog.html +++ b/MP.Stats/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo statistiche MAPO -

    Versione: 6.16.2210.0716

    +

    Versione: 6.16.2210.1708


    Note di rilascio:
      diff --git a/MP.Stats/Resources/VersNum.txt b/MP.Stats/Resources/VersNum.txt index 5df1a0fc..ccf0292a 100644 --- a/MP.Stats/Resources/VersNum.txt +++ b/MP.Stats/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.0716 +6.16.2210.1708 diff --git a/MP.Stats/Resources/manifest.xml b/MP.Stats/Resources/manifest.xml index 6ba8169d..e4fe64f1 100644 --- a/MP.Stats/Resources/manifest.xml +++ b/MP.Stats/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.0716 + 6.16.2210.1708 https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/MP.Stats.zip https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/ChangeLog.html false From bef0ee60001e7dc9f85c956e7da2f1af2e8c8f67 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Mon, 17 Oct 2022 09:22:38 +0200 Subject: [PATCH 2/9] fix text dark progress bar gialla --- MP.SPEC/Components/ListODL.razor | 2 +- MP.SPEC/Components/ListODL.razor.cs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/MP.SPEC/Components/ListODL.razor b/MP.SPEC/Components/ListODL.razor index 0a1ecb65..f2521526 100644 --- a/MP.SPEC/Components/ListODL.razor +++ b/MP.SPEC/Components/ListODL.razor @@ -197,7 +197,7 @@ else
-
@($"{calcolaPerc(statRecord.TotDurata):N1}%")
+
@($"{calcolaPerc(statRecord.TotDurata):N1}%")
diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs index 26e9220d..89a78e52 100644 --- a/MP.SPEC/Components/ListODL.razor.cs +++ b/MP.SPEC/Components/ListODL.razor.cs @@ -3,6 +3,7 @@ using Microsoft.JSInterop; using MP.Data; using MP.Data.DatabaseModels; using MP.SPEC.Data; +using System.Formats.Asn1; namespace MP.SPEC.Components { @@ -70,6 +71,16 @@ namespace MP.SPEC.Components await reloadData(); } + protected string colorChanger(string colorCSS) + { + string answ = ""; + if(colorCSS == "yellow") + { + answ = "text-dark"; + } + return answ; + } + protected async void OnSeachUpdated() { await InvokeAsync(() => From 26e36e7124efc1c5730f2af514bf95554e5e22c9 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Mon, 17 Oct 2022 10:09:16 +0200 Subject: [PATCH 3/9] fix posizionamento label durata --- MP.SPEC/Components/ListODL.razor | 9 ++++----- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- MP.SPEC/wwwroot/css/site.css | 1 - MP.SPEC/wwwroot/css/site.less | 1 - MP.SPEC/wwwroot/css/site.min.css | 2 +- 8 files changed, 9 insertions(+), 12 deletions(-) diff --git a/MP.SPEC/Components/ListODL.razor b/MP.SPEC/Components/ListODL.razor index f2521526..40437f48 100644 --- a/MP.SPEC/Components/ListODL.razor +++ b/MP.SPEC/Components/ListODL.razor @@ -212,8 +212,10 @@ else
-
- @currRecord.DurataMinuti +
+
+ @currRecord.DurataMinuti +
}
@@ -226,6 +228,3 @@ else } - - diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index ef80ede2..c22dd6f0 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2210.1709 + 6.16.2210.1710 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index b34b31a7..6a4810b4 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2210.1709

+

Versione: 6.16.2210.1710


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index d8ccb01e..b0528724 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.1709 +6.16.2210.1710 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index f1531117..acd272f2 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.1709 + 6.16.2210.1710 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 diff --git a/MP.SPEC/wwwroot/css/site.css b/MP.SPEC/wwwroot/css/site.css index 4e954d9b..a5c2e7d7 100644 --- a/MP.SPEC/wwwroot/css/site.css +++ b/MP.SPEC/wwwroot/css/site.css @@ -95,7 +95,6 @@ a, } .dcOverlay { z-index: 9; - margin: 8.5rem; } #blazor-error-ui { background: lightyellow; diff --git a/MP.SPEC/wwwroot/css/site.less b/MP.SPEC/wwwroot/css/site.less index a53999be..b3df8dc6 100644 --- a/MP.SPEC/wwwroot/css/site.less +++ b/MP.SPEC/wwwroot/css/site.less @@ -102,7 +102,6 @@ a, .btn-link { .dcOverlay { z-index: 9; - margin: 8.5rem; } #blazor-error-ui { diff --git a/MP.SPEC/wwwroot/css/site.min.css b/MP.SPEC/wwwroot/css/site.min.css index 2ccf4b3e..5e039876 100644 --- a/MP.SPEC/wwwroot/css/site.min.css +++ b/MP.SPEC/wwwroot/css/site.min.css @@ -1 +1 @@ -@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');@import url('fonts.css');h1,h2,h3,h4,h5,h6,b,display-1,display-2,display-3,display-4{font-family:'Lato',sans-serif;}html,body{font-family:'Roboto',sans-serif;}.textConsensed{font-family:'Roboto Condensed',sans-serif;}h1:focus{outline:none;}a,.btn-link{color:#0071c1;}.btn-primary{color:#fff;background-color:#1b6ec2;border-color:#1861ac;}.content{padding-top:1.1rem;}.valid.modified:not([type=checkbox]){outline:1px solid #26b050;}.invalid{outline:1px solid #f00;}.validation-message{color:#f00;}.selBlock{background-color:#cff4fc;}.watermark{position:absolute;top:250px;left:500px;opacity:.2;}.textTrim{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.max5Char{white-space:nowrap;width:10rem;overflow:hidden;text-overflow:ellipsis;}.max10Char{white-space:nowrap;width:10rem;overflow:hidden;text-overflow:ellipsis;}.max20Char{white-space:nowrap;width:20rem;overflow:hidden;text-overflow:ellipsis;}.footer{line-height:1.8em;}.dcContainer{width:22rem;height:22rem;position:relative;}.dcBox{width:100%;height:100%;position:absolute;top:0;left:0;}.dcOverlay{z-index:9;margin:8.5rem;}#blazor-error-ui{background:#ffffe0;bottom:0;box-shadow:0 -1px 2px rgba(0,0,0,.2);display:none;left:0;padding:.6rem 1.25rem .7rem 1.25rem;position:fixed;width:100%;z-index:1000;}#blazor-error-ui .dismiss{cursor:pointer;position:absolute;right:.75rem;top:.5rem;}.blazor-error-boundary{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem,#b32121;padding:1rem 1rem 1rem 3.7rem;color:#fff;}.blazor-error-boundary::after{content:"An error has occurred.";}.shortcuts{text-align:center;}.shortcuts .shortcut-icon{font-size:2rem;}.shortcuts .shortcut{min-width:9rem;min-height:5rem;display:inline-block;padding:2rem/3 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:1rem/2;}.shortcuts .shortcut-sm{min-width:4.5rem;min-height:3rem;display:inline-block;padding:1rem/4 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:1rem/2;}.shortcuts .shortcut .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:2rem;color:#333;}.shortcuts .shortcut-sm .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:2rem;color:#333;}.shortcuts .shortcut:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0);}.shortcuts .shortcut-sm:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0);}.shortcuts .shortcut:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125);}.shortcuts .shortcut-sm:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125);}.shortcuts .shortcut:hover .shortcut-icon{color:#c93;}.shortcuts .shortcut-sm:hover .shortcut-icon{color:#666;}.shortcuts .shortcut-label{display:block;margin-top:.75em;font-weight:400;color:#666;}@media(max-width:640px){.shortcuts .shortcut{min-width:8rem;min-height:4rem;}body{font-size:.8em;}}.shortcuts{text-align:center;}.shortcuts .shortcut{min-width:9rem;min-height:5rem;display:inline-block;padding:.66666667rem 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:.5em;}.shortcuts .shortcut-sm{min-width:4.5rem;min-height:3rem;display:inline-block;padding:1rem/4 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:1rem/2;}.shortcuts .shortcut .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:2rem;color:#333;}.shortcuts .shortcut-sm .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:2rem;color:#333;}.shortcuts .shortcut:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0);}.shortcuts .shortcut-sm:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0);}.shortcuts .shortcut:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125);}.shortcuts .shortcut-sm:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125);}.shortcuts .shortcut:hover .shortcut-icon{color:#c93;}.shortcuts .shortcut-sm:hover .shortcut-icon{color:#666;}.shortcuts .shortcut-label{display:block;margin-top:.75em;font-weight:400;color:#666;}@media(max-width:992px){.shortcuts .shortcut{min-width:8rem;min-height:4rem;}} \ No newline at end of file +@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');@import url('fonts.css');h1,h2,h3,h4,h5,h6,b,display-1,display-2,display-3,display-4{font-family:'Lato',sans-serif;}html,body{font-family:'Roboto',sans-serif;}.textConsensed{font-family:'Roboto Condensed',sans-serif;}h1:focus{outline:none;}a,.btn-link{color:#0071c1;}.btn-primary{color:#fff;background-color:#1b6ec2;border-color:#1861ac;}.content{padding-top:1.1rem;}.valid.modified:not([type=checkbox]){outline:1px solid #26b050;}.invalid{outline:1px solid #f00;}.validation-message{color:#f00;}.selBlock{background-color:#cff4fc;}.watermark{position:absolute;top:250px;left:500px;opacity:.2;}.textTrim{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.max5Char{white-space:nowrap;width:10rem;overflow:hidden;text-overflow:ellipsis;}.max10Char{white-space:nowrap;width:10rem;overflow:hidden;text-overflow:ellipsis;}.max20Char{white-space:nowrap;width:20rem;overflow:hidden;text-overflow:ellipsis;}.footer{line-height:1.8em;}.dcContainer{width:22rem;height:22rem;position:relative;}.dcBox{width:100%;height:100%;position:absolute;top:0;left:0;}.dcOverlay{z-index:9;}#blazor-error-ui{background:#ffffe0;bottom:0;box-shadow:0 -1px 2px rgba(0,0,0,.2);display:none;left:0;padding:.6rem 1.25rem .7rem 1.25rem;position:fixed;width:100%;z-index:1000;}#blazor-error-ui .dismiss{cursor:pointer;position:absolute;right:.75rem;top:.5rem;}.blazor-error-boundary{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem,#b32121;padding:1rem 1rem 1rem 3.7rem;color:#fff;}.blazor-error-boundary::after{content:"An error has occurred.";}.shortcuts{text-align:center;}.shortcuts .shortcut-icon{font-size:2rem;}.shortcuts .shortcut{min-width:9rem;min-height:5rem;display:inline-block;padding:2rem/3 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:1rem/2;}.shortcuts .shortcut-sm{min-width:4.5rem;min-height:3rem;display:inline-block;padding:1rem/4 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:1rem/2;}.shortcuts .shortcut .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:2rem;color:#333;}.shortcuts .shortcut-sm .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:2rem;color:#333;}.shortcuts .shortcut:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0);}.shortcuts .shortcut-sm:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0);}.shortcuts .shortcut:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125);}.shortcuts .shortcut-sm:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125);}.shortcuts .shortcut:hover .shortcut-icon{color:#c93;}.shortcuts .shortcut-sm:hover .shortcut-icon{color:#666;}.shortcuts .shortcut-label{display:block;margin-top:.75em;font-weight:400;color:#666;}@media(max-width:640px){.shortcuts .shortcut{min-width:8rem;min-height:4rem;}body{font-size:.8em;}}.shortcuts{text-align:center;}.shortcuts .shortcut{min-width:9rem;min-height:5rem;display:inline-block;padding:.66666667rem 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:.5em;}.shortcuts .shortcut-sm{min-width:4.5rem;min-height:3rem;display:inline-block;padding:1rem/4 0;margin:0 2px 1em;vertical-align:top;text-decoration:none;background:#f3f3f3;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fff),to(#eee));background-image:-webkit-linear-gradient(top,#fff,0%,#eee,100%);background-image:-moz-linear-gradient(top,#fff 0%,#eee 100%);background-image:linear-gradient(to bottom,#fff 0%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffeeeeee',GradientType=0);border:1px solid #ddd;box-sizing:border-box;border-radius:1rem/2;}.shortcuts .shortcut .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:2rem;color:#333;}.shortcuts .shortcut-sm .shortcut-icon{width:100%;margin-top:0;margin-bottom:0;font-size:2rem;color:#333;}.shortcuts .shortcut:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0);}.shortcuts .shortcut-sm:hover{background:#e8e8e8;background-image:-webkit-gradient(linear,left 0%,left 100%,from(#fafafa),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#fafafa,0%,#e1e1e1,100%);background-image:-moz-linear-gradient(top,#fafafa 0%,#e1e1e1 100%);background-image:linear-gradient(to bottom,#fafafa 0%,#e1e1e1 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffafafa',endColorstr='#ffe1e1e1',GradientType=0);}.shortcuts .shortcut:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125);}.shortcuts .shortcut-sm:active{box-shadow:inset 0 3px 5px rgba(0,0,0,.125);}.shortcuts .shortcut:hover .shortcut-icon{color:#c93;}.shortcuts .shortcut-sm:hover .shortcut-icon{color:#666;}.shortcuts .shortcut-label{display:block;margin-top:.75em;font-weight:400;color:#666;}@media(max-width:992px){.shortcuts .shortcut{min-width:8rem;min-height:4rem;}} \ No newline at end of file From 470c9a21918e3d4f5d334dae33de5b4243487ce9 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Mon, 17 Oct 2022 11:25:05 +0200 Subject: [PATCH 4/9] aggiunta controllo listaStati null --- MP.SPEC/Components/ListODL.razor | 2 +- MP.SPEC/Components/ListODL.razor.cs | 8 ++++++++ MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Pages/ODL.razor | 10 +++++----- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 7 files changed, 18 insertions(+), 10 deletions(-) diff --git a/MP.SPEC/Components/ListODL.razor b/MP.SPEC/Components/ListODL.razor index 40437f48..80d6a3b5 100644 --- a/MP.SPEC/Components/ListODL.razor +++ b/MP.SPEC/Components/ListODL.razor @@ -207,7 +207,7 @@ else
    - @if (currRecord != null) + @if (currRecord != null && ListOdlStats != null) {
    diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs index 89a78e52..9fcaef33 100644 --- a/MP.SPEC/Components/ListODL.razor.cs +++ b/MP.SPEC/Components/ListODL.razor.cs @@ -81,6 +81,14 @@ namespace MP.SPEC.Components return answ; } + //protected double durataMin(DateTime? DataInizio, DateTime? DataFine) + //{ + // DateTime end = DataInizio != null ? (DateTime)DataFine : DateTime.Now; + // var tsDurata = (end).Subtract((DateTime)DataInizio); + + // return tsDurata.TotalMinutes; + //} + protected async void OnSeachUpdated() { await InvokeAsync(() => diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index c22dd6f0..e6b87a80 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2210.1710 + 6.16.2210.1711 diff --git a/MP.SPEC/Pages/ODL.razor b/MP.SPEC/Pages/ODL.razor index c4a78b2b..8356082c 100644 --- a/MP.SPEC/Pages/ODL.razor +++ b/MP.SPEC/Pages/ODL.razor @@ -37,11 +37,11 @@
    - +
    - - @if (ListStati != null) { @@ -59,8 +59,8 @@
    - - @if (ListMacchine != null) { diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 6a4810b4..20236b47 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

    Versione: 6.16.2210.1710

    +

    Versione: 6.16.2210.1711


    Note di rilascio:
    • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index b0528724..4169a5c0 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.1710 +6.16.2210.1711 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index acd272f2..3c1947ad 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.1710 + 6.16.2210.1711 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 From de562b12872f207caed7375dd617d23bad70d18c Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 17 Oct 2022 12:01:33 +0200 Subject: [PATCH 5/9] Update x gestione chiusura ODL --- MP.Data/Controllers/MpSpecController.cs | 123 +++++++++++- MP.Data/DatabaseModels/StatoProdModel.cs | 20 ++ MP.Data/MoonProContext.cs | 1 + MP.SPEC/Components/ListODL.razor | 29 ++- MP.SPEC/Components/ListODL.razor.cs | 55 +++++- MP.SPEC/Data/MpDataService.cs | 239 +++++++++++++---------- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 10 files changed, 354 insertions(+), 121 deletions(-) create mode 100644 MP.Data/DatabaseModels/StatoProdModel.cs diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index 1eddded3..e21feec9 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -199,15 +199,18 @@ namespace MP.Data.Controllers public async Task> StatOdl(int IdxOdl) { List dbResult = new List(); - using (var dbCtx = new MoonProContext(_configuration)) + if (IdxOdl > 0) { - var IdxODL = new SqlParameter("@IdxODL", IdxOdl); + using (var dbCtx = new MoonProContext(_configuration)) + { + var IdxODL = new SqlParameter("@IdxODL", IdxOdl); - dbResult = await dbCtx - .DbSetStatOdl - .FromSqlRaw("EXEC stp_STAT_ODL @IdxODL", IdxODL) - .AsNoTracking() - .ToListAsync(); + dbResult = await dbCtx + .DbSetStatOdl + .FromSqlRaw("EXEC stp_STAT_ODL @IdxODL", IdxODL) + .AsNoTracking() + .ToListAsync(); + } } return dbResult; } @@ -421,7 +424,7 @@ namespace MP.Data.Controllers .FirstOrDefault(); if (currRec != null) { - currRec.Valore= editRec.Valore; + currRec.Valore = editRec.Valore; dbCtx.Entry(currRec).State = EntityState.Modified; } else @@ -730,6 +733,110 @@ namespace MP.Data.Controllers return fatto; } + + /// + /// Stato prod macchina + /// + /// + /// + public StatoProdModel StatoProdMacchina(string idxMacchina) + { + StatoProdModel dbResult = new StatoProdModel(); + using (var dbCtx = new MoonProContext(_configuration)) + { + var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina); + dbResult = dbCtx + .DbSetStatoProd + .FromSqlRaw("EXEC stp_PzProd_getByMacchina @IdxMacchina", IdxMacchina) + .AsNoTracking() + .FirstOrDefault(); + } + return dbResult; + } + + /// + /// Chiusura ODL con eventuale conferma pezzi + /// + /// idx odl da chiudere + /// idx macchina + /// matricola operatore + /// indica se confermare i pezzi prima di chiudere ODL + /// Conferma con rettifica (ev 121) x pezzi lasciati in macchina + /// Modo conferma produzione (0=periodo, 1=giorno, 2=turno) + /// + public async Task ODLClose(int idxOdl, string idxMacchina, int matrOpr, bool confPezzi, bool confRett, int modoConfProd) + { + bool fatto = false; + if (idxOdl > 0) + { + using (var dbCtx = new MoonProContext(_configuration)) + { + DateTime adesso = DateTime.Now; + // preparo i parametri + var IdxODL = new SqlParameter("@IdxODL", idxOdl); + var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina); + + // FARE FIXME TODO !!! + // da valutare casi setup/autoconferma... +#if false + // controllo se HO pezzi da confermare... + var statoProd = StatoProdMacchina(idxMacchina); + if (statoProd.pezziNonConfermati < 1) + { } +#endif + + // se richiesto confermo produzione + if (confPezzi) + { + var MatrApp = new SqlParameter("@MatrApp", idxMacchina); + + /* ---------------------------------- + * CONFERMA PEZZI + * + * condizioni da verificare: + * - gestione rettifica (ev121) / pezzi da LASCIARE in macchina + * - conferma a zero pezzi (setup) oppure con i pezzi fatti e non ancora confermati + * + * + * + * */ + + // recupero i dati dei pezzi da confermare... con DbSetPzProd + exec stp_PzProd_getByMacchina 'SIMUL_01' + + // stp_ConfermaProduzCompletaFull + /* + * @idxMacchina NVARCHAR(50), + @MatrApp INT, + @dataFrom DATETIME, + @dataTo DATETIME, + @pezziConf INT, + @pezziLasciati INT, -- pezzi lasciati = evento 121 (-) pre conferma e (+) dopo --> da lasciare in macchina post conferma + @pezziScar INT = 0, -- pezzi scartati (registrati da 2016.11.20) DA INDICARE COME VALORE > 0!!! sennò faccio ABS... + @TipoConf INT = 0, -- Tipo intervallo conferma: 0 = periodo intero, 1 = per giorni, 2 = per turni + @DataOraApp DATETIME = NULL, -- di norma GETDATE() nel programma - serve per ricalcolo + @TestConferma BIT = 1 -- TestConferma : 1 = verifica conf. duplicata e inserisci in ElencoConfermeProd, 0 = nessuna verifica e inserimento ( per ricalcolo ) + */ + } + + // ora chiudo ODL + try + { + var dbResult = await dbCtx + .DbSetStatOdl + .FromSqlRaw("EXEC stp_ODL_fineProd @IdxODL, @IdxMacchina", IdxODL, IdxMacchina) + .AsNoTracking() + .ToListAsync(); + } + catch (Exception exc) + { + Log.Error($"Eccezione durante ODLClose{Environment.NewLine}{exc}"); + } + } + } + return fatto; + } + + /// /// Annulla modifiche su una specifica entity (cancel update) /// diff --git a/MP.Data/DatabaseModels/StatoProdModel.cs b/MP.Data/DatabaseModels/StatoProdModel.cs new file mode 100644 index 00000000..4072485e --- /dev/null +++ b/MP.Data/DatabaseModels/StatoProdModel.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +#nullable disable +// +// This is here so CodeMaid doesn't reorganize this document +// +namespace MP.Data.DatabaseModels +{ + public partial class StatoProdModel + { + [Key] + public string idxMacchina { get; set; } = "NA"; + public int pezziNonConfermati { get; set; } = 0; + public DateTime DataFrom { get; set; } = DateTime.Now; + public DateTime DataTo { get; set; } = DateTime.Now; + } +} diff --git a/MP.Data/MoonProContext.cs b/MP.Data/MoonProContext.cs index e35a351e..163b7600 100644 --- a/MP.Data/MoonProContext.cs +++ b/MP.Data/MoonProContext.cs @@ -49,6 +49,7 @@ namespace MP.Data public virtual DbSet DbSetFluxLog { get; set; } public virtual DbSet DbSetDossiers { get; set; } public virtual DbSet DbSetStatOdl { get; set; } + public virtual DbSet DbSetStatoProd { get; set; } #endregion Public Properties diff --git a/MP.SPEC/Components/ListODL.razor b/MP.SPEC/Components/ListODL.razor index 0a1ecb65..28787cf1 100644 --- a/MP.SPEC/Components/ListODL.razor +++ b/MP.SPEC/Components/ListODL.razor @@ -12,10 +12,26 @@ else if (totalCount == 0) else {
      + @if (currRecord != null && !showStats && isCurrOdl) + { +
      +
      +
      + @*
      + + + +
      *@ + +
      + }
      + @@ -28,6 +44,17 @@ else @foreach (var record in ListRecords) { + + @@ -118,7 +118,7 @@ else }
      + + Articolo Fase Macchina
      + @if (isCurrOdl) + { + + } + else + { + + } + @record.CodArticolo
      @record.ArticoloNav.DescArticolo
      @@ -114,7 +141,7 @@ else
      + @if (canStartOdl(record.IdxMacchina)) + { + + } + else + { + } @record.CodArticolo diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index 80e3371f..ddb159cb 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -84,6 +84,23 @@ namespace MP.SPEC.Components await RecordSel.InvokeAsync(newRec); } + protected async Task startOdl(PODLModel selRec) + { + await Task.Delay(1); + } + + /// + /// verifica se sia avviabile ODL x macchina + /// + /// + /// + private bool canStartOdl(string idxMacchina) + { + // fare!!! + bool answ = idxMacchina.Contains("BAG"); + return answ; + } + /// /// Eliminazione record selezionato (previa conferma) /// diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index e6b87a80..e7fa6a9e 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2210.1711 + 6.16.2210.1712 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 20236b47..033649b1 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

      Versione: 6.16.2210.1711

      +

      Versione: 6.16.2210.1712


      Note di rilascio:
      • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 4169a5c0..cfc216e1 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.1711 +6.16.2210.1712 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 3c1947ad..2bf44199 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.1711 + 6.16.2210.1712 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 From 460eb769dc59e333815780a534f4fe554ea41e68 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Mon, 17 Oct 2022 17:27:39 +0200 Subject: [PATCH 7/9] inizio gestione currRecord dopo chiusura modal --- MP.SPEC/Components/ListODL.razor | 7 ++++--- MP.SPEC/Components/ListODL.razor.cs | 31 +++++++++++++++++++++++++--- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Pages/ODL.razor | 1 - MP.SPEC/Pages/_Layout.cshtml | 2 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- MP.SPEC/wwwroot/lib/chartBoot.js | 10 +-------- MP.SPEC/wwwroot/lib/modalHandler.js | 32 +++++++++++++++++++++++++++++ 10 files changed, 70 insertions(+), 21 deletions(-) create mode 100644 MP.SPEC/wwwroot/lib/modalHandler.js diff --git a/MP.SPEC/Components/ListODL.razor b/MP.SPEC/Components/ListODL.razor index 2ae52f3a..8937c9d6 100644 --- a/MP.SPEC/Components/ListODL.razor +++ b/MP.SPEC/Components/ListODL.razor @@ -110,7 +110,7 @@ else @record.DurataMinuti
        - +
      - - diff --git a/MP.SPEC/Pages/_Layout.cshtml b/MP.SPEC/Pages/_Layout.cshtml index e1d1070d..e20191f1 100644 --- a/MP.SPEC/Pages/_Layout.cshtml +++ b/MP.SPEC/Pages/_Layout.cshtml @@ -32,8 +32,8 @@ - + @*Gestione autoriconnessione: https://github.com/dotnet/aspnetcore/issues/38305 (vedere anche https://docs.microsoft.com/it-it/aspnet/core/blazor/fundamentals/signalr?view=aspnetcore-6.0#modify-the-reconnection-handler-blazor-server)*@ diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 20236b47..4d586f32 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

      Versione: 6.16.2210.1711

      +

      Versione: 6.16.2210.1715


      Note di rilascio:
      • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 4169a5c0..9c48c79c 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.1711 +6.16.2210.1715 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 3c1947ad..e06c02e3 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.1711 + 6.16.2210.1715 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 diff --git a/MP.SPEC/wwwroot/lib/chartBoot.js b/MP.SPEC/wwwroot/lib/chartBoot.js index 50401512..d8e9de3e 100644 --- a/MP.SPEC/wwwroot/lib/chartBoot.js +++ b/MP.SPEC/wwwroot/lib/chartBoot.js @@ -1,20 +1,12 @@ ///Setup del chart desiderato con id univoco window.setup = (id, config) => { var ctx = document.getElementById(id).getContext('2d'); - //let currentDate = new Date(); - //console.log(currentDate + " - Calling setup..."); - console.log(id); if (window['myChart'] instanceof Chart) { - //window.myChart.destroy(); window['myChart'].destroy(); - console.log("Chart " + id + " destroyed!"); window['myChart'] = new Chart(ctx, config); } - else - { + else { window['myChart'] = new Chart(ctx, config); - //console.log("Chart " + id + " created!"); - console.log(window['myChart']); } } \ No newline at end of file diff --git a/MP.SPEC/wwwroot/lib/modalHandler.js b/MP.SPEC/wwwroot/lib/modalHandler.js new file mode 100644 index 00000000..d951b3a5 --- /dev/null +++ b/MP.SPEC/wwwroot/lib/modalHandler.js @@ -0,0 +1,32 @@ +//window.recordDeselect = (dotNetHelper) => { +// var myModalEl = document.getElementById('myModal') +// myModalEl.addEventListener('hidden.bs.modal', function (event) { +// // do something... +// //dotNetHelper.invokeMethodAsync('TriggerDotNetInstanceMethod'); +// return dotNetHelper.invokeMethodAsync('svuotaRecord'); +// console.log("fatto"); +// }); +//}; + + +//TENTATIVO POPOLAMENTO HELPER PER POTER INVOCARE IL METODO DOPO +//let helper; + +//window.setHelper = (dotNetHelper) => { +// helper = dotNetHelper.invokeMethodAsync('setHelper'); +// console.log(helper); +// return dotNetHelper.invokeMethodAsync('setHelper'); +//} + +//BECCA QUANDO LA MODALE VIENE CHIUSA ED ESEGUE +document.addEventListener('click', function (e) { + if (e.target.id === 'myModal') { + console.log('chiuso'); + + return helper.invokeMethodAsync('svuotaRecord'); + console.log("fatto"); + } else { + console.log('aperto'); + } + e.stopPropagation(); +}, false); \ No newline at end of file From b2e9ae76d491c8665daa3ec3c405bc7f72e223a7 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 17 Oct 2022 20:10:52 +0200 Subject: [PATCH 8/9] bozza modifiche (da completare) --- MP.Data/Controllers/MpSpecController.cs | 50 +++++++++++ MP.SPEC/Components/ListPODL.razor.cs | 114 ++++++++++++++++++++++-- MP.SPEC/Data/MpDataService.cs | 10 +++ MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Pages/PODL.razor.cs | 10 +-- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 8 files changed, 178 insertions(+), 14 deletions(-) diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index a4342479..eccef8b9 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -754,6 +754,56 @@ namespace MP.Data.Controllers return dbResult; } + + /// + /// Avvio setup ODL da PODL + /// + /// + /// + /// + /// + /// + /// + public async Task PODL_startSetup(PODLModel editRec, int matrOpr, double tcRich, int pzPallet, string note) + { + ODLModel dbResult = new ODLModel(); + using (var dbCtx = new MoonProContext(_configuration)) + { + try + { + var currRec = dbCtx + .DbSetPODL + .Where(x => x.IdxPromessa == editRec.IdxPromessa) + .FirstOrDefault(); + if (currRec != null) + { + // eseguo stored attrezzaggio + var IdxPromessa = new SqlParameter("@idxPromessa", editRec.IdxPromessa); + var MatrOpr = new SqlParameter("@MatrOpr", matrOpr); + var IdxMacchina = new SqlParameter("@IdxMacchina", editRec.IdxMacchina); + var TCRichAttr = new SqlParameter("@TCRichAttr", tcRich); + var PzPallet = new SqlParameter("@PzPallet", pzPallet); + var Note = new SqlParameter("@Note", note); + var callResult = await dbCtx + .Database + .ExecuteSqlRawAsync("EXEC stp_ODL_inizioSetupPromessa @idxPromessa, @MatrOpr, @IdxMacchina @TCRichAttr, @PzPallet, @Note", IdxPromessa, MatrOpr, IdxMacchina, TCRichAttr, PzPallet, Note); + + // recupero info su ODL corrente + dbResult = await dbCtx + .DbSetODL + .Where(x => x.IdxMacchina == editRec.IdxMacchina && x.DataInizio != null && x.DataFine == null) + .FirstOrDefaultAsync(); + } + } + catch (Exception exc) + { + Log.Error($"Eccezione durante PODL_doSetup{Environment.NewLine}{exc}"); + } + } + await Task.Delay(1); + return dbResult; + } + /// /// Chiusura ODL con eventuale conferma pezzi /// diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index ddb159cb..f30db27f 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -3,6 +3,8 @@ using Microsoft.JSInterop; using MP.Data.DatabaseModels; using MP.SPEC.Data; using MP.SPEC.Services; +using System.Reflection.PortableExecutable; +using System.Text; namespace MP.SPEC.Components { @@ -49,7 +51,7 @@ namespace MP.SPEC.Components protected MpDataService MDService { get; set; } = null!; [Inject] - protected IOApiService MpIoApiCall { get; set; } + protected IOApiService MpIoApiCall { get; set; } = null!; [Inject] protected MessageService MsgService { get; set; } = null!; @@ -86,7 +88,67 @@ namespace MP.SPEC.Components protected async Task startOdl(PODLModel selRec) { - await Task.Delay(1); + if (selRec != null) + { + int idxEvento = 0; + string evMess = ""; + // verifico ancora NON ci sia ODL corrente/aperto + if (canStartOdl(selRec.IdxMacchina)) + { + await callStartSetup(selRec.IdxMacchina); + await Task.Delay(1); + // chiamo stored stp_ODL_inizioSetupPromessa e recupero ODL corrente + var newOdl = await MDService.POdlDoSetup(selRec); + if (newOdl != null) + { + // registro evento... + idxEvento = 2; + evMess = $"Registrata inizio produzione | PODL {selRec.IdxPromessa} | ODL {newOdl.IdxOdl}"; + processaEvento(selRec.IdxMacchina, idxEvento, evMess, newOdl.IdxOdl); + + + //aspetto 1 sec + + + // idxEv = 1 + + //// processo chiusura setup + //string evText = "Registrata inizio produzione per ODL {0}"; + //StringBuilder sb = new StringBuilder(); + //sb.AppendLine(String.Format(evText, idxODLStart)); + //processaEvento(idxMacchinaFix, idxEvento, sb.ToString(), idxODLStart); + + + + + // richiedo refresh su IOB-WIN: + // DataLayerObj.addTask4Machine(machine.IdxMacchinaSlave, taskType.setParameter, "ForceUpdate"); + + await callForceUpdate(selRec.IdxMacchina); + await Task.Delay(1); + await callForceUpdate(selRec.IdxMacchina); + await Task.Delay(1); + await callSyncDb(selRec.IdxMacchina); + await Task.Delay(1); + } + } + } + } + + + /// + /// processa evento richiesto + /// + /// + /// + /// + /// + private void processaEvento(string idxMacc, int idxEvento, string userMsg, int idxODL) + { + + // scrivo evento scriviRigaEventoBarcode + + // fixme todo !!! FARE } /// @@ -112,7 +174,7 @@ namespace MP.SPEC.Components return; await Task.Delay(1); var done = await MDService.PODLDeleteRecord(selRec); - await callSyncDb(selRec); + await callSyncDb(selRec.IdxMacchina); currRecord = null; await reloadData(); await Task.Delay(1); @@ -212,17 +274,59 @@ namespace MP.SPEC.Components #region Private Methods + /// /// Chiama metodo x chiedere sync DB /// /// /// - private async Task callSyncDb(PODLModel selRec) + private async Task addTask2Exe(string idxMacc, string taskName, string taskVal) + { + // compongo URL e chiamo + string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName={taskName}&taskVal={taskVal}"; + var response = await MpIoApiCall.callMpIoUrlGet(restUrl); + } + + + /// + /// Chiama metodo x chiedere sync DB + /// + /// + /// + private async Task callSyncDb(string IdxMacc) { // chiamo aggiunta task SyncDb... + await addTask2Exe(IdxMacc, "syncDbData", ""); +#if false string idxMacc = selRec.IdxMacchina; string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName=syncDbData&taskVal="; - var response = await MpIoApiCall.callMpIoUrlGet(restUrl); + var response = await MpIoApiCall.callMpIoUrlGet(restUrl); +#endif + } + + + + + /// + /// Chiama metodo x chiedere force Update + /// + /// + /// + private async Task callForceUpdate(string IdxMacc) + { + // chiamo aggiunta task SyncDb... + await addTask2Exe(IdxMacc, "ForceUpdate", $"SPEC|TS:{DateTime.Now:yyMMddHHmmss}"); + } + + /// + /// Chiama metodo x indicare inizio setup + /// + /// + /// + private async Task callStartSetup(string IdxMacc) + { + // chiamo evento inizio setup + await addTask2Exe(IdxMacc, "startSetup", $"SPEC|TS:{DateTime.Now:yyMMddHHmmss}"); } private async void MessageService_EA_PageUpdated() diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 4a6d02ce..f110fcc0 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -699,6 +699,16 @@ namespace MP.SPEC.Data return await dbController.PODLUpdateRecord(currRec); } + /// + /// Avvio fase setup per il record selezionato + /// + /// + /// + public async Task POdlDoSetup(PODLModel currRec) + { + return await dbController.PODL_startSetup(currRec, 0, 1, 1, ""); ; + } + /// /// Statistiche ODL calcolate (da stored stp_STAT_ODL) /// diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index e7fa6a9e..180e6d8f 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2210.1712 + 6.16.2210.1720 diff --git a/MP.SPEC/Pages/PODL.razor.cs b/MP.SPEC/Pages/PODL.razor.cs index 964dc448..10e1038d 100644 --- a/MP.SPEC/Pages/PODL.razor.cs +++ b/MP.SPEC/Pages/PODL.razor.cs @@ -20,19 +20,19 @@ namespace MP.SPEC.Pages #region Protected Properties [Inject] - protected IJSRuntime JSRuntime { get; set; } + protected IJSRuntime JSRuntime { get; set; } = null!; [Inject] - protected MpDataService MDService { get; set; } + protected MpDataService MDService { get; set; } = null!; [Inject] - protected IOApiService MpIoApiCall { get; set; } + protected IOApiService MpIoApiCall { get; set; } = null!; [Inject] - protected MessageService MsgService { get; set; } + protected MessageService MsgService { get; set; } = null!; [Inject] - protected NavigationManager NavManager { get; set; } + protected NavigationManager NavManager { get; set; } = null!; #endregion Protected Properties diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 033649b1..60b20b12 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

        Versione: 6.16.2210.1712

        +

        Versione: 6.16.2210.1720


        Note di rilascio:
        • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index cfc216e1..fa8114d3 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.1712 +6.16.2210.1720 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 2bf44199..49aabde3 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.1712 + 6.16.2210.1720 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 From 77e7e39985f32835e1ecbd2912fae1adc19c2173 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 18 Oct 2022 08:41:12 +0200 Subject: [PATCH 9/9] Aggiornamento modifiche x chiudere ODL e creare nuovo --- MP.Data/Controllers/MpSpecController.cs | 436 +++++++++++++---------- MP.Data/DatabaseModels/EventListModel.cs | 47 +++ MP.Data/MoonProContext.cs | 7 + MP.SPEC/Components/ListPODL.razor.cs | 199 +++++------ MP.SPEC/Data/MpDataService.cs | 41 ++- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 9 files changed, 427 insertions(+), 311 deletions(-) create mode 100644 MP.Data/DatabaseModels/EventListModel.cs diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index eccef8b9..2e9cd40a 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -6,7 +6,6 @@ using NLog; using System; using System.Collections.Generic; using System.Linq; -using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; namespace MP.Data.Controllers @@ -99,6 +98,25 @@ namespace MP.Data.Controllers return ListValuesFilt("AnagArticoli", "Tipo"); } + /// + /// Elenco codice articoli che abbiano dati Dossier + /// + /// + public List ArticleWithDossier() + { + List dbResult = new List(); + using (var dbCtx = new MoonProContext(_configuration)) + { + dbResult = dbCtx + .DbSetDossiers + .AsNoTracking() + .Select(i => i.OdlNav.CodArticolo) + .Distinct() + .ToList(); + } + return dbResult; + } + /// /// Eliminazione Record /// @@ -192,29 +210,6 @@ namespace MP.Data.Controllers return dbResult; } - /// - /// Statistiche ODL calcolate (da stored stp_STAT_ODL) - /// - /// - public async Task> StatOdl(int IdxOdl) - { - List dbResult = new List(); - if (IdxOdl > 0) - { - using (var dbCtx = new MoonProContext(_configuration)) - { - var IdxODL = new SqlParameter("@IdxODL", IdxOdl); - - dbResult = await dbCtx - .DbSetStatOdl - .FromSqlRaw("EXEC stp_STAT_ODL @IdxODL", IdxODL) - .AsNoTracking() - .ToListAsync(); - } - } - return dbResult; - } - /// /// Update Record /// @@ -443,6 +438,7 @@ namespace MP.Data.Controllers } return fatto; } + /// /// Elenco valori link (x home e navMenu laterale) /// @@ -452,6 +448,32 @@ namespace MP.Data.Controllers return ListLinkFilt("SpecLink"); } + /// + /// Aggiunta record EventList + /// + /// + /// + public async Task EvListInsert(EventListModel newRec) + { + bool fatto = false; + using (var dbCtx = new MoonProContext(_configuration)) + { + try + { + var currRec = dbCtx + .DbSetEvList + .Add(newRec); + await dbCtx.SaveChangesAsync(); + } + catch (Exception exc) + { + Log.Error($"Eccezione durante EvListInsert{Environment.NewLine}{exc}"); + } + } + await Task.Delay(1); + return fatto; + } + /// /// Elenco ultimi n record flux log dato macchina e flusso (ordinato x data registrazione) /// @@ -598,25 +620,6 @@ namespace MP.Data.Controllers return dbResult; } - /// - /// Elenco codice articoli che abbiano dati Dossier - /// - /// - public List ArticleWithDossier() - { - List dbResult = new List(); - using (var dbCtx = new MoonProContext(_configuration)) - { - dbResult = dbCtx - .DbSetDossiers - .AsNoTracking() - .Select(i => i.OdlNav.CodArticolo) - .Distinct() - .ToList(); - } - return dbResult; - } - /// /// Elenco da tabella MappaStatoExpl /// @@ -637,6 +640,107 @@ namespace MP.Data.Controllers return dbResult; } + /// + /// Chiusura ODL con eventuale conferma pezzi + /// + /// idx odl da chiudere + /// idx macchina + /// matricola operatore + /// indica se confermare i pezzi prima di chiudere ODL + /// Conferma con rettifica (ev 121) x pezzi lasciati in macchina + /// Modo conferma produzione (0=periodo, 1=giorno, 2=turno) + /// + public async Task ODLClose(int idxOdl, string idxMacchina, int matrOpr, bool confPezzi, bool confRett, int modoConfProd) + { + bool fatto = false; + if (idxOdl > 0) + { + using (var dbCtx = new MoonProContext(_configuration)) + { + DateTime adesso = DateTime.Now; + // preparo i parametri + var IdxODL = new SqlParameter("@IdxODL", idxOdl); + var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina); + + // FARE FIXME TODO !!! da valutare casi setup/autoconferma... +#if false + // controllo se HO pezzi da confermare... + var statoProd = StatoProdMacchina(idxMacchina); + if (statoProd.pezziNonConfermati < 1) + { } +#endif + + // se richiesto confermo produzione + if (confPezzi) + { + var MatrApp = new SqlParameter("@MatrApp", idxMacchina); + + /* ---------------------------------- + * CONFERMA PEZZI + * + * condizioni da verificare: + * - gestione rettifica (ev121) / pezzi da LASCIARE in macchina + * - conferma a zero pezzi (setup) oppure con i pezzi fatti e non ancora confermati + * + * + * + * */ + + // recupero i dati dei pezzi da confermare... con DbSetPzProd + exec + // stp_PzProd_getByMacchina 'SIMUL_01' + + // stp_ConfermaProduzCompletaFull + /* + * @idxMacchina NVARCHAR(50), + @MatrApp INT, + @dataFrom DATETIME, + @dataTo DATETIME, + @pezziConf INT, + @pezziLasciati INT, -- pezzi lasciati = evento 121 (-) pre conferma e (+) dopo --> da lasciare in macchina post conferma + @pezziScar INT = 0, -- pezzi scartati (registrati da 2016.11.20) DA INDICARE COME VALORE > 0!!! sennò faccio ABS... + @TipoConf INT = 0, -- Tipo intervallo conferma: 0 = periodo intero, 1 = per giorni, 2 = per turni + @DataOraApp DATETIME = NULL, -- di norma GETDATE() nel programma - serve per ricalcolo + @TestConferma BIT = 1 -- TestConferma : 1 = verifica conf. duplicata e inserisci in ElencoConfermeProd, 0 = nessuna verifica e inserimento ( per ricalcolo ) + */ + } + + // ora chiudo ODL + try + { + var dbResult = await dbCtx + .DbSetStatOdl + .FromSqlRaw("EXEC stp_ODL_fineProd @IdxODL, @IdxMacchina", IdxODL, IdxMacchina) + .AsNoTracking() + .ToListAsync(); + } + catch (Exception exc) + { + Log.Error($"Eccezione durante ODLClose{Environment.NewLine}{exc}"); + } + } + } + return fatto; + } + + /// + /// Recupero odl data chiave + /// + /// + /// + /// + public ODLModel OdlGetByKey(int idxOdl) + { + ODLModel dbResult = new ODLModel(); + + using (var dbCtx = new MoonProContext(_configuration)) + { + dbResult = dbCtx + .DbSetODL + .FirstOrDefault(x => x.IdxOdl == idxOdl); + } + return dbResult; + } + /// /// Elenco parametri validi x una data macchina /// @@ -658,6 +762,55 @@ namespace MP.Data.Controllers return dbResult; } + /// + /// Avvio setup ODL da PODL + /// + /// + /// + /// + /// + /// + /// + public async Task PODL_startSetup(PODLModel editRec, int matrOpr, double tcRich, int pzPallet, string note) + { + ODLModel dbResult = new ODLModel(); + using (var dbCtx = new MoonProContext(_configuration)) + { + try + { + var currRec = dbCtx + .DbSetPODL + .Where(x => x.IdxPromessa == editRec.IdxPromessa) + .FirstOrDefault(); + if (currRec != null) + { + // eseguo stored attrezzaggio + var IdxPromessa = new SqlParameter("@idxPromessa", editRec.IdxPromessa); + var MatrOpr = new SqlParameter("@MatrOpr", matrOpr); + var IdxMacchina = new SqlParameter("@IdxMacchina", editRec.IdxMacchina); + var TCRichAttr = new SqlParameter("@TCRichAttr", tcRich); + var PzPallet = new SqlParameter("@PzPallet", pzPallet); + var Note = new SqlParameter("@Note", note); + var callResult = await dbCtx + .Database + .ExecuteSqlRawAsync("EXEC stp_ODL_inizioSetupPromessa @idxPromessa, @MatrOpr, @IdxMacchina @TCRichAttr, @PzPallet, @Note", IdxPromessa, MatrOpr, IdxMacchina, TCRichAttr, PzPallet, Note); + + // recupero info su ODL corrente + dbResult = await dbCtx + .DbSetODL + .Where(x => x.IdxMacchina == editRec.IdxMacchina && x.DataInizio != null && x.DataFine == null) + .FirstOrDefaultAsync(); + } + } + catch (Exception exc) + { + Log.Error($"Eccezione durante PODL_doSetup{Environment.NewLine}{exc}"); + } + } + await Task.Delay(1); + return dbResult; + } + /// /// Eliminazione Record /// @@ -733,160 +886,6 @@ namespace MP.Data.Controllers return fatto; } - - /// - /// Stato prod macchina - /// - /// - /// - public StatoProdModel StatoProdMacchina(string idxMacchina) - { - StatoProdModel dbResult = new StatoProdModel(); - using (var dbCtx = new MoonProContext(_configuration)) - { - var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina); - dbResult = dbCtx - .DbSetStatoProd - .FromSqlRaw("EXEC stp_PzProd_getByMacchina @IdxMacchina", IdxMacchina) - .AsNoTracking() - .FirstOrDefault(); - } - return dbResult; - } - - - /// - /// Avvio setup ODL da PODL - /// - /// - /// - /// - /// - /// - /// - public async Task PODL_startSetup(PODLModel editRec, int matrOpr, double tcRich, int pzPallet, string note) - { - ODLModel dbResult = new ODLModel(); - using (var dbCtx = new MoonProContext(_configuration)) - { - try - { - var currRec = dbCtx - .DbSetPODL - .Where(x => x.IdxPromessa == editRec.IdxPromessa) - .FirstOrDefault(); - if (currRec != null) - { - // eseguo stored attrezzaggio - var IdxPromessa = new SqlParameter("@idxPromessa", editRec.IdxPromessa); - var MatrOpr = new SqlParameter("@MatrOpr", matrOpr); - var IdxMacchina = new SqlParameter("@IdxMacchina", editRec.IdxMacchina); - var TCRichAttr = new SqlParameter("@TCRichAttr", tcRich); - var PzPallet = new SqlParameter("@PzPallet", pzPallet); - var Note = new SqlParameter("@Note", note); - var callResult = await dbCtx - .Database - .ExecuteSqlRawAsync("EXEC stp_ODL_inizioSetupPromessa @idxPromessa, @MatrOpr, @IdxMacchina @TCRichAttr, @PzPallet, @Note", IdxPromessa, MatrOpr, IdxMacchina, TCRichAttr, PzPallet, Note); - - // recupero info su ODL corrente - dbResult = await dbCtx - .DbSetODL - .Where(x => x.IdxMacchina == editRec.IdxMacchina && x.DataInizio != null && x.DataFine == null) - .FirstOrDefaultAsync(); - } - } - catch (Exception exc) - { - Log.Error($"Eccezione durante PODL_doSetup{Environment.NewLine}{exc}"); - } - } - await Task.Delay(1); - return dbResult; - } - - /// - /// Chiusura ODL con eventuale conferma pezzi - /// - /// idx odl da chiudere - /// idx macchina - /// matricola operatore - /// indica se confermare i pezzi prima di chiudere ODL - /// Conferma con rettifica (ev 121) x pezzi lasciati in macchina - /// Modo conferma produzione (0=periodo, 1=giorno, 2=turno) - /// - public async Task ODLClose(int idxOdl, string idxMacchina, int matrOpr, bool confPezzi, bool confRett, int modoConfProd) - { - bool fatto = false; - if (idxOdl > 0) - { - using (var dbCtx = new MoonProContext(_configuration)) - { - DateTime adesso = DateTime.Now; - // preparo i parametri - var IdxODL = new SqlParameter("@IdxODL", idxOdl); - var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina); - - // FARE FIXME TODO !!! - // da valutare casi setup/autoconferma... -#if false - // controllo se HO pezzi da confermare... - var statoProd = StatoProdMacchina(idxMacchina); - if (statoProd.pezziNonConfermati < 1) - { } -#endif - - // se richiesto confermo produzione - if (confPezzi) - { - var MatrApp = new SqlParameter("@MatrApp", idxMacchina); - - /* ---------------------------------- - * CONFERMA PEZZI - * - * condizioni da verificare: - * - gestione rettifica (ev121) / pezzi da LASCIARE in macchina - * - conferma a zero pezzi (setup) oppure con i pezzi fatti e non ancora confermati - * - * - * - * */ - - // recupero i dati dei pezzi da confermare... con DbSetPzProd + exec stp_PzProd_getByMacchina 'SIMUL_01' - - // stp_ConfermaProduzCompletaFull - /* - * @idxMacchina NVARCHAR(50), - @MatrApp INT, - @dataFrom DATETIME, - @dataTo DATETIME, - @pezziConf INT, - @pezziLasciati INT, -- pezzi lasciati = evento 121 (-) pre conferma e (+) dopo --> da lasciare in macchina post conferma - @pezziScar INT = 0, -- pezzi scartati (registrati da 2016.11.20) DA INDICARE COME VALORE > 0!!! sennò faccio ABS... - @TipoConf INT = 0, -- Tipo intervallo conferma: 0 = periodo intero, 1 = per giorni, 2 = per turni - @DataOraApp DATETIME = NULL, -- di norma GETDATE() nel programma - serve per ricalcolo - @TestConferma BIT = 1 -- TestConferma : 1 = verifica conf. duplicata e inserisci in ElencoConfermeProd, 0 = nessuna verifica e inserimento ( per ricalcolo ) - */ - } - - // ora chiudo ODL - try - { - var dbResult = await dbCtx - .DbSetStatOdl - .FromSqlRaw("EXEC stp_ODL_fineProd @IdxODL, @IdxMacchina", IdxODL, IdxMacchina) - .AsNoTracking() - .ToListAsync(); - } - catch (Exception exc) - { - Log.Error($"Eccezione durante ODLClose{Environment.NewLine}{exc}"); - } - } - } - return fatto; - } - - /// /// Annulla modifiche su una specifica entity (cancel update) /// @@ -912,6 +911,49 @@ namespace MP.Data.Controllers return answ; } + /// + /// Statistiche ODL calcolate (da stored stp_STAT_ODL) + /// + /// + public async Task> StatOdl(int IdxOdl) + { + List dbResult = new List(); + if (IdxOdl > 0) + { + using (var dbCtx = new MoonProContext(_configuration)) + { + var IdxODL = new SqlParameter("@IdxODL", IdxOdl); + + dbResult = await dbCtx + .DbSetStatOdl + .FromSqlRaw("EXEC stp_STAT_ODL @IdxODL", IdxODL) + .AsNoTracking() + .ToListAsync(); + } + } + return dbResult; + } + + /// + /// Stato prod macchina + /// + /// + /// + public StatoProdModel StatoProdMacchina(string idxMacchina) + { + StatoProdModel dbResult = new StatoProdModel(); + using (var dbCtx = new MoonProContext(_configuration)) + { + var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina); + dbResult = dbCtx + .DbSetStatoProd + .FromSqlRaw("EXEC stp_PzProd_getByMacchina @IdxMacchina", IdxMacchina) + .AsNoTracking() + .FirstOrDefault(); + } + return dbResult; + } + #endregion Public Methods #region Private Fields diff --git a/MP.Data/DatabaseModels/EventListModel.cs b/MP.Data/DatabaseModels/EventListModel.cs new file mode 100644 index 00000000..fc9e4558 --- /dev/null +++ b/MP.Data/DatabaseModels/EventListModel.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + + +#nullable disable +// +// This is here so CodeMaid doesn't reorganize this document +// +namespace MP.Data.DatabaseModels +{ + [Table("EventList")] + public partial class EventListModel + { + #region Public Properties + + [MaxLength(50)] + public string IdxMacchina { get; set; } = "NA"; + public DateTime? InizioStato { get; set; } = DateTime.Now; + public int IdxTipo { get; set; } = 0; + + [MaxLength(50)] + public string CodArticolo { get; set; } = ""; + + [MaxLength(250)] + public string Value { get; set; } = ""; + + public int MatrOpr { get; set; } = 0; + + [MaxLength(20)] + public string pallet { get; set; } = ""; + + /// + /// Navigazione oggetto Machine + /// + [ForeignKey("IdxMacchina")] + public virtual Macchine MachineNav { get; set; } = null!; + /// + /// Navigazione oggetto Articolo + /// + [ForeignKey("CodArticolo")] + public virtual AnagArticoli ArticoloNav { get; set; } = null!; + + #endregion Public Properties + } +} \ No newline at end of file diff --git a/MP.Data/MoonProContext.cs b/MP.Data/MoonProContext.cs index 163b7600..99ddb37e 100644 --- a/MP.Data/MoonProContext.cs +++ b/MP.Data/MoonProContext.cs @@ -50,6 +50,7 @@ namespace MP.Data public virtual DbSet DbSetDossiers { get; set; } public virtual DbSet DbSetStatOdl { get; set; } public virtual DbSet DbSetStatoProd { get; set; } + public virtual DbSet DbSetEvList { get; set; } #endregion Public Properties @@ -300,6 +301,12 @@ namespace MP.Data }); + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.IdxMacchina, e.InizioStato, e.IdxTipo}); + + }); + OnModelCreatingPartial(modelBuilder); } diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index f30db27f..c6c46400 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -3,8 +3,6 @@ using Microsoft.JSInterop; using MP.Data.DatabaseModels; using MP.SPEC.Data; using MP.SPEC.Services; -using System.Reflection.PortableExecutable; -using System.Text; namespace MP.SPEC.Components { @@ -86,83 +84,6 @@ namespace MP.SPEC.Components await RecordSel.InvokeAsync(newRec); } - protected async Task startOdl(PODLModel selRec) - { - if (selRec != null) - { - int idxEvento = 0; - string evMess = ""; - // verifico ancora NON ci sia ODL corrente/aperto - if (canStartOdl(selRec.IdxMacchina)) - { - await callStartSetup(selRec.IdxMacchina); - await Task.Delay(1); - // chiamo stored stp_ODL_inizioSetupPromessa e recupero ODL corrente - var newOdl = await MDService.POdlDoSetup(selRec); - if (newOdl != null) - { - // registro evento... - idxEvento = 2; - evMess = $"Registrata inizio produzione | PODL {selRec.IdxPromessa} | ODL {newOdl.IdxOdl}"; - processaEvento(selRec.IdxMacchina, idxEvento, evMess, newOdl.IdxOdl); - - - //aspetto 1 sec - - - // idxEv = 1 - - //// processo chiusura setup - //string evText = "Registrata inizio produzione per ODL {0}"; - //StringBuilder sb = new StringBuilder(); - //sb.AppendLine(String.Format(evText, idxODLStart)); - //processaEvento(idxMacchinaFix, idxEvento, sb.ToString(), idxODLStart); - - - - - // richiedo refresh su IOB-WIN: - // DataLayerObj.addTask4Machine(machine.IdxMacchinaSlave, taskType.setParameter, "ForceUpdate"); - - await callForceUpdate(selRec.IdxMacchina); - await Task.Delay(1); - await callForceUpdate(selRec.IdxMacchina); - await Task.Delay(1); - await callSyncDb(selRec.IdxMacchina); - await Task.Delay(1); - } - } - } - } - - - /// - /// processa evento richiesto - /// - /// - /// - /// - /// - private void processaEvento(string idxMacc, int idxEvento, string userMsg, int idxODL) - { - - // scrivo evento scriviRigaEventoBarcode - - // fixme todo !!! FARE - } - - /// - /// verifica se sia avviabile ODL x macchina - /// - /// - /// - private bool canStartOdl(string idxMacchina) - { - // fare!!! - bool answ = idxMacchina.Contains("BAG"); - return answ; - } - /// /// Eliminazione record selezionato (previa conferma) /// @@ -221,6 +142,46 @@ namespace MP.SPEC.Components await RecordSel.InvokeAsync(selRec); } + protected async Task startOdl(PODLModel selRec) + { + if (selRec != null) + { + int idxEvento = 0; + string evMess = ""; + // verifico ancora NON ci sia ODL corrente/aperto + if (canStartOdl(selRec.IdxMacchina)) + { + await callStartSetup(selRec.IdxMacchina); + await Task.Delay(1); + // chiamo stored stp_ODL_inizioSetupPromessa e recupero ODL corrente + var newOdl = await MDService.POdlDoSetup(selRec); + if (newOdl != null) + { + // registro evento... + idxEvento = 2; + evMess = $"Inizio Setup | PODL {selRec.IdxPromessa}"; + processaEvento(selRec.IdxMacchina, idxEvento, evMess, newOdl.IdxOdl, newOdl.CodArticolo); + + // aspetto 1 sec + await Task.Delay(1000); + + // registro inizio produzione + idxEvento = 2; + evMess = $"Registrata inizio Produzione | PODL {selRec.IdxPromessa} | ODL {newOdl.IdxOdl} | ART {newOdl.CodArticolo}"; + processaEvento(selRec.IdxMacchina, idxEvento, evMess, newOdl.IdxOdl, newOdl.CodArticolo); + + // chiamo task x IOB + await callForceUpdate(selRec.IdxMacchina); + await Task.Delay(1); + await callForceUpdate(selRec.IdxMacchina); + await Task.Delay(1); + await callSyncDb(selRec.IdxMacchina); + await Task.Delay(1); + } + } + } + } + protected async Task UpdateData() { currRecord = null; @@ -274,7 +235,6 @@ namespace MP.SPEC.Components #region Private Methods - /// /// Chiama metodo x chiedere sync DB /// @@ -287,26 +247,6 @@ namespace MP.SPEC.Components var response = await MpIoApiCall.callMpIoUrlGet(restUrl); } - - /// - /// Chiama metodo x chiedere sync DB - /// - /// - /// - private async Task callSyncDb(string IdxMacc) - { - // chiamo aggiunta task SyncDb... - await addTask2Exe(IdxMacc, "syncDbData", ""); -#if false - string idxMacc = selRec.IdxMacchina; - string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName=syncDbData&taskVal="; - var response = await MpIoApiCall.callMpIoUrlGet(restUrl); -#endif - } - - - - /// /// Chiama metodo x chiedere force Update /// @@ -329,6 +269,34 @@ namespace MP.SPEC.Components await addTask2Exe(IdxMacc, "startSetup", $"SPEC|TS:{DateTime.Now:yyMMddHHmmss}"); } + /// + /// Chiama metodo x chiedere sync DB + /// + /// + /// + private async Task callSyncDb(string IdxMacc) + { + // chiamo aggiunta task SyncDb... + await addTask2Exe(IdxMacc, "syncDbData", ""); +#if false + string idxMacc = selRec.IdxMacchina; + string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName=syncDbData&taskVal="; + var response = await MpIoApiCall.callMpIoUrlGet(restUrl); +#endif + } + + /// + /// verifica se sia avviabile ODL x macchina + /// + /// + /// + private bool canStartOdl(string idxMacchina) + { + // fare!!! + bool answ = idxMacchina.Contains("BAG"); + return answ; + } + private async void MessageService_EA_PageUpdated() { await reloadData(); @@ -345,6 +313,37 @@ namespace MP.SPEC.Components }); } + /// + /// processa evento richiesto + /// + /// + /// + /// + /// + private async void processaEvento(string idxMacc, int idxEvento, string userMsg, int idxODL, string codArticolo) + { + // se manca codart calcolo... + if (string.IsNullOrEmpty(codArticolo)) + { + var currOdl = await MDService.OdlGetByKey(idxODL); + codArticolo = currOdl.CodArticolo; + } + + // scrivo evento scriviRigaEventoBarcode + EventListModel newRec = new EventListModel() + { + IdxMacchina = idxMacc, + InizioStato = DateTime.Now, + IdxTipo = idxEvento, + CodArticolo = codArticolo, + MatrOpr = 0, + pallet = "", + Value = userMsg + }; + + await MDService.EvListInsert(newRec); + } + private async Task reloadData() { isLoading = true; diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index f110fcc0..75c9ce78 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -440,6 +440,16 @@ namespace MP.SPEC.Data return Task.FromResult(dbController.ElencoLink()); } + /// + /// Aggiunta record EventList + /// + /// + /// + public async Task EvListInsert(EventListModel newRec) + { + return await dbController.EvListInsert(newRec); + } + public async Task FlushRedisCache() { await Task.Delay(1); @@ -643,6 +653,17 @@ namespace MP.SPEC.Data return fatto; } + /// + /// Record ODL da chaive + /// + /// + public async Task OdlGetByKey(int IdxOdl) + { + await Task.Delay(1); + var dbResult = dbController.OdlGetByKey(IdxOdl); + return dbResult; + } + /// /// Elenco di tutti i parametri filtrati x macchina /// @@ -689,6 +710,16 @@ namespace MP.SPEC.Data return await dbController.PODLDeleteRecord(currRec); } + /// + /// Avvio fase setup per il record selezionato + /// + /// + /// + public async Task POdlDoSetup(PODLModel currRec) + { + return await dbController.PODL_startSetup(currRec, 0, 1, 1, ""); + } + /// /// Aggiornamento record selezionato /// @@ -699,16 +730,6 @@ namespace MP.SPEC.Data return await dbController.PODLUpdateRecord(currRec); } - /// - /// Avvio fase setup per il record selezionato - /// - /// - /// - public async Task POdlDoSetup(PODLModel currRec) - { - return await dbController.PODL_startSetup(currRec, 0, 1, 1, ""); ; - } - /// /// Statistiche ODL calcolate (da stored stp_STAT_ODL) /// diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 180e6d8f..dff9d1e3 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2210.1720 + 6.16.2210.1808 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 60b20b12..6223fb6c 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

          Versione: 6.16.2210.1720

          +

          Versione: 6.16.2210.1808


          Note di rilascio:
          • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index fa8114d3..96c69795 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.1720 +6.16.2210.1808 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 49aabde3..c877fcf2 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.1720 + 6.16.2210.1808 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