diff --git a/MP-TAB3/Components/AlarmsMan.razor b/MP-TAB3/Components/AlarmsMan.razor index 71c0d8ef..1c0530a8 100644 --- a/MP-TAB3/Components/AlarmsMan.razor +++ b/MP-TAB3/Components/AlarmsMan.razor @@ -65,7 +65,13 @@ else } + + + + + + + - } \ No newline at end of file diff --git a/MP-TAB3/Components/ControlsMan.razor b/MP-TAB3/Components/ControlsMan.razor index 1ce73d7b..344b70d0 100644 --- a/MP-TAB3/Components/ControlsMan.razor +++ b/MP-TAB3/Components/ControlsMan.razor @@ -123,11 +123,15 @@ } + + + + + + + - \ No newline at end of file diff --git a/MP-TAB3/Components/ControlsMan.razor.cs b/MP-TAB3/Components/ControlsMan.razor.cs index fc59d458..7dd27879 100644 --- a/MP-TAB3/Components/ControlsMan.razor.cs +++ b/MP-TAB3/Components/ControlsMan.razor.cs @@ -6,7 +6,7 @@ using static EgwCoreLib.Utils.DtUtils; namespace MP_TAB3.Components { - public partial class ControlsMan + public partial class ControlsMan : IDisposable { #region Public Properties @@ -23,6 +23,12 @@ namespace MP_TAB3.Components #region Public Methods + public void Dispose() + { + ListComplete.Clear(); + ListPaged.Clear(); + } + /// /// Aggiorno valori produzione alla data richiesta... /// @@ -33,7 +39,7 @@ namespace MP_TAB3.Components await Task.Delay(1); if (!string.IsNullOrEmpty(IdxMaccSel)) { - ListComplete = await TabDServ.RegControlliFilt(IdxMaccSel, IdxOdl, CurrPeriodo.Inizio, CurrPeriodo.Fine, false); + ListComplete = await TabDServ.RegControlliFiltAsync(IdxMaccSel, IdxOdl, CurrPeriodo.Inizio, CurrPeriodo.Fine, false); TotalCount = ListComplete.Count; // esegue paginazione UpdateTable(); @@ -78,8 +84,6 @@ namespace MP_TAB3.Components #endregion Protected Properties - private bool isMulti = false; - #region Protected Methods /// @@ -125,44 +129,7 @@ namespace MP_TAB3.Components await doUpdate(); } } - /// - /// Macchina selezionata MAIN - /// - private string IdxMaccMain - { - get => RecMSE != null ? RecMSE.IdxMacchina : ""; - } - /// - /// Restituisce il codice IdxMacchina dell'altra tavola (se multi) altrimenti la stessa macchina... - /// - private string idxMaccAltraTav - { - get - { - string answ = ""; - if (RecMSE != null) - { - try - { - // verifico se SIA una tavola (ha char "#") - int iSharp = IdxMaccMain.IndexOf('#'); - if (iSharp > 0) - { - // ora verifico SE ALTRA TAVOLA ha ODL... - string nomeTav = IdxMaccMain.Substring(iSharp); - string altraTav = nomeTav.Substring(0, nomeTav.Length - 1); - altraTav += nomeTav.EndsWith("1") ? "2" : "1"; - // sistemo nome - answ = IdxMaccMain.Replace(nomeTav, altraTav); - } - } - catch - { } - } - return answ; - } - } protected async Task SaveKo() { isProcessing = true; @@ -279,7 +246,7 @@ namespace MP_TAB3.Components #region Private Fields private static Logger Log = LogManager.GetCurrentClassLogger(); - + private bool isMulti = false; private bool isProcessing = false; private string noteKo = ""; @@ -302,9 +269,48 @@ namespace MP_TAB3.Components private Periodo CurrPeriodo { get; set; } = new Periodo(); - private string IdxMaccSel { get; set; } = ""; private string IdxMaccAltra { get; set; } = ""; + /// + /// Restituisce il codice IdxMacchina dell'altra tavola (se multi) altrimenti la stessa macchina... + /// + private string idxMaccAltraTav + { + get + { + string answ = ""; + if (RecMSE != null) + { + try + { + // verifico se SIA una tavola (ha char "#") + int iSharp = IdxMaccMain.IndexOf('#'); + if (iSharp > 0) + { + // ora verifico SE ALTRA TAVOLA ha ODL... + string nomeTav = IdxMaccMain.Substring(iSharp); + string altraTav = nomeTav.Substring(0, nomeTav.Length - 1); + altraTav += nomeTav.EndsWith("1") ? "2" : "1"; + // sistemo nome + answ = IdxMaccMain.Replace(nomeTav, altraTav); + } + } + catch + { } + } + return answ; + } + } + + /// + /// Macchina selezionata MAIN + /// + private string IdxMaccMain + { + get => RecMSE != null ? RecMSE.IdxMacchina : ""; + } + + private string IdxMaccSel { get; set; } = ""; private int IdxOdl { get; set; } = 0; private string selMessage diff --git a/MP-TAB3/Components/DeclarMan.razor b/MP-TAB3/Components/DeclarMan.razor index cadac2f2..ac0cb7e6 100644 --- a/MP-TAB3/Components/DeclarMan.razor +++ b/MP-TAB3/Components/DeclarMan.razor @@ -44,7 +44,7 @@ { - + @@ -64,11 +64,15 @@ } + + + + + + + -
- -
\ No newline at end of file diff --git a/MP-TAB3/Components/FixOdl.razor.cs b/MP-TAB3/Components/FixOdl.razor.cs index 4e42017b..246b506c 100644 --- a/MP-TAB3/Components/FixOdl.razor.cs +++ b/MP-TAB3/Components/FixOdl.razor.cs @@ -37,8 +37,8 @@ namespace MP_TAB3.Components get => showFixOdl ? "fa-chevron-up" : "fa-chevron-down"; } - protected List ListComplete { get; set; } = new List(); - protected List ListPaged { get; set; } = new List(); + protected List ListComplete { get; set; } = new List(); + protected List ListPaged { get; set; } = new List(); [Inject] protected MessageService MServ { get; set; } = null!; diff --git a/MP-TAB3/Components/InsManual.razor b/MP-TAB3/Components/InsManual.razor index 394a2375..a0f100cf 100644 --- a/MP-TAB3/Components/InsManual.razor +++ b/MP-TAB3/Components/InsManual.razor @@ -222,45 +222,56 @@ - @foreach (var item in ListDay) + @if (ListDay == null) { - - @if (item.Imported == null) - { - - } - else - { - - } - - @item.IdxMacchina - @(EvDescript(item.IdxTipoEv)) - -
@item.CodArticolo
- @if (!string.IsNullOrEmpty(item.KeyRichiesta)) - { - @item.KeyRichiesta - } - - {item.FineStato:yyyy.MM.dd HH:mm:ss}")">@($"{item.InizioStato:HH:mm}") - @item.PzBuoni - @($"{item.TCiclo:f2}") - @($"{item.MinProd:f2}") - - @if (item.Imported == null) - { - - } - else - { - - - } + +
Nessun dato disponibile
} + else + { + foreach (var item in ListDay) + { + + + @if (item.Imported == null) + { + + } + else + { + + } + + @item.IdxMacchina + @(EvDescript(item.IdxTipoEv)) + +
@item.CodArticolo
+ @if (!string.IsNullOrEmpty(item.KeyRichiesta)) + { + @item.KeyRichiesta + } + + {item.FineStato:yyyy.MM.dd HH:mm:ss}")">@($"{item.InizioStato:HH:mm}") + @item.PzBuoni + @($"{item.TCiclo:f2}") + @($"{item.MinProd:f2}") + + @if (item.Imported == null) + { + + } + else + { + + + } + + + } + } diff --git a/MP-TAB3/Components/MachineBlock.razor.cs b/MP-TAB3/Components/MachineBlock.razor.cs index edd660b6..468c422d 100644 --- a/MP-TAB3/Components/MachineBlock.razor.cs +++ b/MP-TAB3/Components/MachineBlock.razor.cs @@ -70,6 +70,10 @@ namespace MP_TAB3.Components public void Dispose() { + innerCircleVals.Clear(); + outerCircleVals.Clear(); + datiProdAct = null; + LastRecMSE = null; TabDServ.DataInvalidated -= TabDServ_DataInvalidated; } @@ -331,7 +335,7 @@ namespace MP_TAB3.Components { innerCircleVals.Add(new CircleGaugeMulti.CircSegm() { Color = "#CD1916", Value = datiProdAct.PzConfScarto }); } - if (CRecMSE.extraVal > 0) + if (CRecMSE != null && CRecMSE.extraVal > 0) { outerCircleVals.Add(new CircleGaugeMulti.CircSegm() { Color = "#1367FD", Value = CRecMSE.extraVal }); } @@ -525,7 +529,11 @@ namespace MP_TAB3.Components return true; if (LastIdxMacchSub != IdxMacchSub) return true; - if (!LastRecMSE.MostlyEquals(RecMSE)) + if (LastRecMSE == null && RecMSE != null) + return true; + if (LastRecMSE != null && RecMSE == null) + return true; + if (LastRecMSE != null && !LastRecMSE.MostlyEquals(RecMSE)) return true; return false; diff --git a/MP-TAB3/Components/MachineSelOdl.razor.cs b/MP-TAB3/Components/MachineSelOdl.razor.cs index 6d92ec57..0dc5e4a6 100644 --- a/MP-TAB3/Components/MachineSelOdl.razor.cs +++ b/MP-TAB3/Components/MachineSelOdl.razor.cs @@ -14,17 +14,8 @@ namespace MP_TAB3.Components [Parameter] public string IdxMacchina { get; set; } = ""; - #endregion Public Properties - - #region Protected Fields - - protected bool isProcessing = false; - - #endregion Protected Fields - - #region Protected Properties - - protected int IdxOdlSel + [Parameter] + public int IdxOdlSel { get => idxOdlSel; set @@ -37,6 +28,18 @@ namespace MP_TAB3.Components } } + #endregion Public Properties + + #region Protected Fields + + protected bool isProcessing = false; + + #endregion Protected Fields + + #region Protected Properties + + + protected List ListODL { get; set; } = new(); protected int NumRec diff --git a/MP-TAB3/Components/ProdConfMan.razor b/MP-TAB3/Components/ProdConfMan.razor new file mode 100644 index 00000000..43e9bd1b --- /dev/null +++ b/MP-TAB3/Components/ProdConfMan.razor @@ -0,0 +1,84 @@ + + + + +
+
+
+
+

Tipo Selezione

+
+
+
+ + +
+
+
+ @if (useOdl) + { + + } + else + { + + } +
+
+
+
+ + + + + + + @if (ShowRilav) + { + + } + + + + + @foreach (var item in ListPaged) + { + var actOdl = ActiveOdl(item.DataTo); + + + + + @if (ShowRilav) + { + + } + + + } + + + + + + +
Art/ODL# Pz Buoni# Pz Scarto# Pz RilavOperatore
+
Art: @actOdl.CodArticolo
+
ODL: @($"ODL{actOdl.IdxOdl:000000000}")
+ @if (ShowExtCode) + { +
@item.CommessaEsterna
+ } +
@item.PezziConf@item.PezziScar@item.PezziDaRilav +
@($"{item.DataOraConf:ddd yyyy-MM-dd HH:mm:ss}")
+
@OperDto(item.MatrApp)
+ @if (ShowArtDescr) + { +
@actOdl.DescArticolo
+ } +
+ +
+
+
+
+
diff --git a/MP-TAB3/Components/ProdConfMan.razor.cs b/MP-TAB3/Components/ProdConfMan.razor.cs new file mode 100644 index 00000000..5238d0cd --- /dev/null +++ b/MP-TAB3/Components/ProdConfMan.razor.cs @@ -0,0 +1,399 @@ +using Microsoft.AspNetCore.Components; +using MP.Data.DbModels; +using MP.Data.Services; +using NLog; +using static EgwCoreLib.Utils.DtUtils; + +namespace MP_TAB3.Components +{ + public partial class ProdConfMan : IDisposable + { + #region Public Properties + + [Parameter] + public EventCallback E_MachSel { get; set; } + + [Parameter] + public EventCallback E_Updated { get; set; } + + [Parameter] + public string IdxMacchSub { get; set; } = ""; + + [Parameter] + public MappaStatoExplModel? RecMSE { get; set; } = null; + + #endregion Public Properties + + /// + /// Init da valori configurazione + /// + private void InitConfig() + { + TabDServ.ConfigGetVal("TAB_confProdPeriodLastODL", ref ShowLastOdl); + TabDServ.ConfigGetVal("TAB_confProdShowRilav", ref ShowRilav); + TabDServ.ConfigGetVal("TAB_confProdShowArtDescr", ref ShowArtDescr); + TabDServ.ConfigGetVal("TAB_confProdShowExtCode", ref ShowExtCode); + } + + /// + /// Indica se mostrare rilavorati in conferma produzione + /// + private bool ShowRilav = false; + + /// + /// Indica se partire da ultimo ODL x definire ultimo periodo... + /// + private bool ShowLastOdl = false; + + /// + /// Indica se mostrare descrizione articolo su 3° riga + /// + private bool ShowArtDescr = false; + + /// + /// Indica se mostrare CodExt (commessa) su 3° riga + /// + private bool ShowExtCode = false; + + #region Public Methods + + public void Dispose() + { + ListComplete.Clear(); + ListPaged.Clear(); + ListaOdl.Clear(); + ListaOper.Clear(); + DictOpr.Clear(); + } + + #endregion Public Methods + + #region Protected Properties + + protected List ListComplete { get; set; } = new List(); + + protected List ListPaged { get; set; } = new List(); + + [Inject] + protected MessageService MServ { get; set; } = null!; + + [Inject] + protected SharedMemService SMServ { get; set; } = null!; + + [Inject] + protected TabDataService TabDServ { get; set; } = null!; + + #endregion Protected Properties + + #region Protected Methods + + protected override async Task OnInitializedAsync() + { + await Task.Delay(1); + InitConfig(); + await ReloadBaseList(); + if (RecMSE != null) + { + IdxMaccSel = RecMSE.IdxMacchina; + isMulti = SMServ.DictMacchMulti[IdxMaccSel] == 1; + if (isMulti) + { + var idxMSel = MServ.UserPrefGet(IdxMaccSel); + if (!string.IsNullOrEmpty(idxMSel)) + { + IdxMaccSel = idxMSel; + } + } + await setupPeriodo(); + await ReloadData(); + } + } + + protected async Task SetMacc(string selIdxMacc) + { + isProcessing = true; + await Task.Delay(1); + IdxMaccSel = selIdxMacc; + await ReloadData(); + await Task.Delay(1); + isProcessing = false; + await E_MachSel.InvokeAsync(selIdxMacc); + } + + protected void SetNumRec(int newNum) + { + NumRecPage = newNum; + UpdateTable(); + } + + protected async Task SetOdl(int selIdxOdl) + { + isProcessing = true; + IdxOdl = selIdxOdl; + // se ho odl --> imposto periodo + if (IdxOdl > 0) + { + var recOdl = GetOdl(IdxOdl); + if (recOdl != null && recOdl.IdxOdl == IdxOdl) + { + DateTime fine = DateTime.Today.AddDays(1); + DateTime inizio = fine.AddDays(-7); + CurrPeriodo = new Periodo(recOdl.DataInizio ?? inizio, recOdl.DataFine ?? fine); + } + } + // altrimenti reset.. + else + { + setupPeriodo(); + } + await ReloadData(); + isProcessing = false; + //await Task.Delay(1); + } + + protected void SetPage(int newNum) + { + PageNum = newNum; + UpdateTable(); + } + + protected async Task SetPeriodo(Periodo newPeriodo) + { + CurrPeriodo = newPeriodo; + await ReloadData(); + } + + protected void UpdateTable() + { + // esegue paginazione + if (TotalCount > NumRecPage) + { + ListPaged = ListComplete + .OrderByDescending(x => x.DataTo) + .Skip((PageNum - 1) * NumRecPage) + .Take(NumRecPage) + .ToList(); + } + else + { + ListPaged = ListComplete; + } + } + + #endregion Protected Methods + + #region Private Fields + + private static Logger Log = LogManager.GetCurrentClassLogger(); + + private Dictionary DictOpr = new Dictionary(); + + private bool isMulti = false; + + private bool isProcessing = false; + + private List ListaOdl = new List(); + + private List ListaOper = new List(); + + private int NumRecPage = 10; + + private int PageNum = 1; + + private int TotalCount = 0; + + private bool useOdl = false; + + #endregion Private Fields + + #region Private Properties + + private Periodo CurrPeriodo { get; set; } = new Periodo(); + + private string IdxMaccAltra { get; set; } = ""; + + /// + /// Restituisce il codice IdxMacchina dell'altra tavola (se multi) altrimenti la stessa macchina... + /// + private string idxMaccAltraTav + { + get + { + string answ = ""; + if (RecMSE != null) + { + try + { + // verifico se SIA una tavola (ha char "#") + int iSharp = IdxMaccMain.IndexOf('#'); + if (iSharp > 0) + { + // ora verifico SE ALTRA TAVOLA ha ODL... + string nomeTav = IdxMaccMain.Substring(iSharp); + string altraTav = nomeTav.Substring(0, nomeTav.Length - 1); + altraTav += nomeTav.EndsWith("1") ? "2" : "1"; + // sistemo nome + answ = IdxMaccMain.Replace(nomeTav, altraTav); + } + } + catch + { } + } + return answ; + } + } + + /// + /// Macchina selezionata MAIN + /// + private string IdxMaccMain + { + get => RecMSE != null ? RecMSE.IdxMacchina : ""; + } + + private string IdxMaccSel { get; set; } = ""; + + private int IdxOdl { get; set; } = 0; + + private string selMessage + { + get => useOdl ? "Periodo da ODL" : "Periodo Libero"; + } + + private bool UseOdl + { + get => useOdl; + set + { + useOdl = value; + if (!value) + { + IdxOdl = 0; + } + } + } + + #endregion Private Properties + + #region Private Methods + + private ODLExpModel ActiveOdl(DateTime dtRif) + { + var recOdl = ListaOdl + .Where(x => x.DataInizio <= dtRif && (x.DataFine >= dtRif || x.DataFine == null)) + .FirstOrDefault(); + return recOdl ?? new ODLExpModel(); + } + + private ODLExpModel GetOdl(int idxOdl) + { + var recOdl = ListaOdl + .Where(x => x.IdxOdl == idxOdl) + .FirstOrDefault(); + return recOdl ?? new ODLExpModel(); + } + + private string OperDto(int matr) + { + string answ = $"[{matr}]"; + // cerco in dizionario + if (DictOpr.ContainsKey(matr)) + { + answ = DictOpr[matr]; + } + else + { + // altrimenti cerco da lista e inserisco in dizionario + var recOpr = ListaOper.Where(x => x.MatrOpr == matr).FirstOrDefault(); + if (recOpr != null) + { + answ = $"{recOpr.Cognome} {recOpr.Nome}"; + } + DictOpr.Add(matr, answ); + } + return answ; + } + +#if false + private MarkupString OperDto(int matr) + { + string answ = $"[{matr}]"; + // cerco in dizionario + if (DictOpr.ContainsKey(matr)) + { + answ = DictOpr[matr]; + } + else + { + // altrimenti cerco da lista e inserisco in dizionario + var recOpr = ListaOper.Where(x => x.MatrOpr == matr).FirstOrDefault(); + if (recOpr != null) + { + answ = $"{recOpr.Cognome} {recOpr.Nome}{matr}"; + } + DictOpr.Add(matr, answ); + } + return (MarkupString)answ; + } +#endif + + /// + /// Rileggo anagrafiche di base + /// + /// + private async Task ReloadBaseList() + { + ListaOper = await TabDServ.ElencoOperatori(); + } + + /// + /// Aggiorno valori produzione alla data richiesta... + /// + /// + private async Task ReloadData() + { + isProcessing = true; + await Task.Delay(1); + if (!string.IsNullOrEmpty(IdxMaccSel)) + { + ListaOdl = await TabDServ.OdlListByMaccPeriodo(IdxMaccSel, CurrPeriodo.Inizio.AddMonths(-1), CurrPeriodo.Fine); + ListComplete = await TabDServ.ElencoConfProdFiltAsync(IdxMaccSel, CurrPeriodo.Inizio, CurrPeriodo.Fine); + TotalCount = ListComplete.Count; + // esegue paginazione + UpdateTable(); + } + isProcessing = false; + } + + private async Task setupPeriodo() + { + bool doSet = true; + if (ShowLastOdl) + { + UseOdl = true; + var LastODL = await TabDServ.VSOdlGetLastByMacc(IdxMaccSel, 1); + if (LastODL != null) + { + var recOdl = LastODL.FirstOrDefault(); + if (recOdl != null) + { + idxOdlLast = recOdl.value; + await SetOdl(idxOdlLast); + doSet = false; + } + } + } + // controllo di nuovo se impostare priodo + if (doSet) + { + DateTime fine = DateTime.Today.AddDays(1); + DateTime inizio = fine.AddDays(-7); + CurrPeriodo = new Periodo(inizio, fine); + } + } + + private int idxOdlLast = 0; + + #endregion Private Methods + } +} \ No newline at end of file diff --git a/MP-TAB3/Components/ProdConfirm.razor.cs b/MP-TAB3/Components/ProdConfirm.razor.cs index eab1cb97..be23a241 100644 --- a/MP-TAB3/Components/ProdConfirm.razor.cs +++ b/MP-TAB3/Components/ProdConfirm.razor.cs @@ -6,14 +6,8 @@ using NLog.Fluent; namespace MP_TAB3.Components { - public partial class ProdConfirm:IDisposable + public partial class ProdConfirm : IDisposable { - - public void Dispose() - { - confTimer.Elapsed -= ConfTimer_Elapsed; - } - #region Public Properties /// @@ -53,6 +47,16 @@ namespace MP_TAB3.Components #endregion Public Properties + #region Public Methods + + public void Dispose() + { + datiProdAct = null; + confTimer.Elapsed -= ConfTimer_Elapsed; + } + + #endregion Public Methods + #region Protected Properties protected string ConfBg @@ -249,22 +253,6 @@ namespace MP_TAB3.Components confTimer.Elapsed += ConfTimer_Elapsed; } - /// - /// Timer visualizzazione esito conferma pezzi: deve nascondere... - /// - /// - /// - /// - private void ConfTimer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e) - { - confTimer.Stop(); - showConfirmResult = false; - // resetto - lastPzBuoni = 0; - lastPzRilav = 0; - lastPzScarto = 0; - } - protected override async Task OnParametersSetAsync() { lblOut = ""; @@ -340,11 +328,6 @@ namespace MP_TAB3.Components confTimer.Start(); } - /// - /// Timer 3 sec x mostrare conferma - /// - private System.Timers.Timer confTimer = new System.Timers.Timer(3000); - protected void setConfirmBtn(bool newVal) { showConfirm = newVal; @@ -385,20 +368,37 @@ namespace MP_TAB3.Components private bool chkPzBuoniNeg = false; + private bool confDone = false; + private bool confRett = false; + /// + /// Timer 3 sec x mostrare conferma + /// + private System.Timers.Timer confTimer = new System.Timers.Timer(3000); + private bool enableMagPrint = false; private bool enablePzProdLasciati = false; - private bool confDone = false; private bool isMulti = false; + private bool isSlave = false; + private DateTime lastConfProd = DateTime.Now; + + private int lastPzBuoni = 0; + + private int lastPzRilav = 0; + + private int lastPzScarto = 0; + private string lblOut = ""; private int modoConfProd = 0; + private bool showConfirmResult = false; + #endregion Private Fields #region Private Properties @@ -424,17 +424,25 @@ namespace MP_TAB3.Components private bool showConfirm { get; set; } = true; - private bool showConfirmResult = false; - - private int lastPzBuoni = 0; - private int lastPzRilav = 0; - private int lastPzScarto = 0; - private DateTime lastConfProd = DateTime.Now; - #endregion Private Properties #region Private Methods + /// + /// Timer visualizzazione esito conferma pezzi: deve nascondere... + /// + /// + /// + private void ConfTimer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e) + { + confTimer.Stop(); + showConfirmResult = false; + // resetto + lastPzBuoni = 0; + lastPzRilav = 0; + lastPzScarto = 0; + } + /// /// Registra conferma produzione in modalita nuova (con rettifica pezzi lasciati) o legacy /// (con anticipo periodo) diff --git a/MP-TAB3/Components/ProdKIT/KitDetailModal.razor b/MP-TAB3/Components/ProdKIT/KitDetailModal.razor index 335ec458..44a4a18e 100644 --- a/MP-TAB3/Components/ProdKIT/KitDetailModal.razor +++ b/MP-TAB3/Components/ProdKIT/KitDetailModal.razor @@ -80,20 +80,31 @@ - @foreach (var record in ListTK) + @if (ListTK == null) { - - @record.CodArtParent - - - @record.CodArtChild - - -
@record.Qty
+ +
Nessun dato disponibile
} + else + { + foreach (var record in ListTK) + { + + + @record.CodArtParent + + + @record.CodArtChild + + +
@record.Qty
+ + + } + } } diff --git a/MP-TAB3/Components/ScrapMan.razor b/MP-TAB3/Components/ScrapMan.razor index 34e19143..bbe37d17 100644 --- a/MP-TAB3/Components/ScrapMan.razor +++ b/MP-TAB3/Components/ScrapMan.razor @@ -84,13 +84,13 @@ × @if (item.KitSplit) { - } else { - } @@ -136,11 +136,15 @@ } } + + + + + + + -
- -
\ No newline at end of file diff --git a/MP-TAB3/MP-TAB3.csproj b/MP-TAB3/MP-TAB3.csproj index cc7fbe38..55e3a07e 100644 --- a/MP-TAB3/MP-TAB3.csproj +++ b/MP-TAB3/MP-TAB3.csproj @@ -3,7 +3,7 @@ net6.0 enable - 6.16.2507.1117 + 6.16.2507.2814 enable MP_TAB3 diff --git a/MP-TAB3/Pages/Controls.razor.cs b/MP-TAB3/Pages/Controls.razor.cs index 5fabe458..31725104 100644 --- a/MP-TAB3/Pages/Controls.razor.cs +++ b/MP-TAB3/Pages/Controls.razor.cs @@ -2,14 +2,6 @@ namespace MP_TAB3.Pages { public partial class Controls { - #region Private Fields - - private string IdxMaccSubSel = ""; - - private bool IsLoading = false; - - #endregion Private Fields - #region Protected Methods protected async Task ForceReload() @@ -31,5 +23,13 @@ namespace MP_TAB3.Pages } #endregion Protected Methods + + #region Private Fields + + private string IdxMaccSubSel = ""; + + private bool IsLoading = false; + + #endregion Private Fields } } \ No newline at end of file diff --git a/MP-TAB3/Pages/ProdConf.razor b/MP-TAB3/Pages/ProdConf.razor new file mode 100644 index 00000000..f47ecf41 --- /dev/null +++ b/MP-TAB3/Pages/ProdConf.razor @@ -0,0 +1,14 @@ +@page "/ProdConf" +@page "/prod-conf" +@inherits BasePage + +@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null || IsLoading) +{ + +} +else +{ + + + +} diff --git a/MP-TAB3/Pages/ProdConf.razor.cs b/MP-TAB3/Pages/ProdConf.razor.cs new file mode 100644 index 00000000..266c027b --- /dev/null +++ b/MP-TAB3/Pages/ProdConf.razor.cs @@ -0,0 +1,40 @@ + +using Microsoft.AspNetCore.Components; +using MP.Data.Services; + +namespace MP_TAB3.Pages +{ + public partial class ProdConf + { + #region Protected Methods + + protected async Task ForceReload() + { + IsLoading = true; + await Task.Delay(5); + IsLoading = false; + } + + protected override async Task OnInitializedAsync() + { + await base.OnInitializedAsync(); + await ReloadData(); + } + + + protected void SetMacc(string selIdxMacc) + { + IdxMaccSubSel = selIdxMacc; + } + + #endregion Protected Methods + + #region Private Fields + + private string IdxMaccSubSel = ""; + + private bool IsLoading = false; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/MP-TAB3/Pages/StatusMap.razor.cs b/MP-TAB3/Pages/StatusMap.razor.cs index ba89dbc4..5b12615f 100644 --- a/MP-TAB3/Pages/StatusMap.razor.cs +++ b/MP-TAB3/Pages/StatusMap.razor.cs @@ -127,9 +127,11 @@ namespace MP_TAB3.Pages public void Dispose() { - ListMSE = null; TDFeeder.dataPipe.EA_NewMessage -= DataPipe_EA_NewMessage; TDFeeder.blinkPipe.EA_NewMessage -= BlinkPipe_EA_NewMessage; + ListMSE = null; + ListMachineEnabled = null; + AllDataMSE = null; GC.Collect(); } @@ -316,20 +318,20 @@ namespace MP_TAB3.Pages } #endif PubSubEventArgs currArgs = (PubSubEventArgs)e; - // conversione on-the-fly List --> allarmi - if (!string.IsNullOrEmpty(currArgs.newMessage)) + // conversione on-the-fly List --> allarmi + if (!string.IsNullOrEmpty(currArgs.newMessage)) + { + try { - try + List? dataList = JsonConvert.DeserializeObject>(currArgs.newMessage); + if (dataList != null) { - List? dataList = JsonConvert.DeserializeObject>(currArgs.newMessage); - if (dataList != null) - { - InvokeAsync(() => SaveData(dataList)); - } + InvokeAsync(() => SaveData(dataList)); } - catch - { } } + catch + { } + } InvokeAsync(() => { StateHasChanged(); diff --git a/MP-TAB3/Program.cs b/MP-TAB3/Program.cs index 4471706a..6e52aee9 100644 --- a/MP-TAB3/Program.cs +++ b/MP-TAB3/Program.cs @@ -35,7 +35,6 @@ builder.Services.AddRazorPages(); builder.Services.AddServerSideBlazor(); builder.Services.AddSingleton(); - builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); diff --git a/MP-TAB3/Resources/ChangeLog.html b/MP-TAB3/Resources/ChangeLog.html index 97de475d..5380e47a 100644 --- a/MP-TAB3/Resources/ChangeLog.html +++ b/MP-TAB3/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2507.1117

+

Versione: 6.16.2507.2814


Note di rilascio:
  • diff --git a/MP-TAB3/Resources/VersNum.txt b/MP-TAB3/Resources/VersNum.txt index fc35e574..3fdea622 100644 --- a/MP-TAB3/Resources/VersNum.txt +++ b/MP-TAB3/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2507.1117 +6.16.2507.2814 diff --git a/MP-TAB3/Resources/manifest.xml b/MP-TAB3/Resources/manifest.xml index d615d9dc..4d01499a 100644 --- a/MP-TAB3/Resources/manifest.xml +++ b/MP-TAB3/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2507.1117 + 6.16.2507.2814 https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html false diff --git a/MP.Core/DTO/InsManDayDto.cs b/MP.Core/DTO/InsManDayDto.cs index 33bf1360..21523af1 100644 --- a/MP.Core/DTO/InsManDayDto.cs +++ b/MP.Core/DTO/InsManDayDto.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.ComponentModel.DataAnnotations; // // This is here so CodeMaid doesn't reorganize this document diff --git a/MP.Core/DTO/ManualStatusDTO.cs b/MP.Core/DTO/ManualStatusDTO.cs index 75ed97a2..730aa415 100644 --- a/MP.Core/DTO/ManualStatusDTO.cs +++ b/MP.Core/DTO/ManualStatusDTO.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MP.Core.DTO +namespace MP.Core.DTO { public class ManualStatusDTO { diff --git a/MP.Core/DTO/MappaStatoExplDTO.cs b/MP.Core/DTO/MappaStatoExplDTO.cs index a345ee1b..12fe6b44 100644 --- a/MP.Core/DTO/MappaStatoExplDTO.cs +++ b/MP.Core/DTO/MappaStatoExplDTO.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; -using System.Data; +using System.ComponentModel.DataAnnotations.Schema; // // This is here so CodeMaid doesn't reorganize this document diff --git a/MP.Core/DTO/repartiDTO.cs b/MP.Core/DTO/repartiDTO.cs index e664c84b..b6883ff0 100644 --- a/MP.Core/DTO/repartiDTO.cs +++ b/MP.Core/DTO/repartiDTO.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.ComponentModel.DataAnnotations; namespace MP.Core.DTO { diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index 1a8bbe54..3c63a32a 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -635,7 +635,7 @@ namespace MP.Data.Controllers } /// - /// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis + /// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redisConn /// /// macchina /// Num massimo secondi per recuperare dati correnti @@ -658,7 +658,7 @@ namespace MP.Data.Controllers } /// - /// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis + /// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redisConn /// /// macchina /// Data min x selezione diff --git a/MP.Data/Controllers/MpTabController.cs b/MP.Data/Controllers/MpTabController.cs index bd2eb46d..3624e8e2 100644 --- a/MP.Data/Controllers/MpTabController.cs +++ b/MP.Data/Controllers/MpTabController.cs @@ -406,10 +406,10 @@ namespace MP.Data.Controllers using (var dbCtx = new MoonProContext(_configuration)) { dbResult = dbCtx - .DbSetConfig - .AsNoTracking() - .OrderBy(x => x.Chiave) - .ToList(); + .DbSetConfig + .AsNoTracking() + .OrderBy(x => x.Chiave) + .ToList(); } return dbResult; } @@ -1323,9 +1323,9 @@ namespace MP.Data.Controllers /// /// /// - public List OdlListByMaccPeriodo(string idxMacchina, DateTime dtStart, DateTime dtEnd) + public List OdlListByMaccPeriodo(string idxMacchina, DateTime dtStart, DateTime dtEnd) { - List dbResult = new List(); + List dbResult = new List(); using (var dbCtx = new MoonProContext(_configuration)) { try @@ -1334,7 +1334,7 @@ namespace MP.Data.Controllers var DataFrom = new SqlParameter("@dataFrom", dtStart); var DataTo = new SqlParameter("@dataTo", dtEnd); dbResult = dbCtx - .DbSetODL + .DbSetODLExp .FromSqlRaw("EXEC stp_ODL_getByMacchinaPeriodo @IdxMacchina, @dataFrom, @dataTo", IdxMacchina, DataFrom, DataTo) .AsNoTracking() .ToList(); @@ -1717,6 +1717,29 @@ namespace MP.Data.Controllers return dbResult; } + /// + /// Restituisce elenco RC filtrato + /// + /// + /// + /// + /// + public List ElencoConfProdFilt(string idxMacchina, DateTime dataFrom, DateTime dataTo) + { + List dbResult = new List(); + using (var dbCtx = new MoonProContext(_configuration)) + { + dbResult = dbCtx + .DbSetElConfProd + .Where (x => x.IdxMacchina== idxMacchina && (dataFrom <= x.DataOraConf && x.DataOraConf <= dataTo)) + .AsNoTracking() + .ToList(); + } + return dbResult; + } + + + /// /// Registra controllo /// diff --git a/MP.Data/DTO/IobDTO.cs b/MP.Data/DTO/IobDTO.cs index 02171544..6e2cc8a1 100644 --- a/MP.Data/DTO/IobDTO.cs +++ b/MP.Data/DTO/IobDTO.cs @@ -1,11 +1,6 @@ using MP.Core.Objects; -using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace MP.Data.DTO { diff --git a/MP.Data/DbModels/AlarmLogModel.cs b/MP.Data/DbModels/AlarmLogModel.cs index 982c25c2..d7578850 100644 --- a/MP.Data/DbModels/AlarmLogModel.cs +++ b/MP.Data/DbModels/AlarmLogModel.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/AnagArticoliModel.cs b/MP.Data/DbModels/AnagArticoliModel.cs index c98774ab..e1a94480 100644 --- a/MP.Data/DbModels/AnagArticoliModel.cs +++ b/MP.Data/DbModels/AnagArticoliModel.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; #nullable disable // diff --git a/MP.Data/DbModels/AnagArticoli_MAG.cs b/MP.Data/DbModels/AnagArticoli_MAG.cs index acf8707d..5ef8183d 100644 --- a/MP.Data/DbModels/AnagArticoli_MAG.cs +++ b/MP.Data/DbModels/AnagArticoli_MAG.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; #nullable disable // diff --git a/MP.Data/DbModels/AnagCountersModel.cs b/MP.Data/DbModels/AnagCountersModel.cs index 9f845a19..78a2828d 100644 --- a/MP.Data/DbModels/AnagCountersModel.cs +++ b/MP.Data/DbModels/AnagCountersModel.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; #nullable disable diff --git a/MP.Data/DbModels/AnagEventiModel.cs b/MP.Data/DbModels/AnagEventiModel.cs index 75270875..d550dc70 100644 --- a/MP.Data/DbModels/AnagEventiModel.cs +++ b/MP.Data/DbModels/AnagEventiModel.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace MP.Data.DbModels { diff --git a/MP.Data/DbModels/AnagFLTransModel.cs b/MP.Data/DbModels/AnagFLTransModel.cs index 72ff7823..86394a2c 100644 --- a/MP.Data/DbModels/AnagFLTransModel.cs +++ b/MP.Data/DbModels/AnagFLTransModel.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; // // This is here so CodeMaid doesn't reorganize this document diff --git a/MP.Data/DbModels/AnagGiacenzeModel.cs b/MP.Data/DbModels/AnagGiacenzeModel.cs index 2ea61bc4..82d8907b 100644 --- a/MP.Data/DbModels/AnagGiacenzeModel.cs +++ b/MP.Data/DbModels/AnagGiacenzeModel.cs @@ -1,10 +1,6 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; // // This is here so CodeMaid doesn't reorganize this document diff --git a/MP.Data/DbModels/AnagGruppiModel.cs b/MP.Data/DbModels/AnagGruppiModel.cs index bdbc9aa8..400854b3 100644 --- a/MP.Data/DbModels/AnagGruppiModel.cs +++ b/MP.Data/DbModels/AnagGruppiModel.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; #nullable disable // diff --git a/MP.Data/DbModels/AnagKeyValueModel.cs b/MP.Data/DbModels/AnagKeyValueModel.cs index 5677dcb1..36008d90 100644 --- a/MP.Data/DbModels/AnagKeyValueModel.cs +++ b/MP.Data/DbModels/AnagKeyValueModel.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; #nullable disable diff --git a/MP.Data/DbModels/AnagLottoModel.cs b/MP.Data/DbModels/AnagLottoModel.cs index 1af87b3d..3998fe2a 100644 --- a/MP.Data/DbModels/AnagLottoModel.cs +++ b/MP.Data/DbModels/AnagLottoModel.cs @@ -1,10 +1,6 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; // // This is here so CodeMaid doesn't reorganize this document diff --git a/MP.Data/DbModels/AnagMagModel.cs b/MP.Data/DbModels/AnagMagModel.cs index 4351a568..973ceb63 100644 --- a/MP.Data/DbModels/AnagMagModel.cs +++ b/MP.Data/DbModels/AnagMagModel.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; #nullable disable diff --git a/MP.Data/DbModels/AnagOperatoriModel.cs b/MP.Data/DbModels/AnagOperatoriModel.cs index d6edecb8..7831f83f 100644 --- a/MP.Data/DbModels/AnagOperatoriModel.cs +++ b/MP.Data/DbModels/AnagOperatoriModel.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace MP.Data.DbModels { diff --git a/MP.Data/DbModels/AnagStatiModel.cs b/MP.Data/DbModels/AnagStatiModel.cs index d6b6c65d..964ec3ec 100644 --- a/MP.Data/DbModels/AnagStatiModel.cs +++ b/MP.Data/DbModels/AnagStatiModel.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace MP.Data.DbModels { diff --git a/MP.Data/DbModels/AnagTagsModel.cs b/MP.Data/DbModels/AnagTagsModel.cs index 878fd494..49b392aa 100644 --- a/MP.Data/DbModels/AnagTagsModel.cs +++ b/MP.Data/DbModels/AnagTagsModel.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; #nullable disable diff --git a/MP.Data/DbModels/AnagUdcModel.cs b/MP.Data/DbModels/AnagUdcModel.cs index d6696e2a..0e8f3426 100644 --- a/MP.Data/DbModels/AnagUdcModel.cs +++ b/MP.Data/DbModels/AnagUdcModel.cs @@ -1,10 +1,6 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; // // This is here so CodeMaid doesn't reorganize this document diff --git a/MP.Data/DbModels/AnagraficaFlussiModel.cs b/MP.Data/DbModels/AnagraficaFlussiModel.cs index 69a3fc08..df304ec3 100644 --- a/MP.Data/DbModels/AnagraficaFlussiModel.cs +++ b/MP.Data/DbModels/AnagraficaFlussiModel.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; #nullable disable diff --git a/MP.Data/DbModels/CommentiModel.cs b/MP.Data/DbModels/CommentiModel.cs index 7dfa3731..3ce3baf5 100644 --- a/MP.Data/DbModels/CommentiModel.cs +++ b/MP.Data/DbModels/CommentiModel.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/ConfigModel.cs b/MP.Data/DbModels/ConfigModel.cs index 041e41f1..60bbe77b 100644 --- a/MP.Data/DbModels/ConfigModel.cs +++ b/MP.Data/DbModels/ConfigModel.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; #nullable disable // diff --git a/MP.Data/DbModels/DdbTurni.cs b/MP.Data/DbModels/DdbTurni.cs index 637c2fe8..482f4ba4 100644 --- a/MP.Data/DbModels/DdbTurni.cs +++ b/MP.Data/DbModels/DdbTurni.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/ElencoConfermeProdModel.cs b/MP.Data/DbModels/ElencoConfermeProdModel.cs new file mode 100644 index 00000000..7647c64d --- /dev/null +++ b/MP.Data/DbModels/ElencoConfermeProdModel.cs @@ -0,0 +1,38 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + + +#nullable disable +// +// This is here so CodeMaid doesn't reorganize this document +// +namespace MP.Data.DbModels +{ + [Table("ElencoConfermeProd")] + public partial class ElencoConfermeProdModel + { + #region Public Properties + + public DateTime DataOraConf { get; set; } = DateTime.Now; + [MaxLength(50), Column("idxMacchina")] + public string IdxMacchina { get; set; } = ""; + + public int MatrApp { get; set; } = 0; + [Column("dataFrom")] + public DateTime DataFrom { get; set; } = DateTime.Now; + [Column("dataTo")] + public DateTime DataTo { get; set; } = DateTime.Now; + [Column("pezziConf")] + public int PezziConf { get; set; } = 0; + [Column("pezziScar")] + public int PezziScar { get; set; } = 0; + [Column("pezziDaRilav")] + public int PezziDaRilav { get; set; } = 0; + [MaxLength(50)] + public string CommessaEsterna { get; set; } = ""; + public int TipoConf { get; set; } = 1; + + #endregion Public Properties + } +} \ No newline at end of file diff --git a/MP.Data/DbModels/EventListModel.cs b/MP.Data/DbModels/EventListModel.cs index c4ba5bd7..fecaf2b8 100644 --- a/MP.Data/DbModels/EventListModel.cs +++ b/MP.Data/DbModels/EventListModel.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/FermiNonQualModel.cs b/MP.Data/DbModels/FermiNonQualModel.cs index e6a03840..cb24d6dc 100644 --- a/MP.Data/DbModels/FermiNonQualModel.cs +++ b/MP.Data/DbModels/FermiNonQualModel.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; #nullable disable diff --git a/MP.Data/DbModels/Gruppi2MaccModel.cs b/MP.Data/DbModels/Gruppi2MaccModel.cs index eff27663..83b574f1 100644 --- a/MP.Data/DbModels/Gruppi2MaccModel.cs +++ b/MP.Data/DbModels/Gruppi2MaccModel.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; #nullable disable // diff --git a/MP.Data/DbModels/Gruppi2OperModel.cs b/MP.Data/DbModels/Gruppi2OperModel.cs index 34dc2a4e..6747831d 100644 --- a/MP.Data/DbModels/Gruppi2OperModel.cs +++ b/MP.Data/DbModels/Gruppi2OperModel.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; #nullable disable // diff --git a/MP.Data/DbModels/InventorySessionModel.cs b/MP.Data/DbModels/InventorySessionModel.cs index 8fabf5dc..bec5e29d 100644 --- a/MP.Data/DbModels/InventorySessionModel.cs +++ b/MP.Data/DbModels/InventorySessionModel.cs @@ -1,10 +1,6 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; // // This is here so CodeMaid doesn't reorganize this document diff --git a/MP.Data/DbModels/IstanzeKitModel.cs b/MP.Data/DbModels/IstanzeKitModel.cs index a3853604..62b1ec40 100644 --- a/MP.Data/DbModels/IstanzeKitModel.cs +++ b/MP.Data/DbModels/IstanzeKitModel.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace MP.Data.DbModels diff --git a/MP.Data/DbModels/KeepAliveModel.cs b/MP.Data/DbModels/KeepAliveModel.cs index 77c6fd05..452512a0 100644 --- a/MP.Data/DbModels/KeepAliveModel.cs +++ b/MP.Data/DbModels/KeepAliveModel.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; namespace MP.Data.DbModels diff --git a/MP.Data/DbModels/LingueModel.cs b/MP.Data/DbModels/LingueModel.cs index 695b6487..26cb1b2c 100644 --- a/MP.Data/DbModels/LingueModel.cs +++ b/MP.Data/DbModels/LingueModel.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; #nullable disable diff --git a/MP.Data/DbModels/LinkMenuModel.cs b/MP.Data/DbModels/LinkMenuModel.cs index 7199ba71..5918df7a 100644 --- a/MP.Data/DbModels/LinkMenuModel.cs +++ b/MP.Data/DbModels/LinkMenuModel.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/MacchineModel.cs b/MP.Data/DbModels/MacchineModel.cs index 5ed75e4f..a636685f 100644 --- a/MP.Data/DbModels/MacchineModel.cs +++ b/MP.Data/DbModels/MacchineModel.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/MacchineStatModel.cs b/MP.Data/DbModels/MacchineStatModel.cs index dbaad00a..968c1793 100644 --- a/MP.Data/DbModels/MacchineStatModel.cs +++ b/MP.Data/DbModels/MacchineStatModel.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; #nullable disable diff --git a/MP.Data/DbModels/MappaStatoExplModel.cs b/MP.Data/DbModels/MappaStatoExplModel.cs index 3adea883..caa2bbb2 100644 --- a/MP.Data/DbModels/MappaStatoExplModel.cs +++ b/MP.Data/DbModels/MappaStatoExplModel.cs @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; -using System.Data; #nullable disable // diff --git a/MP.Data/DbModels/MicroStatoMacchinaModel.cs b/MP.Data/DbModels/MicroStatoMacchinaModel.cs index ceacd583..6b068f8f 100644 --- a/MP.Data/DbModels/MicroStatoMacchinaModel.cs +++ b/MP.Data/DbModels/MicroStatoMacchinaModel.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/ODLExpModel.cs b/MP.Data/DbModels/ODLExpModel.cs index dfdee3fd..ec0af9b6 100644 --- a/MP.Data/DbModels/ODLExpModel.cs +++ b/MP.Data/DbModels/ODLExpModel.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/ODLModel.cs b/MP.Data/DbModels/ODLModel.cs index 79ae4dbb..caaf0845 100644 --- a/MP.Data/DbModels/ODLModel.cs +++ b/MP.Data/DbModels/ODLModel.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/OdlEnergyModel.cs b/MP.Data/DbModels/OdlEnergyModel.cs index a303cde5..ade03e62 100644 --- a/MP.Data/DbModels/OdlEnergyModel.cs +++ b/MP.Data/DbModels/OdlEnergyModel.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/PODLExpModel.cs b/MP.Data/DbModels/PODLExpModel.cs index 5352f1c0..05617844 100644 --- a/MP.Data/DbModels/PODLExpModel.cs +++ b/MP.Data/DbModels/PODLExpModel.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/PODLModel.cs b/MP.Data/DbModels/PODLModel.cs index 5d660c90..818c5235 100644 --- a/MP.Data/DbModels/PODLModel.cs +++ b/MP.Data/DbModels/PODLModel.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/PzProdModel.cs b/MP.Data/DbModels/PzProdModel.cs index 782f4609..1074bc5c 100644 --- a/MP.Data/DbModels/PzProdModel.cs +++ b/MP.Data/DbModels/PzProdModel.cs @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; #nullable disable // diff --git a/MP.Data/DbModels/RegCheckModel.cs b/MP.Data/DbModels/RegCheckModel.cs index f478495b..772a378c 100644 --- a/MP.Data/DbModels/RegCheckModel.cs +++ b/MP.Data/DbModels/RegCheckModel.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; #nullable disable // diff --git a/MP.Data/DbModels/RegistroControlliModel.cs b/MP.Data/DbModels/RegistroControlliModel.cs index 68358125..c3164062 100644 --- a/MP.Data/DbModels/RegistroControlliModel.cs +++ b/MP.Data/DbModels/RegistroControlliModel.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/RegistroDichiarazioniModel.cs b/MP.Data/DbModels/RegistroDichiarazioniModel.cs index 117bb018..13bdf909 100644 --- a/MP.Data/DbModels/RegistroDichiarazioniModel.cs +++ b/MP.Data/DbModels/RegistroDichiarazioniModel.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/RegistroScartiKitModel.cs b/MP.Data/DbModels/RegistroScartiKitModel.cs index 6b872f50..9d4478b8 100644 --- a/MP.Data/DbModels/RegistroScartiKitModel.cs +++ b/MP.Data/DbModels/RegistroScartiKitModel.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/RemoteRebootLogModel.cs b/MP.Data/DbModels/RemoteRebootLogModel.cs index fbfeec7f..b4728ddf 100644 --- a/MP.Data/DbModels/RemoteRebootLogModel.cs +++ b/MP.Data/DbModels/RemoteRebootLogModel.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/ST_Act.cs b/MP.Data/DbModels/ST_Act.cs index b5d28335..1f84d0a8 100644 --- a/MP.Data/DbModels/ST_Act.cs +++ b/MP.Data/DbModels/ST_Act.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/ST_ActRow.cs b/MP.Data/DbModels/ST_ActRow.cs index 752f4890..bc4f8e55 100644 --- a/MP.Data/DbModels/ST_ActRow.cs +++ b/MP.Data/DbModels/ST_ActRow.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; #nullable disable diff --git a/MP.Data/DbModels/ST_AnagGruppi.cs b/MP.Data/DbModels/ST_AnagGruppi.cs index 451e5060..ce01dbfb 100644 --- a/MP.Data/DbModels/ST_AnagGruppi.cs +++ b/MP.Data/DbModels/ST_AnagGruppi.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/ST_AnagTipi.cs b/MP.Data/DbModels/ST_AnagTipi.cs index 85fb415c..e9e2e873 100644 --- a/MP.Data/DbModels/ST_AnagTipi.cs +++ b/MP.Data/DbModels/ST_AnagTipi.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/ST_Check.cs b/MP.Data/DbModels/ST_Check.cs index ce8985dd..d4ccc293 100644 --- a/MP.Data/DbModels/ST_Check.cs +++ b/MP.Data/DbModels/ST_Check.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/ST_Template.cs b/MP.Data/DbModels/ST_Template.cs index 6efffc79..beec9088 100644 --- a/MP.Data/DbModels/ST_Template.cs +++ b/MP.Data/DbModels/ST_Template.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/ST_TemplateRows.cs b/MP.Data/DbModels/ST_TemplateRows.cs index 701062d4..4958aed1 100644 --- a/MP.Data/DbModels/ST_TemplateRows.cs +++ b/MP.Data/DbModels/ST_TemplateRows.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; #nullable disable diff --git a/MP.Data/DbModels/ScanDataModel.cs b/MP.Data/DbModels/ScanDataModel.cs index 18d5994c..de678ce8 100644 --- a/MP.Data/DbModels/ScanDataModel.cs +++ b/MP.Data/DbModels/ScanDataModel.cs @@ -1,10 +1,6 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; // // This is here so CodeMaid doesn't reorganize this document diff --git a/MP.Data/DbModels/StatODLModel.cs b/MP.Data/DbModels/StatODLModel.cs index 9d879c6c..092fc030 100644 --- a/MP.Data/DbModels/StatODLModel.cs +++ b/MP.Data/DbModels/StatODLModel.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; #nullable disable diff --git a/MP.Data/DbModels/StatoMacchineModel.cs b/MP.Data/DbModels/StatoMacchineModel.cs index 0577b4b4..699b85b9 100644 --- a/MP.Data/DbModels/StatoMacchineModel.cs +++ b/MP.Data/DbModels/StatoMacchineModel.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/StatoProdModel.cs b/MP.Data/DbModels/StatoProdModel.cs index 9eb0e6cc..4bbdf04a 100644 --- a/MP.Data/DbModels/StatoProdModel.cs +++ b/MP.Data/DbModels/StatoProdModel.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/StatsODL.cs b/MP.Data/DbModels/StatsODL.cs index 4cf0a098..f43d77c7 100644 --- a/MP.Data/DbModels/StatsODL.cs +++ b/MP.Data/DbModels/StatsODL.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/TaskExecModel.cs b/MP.Data/DbModels/TaskExecModel.cs index 6cf80a5c..a3ada196 100644 --- a/MP.Data/DbModels/TaskExecModel.cs +++ b/MP.Data/DbModels/TaskExecModel.cs @@ -1,8 +1,6 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using static MP.Core.Objects.Enums; #nullable disable // diff --git a/MP.Data/DbModels/TaskListModel.cs b/MP.Data/DbModels/TaskListModel.cs index d4d6e330..3f446a54 100644 --- a/MP.Data/DbModels/TaskListModel.cs +++ b/MP.Data/DbModels/TaskListModel.cs @@ -1,9 +1,6 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using MP.Core.Objects; -using static MP.Core.Objects.Enums; using static MP.TaskMan.Objects.Enums; #nullable disable diff --git a/MP.Data/DbModels/TaskResultModel.cs b/MP.Data/DbModels/TaskResultModel.cs index 98955694..1f721670 100644 --- a/MP.Data/DbModels/TaskResultModel.cs +++ b/MP.Data/DbModels/TaskResultModel.cs @@ -1,9 +1,4 @@ -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using static MP.Core.Objects.Enums; +using System.ComponentModel.DataAnnotations.Schema; #nullable disable // diff --git a/MP.Data/DbModels/TemplateKitModel.cs b/MP.Data/DbModels/TemplateKitModel.cs index 46b990f5..17241428 100644 --- a/MP.Data/DbModels/TemplateKitModel.cs +++ b/MP.Data/DbModels/TemplateKitModel.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace MP.Data.DbModels diff --git a/MP.Data/DbModels/TksScoreModel.cs b/MP.Data/DbModels/TksScoreModel.cs index c3a5cc50..d90efb2d 100644 --- a/MP.Data/DbModels/TksScoreModel.cs +++ b/MP.Data/DbModels/TksScoreModel.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.ComponentModel.DataAnnotations; // // This is here so CodeMaid doesn't reorganize this document diff --git a/MP.Data/DbModels/TransizioneIngressiModel.cs b/MP.Data/DbModels/TransizioneIngressiModel.cs index 58144420..aa96eada 100644 --- a/MP.Data/DbModels/TransizioneIngressiModel.cs +++ b/MP.Data/DbModels/TransizioneIngressiModel.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; namespace MP.Data.DbModels { diff --git a/MP.Data/DbModels/TransizioneStatiModel.cs b/MP.Data/DbModels/TransizioneStatiModel.cs index b0dd2769..dee2e80e 100644 --- a/MP.Data/DbModels/TransizioneStatiModel.cs +++ b/MP.Data/DbModels/TransizioneStatiModel.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; namespace MP.Data.DbModels { diff --git a/MP.Data/DbModels/TurniMaccModel.cs b/MP.Data/DbModels/TurniMaccModel.cs index 11a35a3d..4ee709ea 100644 --- a/MP.Data/DbModels/TurniMaccModel.cs +++ b/MP.Data/DbModels/TurniMaccModel.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/TurniOee.cs b/MP.Data/DbModels/TurniOee.cs index 529e1cef..90587f75 100644 --- a/MP.Data/DbModels/TurniOee.cs +++ b/MP.Data/DbModels/TurniOee.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; diff --git a/MP.Data/DbModels/VocabolarioModel.cs b/MP.Data/DbModels/VocabolarioModel.cs index 3ccc15a4..5ae0843b 100644 --- a/MP.Data/DbModels/VocabolarioModel.cs +++ b/MP.Data/DbModels/VocabolarioModel.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; #nullable disable // diff --git a/MP.Data/DbModels/WipSetupKitModel.cs b/MP.Data/DbModels/WipSetupKitModel.cs index 8f7d3cf3..b5cef6e9 100644 --- a/MP.Data/DbModels/WipSetupKitModel.cs +++ b/MP.Data/DbModels/WipSetupKitModel.cs @@ -1,10 +1,6 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; // // This is here so CodeMaid doesn't reorganize this document diff --git a/MP.Data/DbModels/vSelCauScartoModel.cs b/MP.Data/DbModels/vSelCauScartoModel.cs index 82adc351..661ae18c 100644 --- a/MP.Data/DbModels/vSelCauScartoModel.cs +++ b/MP.Data/DbModels/vSelCauScartoModel.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; #nullable disable // diff --git a/MP.Data/DbModels/vSelEventiBCodeModel.cs b/MP.Data/DbModels/vSelEventiBCodeModel.cs index 714afad0..c2830541 100644 --- a/MP.Data/DbModels/vSelEventiBCodeModel.cs +++ b/MP.Data/DbModels/vSelEventiBCodeModel.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.ComponentModel.DataAnnotations; namespace MP.Data.DbModels { diff --git a/MP.Data/DbModels/vSelOdlModel.cs b/MP.Data/DbModels/vSelOdlModel.cs index a0a82c21..09f35917 100644 --- a/MP.Data/DbModels/vSelOdlModel.cs +++ b/MP.Data/DbModels/vSelOdlModel.cs @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; #nullable disable // diff --git a/MP.Data/MessagePipe.cs b/MP.Data/MessagePipe.cs index 588428e5..1094cc72 100644 --- a/MP.Data/MessagePipe.cs +++ b/MP.Data/MessagePipe.cs @@ -3,18 +3,21 @@ using StackExchange.Redis; using System; using System.Collections.Generic; using System.Diagnostics; +using System.Threading.Channels; namespace MP.Data { - public class MessagePipe + public class MessagePipe : IDisposable { #region Public Constructors public MessagePipe(IConnectionMultiplexer redisConn, string channelName, bool enableLog = false) { _channel = channelName; - redis = redisConn; - redisDb = redis.GetDatabase(); + rChannel = new RedisChannel(_channel, RedisChannel.PatternMode.Literal); + this.redisConn = redisConn; + redisDb = this.redisConn.GetDatabase(); + redisSub = this.redisConn.GetSubscriber(); this.enableLog = enableLog; // aggiungo sottoscrittore setupSubscriber(); @@ -30,6 +33,12 @@ namespace MP.Data #region Public Methods + public void Dispose() + { + redisDb = null; + redisSub = null; + } + /// /// Invio messaggio sul canale + salvataggio in cache REDIS /// @@ -74,8 +83,15 @@ namespace MP.Data public bool sendMessage(string newMess) { bool answ = false; + if (!string.IsNullOrEmpty(_channel)) + { +#if false ISubscriber sub = redis.GetSubscriber(); sub.Publish(_channel, newMess); +#endif + var numCli = redisSub.Publish(rChannel, newMess); + answ = numCli > 0; + } return answ; } @@ -89,29 +105,35 @@ namespace MP.Data #region Private Fields + /// + /// Nome Canale associato al gestore pipeline messaggi + /// + private string _channel = ""; + private bool enableLog = false; private Dictionary numSent = new Dictionary(); - private IConnectionMultiplexer redis; - private IDatabase redisDb; - - #endregion Private Fields - - #region Private Properties /// - /// Canale associato al gestore pipeline messaggi + /// Channel di comunicazione REDIS /// - private string _channel { get; set; } = ""; + private RedisChannel rChannel; - #endregion Private Properties + private IConnectionMultiplexer redisConn; + private IDatabase redisDb; + private ISubscriber redisSub; + + #endregion Private Fields #region Private Methods private void setupSubscriber() { - ISubscriber sub = redis.GetSubscriber(); - //Subscribe to the channel named messages +#if false + // Subscribe to the channel named messages + ISubscriber sub = redisConn.GetSubscriber(); sub.Subscribe(_channel, (channel, message) => +#endif + redisSub.Subscribe(rChannel, (channel, message) => { if (enableLog) { diff --git a/MP.Data/MoonProContext.cs b/MP.Data/MoonProContext.cs index 60c35a10..6029e3e7 100644 --- a/MP.Data/MoonProContext.cs +++ b/MP.Data/MoonProContext.cs @@ -49,6 +49,7 @@ namespace MP.Data public virtual DbSet DbSetAnagTags { get; set; } public virtual DbSet DbSetArticoli { get; set; } public virtual DbSet DbSetConfig { get; set; } + public virtual DbSet DbSetElConfProd { get; set; } public virtual DbSet DbSetLinkMenu { get; set; } public virtual DbSet DbSetListValues { get; set; } public virtual DbSet DbSetMacchine { get; set; } @@ -196,6 +197,11 @@ namespace MP.Data .IsRequired() .HasMaxLength(50); }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DataOraConf, e.IdxMacchina }); + }); modelBuilder.Entity(entity => { diff --git a/MP.Data/Services/BaseServ.cs b/MP.Data/Services/BaseServ.cs index 88efeb72..db80844c 100644 --- a/MP.Data/Services/BaseServ.cs +++ b/MP.Data/Services/BaseServ.cs @@ -16,16 +16,38 @@ namespace MP.Data.Services /// /// Classe di partenza x costruzione servizi di accesso dati + cache /// - public class BaseServ + public class BaseServ:IDisposable { + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + private bool _disposed = false; + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // Free managed resources here + redisDb = null; + } + + // Free unmanaged resources here + _disposed = true; + } + } + + #region Public Constructors - public BaseServ(IConfiguration configuration) + public BaseServ(IConfiguration configuration, IConnectionMultiplexer redConn) { _configuration = configuration; - // setup compoenti REDIS - redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis")); + // setup componenti REDIS + this.redisConn = redConn; redisDb = redisConn.GetDatabase(); // json serializer... FIX errore loop circolare https://www.ryadel.com/en/jsonserializationexception-self-referencing-loop-detected-error-fix-entity-framework-asp-net-core/ @@ -53,7 +75,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); IOB_data? result = new IOB_data(); - // cerco in redis... + // cerco in redisConn... string currKey = RedHashMpIO($"hM2IOB:{IdxMacchina}"); RedisValue rawData = redisDb.StringGet(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -89,7 +111,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); Dictionary result = new Dictionary(); - // cerco in redis... + // cerco in redisConn... string currKey = RedHashMpIO($"IOB:{IdxMacchina}:MachIobConf"); try { @@ -123,7 +145,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); string result = ""; - // cerco in redis... + // cerco in redisConn... string currKey = RedHashMpIO($"IOB:{IdxMacchina}:ConfYaml"); try { @@ -155,9 +177,9 @@ namespace MP.Data.Services /// /// Oggetto per connessione a REDIS /// - protected ConnectionMultiplexer redisConn = null!; + protected IConnectionMultiplexer redisConn = null!; - //ISubscriber sub = redis.GetSubscriber(); + //ISubscriber sub = redisConn.GetSubscriber(); /// /// Oggetto DB redis da impiegare x chiamate R/W /// diff --git a/MP.Data/Services/ExecStatsCollector.cs b/MP.Data/Services/ExecStatsCollector.cs index d8c49143..cd72b5e2 100644 --- a/MP.Data/Services/ExecStatsCollector.cs +++ b/MP.Data/Services/ExecStatsCollector.cs @@ -9,10 +9,15 @@ namespace MP.Data.Services /// /// Gestore statistiche esecuzione processi x analisi timing /// - public class ExecStatsCollector + public class ExecStatsCollector : IDisposable { #region Public Methods + public void Dispose() + { + TrackData.Clear(); + } + /// /// restituisce una stringa da poter emettere in log con il summary degli eventi tracciati ed eventuale reset... /// diff --git a/MP.Data/Services/LandDataService.cs b/MP.Data/Services/LandDataService.cs index bb86cc63..00588e84 100644 --- a/MP.Data/Services/LandDataService.cs +++ b/MP.Data/Services/LandDataService.cs @@ -9,6 +9,7 @@ using NLog; using StackExchange.Redis; using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Diagnostics; using System.Linq; using System.Text; @@ -20,7 +21,7 @@ namespace MP.Data.Services { #region Public Constructors - public LandDataService(IConfiguration configuration) : base(configuration) + public LandDataService(IConfiguration configuration, IConnectionMultiplexer redConn) : base(configuration, redConn) { // conf DB string connStr = _configuration.GetConnectionString("MP.Land"); @@ -41,7 +42,7 @@ namespace MP.Data.Services #region Public Properties - public static Controllers.MpLandController dbController { get; set; } = null!; + public static MpLandController dbController { get; set; } = null!; #endregion Public Properties @@ -58,7 +59,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:DbInfo:ALL"; RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) @@ -122,7 +123,7 @@ namespace MP.Data.Services //ordino x idxmacchina... dbResult = dbResult.OrderBy(x => x.IdxMacchina).ToList(); - // serializzo in cache redis + // serializzo in cache redisConn rawData = JsonConvert.SerializeObject(dbResult, JSSettings); redisDb.StringSet(currKey, rawData, UltraLongCache); } @@ -146,7 +147,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:RemRebLog:ALL"; RedisValue rawData = redisDb.StringGet(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -182,7 +183,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:RemRebLog:LAST"; RedisValue rawData = redisDb.StringGet(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -209,9 +210,32 @@ namespace MP.Data.Services #endregion Public Methods + #region Protected Methods + + protected override void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // Free managed resources here + dbController.Dispose(); + } + + // Free unmanaged resources here + _disposed = true; + } + + // Call base class implementation. + base.Dispose(disposing); + } + + #endregion Protected Methods + #region Private Fields private static Logger Log = LogManager.GetCurrentClassLogger(); + private bool _disposed = false; private string redisBaseKey = "MP:LAND:Cache"; #endregion Private Fields diff --git a/MP.Data/Services/ListSelectDataSrv.cs b/MP.Data/Services/ListSelectDataSrv.cs index e5c8aac5..f536a40f 100644 --- a/MP.Data/Services/ListSelectDataSrv.cs +++ b/MP.Data/Services/ListSelectDataSrv.cs @@ -6,6 +6,7 @@ using NLog; using StackExchange.Redis; using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Data; using System.Diagnostics; using System.IO; @@ -18,19 +19,12 @@ namespace MP.Data.Services /// /// Classe accesso dati filtrati per operatore /// - public class ListSelectDataSrv : BaseServ, IDisposable + public class ListSelectDataSrv : BaseServ { #region Public Constructors - public ListSelectDataSrv(IConfiguration configuration) : base(configuration) + public ListSelectDataSrv(IConfiguration configuration, IConnectionMultiplexer redConn) : base(configuration, redConn) { -#if false - _configuration = configuration; - // setup compoenti REDIS - redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis")); - redisDb = redisConn.GetDatabase(); -#endif - // conf DB string connStr = _configuration.GetConnectionString("MP.All"); if (string.IsNullOrEmpty(connStr)) @@ -69,7 +63,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:Art:{azienda}:{searchVal}:{numRecord}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -81,7 +75,7 @@ namespace MP.Data.Services { result = dbController.ArticoliGetSearch(numRecord, azienda, searchVal); #if false - result = await Task.FromResult(dbController.ArticoliGetSearch(numRecord, azienda, searchVal)); + result = await Task.FromResult(dbController.ArticoliGetSearch(numRecord, azienda, searchVal)); #endif // serializzp e salvo... rawData = JsonConvert.SerializeObject(result); @@ -106,7 +100,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:Conf"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -130,15 +124,6 @@ namespace MP.Data.Services return result; } - public void Dispose() - { - // Clear database controller - dbController.Dispose(); - // redis dispose - redisConn = null; - redisDb = null; - } - /// /// Pulizia cache Redis (tutta) /// @@ -171,7 +156,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:Menu:ALL"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -206,7 +191,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:Menu:{tipoLink}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -242,7 +227,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:Macc:{MatrOpr}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -269,26 +254,32 @@ namespace MP.Data.Services #endregion Public Methods - #region Protected Fields + #region Protected Methods -#if false - /// - /// Oggetto per connessione a REDIS - /// - protected ConnectionMultiplexer redisConn = null!; + protected override void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // Free managed resources here + dbController.Dispose(); + } - /// - /// Oggetto DB redis da impiegare x chiamate R/W - /// - protected IDatabase redisDb = null!; -#endif + // Free unmanaged resources here + _disposed = true; + } - #endregion Protected Fields + // Call base class implementation. + base.Dispose(disposing); + } + + #endregion Protected Methods #region Private Fields private static Logger Log = LogManager.GetCurrentClassLogger(); - + private bool _disposed = false; private string redisBaseKey = "MP:ALL:Cache"; #endregion Private Fields @@ -296,7 +287,7 @@ namespace MP.Data.Services #region Private Methods /// - /// Esegue flush memoria redis dato pattern + /// Esegue flush memoria redisConn dato pattern /// /// /// diff --git a/MP.Data/Services/MessageService.cs b/MP.Data/Services/MessageService.cs index 37c2e730..eb231f55 100644 --- a/MP.Data/Services/MessageService.cs +++ b/MP.Data/Services/MessageService.cs @@ -1,11 +1,7 @@ using Blazored.LocalStorage; using Blazored.SessionStorage; using EgwCoreLib.Utils; -using Microsoft.AspNetCore.Components; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal; using Microsoft.Extensions.Configuration; -using MP.AppAuth.Services; -using MP.Data.Controllers; using MP.Data.DbModels; using MP.Data.DTO; using Newtonsoft.Json; @@ -32,7 +28,7 @@ namespace MP.Data.Services #region Public Constructors - public MessageService(IConfiguration configuration, ILocalStorageService genLocalStorage, ISessionStorageService sessStore, TabDataService tdService, SharedMemService smServ) + public MessageService(IConfiguration configuration, IConnectionMultiplexer redConn, ILocalStorageService genLocalStorage, ISessionStorageService sessStore, TabDataService tdService, SharedMemService smServ) { _configuration = configuration; @@ -42,8 +38,8 @@ namespace MP.Data.Services TDService = tdService; SMService = smServ; - // setup compoenti REDIS - redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis")); + // setup componenti REDIS + this.redisConn = redConn; redisDb = redisConn.GetDatabase(); } @@ -296,9 +292,13 @@ namespace MP.Data.Services public void Dispose() { - // redis dispose - redisConn = null; redisDb = null; + _rigaOper = null; + if (userListMachine != null) + { + userListMachine.Clear(); + } + UserPrefs.Clear(); } public async Task DoLogIn(string decodValue, bool saveOpr) @@ -663,10 +663,10 @@ namespace MP.Data.Services /// /// Oggetto per connessione a REDIS /// - protected ConnectionMultiplexer redisConn = null!; + protected IConnectionMultiplexer redisConn = null!; /// - /// Oggetto DB redis da impiegare x chiamate R/W + /// Oggetto DB redisConn da impiegare x chiamate R/W /// protected IDatabase redisDb = null!; @@ -723,7 +723,7 @@ namespace MP.Data.Services } /// - /// Recupero HashSet redis come Dictionary + /// Recupero HashSet redisConn come Dictionary /// /// /// diff --git a/MP.Data/Services/MonDataFeeder.cs b/MP.Data/Services/MonDataFeeder.cs index 97971dae..15c151a9 100644 --- a/MP.Data/Services/MonDataFeeder.cs +++ b/MP.Data/Services/MonDataFeeder.cs @@ -7,11 +7,11 @@ using System.Threading.Tasks; namespace MP.Data.Services { - public class MonDataFeeder : StatusData, IDisposable + public class MonDataFeeder : StatusData { #region Public Constructors - public MonDataFeeder(IConfiguration configuration) : base(configuration) + public MonDataFeeder(IConfiguration configuration, IConnectionMultiplexer redConn) : base(configuration, redConn) { // setup canali pub/sub dataPipe = new MessagePipe(redisConn, Constants.MON_ACT_MSE_DATA_KEY); @@ -33,12 +33,6 @@ namespace MP.Data.Services #region Public Methods - public new void Dispose() - { - base.Dispose(); - stopTimers(); - } - /// /// Impostazione forzata timer refresh /// @@ -62,20 +56,46 @@ namespace MP.Data.Services public void stopTimers() { // stop timers - fastTimer.Elapsed -= ElapsedFastTimer; - fastTimer.Enabled = false; - fastTimer.Stop(); - fastTimer.Dispose(); + if (fastTimer != null) + { + fastTimer.Elapsed -= ElapsedFastTimer; + fastTimer.Enabled = false; + fastTimer.Stop(); + fastTimer.Dispose(); + } } #endregion Public Methods + #region Protected Methods + + protected override void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // Free managed resources here + stopTimers(); + dataPipe = null; + blinkPipe = null; + } + + // Free unmanaged resources here + _disposed = true; + } + + // Call base class implementation. + base.Dispose(disposing); + } + + #endregion Protected Methods + #region Private Fields private static System.Timers.Timer fastTimer = new System.Timers.Timer(4000); - private static Logger Log = LogManager.GetCurrentClassLogger(); - + private bool _disposed = false; private int fastRefreshMs = 1000; #endregion Private Fields diff --git a/MP.Data/Services/OrderDataSrv.cs b/MP.Data/Services/OrderDataSrv.cs index fc6ab539..3461a60e 100644 --- a/MP.Data/Services/OrderDataSrv.cs +++ b/MP.Data/Services/OrderDataSrv.cs @@ -6,6 +6,7 @@ using NLog; using StackExchange.Redis; using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Data; using System.Diagnostics; using System.IO; @@ -18,20 +19,12 @@ namespace MP.Data.Services /// /// Classe accesso dati ordini /// - public class OrderDataSrv : BaseServ, IDisposable + public class OrderDataSrv : BaseServ { #region Public Constructors - public OrderDataSrv(IConfiguration configuration): base(configuration) + public OrderDataSrv(IConfiguration configuration, IConnectionMultiplexer redConn) : base(configuration, redConn) { -#if false - _configuration = configuration; - - // setup compoenti REDIS - redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis")); - redisDb = redisConn.GetDatabase(); -#endif - // conf DB string connStr = _configuration.GetConnectionString("MP.All"); if (string.IsNullOrEmpty(connStr)) @@ -67,7 +60,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:Conf"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -92,15 +85,6 @@ namespace MP.Data.Services return result; } - public void Dispose() - { - // Clear database controller - dbController.Dispose(); - // redis dispose - redisConn = null; - redisDb = null; - } - /// /// Elenco ODL filtrati x articolo e macchina /// @@ -119,7 +103,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:ODL:{IdxMacchina}:{CodArt}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -146,23 +130,32 @@ namespace MP.Data.Services #endregion Public Methods - #region Protected Fields + #region Protected Methods - /// - /// Oggetto per connessione a REDIS - /// - protected ConnectionMultiplexer redisConn = null!; + protected override void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // Free managed resources here + dbController.Dispose(); + } - /// - /// Oggetto DB redis da impiegare x chiamate R/W - /// - protected IDatabase redisDb = null!; + // Free unmanaged resources here + _disposed = true; + } - #endregion Protected Fields + // Call base class implementation. + base.Dispose(disposing); + } + + #endregion Protected Methods #region Private Fields private static Logger Log = LogManager.GetCurrentClassLogger(); + private bool _disposed = false; private string redisBaseKey = "MP:ALL:Cache"; #endregion Private Fields diff --git a/MP.Data/Services/SharedMemService.cs b/MP.Data/Services/SharedMemService.cs index aa64a597..6609ecc1 100644 --- a/MP.Data/Services/SharedMemService.cs +++ b/MP.Data/Services/SharedMemService.cs @@ -9,24 +9,17 @@ namespace MP.Data.Services { public class SharedMemService : BaseServ { + #region Public Constructors + /// /// Init servizio TAB /// /// - public SharedMemService(IConfiguration configuration) : base(configuration) + public SharedMemService(IConfiguration configuration, IConnectionMultiplexer redConn) : base(configuration, redConn) { } - #region Private Fields - - private static Logger Log = LogManager.GetCurrentClassLogger(); - - /// - /// Oggetto vocabolario x uso continuo traduzione - /// - private List ObjVocabolario = new List(); - - #endregion Private Fields + #endregion Public Constructors #region Public Properties @@ -60,16 +53,16 @@ namespace MP.Data.Services ///
public Dictionary DictMacchine { get; set; } = new Dictionary(); - /// - /// Dizionario macchine con info multi(int) - /// - public Dictionary DictMacchMulti { get; set; } = new Dictionary(); - /// /// Dizionario macchine con info manual(bool) /// public Dictionary DictMacchManual { get; set; } = new Dictionary(); + /// + /// Dizionario macchine con info multi(int) + /// + public Dictionary DictMacchMulti { get; set; } = new Dictionary(); + /// /// Dizionario Menu /// @@ -106,7 +99,7 @@ namespace MP.Data.Services public List ListStati { get; set; } = new List(); /// - /// Lista completa stati + /// Lista completa lemmi e traduzioni vocabolario /// public List ListVocab { get; set; } = new List(); @@ -117,12 +110,6 @@ namespace MP.Data.Services #endregion Public Properties - #region Private Properties - - private List AllMenuData { get; set; } = new List(); - - #endregion Private Properties - #region Public Methods /// @@ -130,6 +117,7 @@ namespace MP.Data.Services /// public void ClearCache() { +#if false DictMacchine = new Dictionary(); DictMacchMulti = new Dictionary(); DictMenu = new Dictionary>(); @@ -138,6 +126,22 @@ namespace MP.Data.Services DictEventi = new Dictionary(); DictStati = new Dictionary(); DictVocab = new Dictionary(); +#endif + AllMenuData.Clear(); + DbConfig.Clear(); + DictConfig.Clear(); + DictEventi.Clear(); + DictMacchine.Clear(); + DictMacchManual.Clear(); + DictMacchMulti.Clear(); + DictMenu.Clear(); + DictStati.Clear(); + DictVocab.Clear(); + ListEventi.Clear(); + ListM2S.Clear(); + ListMSFD.Clear(); + ListStati.Clear(); + ListVocab.Clear(); Log.Info("SharedMemService | Cache resetted!"); } @@ -321,5 +325,40 @@ namespace MP.Data.Services } #endregion Public Methods + + #region Protected Methods + + protected override void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // Free managed resources here + ClearCache(); + } + + // Free unmanaged resources here + _disposed = true; + } + + // Call base class implementation. + base.Dispose(disposing); + } + + #endregion Protected Methods + + #region Private Fields + + private static Logger Log = LogManager.GetCurrentClassLogger(); + private bool _disposed = false; + + #endregion Private Fields + + #region Private Properties + + private List AllMenuData { get; set; } = new List(); + + #endregion Private Properties } } \ No newline at end of file diff --git a/MP.Data/Services/StatusData.cs b/MP.Data/Services/StatusData.cs index afdece54..93594364 100644 --- a/MP.Data/Services/StatusData.cs +++ b/MP.Data/Services/StatusData.cs @@ -20,12 +20,12 @@ namespace MP.Data.Services { #region Public Constructors - public StatusData(IConfiguration configuration) + public StatusData(IConfiguration configuration, IConnectionMultiplexer redConn) { _configuration = configuration; - // setup compoenti REDIS - redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis")); + // setup componenti REDIS + this.redisConn = redConn; redisDb = redisConn.GetDatabase(); // conf DB @@ -36,7 +36,7 @@ namespace MP.Data.Services } else { - dbController = new Controllers.MpMonController(configuration); + dbController = new MpMonController(configuration); StringBuilder sb = new StringBuilder(); sb.AppendLine($"StatusData | MpMonController OK"); Log.Info(sb.ToString()); @@ -64,7 +64,7 @@ namespace MP.Data.Services #region Public Properties - public static Controllers.MpMonController dbController { get; set; } = null!; + public static MpMonController dbController { get; set; } = null!; /// /// Dizionario dei tag configurati per IOB @@ -85,7 +85,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:Conf"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -112,11 +112,8 @@ namespace MP.Data.Services public void Dispose() { - // Clear database controller - dbController.Dispose(); - // redis dispose - redisConn = null; - redisDb = null; + Dispose(true); + GC.SuppressFinalize(this); } /// @@ -173,7 +170,7 @@ namespace MP.Data.Services string source = "DB"; sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{Constants.redisMacchine}:ALL"; RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) @@ -204,7 +201,7 @@ namespace MP.Data.Services string source = "DB"; sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{Constants.redisMacchine}:{CodGruppo}"; RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) @@ -323,7 +320,7 @@ namespace MP.Data.Services string source = "DB"; sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... RedisValue rawData = redisDb.StringGet(Constants.redisMseKey); if (rawData.HasValue && !forceDb) { @@ -353,9 +350,8 @@ namespace MP.Data.Services /// /// Oggetto per connessione a REDIS /// - protected ConnectionMultiplexer redisConn = null!; + protected IConnectionMultiplexer redisConn = null!; - //ISubscriber sub = redis.GetSubscriber(); /// /// Oggetto DB redis da impiegare x chiamate R/W /// @@ -363,10 +359,36 @@ namespace MP.Data.Services #endregion Protected Fields + #region Protected Methods + + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // Free managed resources here + currTagConf.Clear(); + MachineNumPz.Clear(); + MachineProdStatus.Clear(); + // REDIS dispose + redisDb = null; + // Clear database controller + dbController.Dispose(); + } + + // Free unmanaged resources here + _disposed = true; + } + } + + #endregion Protected Methods + #region Private Fields private static IConfiguration _configuration = null!; - private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); + private static Logger Log = LogManager.GetCurrentClassLogger(); + private bool _disposed = false; /// /// Cache breve durata @@ -398,7 +420,7 @@ namespace MP.Data.Services #region Private Methods /// - /// Esegue flush memoria redis dato pattern + /// Esegue flush memoria redisConn dato pattern /// /// /// diff --git a/MP.Data/Services/TabDataFeeder.cs b/MP.Data/Services/TabDataFeeder.cs index 7189b7d8..cb8f1586 100644 --- a/MP.Data/Services/TabDataFeeder.cs +++ b/MP.Data/Services/TabDataFeeder.cs @@ -7,26 +7,15 @@ using System.Threading.Tasks; namespace MP.Data.Services { - public class TabDataFeeder : StatusData, IDisposable + public class TabDataFeeder : StatusData { - #region Private Fields - - private static System.Timers.Timer fastTimer = new System.Timers.Timer(4000); - - private static Logger Log = LogManager.GetCurrentClassLogger(); - - private int fastRefreshMs = 1000; - - #endregion Private Fields - #region Public Constructors - public TabDataFeeder(IConfiguration configuration) : base(configuration) + public TabDataFeeder(IConfiguration configuration, IConnectionMultiplexer redConn) : base(configuration, redConn) { // setup canali pub/sub dataPipe = new MessagePipe(redisConn, Constants.TAB_ACT_MSE_DATA_KEY, false); blinkPipe = new MessagePipe(redisConn, Constants.TAB_ACT_BLINK_KEY, false); - // avvio timers... startTimers(); } @@ -36,19 +25,12 @@ namespace MP.Data.Services #region Public Properties public MessagePipe blinkPipe { get; set; } = null!; - public MessagePipe dataPipe { get; set; } = null!; #endregion Public Properties #region Public Methods - public new void Dispose() - { - base.Dispose(); - stopTimers(); - } - /// /// Impostazione forzata timer refresh /// @@ -72,14 +54,52 @@ namespace MP.Data.Services public void stopTimers() { // stop timers - fastTimer.Elapsed -= ElapsedFastTimer; - fastTimer.Enabled = false; - fastTimer.Stop(); - fastTimer.Dispose(); + if (fastTimer != null) + { + fastTimer.Elapsed -= ElapsedFastTimer; + fastTimer.Enabled = false; + fastTimer.Stop(); + fastTimer.Dispose(); + } } #endregion Public Methods + #region Protected Methods + + protected override void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // Free managed resources here + stopTimers(); + dataPipe = null; + blinkPipe = null; + } + + // Free unmanaged resources here + _disposed = true; + } + + // Call base class implementation. + base.Dispose(disposing); + } + + #endregion Protected Methods + + #region Private Fields + + private static System.Timers.Timer fastTimer = new System.Timers.Timer(4000); + + private static Logger Log = LogManager.GetCurrentClassLogger(); + + private bool _disposed = false; + private int fastRefreshMs = 1000; + + #endregion Private Fields + #region Private Methods private void ElapsedFastTimer(object? source, System.Timers.ElapsedEventArgs e) diff --git a/MP.Data/Services/TabDataService.cs b/MP.Data/Services/TabDataService.cs index d063dd49..54c445b5 100644 --- a/MP.Data/Services/TabDataService.cs +++ b/MP.Data/Services/TabDataService.cs @@ -9,6 +9,7 @@ using NLog; using StackExchange.Redis; using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Data; using System.Diagnostics; using System.Globalization; @@ -18,7 +19,7 @@ using System.Threading.Tasks; namespace MP.Data.Services { - public class TabDataService : BaseServ, IDisposable + public class TabDataService : BaseServ { #region Public Constructors @@ -26,14 +27,10 @@ namespace MP.Data.Services /// Init servizio TAB /// /// - public TabDataService(IConfiguration configuration) : base(configuration) + public TabDataService(IConfiguration configuration, IConnectionMultiplexer redConn) : base(configuration, redConn) { _configuration = configuration; - // setup compoenti REDIS - redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis")); - redisDb = redisConn.GetDatabase(); - // conf DB ConnStr = _configuration.GetConnectionString("MP.All"); if (string.IsNullOrEmpty(ConnStr)) @@ -171,7 +168,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:AlarmLog:{idxMacchina}:{dtFrom:yyyyMMdd-HHmmss}:{dtTo::yyyyMMdd-HHmmss}:{showMulti}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -231,7 +228,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:AnagEventi:ALL"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -265,7 +262,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:VSEB:{IdxMacch}"; RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) @@ -300,7 +297,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:AnagTags"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -337,7 +334,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:AnagStati"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -376,7 +373,7 @@ namespace MP.Data.Services string readType = "DB"; string sKey = string.IsNullOrEmpty(tipo) ? "ALL" : tipo; string currKey = $"{Utils.redisArtList}:{azienda}:Tipo:{sKey}"; - // cerco in redis dato valore sel idxMaccSel... + // cerco in redisConn dato valore sel idxMaccSel... RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) { @@ -414,7 +411,7 @@ namespace MP.Data.Services sw.Start(); List result = new List(); DateTime adesso = DateTime.Now; - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:Commenti:{idxMacchina}:{adesso:yyMMdd-HHmm}:{numDays}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -488,7 +485,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:Conf"; RedisValue rawData = redisDb.StringGet(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -656,15 +653,28 @@ namespace MP.Data.Services return SteamCrypto.DecryptString(encData, Constants.passPhrase); } - public void Dispose() + private bool _disposed = false; + protected override void Dispose(bool disposing) { - // Clear database controller - dbTabController.Dispose(); - dbIocController.Dispose(); - dbInveController.Dispose(); - // redis dispose - redisConn = null; - redisDb = null; + if (!_disposed) + { + if (disposing) + { + // Free managed resources here + dbTabController.Dispose(); + dbIocController.Dispose(); + dbInveController.Dispose(); + CurrConfig.Clear(); + connStrParams.Clear(); + esCollect.Dispose(); + } + + // Free unmanaged resources here + _disposed = true; + } + + // Call base class implementation. + base.Dispose(disposing); } /// @@ -700,7 +710,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:ElencoOpr"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -770,7 +780,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:EvList:Last:{idxMacchina}:{idxTipo}:{dtLimit:yyyyMMdd-HHmm}:{maxRec}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -851,7 +861,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:FNQ:{idxMacchina}:{gg}:{durataMin:N0}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -1054,7 +1064,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:InsMan:{idxMacchina}:{dtFrom:yyyyMMdd-HHmmss}:{dtTo::yyyyMMdd-HHmmss}"; RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) @@ -1236,44 +1246,6 @@ namespace MP.Data.Services return fatto; } -#if false - /// - /// Recupero info IOB x TAB (da info registrate IOB-WIN--> MP-IO) - /// - /// - /// - public IOB_data IobInfo(string IdxMacchina) - { - string source = "DB"; - Stopwatch sw = new Stopwatch(); - sw.Start(); - IOB_data? result = new IOB_data(); - // cerco in redis... - string currKey = RedHashMpIO($"hM2IOB:{IdxMacchina}"); - RedisValue rawData = redisDb.StringGet(currKey); - //if (!string.IsNullOrEmpty($"{rawData}")) - if (rawData.HasValue) - { - result = JsonConvert.DeserializeObject($"{rawData}"); - source = "REDIS"; - } - else - { - Log.Error($"Errore: non trovato valore valido in REDIS | key: {currKey}"); - Log.Info($"REDIS | conf: {redisConn.Configuration}"); - Log.Info($" --> Valore trovato:{Environment.NewLine}{rawData}"); - } - if (result == null) - { - result = new IOB_data(); - Log.Debug($"Init valore default | IdxMacchina: {IdxMacchina}"); - } - sw.Stop(); - Log.Debug($"IobInfo per {IdxMacchina} | {source} | {sw.Elapsed.TotalMilliseconds}ms"); - return result; - } -#endif - /// /// Recupero info IOB x TAB (da info registrate IOB-WIN--> MP-IO) /// @@ -1285,7 +1257,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); IOB_data? result = new IOB_data(); - // cerco in redis... + // cerco in redisConn... string currKey = RedHashMpIO($"hM2IOB:{IdxMacchina}"); RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -1319,7 +1291,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:PODL:{idxMacchina}:{onlyFree}:{onlyDirect}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -1353,7 +1325,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:ListVal:{tabName}:{fieldName}"; RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) @@ -1391,7 +1363,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:LottoExt:{codMagazzino}:{codArt}:{codLotto}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -1438,7 +1410,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:Mach2Slave"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -1477,7 +1449,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:MachByMatOp:{MatrOpr}"; RedisValue rawData = redisDb.StringGet(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -1520,7 +1492,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = RedHashMpIO($"CurrentParameters:{idxMacchina}"); RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue && rawData.Length() > 2) @@ -1629,74 +1601,6 @@ namespace MP.Data.Services return answ; } -#if false - /// - /// Recupero info Machine-IOB x TAB (da info registrate IOB-WIN --> MP-IO) - /// - /// - /// - public Dictionary MachIobConf(string IdxMacchina) - { - string source = "NA"; - Stopwatch sw = new Stopwatch(); - sw.Start(); - Dictionary result = new Dictionary(); - // cerco in redis... - string currKey = RedHashMpIO($"IOB:{IdxMacchina}:MachIobConf"); - try - { - result = redisDb - .HashGetAll(currKey) - .ToDictionary(x => $"{x.Name}", x => $"{x.Value}"); - source = "REDIS"; - } - catch (Exception exc) - { - Log.Error($"Errore in MachIobConf{Environment.NewLine}{exc}"); - } - if (result == null) - { - result = new Dictionary(); - Log.Debug($"Init valore default MachIobConf | IdxMacchina: {IdxMacchina}"); - } - sw.Stop(); - Log.Debug($"MachIobConf per {IdxMacchina} | {source} | {sw.Elapsed.TotalMilliseconds}ms"); - return result; - } - - /// - /// Recupero Conf Yaml Machine-IOB - /// - /// - /// - public string MachIobYamlConf(string IdxMacchina) - { - string source = "NA"; - Stopwatch sw = new Stopwatch(); - sw.Start(); - string result = ""; - // cerco in redis... - string currKey = RedHashMpIO($"IOB:{IdxMacchina}:ConfYaml"); - try - { - result = redisDb.StringGet(currKey); - source = "REDIS"; - } - catch (Exception exc) - { - Log.Error($"Errore in MachIobYamlConf{Environment.NewLine}{exc}"); - } - if (result == null) - { - result = ""; - Log.Debug($"Init valore default MachIobYamlConf | IdxMacchina: {IdxMacchina}"); - } - sw.Stop(); - Log.Debug($"MachIobYamlConf per {IdxMacchina} | {source} | {sw.Elapsed.TotalMilliseconds}ms"); - return result; - } -#endif - /// /// Restitusice elenco KVP dei TASK SALVATI (da passare a IOB-WIN) per l'impianto indicato /// @@ -1707,7 +1611,7 @@ namespace MP.Data.Services { // hard coded dimensione vettore DatiMacchine Dictionary answ = new Dictionary(); - // ORA recupero da memoria redis... + // ORA recupero da memoria redisConn... try { var currKey = (RedisKey)savedTaskHash(idxMacchina); @@ -1732,7 +1636,7 @@ namespace MP.Data.Services Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); MappaStatoExplModel result = new MappaStatoExplModel(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{Constants.redisMseKeySingle}:{idxMacchSub}"; RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue && !forceDb) @@ -1805,7 +1709,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); ODLExpModel result = new ODLExpModel(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:ODL:{idxOdl}:{onlyUnused}"; RedisValue rawData = redisDb.StringGet(currKey); #if false @@ -1887,7 +1791,7 @@ namespace MP.Data.Services // se vuoto esco subito... if (!string.IsNullOrEmpty(idxMacchina)) { - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:ODL:{idxMacchina}:CURR"; RedisValue rawData = redisDb.StringGet(currKey); #if false @@ -2044,7 +1948,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); ODLModel result = new ODLModel(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:ODL:{idxMacchina}:LAST"; RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue && !forceDb) @@ -2077,23 +1981,23 @@ namespace MP.Data.Services /// /// /// - public async Task> OdlListByMaccPeriodo(string idxMacchina, DateTime dtStart, DateTime dtEnd) + public async Task> OdlListByMaccPeriodo(string idxMacchina, DateTime dtStart, DateTime dtEnd) { string source = "DB"; Stopwatch sw = new Stopwatch(); sw.Start(); - List? result = new List(); - // cerco in redis... + List? result = new List(); + // cerco in redisConn... string currKey = $"{redisBaseKey}:ODL:{idxMacchina}:{dtStart:yyyyMMdd-HHmmss}:{dtEnd:yyyyMMdd-HHmmss}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) { - result = JsonConvert.DeserializeObject>($"{rawData}"); + result = JsonConvert.DeserializeObject>($"{rawData}"); source = "REDIS"; } else { - result = await Task.FromResult(dbTabController.OdlListByMaccPeriodo(idxMacchina, dtStart, dtEnd)); + result = dbTabController.OdlListByMaccPeriodo(idxMacchina, dtStart, dtEnd); // riordino result = result.OrderByDescending(x => x.DataInizio).ToList(); // serializzo e salvo... @@ -2102,7 +2006,7 @@ namespace MP.Data.Services } if (result == null) { - result = new List(); + result = new List(); } sw.Stop(); Log.Debug($"OdlListByMaccPeriodo | {source} | {sw.Elapsed.TotalMilliseconds}ms"); @@ -2120,7 +2024,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); ODLModel result = new ODLModel(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:ODL:{idxMacchina}:LAST"; var results = await Task.FromResult(dbTabController.OdlReopenOdlMacc(idxMacchina)); // riordino @@ -2249,7 +2153,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); bool answ = false; - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisUserDataKey}:CurrOpr:{matrOpr}:CurrDevGuid:{DevGuid}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -2275,7 +2179,7 @@ namespace MP.Data.Services public TimeSpan OperatoreGetGuidTTL(int matrOpr, Guid currDevGuid) { TimeSpan answ = new TimeSpan(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisUserDataKey}:CurrOpr:{matrOpr}:CurrDevGuid:{currDevGuid}"; answ = GetKeyTTL(currKey); return answ; @@ -2292,7 +2196,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); string answ = ""; - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisUserDataKey}:CurrOpr:{matrOpr}:CurrDevGuid:{currDevGuid}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -2344,7 +2248,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); string answ = ""; - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisUserDataKey}:CurrOpr:{matrOpr}:CurrDevGuid:{currDevGuid}"; //RedisValue rawData = await redisDb.StringGetAsync(currKey); // serializzo e salvo... @@ -2374,7 +2278,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:PzProd:{idxMacchina}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -2438,7 +2342,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); PODLExpModel result = new PODLExpModel(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:PODL:{idxPODL}"; RedisValue rawData; rawData = redisDb.StringGet(currKey); @@ -2514,7 +2418,7 @@ namespace MP.Data.Services stopWatch.Start(); string readType = "DB"; string currKey = $"{Utils.redisPOdlList}_kit:ByParent:{IdxPodlParent}"; - // cerco in redis dato valore sel idxMaccSel... + // cerco in redisConn dato valore sel idxMaccSel... RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) { @@ -2558,7 +2462,7 @@ namespace MP.Data.Services else { answ = await pzCounterTC(idxMacchina); - // salvo in redis... + // salvo in redisConn... await saveCounter(idxMacchina, answ.ToString()); } } @@ -2644,7 +2548,7 @@ namespace MP.Data.Services /// /// /// - public async Task> RegControlliFilt(string idxMacchina, int idxODL, DateTime dataFrom, DateTime dataTo, bool showMulti) + public async Task> RegControlliFiltAsync(string idxMacchina, int idxODL, DateTime dataFrom, DateTime dataTo, bool showMulti) { int rndWait = rnd.Next(0, 2); await Task.Delay(rndWait); @@ -2653,12 +2557,12 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:RecContr:{idxMacchina}:{idxODL}:{dataFrom:yyyyyMMdd-HHmm}:{dataFrom:yyyyyMMdd-HHmm}:{showMulti}"; - RedisValue rawData = redisDb.StringGet(currKey); #if false - RedisValue rawData = await redisDb.StringGetAsync(currKey); + RedisValue rawData = redisDb.StringGet(currKey); #endif + RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) { result = JsonConvert.DeserializeObject>($"{rawData}"); @@ -2669,10 +2573,10 @@ namespace MP.Data.Services result = dbTabController.RegControlliFilt(idxMacchina, idxODL, dataFrom, dataTo, showMulti); // serializzo e salvo... rawData = JsonConvert.SerializeObject(result); - redisDb.StringSet(currKey, rawData, UltraLongCache); #if false - await redisDb.StringSetAsync(currKey, rawData, UltraLongCache); + redisDb.StringSet(currKey, rawData, UltraLongCache); #endif + await redisDb.StringSetAsync(currKey, rawData, UltraLongCache); } if (result == null) { @@ -2680,9 +2584,49 @@ namespace MP.Data.Services } sw.Stop(); #if false - Log.Debug($"RegControlliFilt | {source} | {sw.Elapsed.TotalMilliseconds}ms"); + Log.Debug($"RegControlliFiltAsync | {source} | {sw.Elapsed.TotalMilliseconds}ms"); #endif - string callName = $"RegControlliFilt.{source}"; + string callName = $"RegControlliFiltAsync.{source}"; + int numRec = esCollect.RecordCall(callName, sw.Elapsed.TotalMilliseconds); + if (numRec >= nRecLog) + { + Log.Debug(esCollect.GetCallSum(callName, true)); + } + return result; + } + + + /// + /// Restituisce elenco ElencoConfermeProd filtrato e async + /// + /// + /// + /// + /// + public async Task> ElencoConfProdFiltAsync(string idxMacchina, DateTime dataFrom, DateTime dataTo) + { + // setup parametri costanti + string source = "DB"; + Stopwatch sw = new Stopwatch(); + sw.Start(); + List result = new List(); + // cerco in redisConn... + string currKey = $"{redisBaseKey}:ElConfProd:{idxMacchina}:{dataFrom:yyyyyMMdd-HHmm}:{dataFrom:yyyyyMMdd-HHmm}"; + RedisValue rawData = await redisDb.StringGetAsync(currKey); + if (rawData.HasValue) + { + result = JsonConvert.DeserializeObject>($"{rawData}")?? new List(); + source = "REDIS"; + } + else + { + result = dbTabController.ElencoConfProdFilt(idxMacchina, dataFrom, dataTo); + // serializzo e salvo... + rawData = JsonConvert.SerializeObject(result); + await redisDb.StringSetAsync(currKey, rawData, UltraLongCache); + } + sw.Stop(); + string callName = $"ElencoConfProdFiltAsync.{source}"; int numRec = esCollect.RecordCall(callName, sw.Elapsed.TotalMilliseconds); if (numRec >= nRecLog) { @@ -2731,7 +2675,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:RecContr:{idxMacchina}:LAST"; RedisValue rawData = redisDb.StringGet(currKey); #if false @@ -2785,7 +2729,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:RegDichiar:{idxMacchina}:{tagCode}:{matrOpr}:{idxODL}:{dataFrom:yyyyyMMdd-HHmm}:{dataTo:yyyyyMMdd-HHmm}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -2871,7 +2815,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:RegScarti:{idxMacchina}:{idxODL}:{dataFrom:yyyyyMMdd-HHmm}:{dataTo:yyyyyMMdd-HHmm}:{showMulti}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -2955,7 +2899,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:RegScartiKit:{ParentRec.IdxMacchina}:{ParentRec.DataOra:yyyyyMMdd-HHmm}:{ParentRec.Causale}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -3105,7 +3049,7 @@ namespace MP.Data.Services { Log.Info($"Eccezione in calcolo timeout dati macchina: idxMacchina{idxMacchina} | TShort: {tOutShort} | TLong {tOutLong}{Environment.NewLine}{exc}"); } - // salvo in redis! + // salvo in redisConn! redisHashDictSet(currKey, answ, TimeSpan.FromSeconds(redDtMacTOut)); } return answ; @@ -3143,7 +3087,7 @@ namespace MP.Data.Services Value = "FER" }; var result = dbTabController.MicroStatoMacchinaUpsert(newRecMS); - // reset in redis + // reset in redisConn await resetDatiMacchina(idxMacchina); } @@ -3185,7 +3129,7 @@ namespace MP.Data.Services if (newCounter >= 0) { string redKey = redHash($"PzCount:{idxMacchina}"); - // verifico SE ci sia chiave in redis (ALTRIMENTI rileggo da DB) + // verifico SE ci sia chiave in redisConn (ALTRIMENTI rileggo da DB) string redVal = redisDb.StringGet(redKey); if (!string.IsNullOrEmpty(redVal)) { @@ -3283,7 +3227,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:ST:AnagGruppiModel"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -3393,7 +3337,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:STAR:{codGruppo}:{idxODL}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -3432,7 +3376,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:STAR:{codGruppo}:{label}:{idxODL}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -3469,7 +3413,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:STAR:Pend:{idxODL}"; RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) @@ -3505,7 +3449,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); StatoMacchineModel? result = new StatoMacchineModel(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:StatoMacc:{idxMacchina}"; RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) @@ -3544,7 +3488,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); StatoProdModel? result = new StatoProdModel(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:StatoProd:{idxMacchina}:{dtReq:HHmm}"; RedisValue rawData = redisDb.StringGet(currKey); #if false @@ -3595,7 +3539,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{Utils.redisKitTempl}:{codParent}:{codChild}"; RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) @@ -3629,7 +3573,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); TurniMaccModel? result = new TurniMaccModel(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:TurniMacc:{idxMacchina}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -3664,7 +3608,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:TurniMacc:All"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -3716,7 +3660,7 @@ namespace MP.Data.Services /// /// Intera vista v_MSFD /// - /// forza rilettura + save su redis + /// forza rilettura + save su redisConn /// public async Task> VMSFDGetAll(bool doForce = false) { @@ -3725,7 +3669,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:MSFD:ALL"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue && !doForce) @@ -3761,7 +3705,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:MSFD:MACCH:{idxMacc}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -3798,7 +3742,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:MSFD:MULTI:{idxMacc}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -3830,7 +3774,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:Vocab"; RedisValue rawData = redisDb.StringGet(currKey); if (rawData.HasValue) @@ -3864,7 +3808,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:VSCS"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -3900,7 +3844,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:VSODL:{idxMacchina}:{numRec}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue) @@ -3937,7 +3881,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:VSODL:{idxMacchina}:ALL_{showAll}:{numDayAdd}"; RedisValue rawData = await redisDb.StringGetAsync(currKey); if (rawData.HasValue && rawData.Length() > 2) @@ -3967,18 +3911,6 @@ namespace MP.Data.Services protected int expMinutes = 1; - protected string MpIoNS = ""; - - /// - /// Oggetto per connessione a REDIS - /// - protected ConnectionMultiplexer redisConn = null!; - - /// - /// Oggetto DB redis da impiegare x chiamate R/W - /// - protected IDatabase redisDb = null!; - #endregion Protected Fields #region Protected Properties @@ -4052,7 +3984,7 @@ namespace MP.Data.Services #region Private Methods /// - /// Esegue flush memoria redis dato pattern, metodo sincrono + /// Esegue flush memoria redisConn dato pattern, metodo sincrono /// /// /// @@ -4080,7 +4012,7 @@ namespace MP.Data.Services } /// - /// Esegue flush memoria redis dato pattern in async + /// Esegue flush memoria redisConn dato pattern in async /// /// /// @@ -4126,7 +4058,7 @@ namespace MP.Data.Services { // hard coded dimensione vettore DatiMacchine Dictionary answ = new Dictionary(); - // ORA recupero da memoria redis... + // ORA recupero da memoria redisConn... try { var currKey = (RedisKey)exeTaskHash(idxMacchina); @@ -4187,7 +4119,7 @@ namespace MP.Data.Services } /// - /// Recupero HashSet redis come Dictionary + /// Recupero HashSet redisConn come Dictionary /// /// /// diff --git a/MP.Data/Services/TranslateSrv.cs b/MP.Data/Services/TranslateSrv.cs index e1309c26..7f61465d 100644 --- a/MP.Data/Services/TranslateSrv.cs +++ b/MP.Data/Services/TranslateSrv.cs @@ -6,6 +6,7 @@ using NLog; using StackExchange.Redis; using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Data; using System.Diagnostics; using System.IO; @@ -18,19 +19,14 @@ namespace MP.Data.Services /// /// Classe accesso processi traduzione /// - public class TranslateSrv : BaseServ, IDisposable + public class TranslateSrv : BaseServ { #region Public Constructors - public TranslateSrv(IConfiguration configuration) : base(configuration) + public TranslateSrv(IConfiguration configuration, IConnectionMultiplexer redConn) : base(configuration, redConn) { - Stopwatch sw = Stopwatch.StartNew(); + Stopwatch sw = new Stopwatch(); sw.Start(); - _configuration = configuration; - // setup compoenti REDIS - redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis")); - redisDb = redisConn.GetDatabase(); - // conf DB string connStr = _configuration.GetConnectionString("MP.Voc"); if (string.IsNullOrEmpty(connStr)) @@ -66,7 +62,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:Conf"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -91,15 +87,6 @@ namespace MP.Data.Services return result; } - public void Dispose() - { - // Clear database controller - dbController.Dispose(); - // redis dispose - redisConn = null; - redisDb = null; - } - /// /// Pulizia cache Redis (tutta) /// @@ -135,7 +122,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:Lang"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -187,7 +174,7 @@ namespace MP.Data.Services Stopwatch sw = new Stopwatch(); sw.Start(); List? result = new List(); - // cerco in redis... + // cerco in redisConn... string currKey = $"{redisBaseKey}:Voc"; RedisValue rawData = await redisDb.StringGetAsync(currKey); //if (!string.IsNullOrEmpty($"{rawData}")) @@ -201,7 +188,7 @@ namespace MP.Data.Services result = dbController.VocabolarioGetAll(); // serializzo e salvo... rawData = JsonConvert.SerializeObject(result); - redisDb.StringSet(currKey, rawData, LongCache); + redisDb.StringSet(currKey, rawData, UltraLongCache); } if (result == null) { @@ -221,22 +208,35 @@ namespace MP.Data.Services /// protected static Dictionary DictVocab = new Dictionary(); - /// - /// Oggetto per connessione a REDIS - /// - protected ConnectionMultiplexer redisConn = null!; - - /// - /// Oggetto DB redis da impiegare x chiamate R/W - /// - protected IDatabase redisDb = null!; - #endregion Protected Fields + #region Protected Methods + + protected override void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // Free managed resources here + DictVocab.Clear(); + dbController.Dispose(); + } + + // Free unmanaged resources here + _disposed = true; + } + + // Call base class implementation. + base.Dispose(disposing); + } + + #endregion Protected Methods + #region Private Fields private static Logger Log = LogManager.GetCurrentClassLogger(); - + private bool _disposed = false; private string redisBaseKey = "MP:Voc:Cache"; #endregion Private Fields @@ -254,7 +254,7 @@ namespace MP.Data.Services } /// - /// Esegue flush memoria redis dato pattern + /// Esegue flush memoria redisConn dato pattern /// /// /// diff --git a/MP.Stats/Data/MpStatsService.cs b/MP.Stats/Data/MpStatsService.cs index b9f90a89..262062a1 100644 --- a/MP.Stats/Data/MpStatsService.cs +++ b/MP.Stats/Data/MpStatsService.cs @@ -13,7 +13,7 @@ using System.Threading.Tasks; namespace MP.Stats.Data { - public class MpStatsService : BaseServ, IDisposable + public class MpStatsService : BaseServ { #region Public Fields @@ -23,17 +23,10 @@ namespace MP.Stats.Data #region Public Constructors - public MpStatsService(IConfiguration configuration) : base(configuration) + public MpStatsService(IConfiguration configuration, IConnectionMultiplexer redConn) : base(configuration, redConn) { Stopwatch sw = Stopwatch.StartNew(); sw.Start(); -#if false - _configuration = configuration; - - // setup compoenti REDIS - redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis")); - redisDb = redisConn.GetDatabase(); -#endif // conf DB string connStr = _configuration.GetConnectionString("MP.Stats"); @@ -201,15 +194,6 @@ namespace MP.Stats.Data return result; } - public void Dispose() - { - // Clear database controller - dbController.Dispose(); - // redis dispose - redisConn = null; - redisDb = null; - } - /// /// Pulizia cache Redis (tutta) /// @@ -777,7 +761,6 @@ namespace MP.Stats.Data #region Protected Fields protected static string connStringBBM = ""; - protected static string connStringFatt = ""; /// @@ -787,20 +770,26 @@ namespace MP.Stats.Data #endregion Protected Fields -#if false - /// - /// Oggetto per connessione a REDIS - /// - protected ConnectionMultiplexer redisConn = null!; - - /// - /// Oggetto DB redis da impiegare x chiamate R/W - /// - protected IDatabase redisDb = null!; -#endif - #region Protected Methods + protected override void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // Free managed resources here + dbController.Dispose(); + } + + // Free unmanaged resources here + _disposed = true; + } + + // Call base class implementation. + base.Dispose(disposing); + } + protected string getCacheKey(string TableName, SelectData CurrFilter) { string answ = $"{TableName}:M_{CurrFilter.IdxMacchina}:AZ_{CurrFilter.Azione}:ART_{CurrFilter.CodArticolo}:KR_{CurrFilter.KeyRichiesta}:O_{CurrFilter.IdxOdl}:D_{CurrFilter.DateStart:yyyyMMddHHmm}_{CurrFilter.DateEnd:yyyyMMddHHmm}"; @@ -818,6 +807,7 @@ namespace MP.Stats.Data #region Private Fields private static Logger Log = LogManager.GetCurrentClassLogger(); + private bool _disposed = false; private string redisBaseKey = "MP:STATS"; #endregion Private Fields diff --git a/MP.Stats/MP.Stats.csproj b/MP.Stats/MP.Stats.csproj index d8691f50..3411c932 100644 --- a/MP.Stats/MP.Stats.csproj +++ b/MP.Stats/MP.Stats.csproj @@ -4,8 +4,8 @@ net6.0 MP.Stats 826e877c-ba70-4253-84cb-d0b1cafd4440 - 6.16.2507.1613 - 6.16.2507.1613 + 6.16.2507.2411 + 6.16.2507.2411 true $(NoWarn);1591 en diff --git a/MP.Stats/Resources/ChangeLog.html b/MP.Stats/Resources/ChangeLog.html index f2b1af10..c3141ffc 100644 --- a/MP.Stats/Resources/ChangeLog.html +++ b/MP.Stats/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo statistiche MAPO -

Versione: 6.16.2507.1613

+

Versione: 6.16.2507.2411


Note di rilascio:
    diff --git a/MP.Stats/Resources/VersNum.txt b/MP.Stats/Resources/VersNum.txt index 47f53dfb..31280746 100644 --- a/MP.Stats/Resources/VersNum.txt +++ b/MP.Stats/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2507.1613 +6.16.2507.2411 diff --git a/MP.Stats/Resources/manifest.xml b/MP.Stats/Resources/manifest.xml index 144c5d85..5198639b 100644 --- a/MP.Stats/Resources/manifest.xml +++ b/MP.Stats/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2507.1613 + 6.16.2507.2411 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 diff --git a/MP.Stats/appsettings.json b/MP.Stats/appsettings.json index d0c75b18..213a8c54 100644 --- a/MP.Stats/appsettings.json +++ b/MP.Stats/appsettings.json @@ -51,10 +51,10 @@ ] }, "ConnectionStrings": { - //"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro_STATS;Trusted_Connection=True;MultipleActiveResultSets=true", - //"MP.Stats": "Server=SQL2016DEV;Database=MoonPro_STATS;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.STATS;", - "DefaultConnection": "Server=SQL2016DEV;Database=Jetco_MoonPro_STATS_Prod;Trusted_Connection=True;MultipleActiveResultSets=true", - "MP.Stats": "Server=SQL2022PROD;Database=Jetco_MoonPro_STATS_Prod;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.STATS;", + "DefaultConnection": "Server=SQL2016DEV;Database=MoonPro_STATS;Trusted_Connection=True;MultipleActiveResultSets=true", + "MP.Stats": "Server=SQL2016DEV;Database=MoonPro_STATS;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.STATS;", + //"DefaultConnection": "Server=SQL2016DEV;Database=Jetco_MoonPro_STATS_Prod;Trusted_Connection=True;MultipleActiveResultSets=true", + //"MP.Stats": "Server=SQL2022PROD;Database=Jetco_MoonPro_STATS_Prod;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.STATS;", "MP.Voc": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.STATS;", "Redis": "redis.ufficio:26379,serviceName=devel,DefaultDatabase=5,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,allowAdmin=true" }, diff --git a/MP.TaskMan/Models/TaskExecModel.cs b/MP.TaskMan/Models/TaskExecModel.cs index 8a1c9332..eba64519 100644 --- a/MP.TaskMan/Models/TaskExecModel.cs +++ b/MP.TaskMan/Models/TaskExecModel.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; #nullable disable diff --git a/MP.TaskMan/Models/TaskListModel.cs b/MP.TaskMan/Models/TaskListModel.cs index f27cfff4..b402a2e0 100644 --- a/MP.TaskMan/Models/TaskListModel.cs +++ b/MP.TaskMan/Models/TaskListModel.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Drawing.Printing; using static MP.TaskMan.Objects.Enums; #nullable disable diff --git a/MP.TaskMan/Models/TaskResultModel.cs b/MP.TaskMan/Models/TaskResultModel.cs index bd5534ba..85fcf6d3 100644 --- a/MP.TaskMan/Models/TaskResultModel.cs +++ b/MP.TaskMan/Models/TaskResultModel.cs @@ -1,5 +1,4 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; #nullable disable // diff --git a/MP.TaskMan/Services/TaskService.cs b/MP.TaskMan/Services/TaskService.cs index e55c55a1..ae542b06 100644 --- a/MP.TaskMan/Services/TaskService.cs +++ b/MP.TaskMan/Services/TaskService.cs @@ -28,7 +28,7 @@ namespace MP.TaskMan.Services { _configuration = configuration; - // setup compoenti REDIS + // setup componenti REDIS redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis")); redisDb = redisConn.GetDatabase();