From 094ce0d1810b53ac08eeb755c243e3b0452fd55d Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Tue, 18 Oct 2022 11:10:39 +0200 Subject: [PATCH 01/10] fix style plot --- MP.SPEC/Components/Chart/Doughnut.razor.cs | 5 +++-- MP.SPEC/Components/ListODL.razor | 2 +- MP.SPEC/Components/ListODL.razor.cs | 21 ++++++++++++++++++++- MP.SPEC/Components/ODLPlot.razor | 2 +- MP.SPEC/Components/ODLPlot.razor.cs | 17 +++++++++++++++-- MP.SPEC/Data/DoughnutStyling.cs | 16 ++++++++++++++++ 6 files changed, 56 insertions(+), 7 deletions(-) create mode 100644 MP.SPEC/Data/DoughnutStyling.cs diff --git a/MP.SPEC/Components/Chart/Doughnut.razor.cs b/MP.SPEC/Components/Chart/Doughnut.razor.cs index 52b21dc9..b3c63a4f 100644 --- a/MP.SPEC/Components/Chart/Doughnut.razor.cs +++ b/MP.SPEC/Components/Chart/Doughnut.razor.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using MP.Data; +using MP.SPEC.Data; using static System.Net.Mime.MediaTypeNames; namespace MP.SPEC.Components.Chart @@ -28,7 +29,7 @@ namespace MP.SPEC.Components.Chart public double[] Data { get; set; } [Parameter] - public string[] BackgroundColor { get; set; } + public List BackgroundColor { get; set; } [Parameter] public string[] Labels { get; set; } @@ -46,7 +47,7 @@ namespace MP.SPEC.Components.Chart { Datasets = new[] { - new { Data = Data, BackgroundColor = BackgroundColor + new { Data = Data, BackgroundColor = BackgroundColor.Select(x=>x.color), borderColor = BackgroundColor.Select(x=>x.border), borderWidth= 0, offset= 10, borderRadius = 10 } }, Labels = Labels diff --git a/MP.SPEC/Components/ListODL.razor b/MP.SPEC/Components/ListODL.razor index 838f5857..a1368074 100644 --- a/MP.SPEC/Components/ListODL.razor +++ b/MP.SPEC/Components/ListODL.razor @@ -224,7 +224,7 @@ else
-
@($"{calcolaPerc(stat.TotDurata):N1}%")
+
@($"{calcolaPerc(stat.TotDurata):N1}%")
diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs index 897c8f71..473b369f 100644 --- a/MP.SPEC/Components/ListODL.razor.cs +++ b/MP.SPEC/Components/ListODL.razor.cs @@ -277,7 +277,26 @@ namespace MP.SPEC.Components } return answ; } - + private string pbStyle(string css) + { + string answ = ""; + if (ListOdlStats != null) + { + if (css == "yellow") + { + answ ="orange"; + } + else if (css == "blue") + { + answ = "purple"; + } + else + { + answ = css; + } + } + return answ; + } private async void MessageService_EA_PageUpdated() { await reloadData(); diff --git a/MP.SPEC/Components/ODLPlot.razor b/MP.SPEC/Components/ODLPlot.razor index 325b78fb..bbecf152 100644 --- a/MP.SPEC/Components/ODLPlot.razor +++ b/MP.SPEC/Components/ODLPlot.razor @@ -7,7 +7,7 @@ } else { - + } } \ No newline at end of file diff --git a/MP.SPEC/Components/ODLPlot.razor.cs b/MP.SPEC/Components/ODLPlot.razor.cs index 475a5db4..f3da5226 100644 --- a/MP.SPEC/Components/ODLPlot.razor.cs +++ b/MP.SPEC/Components/ODLPlot.razor.cs @@ -49,7 +49,7 @@ namespace MP.SPEC.Components public List Data = new List(); public List Labels = new List(); - public List colors = new List(); + public List colors = new List(); protected async Task ReloadData() { @@ -61,7 +61,20 @@ namespace MP.SPEC.Components { Data.Add(record.TotDurata); Labels.Add($"{record.Descrizione} - {record.TotDurata:N1}min"); - colors.Add($"{record.Css}"); + if (record.Css == "yellow") + { + colors.Add(new DoughnutStyling("orange", "ccc")); + } + else if (record.Css == "blue") + { + colors.Add(new DoughnutStyling("purple", "ccc")); + } + else + { + colors.Add(new DoughnutStyling(record.Css, "ccc")); + } + + } await Task.Delay(1); isLoading = false; diff --git a/MP.SPEC/Data/DoughnutStyling.cs b/MP.SPEC/Data/DoughnutStyling.cs new file mode 100644 index 00000000..54a76b53 --- /dev/null +++ b/MP.SPEC/Data/DoughnutStyling.cs @@ -0,0 +1,16 @@ +using System.Drawing; + +namespace MP.SPEC.Data +{ + public class DoughnutStyling + { + public string color { get; set; } + public string border { get; set; } + + public DoughnutStyling(string color, string border) + { + this.color = color; + this.border = border; + } + } +} From 0cf6ecd38fa1b3e98a1fb89cf21e1f4627a458b4 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Tue, 18 Oct 2022 11:23:27 +0200 Subject: [PATCH 02/10] fix colori --- MP.SPEC/Components/Chart/Doughnut.razor.cs | 2 +- MP.SPEC/Components/ListODL.razor.cs | 2 +- MP.SPEC/Components/ODLPlot.razor.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MP.SPEC/Components/Chart/Doughnut.razor.cs b/MP.SPEC/Components/Chart/Doughnut.razor.cs index b3c63a4f..e8c77ffb 100644 --- a/MP.SPEC/Components/Chart/Doughnut.razor.cs +++ b/MP.SPEC/Components/Chart/Doughnut.razor.cs @@ -47,7 +47,7 @@ namespace MP.SPEC.Components.Chart { Datasets = new[] { - new { Data = Data, BackgroundColor = BackgroundColor.Select(x=>x.color), borderColor = BackgroundColor.Select(x=>x.border), borderWidth= 0, offset= 10, borderRadius = 10 + new { Data = Data, BackgroundColor = BackgroundColor.Select(x=>x.color), borderColor = BackgroundColor.Select(x=>x.border), borderWidth= 0, offset= 1, borderRadius = 0 } }, Labels = Labels diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs index 473b369f..03017de9 100644 --- a/MP.SPEC/Components/ListODL.razor.cs +++ b/MP.SPEC/Components/ListODL.razor.cs @@ -288,7 +288,7 @@ namespace MP.SPEC.Components } else if (css == "blue") { - answ = "purple"; + answ = "#2874A6"; } else { diff --git a/MP.SPEC/Components/ODLPlot.razor.cs b/MP.SPEC/Components/ODLPlot.razor.cs index f3da5226..666e3af4 100644 --- a/MP.SPEC/Components/ODLPlot.razor.cs +++ b/MP.SPEC/Components/ODLPlot.razor.cs @@ -67,7 +67,7 @@ namespace MP.SPEC.Components } else if (record.Css == "blue") { - colors.Add(new DoughnutStyling("purple", "ccc")); + colors.Add(new DoughnutStyling("#2874A6", "ccc")); } else { From f56a7e516414c7b1dd875d14d7e5ac8f167db29e Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 18 Oct 2022 11:28:59 +0200 Subject: [PATCH 03/10] Aggiunto btn x forzare syncDb --- MP.SPEC/Components/ListODL.razor | 1 + MP.SPEC/Components/ListODL.razor.cs | 160 ++++++++++++++++++---------- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 6 files changed, 109 insertions(+), 60 deletions(-) diff --git a/MP.SPEC/Components/ListODL.razor b/MP.SPEC/Components/ListODL.razor index a1368074..0f4c5086 100644 --- a/MP.SPEC/Components/ListODL.razor +++ b/MP.SPEC/Components/ListODL.razor @@ -15,6 +15,7 @@ else @if (currRecord != null && !showStats && isCurrOdl) {
+
@*
diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs index 473b369f..2a062862 100644 --- a/MP.SPEC/Components/ListODL.razor.cs +++ b/MP.SPEC/Components/ListODL.razor.cs @@ -1,10 +1,8 @@ using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; -using MP.Data; using MP.Data.DatabaseModels; using MP.SPEC.Data; -using MP.SPEC.Pages; -using System.Xml.Linq; +using MP.SPEC.Services; namespace MP.SPEC.Components { @@ -45,34 +43,10 @@ namespace MP.SPEC.Components return MP.Data.Utils.FormDurata(durataMin); } - //oggetto contenente le funzioni del code behind che sono jsInvokable - private DotNetObjectReference? objRef; - -#if false //FUNZIONA SE IL METODO TriggerDotNetInstanceMethod() E' IN ONCLICK BOTTONE - - [JSInvokable] - public void setHelper() - { - objRef = DotNetObjectReference.Create(this); - } - [JSInvokable] - public void svuotaRecord() - { - currRecord = null; - - } - public async Task TriggerDotNetInstanceMethod() - { - await JSRuntime.InvokeVoidAsync("recordDeselect", objRef); - } -#endif - #endregion Public Methods #region Protected Properties - - [Inject] protected IJSRuntime JSRuntime { get; set; } = null!; @@ -82,6 +56,9 @@ namespace MP.SPEC.Components [Inject] protected MessageService MessageService { get; set; } = null!; + [Inject] + protected IOApiService MpIoApiCall { get; set; } = null!; + #endregion Protected Properties #region Protected Methods @@ -105,6 +82,34 @@ namespace MP.SPEC.Components await reloadData(); } + protected string colorChanger(string colorCSS) + { + string answ = ""; + if (colorCSS == "yellow") + { + answ = "text-dark"; + } + return answ; + } + + /// + /// Richiesta invio sync all'IOB-WIN + /// + /// + protected async Task forceSyncDb() + { + if (!await JSRuntime.InvokeAsync("confirm", "Sei sicuro di voler reinviare i dati (Articoli, PODL) all'impianto?")) + return; + + if (currRecord != null) + { + await callSyncDb(currRecord.IdxMacchina); + // ricarica... + await selectRecord(null); + } + await reloadData(); + } + protected override async Task OnInitializedAsync() { ListStati = await MDService.AnagStatiComm(); @@ -117,24 +122,6 @@ namespace MP.SPEC.Components await reloadData(); } - protected string colorChanger(string colorCSS) - { - string answ = ""; - if (colorCSS == "yellow") - { - answ = "text-dark"; - } - 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(() => @@ -145,12 +132,18 @@ namespace MP.SPEC.Components }); } + // return tsDurata.TotalMinutes; + //} protected async Task resetSel() { await selectRecord(null); await reloadData(); } + //protected double durataMin(DateTime? DataInizio, DateTime? DataFine) + //{ + // DateTime end = DataInizio != null ? (DateTime)DataFine : DateTime.Now; + // var tsDurata = (end).Subtract((DateTime)DataInizio); protected async Task selectRecord(ODLModel? currRec) { showStats = true; @@ -167,6 +160,7 @@ namespace MP.SPEC.Components ListOdlStats = null; } } + protected async Task selectStatRecord(ODLModel? currRec) { showStats = true; @@ -205,16 +199,36 @@ namespace MP.SPEC.Components private ODLModel? currRecord = null; - private ODLModel? statRecord = null; - private List? ListOdlStats; private List? ListRecords; private List? ListStati; + //oggetto contenente le funzioni del code behind che sono jsInvokable + private DotNetObjectReference? objRef; + +#if false //FUNZIONA SE IL METODO TriggerDotNetInstanceMethod() E' IN ONCLICK BOTTONE + + [JSInvokable] + public void setHelper() + { + objRef = DotNetObjectReference.Create(this); + } + [JSInvokable] + public void svuotaRecord() + { + currRecord = null; + } + public async Task TriggerDotNetInstanceMethod() + { + await JSRuntime.InvokeVoidAsync("recordDeselect", objRef); + } +#endif private List? SearchRecords; + private ODLModel? statRecord = null; + #endregion Private Fields #region Private Properties @@ -242,17 +256,33 @@ namespace MP.SPEC.Components } private DateTime selDtFine { get; set; } = DateTime.Now; + private bool showStats { get; set; } = false; -#if false - private List? ListOdlStatsData = new List(); - private List? ListOdlStatsLabels = new List(); -#endif + private int totalCount { get; set; } = 0; #endregion Private Properties #region Private Methods + /// + /// Chiama metodo x chiedere sync DB + /// + /// + /// + private async Task addTask2Exe(string idxMacc, string taskName, string taskVal) + { + // compongo URL e chiamo + string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName={taskName}&taskVal={taskVal}"; + try + { + var response = await MpIoApiCall.callMpIoUrlGet(restUrl); + } + catch (Exception exc) + { + } + } + private double calcolaPerc(double durata) { double answ = 0; @@ -277,6 +307,28 @@ namespace MP.SPEC.Components } return answ; } + + /// + /// Chiama metodo x chiedere sync DB + /// + /// + /// + private async Task callSyncDb(string IdxMacc) + { + // chiamo aggiunta task SyncDb... + await addTask2Exe(IdxMacc, "syncDbData", ""); + } + +#if false + private List? ListOdlStatsData = new List(); + private List? ListOdlStatsLabels = new List(); +#endif + + private async void MessageService_EA_PageUpdated() + { + await reloadData(); + } + private string pbStyle(string css) { string answ = ""; @@ -284,7 +336,7 @@ namespace MP.SPEC.Components { if (css == "yellow") { - answ ="orange"; + answ = "orange"; } else if (css == "blue") { @@ -297,10 +349,6 @@ namespace MP.SPEC.Components } return answ; } - private async void MessageService_EA_PageUpdated() - { - await reloadData(); - } private async Task reloadData() { diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index fa062dff..ff760eab 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2210.1810 + 6.16.2210.1811 diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index af7eb687..1781293c 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2210.1810

+

Versione: 6.16.2210.1811


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index d2be8c80..214992df 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.1810 +6.16.2210.1811 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index d4046f3a..b444da8d 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.1810 + 6.16.2210.1811 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 419863a68486a9ec890f37a94905e85e041d9f50 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 18 Oct 2022 12:01:04 +0200 Subject: [PATCH 04/10] Loop Update: inizio verifica ODL/PODL --- MP.Data/Controllers/MpSpecController.cs | 1 + MP.SPEC/Components/ListODL.razor | 10 ++-- MP.SPEC/Components/ListODL.razor.cs | 16 +++--- MP.SPEC/Components/ListPODL.razor.cs | 12 +++-- MP.SPEC/Data/MpDataService.cs | 11 ++-- MP.SPEC/Data/SelectOdlParams.cs | 1 + MP.SPEC/Data/SelectPOdlParams.cs | 72 +++++++++++++++++++++++++ MP.SPEC/Pages/ODL.razor.cs | 12 +++-- 8 files changed, 112 insertions(+), 23 deletions(-) create mode 100644 MP.SPEC/Data/SelectPOdlParams.cs diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index ead7a188..83e4b7f4 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -932,6 +932,7 @@ namespace MP.Data.Controllers currRec.KeyRichiesta = editRec.KeyRichiesta; currRec.NumPezzi = editRec.NumPezzi; currRec.Tcassegnato = editRec.Tcassegnato; + currRec.Attivabile = editRec.Attivabile; currRec.Note = editRec.Note; dbCtx.Entry(currRec).State = EntityState.Modified; } diff --git a/MP.SPEC/Components/ListODL.razor b/MP.SPEC/Components/ListODL.razor index 0f4c5086..3729a110 100644 --- a/MP.SPEC/Components/ListODL.razor +++ b/MP.SPEC/Components/ListODL.razor @@ -99,8 +99,9 @@ else else {
    -
    @($"{DateTime.Now:yyyy/MM/dd}")
    -
    @($"{DateTime.Now:ddd HH:mm:ss}")
    + @*
    @($"{DateTime.Now:yyyy/MM/dd}")
    +
    @($"{DateTime.Now:ddd HH:mm:ss}")
    *@ +
    NOW
    }
@@ -172,8 +173,9 @@ else else {
-
@($"{DateTime.Now:yyyy/MM/dd}")
-
@($"{DateTime.Now:ddd HH:mm:ss}")
+ @*
@($"{DateTime.Now:yyyy/MM/dd}")
+
@($"{DateTime.Now:ddd HH:mm:ss}")
*@ +
NOW
}
diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs index 2a062862..78fa855e 100644 --- a/MP.SPEC/Components/ListODL.razor.cs +++ b/MP.SPEC/Components/ListODL.razor.cs @@ -53,8 +53,10 @@ namespace MP.SPEC.Components [Inject] protected MpDataService MDService { get; set; } = null!; +#if false [Inject] - protected MessageService MessageService { get; set; } = null!; + protected MessageService MessageService { get; set; } = null!; +#endif [Inject] protected IOApiService MpIoApiCall { get; set; } = null!; @@ -235,8 +237,8 @@ namespace MP.SPEC.Components private int currPage { - get => MessageService.currPage; - set => MessageService.currPage = value; + get => currFilter.CurrPage; + set => currFilter.CurrPage = value; } /// @@ -251,8 +253,8 @@ namespace MP.SPEC.Components private int numRecord { - get => MessageService.numRecord; - set => MessageService.numRecord = value; + get => currFilter.NumRec; + set => currFilter.NumRec = value; } private DateTime selDtFine { get; set; } = DateTime.Now; @@ -324,10 +326,12 @@ namespace MP.SPEC.Components private List? ListOdlStatsLabels = new List(); #endif +#if false private async void MessageService_EA_PageUpdated() { await reloadData(); - } + } +#endif private string pbStyle(string css) { diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index ad5575e3..ce222f9f 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -51,8 +51,10 @@ namespace MP.SPEC.Components [Inject] protected IOApiService MpIoApiCall { get; set; } = null!; +#if true [Inject] - protected MessageService MsgService { get; set; } = null!; + protected MessageService MsgService { get; set; } = null!; +#endif #endregion Protected Properties @@ -103,9 +105,11 @@ namespace MP.SPEC.Components protected override async Task OnInitializedAsync() { +#if true MsgService.EA_PageUpdated += MessageService_EA_PageUpdated; MsgService.EA_SearchUpdated += OnSeachUpdated; - MsgService.EA_StatoSearch += MsgService_EA_StatoSearch; + MsgService.EA_StatoSearch += MsgService_EA_StatoSearch; +#endif ListStati = await MDService.AnagStatiComm(); } @@ -254,7 +258,7 @@ namespace MP.SPEC.Components { var response = await MpIoApiCall.callMpIoUrlGet(restUrl); } - catch(Exception exc) + catch (Exception exc) { } } @@ -305,7 +309,7 @@ namespace MP.SPEC.Components private bool canStartOdl(string idxMacchina) { var currOdl = MDService.OdlGetCurrentByMacc(idxMacchina); - bool answ = currOdl == null; + bool answ = (currOdl == null || currOdl.IdxOdl == 0); return answ; } diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 73f64ab4..4ddf2dee 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -686,13 +686,16 @@ namespace MP.SPEC.Data else { dbResult = dbController.OdlGetCurrentByMacc(idxMacchina); - // serializzp e salvo... - rawData = JsonConvert.SerializeObject(dbResult); - redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(3)); + //if (dbResult != null) + //{ + // serializzp e salvo... + rawData = JsonConvert.SerializeObject(dbResult); + redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(3)); + //} } if (dbResult == null) { - dbResult = new ODLModel(); + dbResult = new ODLModel(); } stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; diff --git a/MP.SPEC/Data/SelectOdlParams.cs b/MP.SPEC/Data/SelectOdlParams.cs index 47a23ad0..f9c089dd 100644 --- a/MP.SPEC/Data/SelectOdlParams.cs +++ b/MP.SPEC/Data/SelectOdlParams.cs @@ -17,6 +17,7 @@ namespace MP.SPEC.Data public string IdxMacchina { get; set; } = "*"; public int CurrPage { get; set; } = 1; public int NumRec { get; set; } = 10; + public int TotCount { get; set; } = 0; public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5); public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-7); public int MaxRecord { get; set; } = 100; diff --git a/MP.SPEC/Data/SelectPOdlParams.cs b/MP.SPEC/Data/SelectPOdlParams.cs new file mode 100644 index 00000000..b2e9b616 --- /dev/null +++ b/MP.SPEC/Data/SelectPOdlParams.cs @@ -0,0 +1,72 @@ +using MP.Data; + +namespace MP.SPEC.Data +{ + public class SelectPOdlParams + { + #region Public Constructors + + public SelectPOdlParams() + { } + + #endregion Public Constructors + + #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); + public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-7); + public int MaxRecord { get; set; } = 100; + public bool IsActive { get; set; } = true; + public string SearchVal { get; set; } = "*"; + + #endregion Public Properties + + #region Public Methods + + public override bool Equals(object obj) + { + if (!(obj is SelectOdlParams item)) + return false; + + if (IsActive != item.IsActive) + return false; + + if (CodStato != item.CodStato) + return false; + + if (IdxMacchina != item.IdxMacchina) + return false; + + if (MaxRecord != item.MaxRecord) + return false; + + if (NumRec != item.NumRec) + return false; + + if (DtStart != item.DtStart) + return false; + + if (DtEnd != item.DtEnd) + return false; + + if (CurrPage != item.CurrPage) + return false; + + if (SearchVal != item.SearchVal) + return false; + + return true; + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/MP.SPEC/Pages/ODL.razor.cs b/MP.SPEC/Pages/ODL.razor.cs index a9b5aba2..7ddd5330 100644 --- a/MP.SPEC/Pages/ODL.razor.cs +++ b/MP.SPEC/Pages/ODL.razor.cs @@ -116,7 +116,9 @@ namespace MP.SPEC.Pages protected void UpdateTotCount(int newTotCount) { - totalCount = newTotCount; +#if false + totalCount = newTotCount; +#endif } #endregion Protected Methods @@ -147,8 +149,8 @@ namespace MP.SPEC.Pages private int numRecord { - get => MsgService.numRecord; - set => MsgService.numRecord = value; + get => currFilter.NumRec; + set => currFilter.NumRec = value; } private string rightStringCSS @@ -169,8 +171,8 @@ namespace MP.SPEC.Pages private int totalCount { - get => MsgService.totalCount; - set => MsgService.totalCount = value; + get => currFilter.TotCount; + set => currFilter.TotCount = value; } #endregion Private Properties From 56c3ba40649d035f7ddb24dcde254d407abc0db2 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Tue, 18 Oct 2022 15:56:14 +0200 Subject: [PATCH 05/10] Fix loop ram --- MP.SPEC/Components/DataPager.razor.cs | 2 +- MP.SPEC/Components/ListODL.razor.cs | 16 ++++++- MP.SPEC/Components/ListPODL.razor.cs | 60 +++++++++++++++++---------- MP.SPEC/Data/SelectPOdlParams.cs | 3 ++ MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Pages/ODL.razor.cs | 12 +++--- MP.SPEC/Pages/PODL.razor.cs | 43 +++++++++++++------ MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 10 files changed, 95 insertions(+), 49 deletions(-) diff --git a/MP.SPEC/Components/DataPager.razor.cs b/MP.SPEC/Components/DataPager.razor.cs index dc625ff6..5fdb615f 100644 --- a/MP.SPEC/Components/DataPager.razor.cs +++ b/MP.SPEC/Components/DataPager.razor.cs @@ -98,7 +98,7 @@ namespace MP.SPEC.Components protected int _numRecord { get; set; } = 10; - protected int percLoading { get; set; } = 0; + protected int percLoading { get; set; } = 0; #endregion Protected Properties diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs index 324a21e0..de926587 100644 --- a/MP.SPEC/Components/ListODL.razor.cs +++ b/MP.SPEC/Components/ListODL.razor.cs @@ -261,7 +261,19 @@ namespace MP.SPEC.Components private bool showStats { get; set; } = false; - private int totalCount { get; set; } = 0; + private int _totalCount { get; set; } = 0; + private int totalCount + { + get => _totalCount; + set + { + if (_totalCount != value) + { + _totalCount = value; + updateRecordCount.InvokeAsync(value); + } + } + } #endregion Private Properties @@ -362,7 +374,7 @@ namespace MP.SPEC.Components ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); await Task.Delay(1); await InvokeAsync(() => StateHasChanged()); - await updateRecordCount.InvokeAsync(totalCount); + //await updateRecordCount.InvokeAsync(totalCount); isLoading = false; } diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index ce222f9f..62988fa8 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -38,6 +38,7 @@ namespace MP.SPEC.Components return answ; } + #endregion Public Methods #region Protected Properties @@ -51,7 +52,7 @@ namespace MP.SPEC.Components [Inject] protected IOApiService MpIoApiCall { get; set; } = null!; -#if true +#if false [Inject] protected MessageService MsgService { get; set; } = null!; #endif @@ -105,11 +106,12 @@ namespace MP.SPEC.Components protected override async Task OnInitializedAsync() { -#if true +#if false MsgService.EA_PageUpdated += MessageService_EA_PageUpdated; MsgService.EA_SearchUpdated += OnSeachUpdated; MsgService.EA_StatoSearch += MsgService_EA_StatoSearch; #endif + //await FilterChanged.InvokeAsync(currFilter); ListStati = await MDService.AnagStatiComm(); } @@ -209,37 +211,49 @@ namespace MP.SPEC.Components private List? ListStati; private List? SearchRecords; - + private SelectPOdlParams currFilter { get; set; } = new SelectPOdlParams(); #endregion Private Fields #region Private Properties private int currPage { - get => MsgService.currPage; - set => MsgService.currPage = value; + get => currFilter.CurrPage; + set => currFilter.CurrPage = value; } private bool isLoading { get; set; } = false; private int numRecord { - get => MsgService.numRecord; - set => MsgService.numRecord = value; + get => currFilter.NumRec; + set => currFilter.NumRec = value; } private string SearchVal { - get => string.IsNullOrEmpty(MsgService.SearchVal) ? "*" : MsgService.SearchVal; + get => string.IsNullOrEmpty(currFilter.SearchVal) ? "*" : currFilter.SearchVal; } private string StatoSel { - get => MsgService.StateSel; - set => MsgService.StateSel = value; + get => currFilter.CodStato; + set => currFilter.CodStato = value; } - private int totalCount { get; set; } = 0; + private int _totalCount { get; set; } = 0; + private int totalCount + { + get => _totalCount; + set + { + if (_totalCount != value) + { + _totalCount = value; + updateRecordCount.InvokeAsync(value); + } + } + } #endregion Private Properties @@ -318,16 +332,16 @@ namespace MP.SPEC.Components await reloadData(); } - private async void MsgService_EA_StatoSearch() - { - await InvokeAsync(() => - { - PagerResetReq.InvokeAsync(true); - //currPage = 1; - Task task = UpdateData(); - StateHasChanged(); - }); - } + //private async void MsgService_EA_StatoSearch() + //{ + // await InvokeAsync(() => + // { + // PagerResetReq.InvokeAsync(true); + // //currPage = 1; + // Task task = UpdateData(); + // StateHasChanged(); + // }); + //} /// /// processa evento richiesto @@ -371,7 +385,7 @@ namespace MP.SPEC.Components ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); await Task.Delay(1); await InvokeAsync(() => StateHasChanged()); - await updateRecordCount.InvokeAsync(totalCount); + //await updateRecordCount.InvokeAsync(totalCount); isLoading = false; } @@ -388,7 +402,7 @@ namespace MP.SPEC.Components } return answ; } - + #endregion Private Methods } } \ No newline at end of file diff --git a/MP.SPEC/Data/SelectPOdlParams.cs b/MP.SPEC/Data/SelectPOdlParams.cs index b2e9b616..685381f5 100644 --- a/MP.SPEC/Data/SelectPOdlParams.cs +++ b/MP.SPEC/Data/SelectPOdlParams.cs @@ -17,6 +17,7 @@ namespace MP.SPEC.Data public string IdxMacchina { get; set; } = "*"; public int CurrPage { get; set; } = 1; public int NumRec { get; set; } = 10; + public int TotCount { get; set; } = 0; public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5); public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-7); public int MaxRecord { get; set; } = 100; @@ -46,6 +47,8 @@ namespace MP.SPEC.Data if (NumRec != item.NumRec) return false; + if (TotCount != item.TotCount) + return false; if (DtStart != item.DtStart) return false; diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index ff760eab..9e33fab6 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2210.1811 + 6.16.2210.1815 diff --git a/MP.SPEC/Pages/ODL.razor.cs b/MP.SPEC/Pages/ODL.razor.cs index 7ddd5330..dab3642f 100644 --- a/MP.SPEC/Pages/ODL.razor.cs +++ b/MP.SPEC/Pages/ODL.razor.cs @@ -44,8 +44,10 @@ namespace MP.SPEC.Pages [Inject] protected MpDataService MDService { get; set; } = null!; +#if false [Inject] - protected MessageService MsgService { get; set; } = null!; + protected MessageService MsgService { get; set; } = null!; +#endif protected DateTime selDtEnd { @@ -87,10 +89,6 @@ namespace MP.SPEC.Pages protected override async Task OnInitializedAsync() { - // abilito ricerca... - MsgService.ShowSearch = true; - // resetto search - MsgService.SearchVal = ""; ListStati = await MDService.AnagStatiComm(); ListMacchine = await MDService.MacchineWithFlux(); #if false @@ -136,8 +134,8 @@ namespace MP.SPEC.Pages private int currPage { - get => MsgService.currPage; - set => MsgService.currPage = value; + get => currFilter.CurrPage; + set => currFilter.CurrPage = value; } private bool isLoading { get; set; } = false; diff --git a/MP.SPEC/Pages/PODL.razor.cs b/MP.SPEC/Pages/PODL.razor.cs index 10e1038d..4f34ca0f 100644 --- a/MP.SPEC/Pages/PODL.razor.cs +++ b/MP.SPEC/Pages/PODL.razor.cs @@ -14,6 +14,7 @@ namespace MP.SPEC.Pages protected DataPager pagerODL; protected bool reqNew = false; + private SelectPOdlParams currFilter { get; set; } = new SelectPOdlParams(); #endregion Protected Fields @@ -27,10 +28,12 @@ namespace MP.SPEC.Pages [Inject] protected IOApiService MpIoApiCall { get; set; } = null!; +#if false [Inject] protected MessageService MsgService { get; set; } = null!; +#endif [Inject] protected NavigationManager NavManager { get; set; } = null!; @@ -70,10 +73,6 @@ namespace MP.SPEC.Pages protected override async Task OnInitializedAsync() { - // abilito ricerca... - MsgService.ShowSearch = true; - // resetto search - MsgService.SearchVal = ""; ListAziende = await MDService.ElencoAziende(); ListGruppiFase = await MDService.ElencoGruppiFase(); ListMacchine = await MDService.MacchineGetAll(); @@ -239,8 +238,8 @@ namespace MP.SPEC.Pages private int currPage { - get => MsgService.currPage; - set => MsgService.currPage = value; + get => currFilter.CurrPage; + set => currFilter.CurrPage = value; } private PODLModel? currRecord @@ -257,20 +256,25 @@ namespace MP.SPEC.Pages private int numRecord { - get => MsgService.numRecord; - set => MsgService.numRecord = value; + get => currFilter.NumRec; + set => currFilter.NumRec = value; } private string selStato { - get => MsgService.StateSel; - set => MsgService.StateSel = value; + get => currFilter.CodStato; + set => currFilter.CodStato = value; } private int totalCount { - get => MsgService.totalCount; - set => MsgService.totalCount = value; + get => currFilter.TotCount; + set => currFilter.TotCount = value; + } + + protected void updateTotal(int newTotCount) + { + totalCount = newTotCount; } #endregion Private Properties @@ -305,6 +309,21 @@ namespace MP.SPEC.Pages isLoading = false; } + private async Task updateFilter(SelectPOdlParams newParams) + { + isLoading = true; + await Task.Delay(1); + currPage = 1; + if (newParams.CurrPage == 0) + { + newParams.CurrPage = 1; + } + await Task.Delay(1); + await InvokeAsync(() => StateHasChanged()); + currFilter = newParams; + isLoading = false; + } + #endregion Private Methods } } \ No newline at end of file diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 1781293c..54371c5b 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2210.1811

+

Versione: 6.16.2210.1815


Note di rilascio:
  • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 214992df..84418db8 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.1811 +6.16.2210.1815 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index b444da8d..c6f23083 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.1811 + 6.16.2210.1815 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 d659afacc2a1c089a92feb5448e76d448f316dad Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 18 Oct 2022 16:15:59 +0200 Subject: [PATCH 06/10] Fix PODL - paginazione - cambio num rec - sel fase --- MP.SPEC/Components/ListPODL.razor.cs | 47 ++++++++++------------- MP.SPEC/Data/MpDataService.cs | 8 +--- MP.SPEC/Data/SelectPOdlParams.cs | 4 +- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Pages/PODL.razor | 12 +++--- MP.SPEC/Pages/PODL.razor.cs | 57 ++++++++++------------------ MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 9 files changed, 53 insertions(+), 83 deletions(-) diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index 62988fa8..9875d2d1 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -10,6 +10,9 @@ namespace MP.SPEC.Components { #region Public Properties + [Parameter] + public SelectPOdlParams actFilter { get; set; } = new SelectPOdlParams(); + [Parameter] public EventCallback PagerResetReq { get; set; } @@ -38,7 +41,6 @@ namespace MP.SPEC.Components return answ; } - #endregion Public Methods #region Protected Properties @@ -52,13 +54,13 @@ namespace MP.SPEC.Components [Inject] protected IOApiService MpIoApiCall { get; set; } = null!; + #endregion Protected Properties + #if false [Inject] - protected MessageService MsgService { get; set; } = null!; + protected MessageService MsgService { get; set; } = null!; #endif - #endregion Protected Properties - #region Protected Methods protected async Task cloneRecord(PODLModel selRec) @@ -109,9 +111,9 @@ namespace MP.SPEC.Components #if false MsgService.EA_PageUpdated += MessageService_EA_PageUpdated; MsgService.EA_SearchUpdated += OnSeachUpdated; - MsgService.EA_StatoSearch += MsgService_EA_StatoSearch; + MsgService.EA_StatoSearch += MsgService_EA_StatoSearch; #endif - //await FilterChanged.InvokeAsync(currFilter); + //await FilterChanged.InvokeAsync(actFilter); ListStati = await MDService.AnagStatiComm(); } @@ -211,37 +213,38 @@ namespace MP.SPEC.Components private List? ListStati; private List? SearchRecords; - private SelectPOdlParams currFilter { get; set; } = new SelectPOdlParams(); + #endregion Private Fields #region Private Properties + private int _totalCount { get; set; } = 0; + private int currPage { - get => currFilter.CurrPage; - set => currFilter.CurrPage = value; + get => actFilter.CurrPage; + set => actFilter.CurrPage = value; } private bool isLoading { get; set; } = false; private int numRecord { - get => currFilter.NumRec; - set => currFilter.NumRec = value; + get => actFilter.NumRec; + set => actFilter.NumRec = value; } private string SearchVal { - get => string.IsNullOrEmpty(currFilter.SearchVal) ? "*" : currFilter.SearchVal; + get => string.IsNullOrEmpty(actFilter.SearchVal) ? "*" : actFilter.SearchVal; } private string StatoSel { - get => currFilter.CodStato; - set => currFilter.CodStato = value; + get => actFilter.CodFase; + set => actFilter.CodFase = value; } - private int _totalCount { get; set; } = 0; private int totalCount { get => _totalCount; @@ -327,22 +330,12 @@ namespace MP.SPEC.Components return answ; } + private async void MessageService_EA_PageUpdated() { await reloadData(); } - //private async void MsgService_EA_StatoSearch() - //{ - // await InvokeAsync(() => - // { - // PagerResetReq.InvokeAsync(true); - // //currPage = 1; - // Task task = UpdateData(); - // StateHasChanged(); - // }); - //} - /// /// processa evento richiesto /// @@ -402,7 +395,7 @@ namespace MP.SPEC.Components } return answ; } - + #endregion Private Methods } } \ No newline at end of file diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 4ddf2dee..e7bbcdf4 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -686,12 +686,8 @@ namespace MP.SPEC.Data else { dbResult = dbController.OdlGetCurrentByMacc(idxMacchina); - //if (dbResult != null) - //{ - // serializzp e salvo... - rawData = JsonConvert.SerializeObject(dbResult); - redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(3)); - //} + rawData = JsonConvert.SerializeObject(dbResult); + redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(3)); } if (dbResult == null) { diff --git a/MP.SPEC/Data/SelectPOdlParams.cs b/MP.SPEC/Data/SelectPOdlParams.cs index 685381f5..d0579bf5 100644 --- a/MP.SPEC/Data/SelectPOdlParams.cs +++ b/MP.SPEC/Data/SelectPOdlParams.cs @@ -13,7 +13,7 @@ namespace MP.SPEC.Data #region Public Properties - public string CodStato { get; set; } = "*"; + public string CodFase { get; set; } = "*"; public string IdxMacchina { get; set; } = "*"; public int CurrPage { get; set; } = 1; public int NumRec { get; set; } = 10; @@ -36,7 +36,7 @@ namespace MP.SPEC.Data if (IsActive != item.IsActive) return false; - if (CodStato != item.CodStato) + if (CodFase != item.CodStato) return false; if (IdxMacchina != item.IdxMacchina) diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 9e33fab6..933e1de5 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2210.1815 + 6.16.2210.1816 diff --git a/MP.SPEC/Pages/PODL.razor b/MP.SPEC/Pages/PODL.razor index 884921cd..f5c83e96 100644 --- a/MP.SPEC/Pages/PODL.razor +++ b/MP.SPEC/Pages/PODL.razor @@ -4,7 +4,7 @@
    -
    +

    Promesse ODL

    @@ -17,9 +17,9 @@
    -
    +
    - + @* + *@ - @if (ListStati != null) { @@ -222,7 +222,7 @@ } else { - + }
    @*
    - - - -
    *@ + + + +
    *@
    } @@ -99,9 +99,8 @@ else else {
    - @*
    @($"{DateTime.Now:yyyy/MM/dd}")
    -
    @($"{DateTime.Now:ddd HH:mm:ss}")
    *@ -
    NOW
    +
    @($"{DateTime.Now:yyyy/MM/dd}")
    +
    @($"{DateTime.Now:ddd HH:mm:ss}")
    }
    @@ -173,18 +172,13 @@ else else {
    - @*
    @($"{DateTime.Now:yyyy/MM/dd}")
    -
    @($"{DateTime.Now:ddd HH:mm:ss}")
    *@ -
    NOW
    +
    @($"{DateTime.Now:yyyy/MM/dd}")
    +
    @($"{DateTime.Now:ddd HH:mm:ss}")
    }
    - - - - diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs index de926587..619f0775 100644 --- a/MP.SPEC/Components/ListODL.razor.cs +++ b/MP.SPEC/Components/ListODL.razor.cs @@ -6,7 +6,7 @@ using MP.SPEC.Services; namespace MP.SPEC.Components { - public partial class ListODL + public partial class ListODL: IDisposable { #region Public Properties @@ -53,10 +53,14 @@ namespace MP.SPEC.Components [Inject] protected MpDataService MDService { get; set; } = null!; -#if false - [Inject] - protected MessageService MessageService { get; set; } = null!; -#endif + + + public void Dispose() + { + currRecord = null; + SearchRecords = null; + ListRecords= null; + } [Inject] protected IOApiService MpIoApiCall { get; set; } = null!; diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index c59d0875..ec59e0eb 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -13,7 +13,7 @@ namespace MP.SPEC.Components [Parameter] public SelectPOdlParams actFilter { get; set; } = new SelectPOdlParams(); - private SelectPOdlParams lastFilter { get; set; } = new SelectPOdlParams(); + private SelectPOdlParams lastFilter { get; set; } = new SelectPOdlParams() { CurrPage = -1 }; [Parameter] public EventCallback PagerResetReq { get; set; } diff --git a/MP.SPEC/Data/SelectPOdlParams.cs b/MP.SPEC/Data/SelectPOdlParams.cs index 5d6528db..a4836926 100644 --- a/MP.SPEC/Data/SelectPOdlParams.cs +++ b/MP.SPEC/Data/SelectPOdlParams.cs @@ -1,7 +1,4 @@ -using MP.Data; -using System.Runtime.CompilerServices; - -namespace MP.SPEC.Data +namespace MP.SPEC.Data { public class SelectPOdlParams { @@ -10,6 +7,28 @@ namespace MP.SPEC.Data public SelectPOdlParams() { } + #endregion Public Constructors + + #region Public Properties + + public string CodFase { get; set; } = "*"; + + public int CurrPage { get; set; } = 1; + + public string IdxMacchina { get; set; } = "*"; + + public int MaxRecord { get; set; } = 100; + + public int NumRec { get; set; } = 10; + + public string SearchVal { get; set; } = "*"; + + public int TotCount { get; set; } = 0; + + #endregion Public Properties + + #region Public Methods + public SelectPOdlParams clone() { SelectPOdlParams clonedData = new SelectPOdlParams() @@ -25,28 +44,12 @@ namespace MP.SPEC.Data return clonedData; } - #endregion Public Constructors - - #region Public Properties - - public string CodFase { get; set; } = "*"; - public string IdxMacchina { get; set; } = "*"; - public int CurrPage { get; set; } = 1; - public int NumRec { get; set; } = 10; - public int TotCount { get; set; } = 0; - public int MaxRecord { get; set; } = 100; - public string SearchVal { get; set; } = "*"; - - #endregion Public Properties - - #region Public Methods - public override bool Equals(object obj) { - if (!(obj is SelectOdlParams item)) + if (!(obj is SelectPOdlParams item)) return false; - if (CodFase != item.CodStato) + if (CodFase != item.CodFase) return false; if (MaxRecord != item.MaxRecord) @@ -54,6 +57,7 @@ namespace MP.SPEC.Data if (NumRec != item.NumRec) return false; + if (TotCount != item.TotCount) return false; diff --git a/MP.SPEC/Pages/ODL.razor.cs b/MP.SPEC/Pages/ODL.razor.cs index dab3642f..a8ff4f78 100644 --- a/MP.SPEC/Pages/ODL.razor.cs +++ b/MP.SPEC/Pages/ODL.razor.cs @@ -26,7 +26,7 @@ namespace MP.SPEC.Pages #region Protected Fields - protected DataPager pagerODL; + protected DataPager pagerODL = null!; #endregion Protected Fields @@ -44,11 +44,6 @@ namespace MP.SPEC.Pages [Inject] protected MpDataService MDService { get; set; } = null!; -#if false - [Inject] - protected MessageService MsgService { get; set; } = null!; -#endif - protected DateTime selDtEnd { get => currFilter.DtEnd; @@ -91,10 +86,6 @@ namespace MP.SPEC.Pages { ListStati = await MDService.AnagStatiComm(); ListMacchine = await MDService.MacchineWithFlux(); -#if false - // carico dati - await reloadData(); -#endif } protected async Task pgResetReq(bool doReset) @@ -114,9 +105,7 @@ namespace MP.SPEC.Pages protected void UpdateTotCount(int newTotCount) { -#if false - totalCount = newTotCount; -#endif + totalCount = newTotCount; } #endregion Protected Methods diff --git a/MP.SPEC/Pages/PODL.razor b/MP.SPEC/Pages/PODL.razor index f5c83e96..edd74ebb 100644 --- a/MP.SPEC/Pages/PODL.razor +++ b/MP.SPEC/Pages/PODL.razor @@ -226,9 +226,6 @@ }
    -
    - - - + \ No newline at end of file diff --git a/MP.SPEC/Pages/PODL.razor.cs b/MP.SPEC/Pages/PODL.razor.cs index 268d2729..b9699f04 100644 --- a/MP.SPEC/Pages/PODL.razor.cs +++ b/MP.SPEC/Pages/PODL.razor.cs @@ -11,7 +11,7 @@ namespace MP.SPEC.Pages { #region Protected Fields - protected DataPager pagerODL; + protected DataPager pagerODL = null!; protected bool reqNew = false; @@ -153,11 +153,6 @@ namespace MP.SPEC.Pages await Task.Delay(1); } - protected void updateTotal(int newTotCount) - { - totalCount = newTotCount; - } - protected void UpdateTotCount(int newTotCount) { totalCount = newTotCount; From 12473b5088254c97b03c98939ff89223264044c2 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 18 Oct 2022 17:10:29 +0200 Subject: [PATCH 09/10] Ancora cleanup di GC x recupero RAM inutilizzata --- MP.SPEC/Components/ListDossiers.razor.cs | 12 ++++- MP.SPEC/Components/ListODL.razor.cs | 66 +++++------------------- MP.SPEC/Components/ListPARAMS.razor.cs | 4 ++ MP.SPEC/Components/ListPODL.razor.cs | 11 +++- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Pages/Articoli.razor.cs | 6 +++ MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 9 files changed, 49 insertions(+), 58 deletions(-) diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs index 4fde0b3a..b52d02dc 100644 --- a/MP.SPEC/Components/ListDossiers.razor.cs +++ b/MP.SPEC/Components/ListDossiers.razor.cs @@ -6,7 +6,7 @@ using MP.SPEC.Data; namespace MP.SPEC.Components { - public partial class ListDossiers + public partial class ListDossiers: IDisposable { #region Public Properties @@ -40,6 +40,16 @@ namespace MP.SPEC.Components } return answ; } + public void Dispose() + { + MessageService.EA_PageUpdated -= MessageService_EA_PageUpdated; + MessageService.EA_SearchUpdated -= OnSeachUpdated; + currRecord = null; + SearchRecords = null; + ListRecords = null; + GC.Collect(); + } + #endregion Public Methods diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs index 619f0775..97105efa 100644 --- a/MP.SPEC/Components/ListODL.razor.cs +++ b/MP.SPEC/Components/ListODL.razor.cs @@ -6,7 +6,7 @@ using MP.SPEC.Services; namespace MP.SPEC.Components { - public partial class ListODL: IDisposable + public partial class ListODL : IDisposable { #region Public Properties @@ -38,6 +38,17 @@ namespace MP.SPEC.Components return answ; } + public void Dispose() + { + currRecord = null; + SearchRecords = null; + ListRecords = null; + ListStati = null; + ListOdlStats = null; + statRecord = null; + GC.Collect(); + } + public string formDurata(double durataMin) { return MP.Data.Utils.FormDurata(durataMin); @@ -53,15 +64,6 @@ namespace MP.SPEC.Components [Inject] protected MpDataService MDService { get; set; } = null!; - - - public void Dispose() - { - currRecord = null; - SearchRecords = null; - ListRecords= null; - } - [Inject] protected IOApiService MpIoApiCall { get; set; } = null!; @@ -119,8 +121,6 @@ namespace MP.SPEC.Components protected override async Task OnInitializedAsync() { ListStati = await MDService.AnagStatiComm(); - objRef = DotNetObjectReference.Create(this); - //await JSRuntime.InvokeVoidAsync("setHelper", objRef); } protected override async Task OnParametersSetAsync() @@ -138,18 +138,12 @@ namespace MP.SPEC.Components }); } - // return tsDurata.TotalMinutes; - //} protected async Task resetSel() { await selectRecord(null); await reloadData(); } - //protected double durataMin(DateTime? DataInizio, DateTime? DataFine) - //{ - // DateTime end = DataInizio != null ? (DateTime)DataFine : DateTime.Now; - // var tsDurata = (end).Subtract((DateTime)DataInizio); protected async Task selectRecord(ODLModel? currRec) { showStats = true; @@ -211,26 +205,6 @@ namespace MP.SPEC.Components private List? ListStati; - //oggetto contenente le funzioni del code behind che sono jsInvokable - private DotNetObjectReference? objRef; - -#if false //FUNZIONA SE IL METODO TriggerDotNetInstanceMethod() E' IN ONCLICK BOTTONE - - [JSInvokable] - public void setHelper() - { - objRef = DotNetObjectReference.Create(this); - } - [JSInvokable] - public void svuotaRecord() - { - currRecord = null; - } - public async Task TriggerDotNetInstanceMethod() - { - await JSRuntime.InvokeVoidAsync("recordDeselect", objRef); - } -#endif private List? SearchRecords; private ODLModel? statRecord = null; @@ -239,6 +213,8 @@ namespace MP.SPEC.Components #region Private Properties + private int _totalCount { get; set; } = 0; + private int currPage { get => currFilter.CurrPage; @@ -265,7 +241,6 @@ namespace MP.SPEC.Components private bool showStats { get; set; } = false; - private int _totalCount { get; set; } = 0; private int totalCount { get => _totalCount; @@ -337,18 +312,6 @@ namespace MP.SPEC.Components await addTask2Exe(IdxMacc, "syncDbData", ""); } -#if false - private List? ListOdlStatsData = new List(); - private List? ListOdlStatsLabels = new List(); -#endif - -#if false - private async void MessageService_EA_PageUpdated() - { - await reloadData(); - } -#endif - private string pbStyle(string css) { string answ = ""; @@ -378,7 +341,6 @@ namespace MP.SPEC.Components ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); await Task.Delay(1); await InvokeAsync(() => StateHasChanged()); - //await updateRecordCount.InvokeAsync(totalCount); isLoading = false; } diff --git a/MP.SPEC/Components/ListPARAMS.razor.cs b/MP.SPEC/Components/ListPARAMS.razor.cs index c699b8fe..9b8844ed 100644 --- a/MP.SPEC/Components/ListPARAMS.razor.cs +++ b/MP.SPEC/Components/ListPARAMS.razor.cs @@ -62,6 +62,10 @@ namespace MP.SPEC.Components MessageService.EA_SearchUpdated -= OnSeachUpdated; aTimer.Stop(); aTimer.Dispose(); + currRecord = null; + SearchRecords = null; + ListRecords = null; + GC.Collect(); } public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e) diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index ec59e0eb..dad65b17 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -6,7 +6,7 @@ using MP.SPEC.Services; namespace MP.SPEC.Components { - public partial class ListPODL + public partial class ListPODL : IDisposable { #region Public Properties @@ -45,6 +45,15 @@ namespace MP.SPEC.Components #endregion Public Methods + public void Dispose() + { + currRecord = null; + SearchRecords = null; + ListRecords = null; + ListStati = null; + GC.Collect(); + } + #region Protected Properties [Inject] diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 933e1de5..bd297fa3 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2210.1816 + 6.16.2210.1817 diff --git a/MP.SPEC/Pages/Articoli.razor.cs b/MP.SPEC/Pages/Articoli.razor.cs index 577db802..25bceea2 100644 --- a/MP.SPEC/Pages/Articoli.razor.cs +++ b/MP.SPEC/Pages/Articoli.razor.cs @@ -27,6 +27,12 @@ namespace MP.SPEC.Pages public void Dispose() { MessageService.EA_SearchUpdated -= OnSeachUpdated; + currRecord = null; + ListTipoArt = null; + ListAziende = null; + SearchRecords = null; + ListRecords = null; + GC.Collect(); } public async void OnSeachUpdated() diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 9801ef3d..64a26b06 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

    Versione: 6.16.2210.1816

    +

    Versione: 6.16.2210.1817


    Note di rilascio:
    • diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 3b73da9f..458a9aa8 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2210.1816 +6.16.2210.1817 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index cd716faa..4f3dec63 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2210.1816 + 6.16.2210.1817 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 6e75f590bb69fcfd7421b0d5cd1ebaee31618a7e Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 18 Oct 2022 17:11:42 +0200 Subject: [PATCH 10/10] pulizia codice --- MP.SPEC/Components/ListDossiers.razor.cs | 12 ------------ MP.SPEC/Components/ListPODL.razor.cs | 10 ---------- 2 files changed, 22 deletions(-) diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs index b52d02dc..09b6ee5b 100644 --- a/MP.SPEC/Components/ListDossiers.razor.cs +++ b/MP.SPEC/Components/ListDossiers.razor.cs @@ -91,18 +91,6 @@ namespace MP.SPEC.Components await RecordSelFlux.InvokeAsync(selRec); } - protected string findRec(FluxLog record) - { - string answ = ""; -#if false - if (ListRecordsMod != null) - { - answ = ListRecordsMod.Where(l => l.IdxMacchina == record.IdxMacchina && l.CodFlux == record.CodFlux).Select(x => x.Valore).SingleOrDefault(); - } -#endif - return answ; - } - protected override async Task OnInitializedAsync() { MessageService.EA_PageUpdated += MessageService_EA_PageUpdated; diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index dad65b17..52150c77 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -114,11 +114,6 @@ namespace MP.SPEC.Components protected override async Task OnInitializedAsync() { -#if false - MsgService.EA_PageUpdated += MessageService_EA_PageUpdated; - MsgService.EA_SearchUpdated += OnSeachUpdated; - MsgService.EA_StatoSearch += MsgService_EA_StatoSearch; -#endif //await FilterChanged.InvokeAsync(actFilter); ListStati = await MDService.AnagStatiComm(); } @@ -321,11 +316,6 @@ namespace MP.SPEC.Components { // 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 } ///