Compare commits

..

88 Commits

Author SHA1 Message Date
Samuele Locatelli 03eb82c7b2 Merge branch 'Release/FIxArtInsertDelete' 2022-11-04 18:10:48 +01:00
Samuele Locatelli 7655e340eb Update gest articoli
- se elimina o insert reset cache
2022-11-04 18:07:34 +01:00
Samuele Locatelli 443a56cc07 Update gestione filtro periodo parametri 2022-11-04 18:01:59 +01:00
Samuele Locatelli 06390295d2 Pulizie minori codice dossier 2022-11-04 17:34:00 +01:00
Samuele Locatelli a3f5855b4a Merge tag 'UpdateDuplicaDossier' into develop
Update gestione duplicazione dossier
2022-11-04 16:49:24 +01:00
Samuele Locatelli bd14fc0502 Merge branch 'Release/UpdateDuplicaDossier' 2022-11-04 16:48:30 +01:00
Samuele Locatelli 6525d7e803 Fix pagina contatti 2022-11-04 16:48:02 +01:00
Samuele Locatelli 140566d81b Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-11-04 16:26:25 +01:00
Samuele Locatelli af0624b9c4 Add pagina Contacts 2022-11-04 16:26:22 +01:00
zaccaria.majid 74856d9831 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-11-04 16:15:38 +01:00
zaccaria.majid bf654f54e6 resetSelect visibile solo se record selezionato
+ refresh dopo creazione dossier
2022-11-04 16:13:02 +01:00
Samuele Locatelli 8fbfea1f62 COmplreto refresh gestione licenze LAND
- sistemato GC in generale
- controllo e sistemazione calcolo data scadenza
2022-11-04 16:09:26 +01:00
Samuele Locatelli b8dc7dffc4 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-11-04 15:51:31 +01:00
Samuele Locatelli 2c3feaa4f3 Refresh versione 2022-11-04 15:50:51 +01:00
Samuele Locatelli dbb4fbf9e2 Inizio update LAND x problemi GC 2022-11-04 15:50:40 +01:00
zaccaria.majid d13a1b7833 aggiunta clona dossier 2022-11-04 15:20:35 +01:00
Samuele Locatelli 76c49d1eea Fix scrittura clone dossier 2022-11-04 10:10:56 +01:00
Samuele Locatelli 3f1a3aa2ce Aggiunta navmanager 2022-11-04 09:30:01 +01:00
Samuele Locatelli bbec081cae Separato codice cs x CmpTop 2022-11-04 09:29:43 +01:00
Samuele Locatelli 29fd417499 Merge remote-tracking branch 'origin/develop' into develop 2022-11-04 09:27:54 +01:00
Samuele Locatelli 5380c996ac Refresh DbModel x macchina 2022-11-04 09:27:44 +01:00
zaccaria.majid 4e61028323 Merge branch 'FeaturecloneDossier' into develop 2022-11-04 09:26:38 +01:00
zaccaria.majid 4f7ac21f41 new dossier 2022-11-04 09:20:53 +01:00
zaccaria.majid 55187eda96 dismiss nuovo dossier 2022-11-04 09:11:55 +01:00
Samuele Locatelli d6f7a55a05 update metodo insert dossier 2022-11-04 09:06:43 +01:00
zaccaria.majid c71d7291a2 Prima bozza aggiunta nuovo dossier 2022-11-03 17:21:44 +01:00
Samuele Locatelli 79c73db726 Fix reload apgina 2022-11-03 12:28:06 +01:00
Samuele Locatelli 2608395e5b Merge tag 'UpdateSpecProd' into develop
Vari udpate x fix e ottimizzazioni
2022-11-03 12:17:11 +01:00
Samuele Locatelli c9c57208bf Merge branch 'Release/UpdateSpecProd' 2022-11-03 12:16:55 +01:00
Samuele Locatelli af314cd578 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-11-03 12:16:34 +01:00
Samuele Locatelli 788bd6d730 Fix warnings (rimossi in blocco) + fix live parametri 2022-11-03 12:16:29 +01:00
zaccaria.majid e1eb5c6cdf aggiunta traduzione fase pagina dossier 2022-11-03 12:09:31 +01:00
Samuele Locatelli 1bf5cfc0be Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-11-03 11:46:49 +01:00
Samuele Locatelli 491365e8df Vocabolario
- aggiunto modello
- aggiunta metori recupero DB/REDIS
- aggiunto metodo traduzione lemmi (pag parametri)
2022-11-03 11:46:09 +01:00
zaccaria.majid 40b16d2e83 spostato bottone flush cache in top 2022-11-03 11:28:15 +01:00
zaccaria.majid 39cf45869c fix order 2022-10-26 17:27:45 +02:00
zaccaria.majid ea930b308d fix richiesti pagina PODL 2022-10-26 17:25:09 +02:00
zaccaria.majid b07c610edd fix pagina params 2022-10-21 15:40:26 +02:00
zaccaria.majid 185e27f31d fix bottone liveupdate 2022-10-21 14:14:12 +02:00
zaccaria.majid 6a44e7b0c9 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-21 12:53:05 +02:00
zaccaria.majid eb11533338 display filtri attivi fine 2022-10-21 12:51:52 +02:00
Samuele Locatelli 8b91210115 fix copia script x cambio vers num 2022-10-21 10:42:08 +02:00
Samuele Locatelli 9f9f44f604 Bozza display filtri attivi 2022-10-21 10:20:08 +02:00
Samuele Locatelli dee4b63ca4 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-21 09:31:29 +02:00
Samuele Locatelli bb19bb02c4 Fix rimozione message pipe MON da SPEC 2022-10-21 09:30:56 +02:00
zaccaria.majid fd69a196d2 fix date snapshot 2022-10-21 09:24:13 +02:00
Samuele Locatelli dcfaa6257a Merge tag 'FixOreAnticipo' into develop
Fix ore anticipo: default a 50h
2022-10-20 17:28:36 +02:00
Samuele Locatelli 1271b44b15 Merge branch 'Release/FixOreAnticipo' 2022-10-20 17:28:21 +02:00
Samuele Locatelli 132f5966dd Forzato default anticipo a 50h... 2022-10-20 17:28:01 +02:00
Samuele Locatelli 02c46c99db Merge tag 'UpdateSearchArt' into develop
Fix ricerca articoli
2022-10-20 16:53:17 +02:00
Samuele Locatelli 485808e8d4 Merge branch 'Release/UpdateSearchArt' 2022-10-20 16:53:09 +02:00
Samuele Locatelli d78c2d3173 Fix ricerca articoli 2022-10-20 16:52:47 +02:00
Samuele Locatelli 2a1602c5b9 Update metodi dossier 2022-10-20 16:33:48 +02:00
Samuele Locatelli a096f6a13e Merge tag 'UpdateModuloDoss' into develop
Update modulo dossier in blocco
2022-10-20 14:54:28 +02:00
Samuele Locatelli 1cae70c244 Merge branch 'Release/UpdateModuloDoss' 2022-10-20 14:54:22 +02:00
Samuele Locatelli 18ee183b05 Pulizia codice DOSS x spostamento modulo update 2022-10-20 14:54:03 +02:00
Samuele Locatelli d88c4cc2bd Update comportamento edit dossier 2022-10-20 13:16:07 +02:00
zaccaria.majid 67922520b8 fix edit mode label 'PENDING CHANGES' 2022-10-20 11:42:10 +02:00
zaccaria.majid c5b5b54586 fix edit mode 2022-10-20 11:21:01 +02:00
zaccaria.majid ae3864a614 fix salva solo quando finito 2022-10-20 11:08:31 +02:00
zaccaria.majid f878f1c496 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-20 09:42:27 +02:00
zaccaria.majid d453c1d944 modifiche comportamento editing 2022-10-20 09:42:19 +02:00
Samuele Locatelli 921bf52659 Filtro eventi macchina spenta
- preso da semaforo (no idxStato)
2022-10-20 09:31:42 +02:00
Samuele Locatelli e948ae31af Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-19 20:07:36 +02:00
Samuele Locatelli b344180da2 Fix gestione HideSpenta da statistiche 2022-10-19 20:07:33 +02:00
zaccaria.majid 4b885d780c Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-19 17:47:48 +02:00
zaccaria.majid 01e181a4fc inizio modifiche editing 2022-10-19 17:47:07 +02:00
Samuele Locatelli 56f342a488 refresh test 2022-10-19 17:30:26 +02:00
Samuele Locatelli ed72bdfa24 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-19 17:14:20 +02:00
Samuele Locatelli 5e6924f0fe Inizio gestione nascondi spenta 2022-10-19 17:13:43 +02:00
zaccaria.majid cae7e50cbd cleanUp 2022-10-19 17:11:27 +02:00
zaccaria.majid e769227bb3 fix not update if "annulla" 2022-10-19 17:10:56 +02:00
zaccaria.majid 60f757965e CleanUp 2022-10-19 13:07:05 +02:00
zaccaria.majid 603ed3782f Cleanup 2022-10-19 13:02:59 +02:00
zaccaria.majid 71177e04c7 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-19 13:01:28 +02:00
zaccaria.majid 1a211ebca5 delete msgService da PARAMS 2022-10-19 13:01:21 +02:00
zaccaria.majid 591b66b52d delete msgService da dossier 2022-10-19 12:49:13 +02:00
Samuele Locatelli 96f4bb3b4c Merge tag 'UpdateLogCall' into develop
Fix log chaimate MP/IO
2022-10-19 11:02:23 +02:00
Samuele Locatelli f1c295993c Merge branch 'Release/UpdateLogCall' 2022-10-19 11:02:16 +02:00
Samuele Locatelli a293ce825e Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-19 11:01:34 +02:00
Samuele Locatelli e3b67ee6c0 Fix log vari x chiamate MP/IO 2022-10-19 11:01:29 +02:00
zaccaria.majid 0c5e41826e fix recordsel = null in dossier post chiusura 2022-10-19 10:43:45 +02:00
Samuele Locatelli 0d4e1aed88 Merge tag 'FixPAramsDetailAndReload' into develop
Sistemazione reload e params detail
2022-10-18 20:02:34 +02:00
Samuele Locatelli 93f4f09b85 Merge branch 'Release/FixPAramsDetailAndReload' 2022-10-18 20:02:26 +02:00
Samuele Locatelli aebae6b406 Update selezione dossier:
- selezione x periodo
- ancora check ottimizzazione sel distinct
2022-10-18 20:01:53 +02:00
Samuele Locatelli a2bf5f4a8b Ottimizzazioni selezione casi distinct 2022-10-18 19:16:20 +02:00
Samuele Locatelli 759373b5a4 Modifica display valori fluxLog x Dossier 2022-10-18 18:37:26 +02:00
Samuele Locatelli 0ea3ee6341 Merge tag 'FixMemoryLeakError' into develop
Update x gestione condizione errore memory leak (ridotto in test debug)
x gestione dispose componenti
2022-10-18 17:12:23 +02:00
83 changed files with 2393 additions and 945 deletions
+4
View File
@@ -0,0 +1,4 @@
[*.cs]
# CS8765: Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes).
dotnet_diagnostic.CS8765.severity = none
+5
View File
@@ -7,6 +7,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Data", "MP.Data\MP.Data.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.SPEC", "MP.SPEC\MP.SPEC.csproj", "{C777A098-6F91-45AF-A85E-0AD08CBCAC52}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1B6A7550-F6C9-468E-B3B4-C30FF6FE8933}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
+73 -24
View File
@@ -110,7 +110,7 @@ namespace MP.Data.Controllers
dbResult = dbCtx
.DbSetDossiers
.AsNoTracking()
.Select(i => i.OdlNav.CodArticolo)
.Select(i => i.CodArticolo)
.Distinct()
.ToList();
}
@@ -183,11 +183,11 @@ namespace MP.Data.Controllers
{
dbResult = dbCtx
.DbSetArticoli
.AsNoTracking()
.Where(x => (x.Azienda == azienda || azienda == "*") && (x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal) || string.IsNullOrEmpty(searchVal)))
.OrderBy(x => x.CodArticolo)
.Take(numRecord)
.ToList();
.AsNoTracking()
.Where(x => (x.Azienda == azienda || azienda == "*") && (x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal) || string.IsNullOrEmpty(searchVal)))
.OrderBy(x => x.CodArticolo)
.Take(numRecord)
.ToList();
}
return dbResult;
}
@@ -302,7 +302,7 @@ namespace MP.Data.Controllers
/// </summary>
/// <param name="currRec">record dossier da eliminare</param>
/// <returns></returns>
public async Task<bool> DossiersDeleteRecord(Dossiers currRec)
public async Task<bool> DossiersDeleteRecord(DossierModel currRec)
{
bool answ = false;
using (var dbCtx = new MoonProContext(_configuration))
@@ -333,28 +333,53 @@ namespace MP.Data.Controllers
/// </summary>
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
/// <param name="CodArticolo">* = tutti, altrimenti solo x un dato articolo</param>
/// <param name="DtRef">Data di riferimento (Massima) per estrazioen records</param>
/// <param name="MaxRec">numero massimo record da restituire</param>
/// <param name="DtStart">Data minima per estrazione records</param>
/// <param name="DtEnd">Data Massima per estrazione records</param>
/// <returns></returns>
public List<Dossiers> DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtRef, int MaxRec)
public List<DossierModel> DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtStart, DateTime DtEnd)
{
List<Dossiers> dbResult = new List<Dossiers>();
List<DossierModel> dbResult = new List<DossierModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
.DbSetDossiers
.AsNoTracking()
.Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && (CodArticolo == "*" || x.OdlNav.CodArticolo == CodArticolo) && x.DtRif <= DtRef)
.Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && (CodArticolo == "*" || x.CodArticolo == CodArticolo) && (x.DtRif >= DtStart && x.DtRif <= DtEnd))
.Include(m => m.MachineNav)
.Include(o => o.OdlNav)
.Include(a => a.OdlNav.ArticoloNav)
//.Include(o => o.OdlNav)
.Include(a => a.ArticoloNav)
.OrderByDescending(x => x.DtRif)
.Take(MaxRec)
.ToList();
}
return dbResult;
}
/// <summary>
/// insert di un record Dossier
/// </summary>
/// <param name="editRec">record dossier da modificare</param>
/// <returns></returns>
public async Task<bool> DossiersInsert(DossierModel newRec)
{
bool fatto = false;
using (var dbCtx = new MoonProContext(_configuration))
{
try
{
dbCtx
.DbSetDossiers
.Add(newRec);
await dbCtx.SaveChangesAsync();
fatto = true;
}
catch (Exception exc)
{
Log.Error($"Eccezione durante DossiersInsert{Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis
/// </summary>
@@ -402,11 +427,11 @@ namespace MP.Data.Controllers
}
/// <summary>
/// Update ddel campo VALORE di un dossier (che contiene json flux log serializzati)
/// Update del campo VALORE di un dossier (che contiene json flux log serializzati)
/// </summary>
/// <param name="editRec">record dossier da modificare</param>
/// <returns></returns>
public async Task<bool> DossiersUpdateValore(Dossiers editRec)
public async Task<bool> DossiersUpdateValore(DossierModel editRec)
{
bool fatto = false;
using (var dbCtx = new MoonProContext(_configuration))
@@ -477,12 +502,13 @@ namespace MP.Data.Controllers
/// <summary>
/// Elenco ultimi n record flux log dato macchina e flusso (ordinato x data registrazione)
/// </summary>
/// <param name="DtMax">Data massima (recupera eventi antecedenti)</param>
/// <param name="DtMax">Data massima x eventi</param>
/// <param name="DtMin">Data minima x eventi</param>
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
/// <param name="CodFlux">*=tutti, altrimenti solo selezionato</param>
/// <param name="MaxRec">numero massimo record da restituire</param>
/// <returns></returns>
public List<FluxLog> FluxLogGetLastFilt(DateTime DtMax, string IdxMacchina, string CodFlux, int MaxRec)
public List<FluxLog> FluxLogGetLastFilt(DateTime DtMax, DateTime DtMin, string IdxMacchina, string CodFlux, int MaxRec)
{
List<FluxLog> dbResult = new List<FluxLog>();
using (var dbCtx = new MoonProContext(_configuration))
@@ -490,7 +516,7 @@ namespace MP.Data.Controllers
dbResult = dbCtx
.DbSetFluxLog
.AsNoTracking()
.Where(x => (x.dtEvento <= DtMax) && (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && (CodFlux == "*" || x.CodFlux == CodFlux))
.Where(x => (x.dtEvento >= DtMin && x.dtEvento <= DtMax) && (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && (CodFlux == "*" || x.CodFlux == CodFlux))
.OrderByDescending(x => x.dtEvento)
.Take(MaxRec)
.ToList();
@@ -556,7 +582,7 @@ namespace MP.Data.Controllers
.AsNoTracking()
.Include(m => m.MachineNav)
.Include(a => a.ArticoloNav)
.OrderBy(x => x.InsertDate)
.OrderByDescending(x => x.InsertDate)
.ToList();
}
return dbResult;
@@ -602,10 +628,12 @@ namespace MP.Data.Controllers
}
/// <summary>
/// Elenco id Macchine che abbiano dati FLuxLog
/// Elenco id Macchine che abbiano dati FLuxLog, nel periodo indicato
/// </summary>
/// <param name="dtStart"></param>
/// <param name="dtEnd"></param>
/// <returns></returns>
public async Task<List<string>> MacchineWithFlux()
public async Task<List<string>> MacchineWithFlux(DateTime dtStart, DateTime dtEnd)
{
List<string> dbResult = new List<string>();
using (var dbCtx = new MoonProContext(_configuration))
@@ -613,6 +641,7 @@ namespace MP.Data.Controllers
dbResult = await dbCtx
.DbSetFluxLog
.AsNoTracking()
.Where(x => x.dtEvento >= dtStart && x.dtEvento <= dtEnd)
.Select(i => i.IdxMacchina)
.Distinct()
.ToListAsync();
@@ -742,7 +771,7 @@ namespace MP.Data.Controllers
}
/// <summary>
/// Recupero Odl CORRENTI
/// Recupero Odl CORRENTI
/// </summary>
/// <returns></returns>
public List<ODLModel> OdlGetCurrent()
@@ -795,8 +824,10 @@ namespace MP.Data.Controllers
.DbSetFluxLog
.AsNoTracking()
.Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina))
.Take(1000)
.Select(i => i.CodFlux)
.Distinct()
.OrderBy(x => x)
.ToList();
}
return dbResult;
@@ -997,6 +1028,24 @@ namespace MP.Data.Controllers
return dbResult;
}
/// <summary>
/// Elenco Vocabolario (completo)
/// </summary>
/// <returns></returns>
public List<VocabolarioModel> VocabolarioGetAll()
{
List<VocabolarioModel> dbResult = new List<VocabolarioModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
.DbSetVocabolario
.AsNoTracking()
.OrderBy(x => x.Lemma)
.ToList();
}
return dbResult;
}
#endregion Public Methods
#region Private Fields
@@ -10,7 +10,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace MP.Data.DatabaseModels
{
[Table("Dossiers")]
public partial class Dossiers
public partial class DossierModel
{
#region Public Properties
@@ -31,7 +31,8 @@ namespace MP.Data.DatabaseModels
public string Valore { get; set; } = "";
[MaxLength(50)]
public string KeyRichiesta { get; set; } = "";
/// <summary>
/// Navigazione oggetto Machine
@@ -45,6 +46,12 @@ namespace MP.Data.DatabaseModels
[ForeignKey("IdxODL")]
public virtual ODLModel OdlNav { get; set; } = null!;
/// <summary>
/// Navigazione oggetto Articolo
/// </summary>
[ForeignKey("CodArticolo")]
public virtual AnagArticoli ArticoloNav { get; set; } = null!;
#endregion Public Properties
}
}
+13 -3
View File
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
@@ -8,14 +10,22 @@ using System.Collections.Generic;
// </Auto-Generated>
namespace MP.Data.DatabaseModels
{
[Table("Macchine")]
public partial class Macchine
{
#region Public Properties
public string CodMacchina { get; set; }
public string Descrizione { get; set; }
[Key]
public string IdxMacchina { get; set; }
public string Nome { get; set; }
public string CodMacchina { get; set; } = "";
public string Descrizione { get; set; } = "";
public string Nome { get; set; } = "";
public string Note { get; set; } = "";
public string url { get; set; } = "";
public string locazione { get; set; } = "";
public string css { get; set; } = "";
public int RowNum { get; set; } = 0;
public int ColNum { get; set; } = 0;
#endregion Public Properties
}
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DatabaseModels
{
[Table("Vocabolario")]
public partial class VocabolarioModel
{
#region Public Properties
public string Lingua { get; set; }
public string Lemma { get; set; }
public string Traduzione { get; set; }
#endregion Public Properties
}
}
+4
View File
@@ -11,6 +11,10 @@
<Compile Remove="DatabaseModels\TurniParetoOdl.cs" />
</ItemGroup>
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.9" />
+2 -2
View File
@@ -69,7 +69,7 @@ namespace MP.Data
private bool enableLog = false;
private IConnectionMultiplexer redis;
private IDatabase? redisDb;
private IDatabase redisDb;
#endregion Private Fields
@@ -90,7 +90,7 @@ namespace MP.Data
//Subscribe to the channel named messages
sub.Subscribe(_channel, (channel, message) =>
{
Log.Trace($"ch {channel} | {message}");
Log.Trace($"req setup ch {channel} | {message}");
// messaggio
PubSubEventArgs mea = new PubSubEventArgs(message);
// se qualcuno ascolta sollevo evento nuovo valore...
+8 -2
View File
@@ -47,10 +47,11 @@ namespace MP.Data
public virtual DbSet<ODLModel> DbSetODL { get; set; }
public virtual DbSet<PODLModel> DbSetPODL { get; set; }
public virtual DbSet<FluxLog> DbSetFluxLog { get; set; }
public virtual DbSet<Dossiers> DbSetDossiers { get; set; }
public virtual DbSet<DossierModel> DbSetDossiers { get; set; }
public virtual DbSet<StatODLModel> DbSetStatOdl { get; set; }
public virtual DbSet<StatoProdModel> DbSetStatoProd { get; set; }
public virtual DbSet<EventListModel> DbSetEvList { get; set; }
public virtual DbSet<VocabolarioModel> DbSetVocabolario { get; set; }
#endregion Public Properties
@@ -303,7 +304,12 @@ namespace MP.Data
modelBuilder.Entity<EventListModel>(entity =>
{
entity.HasKey(e => new { e.IdxMacchina, e.InizioStato, e.IdxTipo});
entity.HasKey(e => new { e.IdxMacchina, e.InizioStato, e.IdxTipo });
});
modelBuilder.Entity<VocabolarioModel>(entity =>
{
entity.HasKey(e => new { e.Lingua, e.Lemma });
});
-55
View File
@@ -22,62 +22,7 @@
</div>
</div>
@code {
//[CascadingParameter]
//private Task<AuthenticationState> AuthenticationStateTask { get; set; }
[CascadingParameter(Name = "ShowSearch")]
private bool ShowSearch { get; set; }
private string userName = "";
private string PageName { get; set; }
private string PageIcon { get; set; }
protected override async Task OnInitializedAsync()
{
await forceReload();
}
protected override void OnInitialized()
{
AppMessages.EA_PageUpdated += OnPageUpdate;
}
public void OnPageUpdate()
{
PageName = AppMessages.PageName;
PageIcon = AppMessages.PageIcon;
InvokeAsync(() =>
{
StateHasChanged();
});
}
public void Dispose()
{
AppMessages.EA_PageUpdated -= OnPageUpdate;
}
private async Task forceReload()
{
userName = "N.A.";
await Task.Delay(1);
#if false
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
var user = authState.User;
if (user.Identity.IsAuthenticated)
{
userName = $"{user.Identity.Name}";
}
else
{
userName = "N.A.";
}
#endif
}
}
@* // Vedere anche:
// https://docs.microsoft.com/en-us/aspnet/core/blazor/security/?view=aspnetcore-5.0#:~:text=Blazor%20uses%20the%20existing%20ASP.NET%20Core%20authentication%20mechanisms,all%20client-side%20code%20can%20be%20modified%20by%20users
+83
View File
@@ -0,0 +1,83 @@
using Microsoft.AspNetCore.Components;
using System;
using System.Threading.Tasks;
namespace MP.Land.Components
{
public partial class CmpTop
{
#region Public Methods
public void Dispose()
{
AppMessages.EA_PageUpdated -= OnPageUpdate;
GC.Collect();
}
public void OnPageUpdate()
{
PageName = AppMessages.PageName;
PageIcon = AppMessages.PageIcon;
InvokeAsync(() =>
{
StateHasChanged();
});
}
#endregion Public Methods
#region Protected Methods
protected override void OnInitialized()
{
AppMessages.EA_PageUpdated += OnPageUpdate;
}
protected override async Task OnInitializedAsync()
{
await forceReload();
}
#endregion Protected Methods
#region Private Fields
private string userName = "";
#endregion Private Fields
#region Private Properties
private string PageIcon { get; set; }
private string PageName { get; set; }
[CascadingParameter(Name = "ShowSearch")]
private bool ShowSearch { get; set; }
#endregion Private Properties
#region Private Methods
private async Task forceReload()
{
userName = "N.A.";
await Task.Delay(1);
#if false
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
var user = authState.User;
if (user.Identity.IsAuthenticated)
{
userName = $"{user.Identity.Name}";
}
else
{
userName = "N.A.";
}
#endif
}
#endregion Private Methods
}
}
-76
View File
@@ -53,79 +53,3 @@ else // disegno box non cliccabile e licenza mancante
</div>
}
@code {
[Parameter]
public UpdMan CurrItem { get; set; }
protected List<AnagKeyValueModel> AKVList
{
get
{
return LicServ.AKVList;
}
set
{
LicServ.AKVList = value;
}
}
protected override async Task OnInitializedAsync()
{
// check init AKV
if (AKVList == null || AKVList.Count == 0)
{
AKVList = await DataService.AnagKeyValList();
LicServ.InitAkv();
}
}
protected string getAKVString(string nomeVar)
{
string answ = "";
if (AKVList != null)
{
var currRec = AKVList.FirstOrDefault(x => x.NomeVar == nomeVar);
if (currRec != null)
{
answ = currRec.ValString;
}
}
return answ;
}
protected AnagKeyValueModel getAKVRec(string nomeVar)
{
AnagKeyValueModel answ = new AnagKeyValueModel();
if (AKVList != null)
{
answ = AKVList.FirstOrDefault(x => x.NomeVar == nomeVar);
}
return answ;
}
protected bool authOk()
{
bool allOk = !string.IsNullOrEmpty(CurrItem.LicenseKey);
if (allOk)
{
allOk = LicServ.checkLicenseActive(CurrItem.LicenseKey);
}
return allOk;
}
protected string fullUrl(string relUrl)
{
return $"{Configuration["ServerConf:BaseUrl"]}{relUrl}";
}
protected MarkupString traduci(string lemma)
{
MarkupString answ;
string rawHtml = DataService.Traduci(lemma, "IT");
answ = new MarkupString(rawHtml);
return answ;
}
}
+109
View File
@@ -0,0 +1,109 @@
using Microsoft.AspNetCore.Components;
using MP.AppAuth.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace MP.Land.Components
{
public partial class HomeLink : IDisposable
{
#region Public Properties
[Parameter]
public UpdMan CurrItem { get; set; }
#endregion Public Properties
#region Public Methods
public void Dispose()
{
GC.Collect();
}
#endregion Public Methods
#region Protected Properties
protected List<AnagKeyValueModel> AKVList
{
get
{
return LicServ.AKVList;
}
set
{
LicServ.AKVList = value;
}
}
#endregion Protected Properties
#region Protected Methods
protected bool authOk()
{
bool allOk = !string.IsNullOrEmpty(CurrItem.LicenseKey);
if (allOk)
{
allOk = LicServ.checkLicenseActive(CurrItem.LicenseKey);
}
return allOk;
}
protected string fullUrl(string relUrl)
{
return $"{Configuration["ServerConf:BaseUrl"]}{relUrl}";
}
protected AnagKeyValueModel getAKVRec(string nomeVar)
{
AnagKeyValueModel answ = new AnagKeyValueModel();
if (AKVList != null)
{
answ = AKVList.FirstOrDefault(x => x.NomeVar == nomeVar);
}
return answ;
}
protected string getAKVString(string nomeVar)
{
string answ = "";
if (AKVList != null)
{
var currRec = AKVList.FirstOrDefault(x => x.NomeVar == nomeVar);
if (currRec != null)
{
answ = currRec.ValString;
}
}
return answ;
}
protected override async Task OnInitializedAsync()
{
// check init AKV
if (AKVList == null || AKVList.Count == 0)
{
AKVList = await DataService.AnagKeyValList();
LicServ.InitAkv();
}
}
protected MarkupString traduci(string lemma)
{
MarkupString answ;
string rawHtml = DataService.Traduci(lemma, "IT");
answ = new MarkupString(rawHtml);
return answ;
}
#endregion Protected Methods
}
}
+29 -1
View File
@@ -372,7 +372,35 @@ namespace MP.Land.Data
}
else
{
_logger.LogInformation($"Record non trovato per {authKey}");
_logger.LogInformation($"checkLicenseActive | Record non trovato per {authKey}");
}
}
return answ;
}
/// <summary>
/// Verifica scadenza licenza
/// </summary>
/// <param name="authKey"></param>
/// <returns></returns>
public DateTime getLicenseExpiry(string authKey)
{
DateTime answ = DateTime.Today.AddDays(-1);
//cerco anche nelle info AKV
if (AKVList != null)
{
var recLic = AKVList.Where(x => x.ValString == authKey).FirstOrDefault();
int numLic = 0;
//cerco in record
if (recLic != null)
{
numLic = (int)recLic.ValInt;
// verifico scadenza licenza!
DateTime scadenza = licenseManGLS.expiryDateByAuthKey(Installazione, recLic.NomeVar, numLic, authKey);
answ = scadenza;
}
else
{
_logger.LogInformation($"getLicenseExpiry | Record non trovato per {authKey}");
}
}
return answ;
+7 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>MP.Land</RootNamespace>
<Version>6.16.2209.2118</Version>
<Version>6.16.2211.0416</Version>
</PropertyGroup>
<ItemGroup>
@@ -60,6 +60,12 @@
<ProjectReference Include="..\MP.AppAuth\MP.AppAuth.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="post-build.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
</Target>
+30 -33
View File
@@ -1,40 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using System.Net.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Web.Virtualization;
using Microsoft.JSInterop;
using MP.Land;
using MP.Land.Shared;
using MP.Land.Data;
using NLog;
using System;
using System.Threading.Tasks;
namespace MP.Land.Pages
{
public partial class About
{
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private string Titolo = "";
private string Messaggio = "";
private string ServerStatus = "SrvState";
private string Installazione = "Inst";
private string Applicazione = "App";
private string Licenze = "#";
private DateTime Scadenza = DateTime.Today;
private string MastKey = "########################";
private string mainCss = "alert alert-info";
private string remSrvCss = "bg-warning text-secondary";
private string expDateCss = "bg-warning text-secondary";
private string licenseCss = "bg-warning text-secondary";
#region Protected Methods
protected override async Task OnInitializedAsync()
{
@@ -43,9 +15,31 @@ namespace MP.Land.Pages
await reloadLicenseData();
}
#endregion Protected Methods
#region Private Fields
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private string Applicazione = "App";
private string expDateCss = "bg-warning text-secondary";
private string Installazione = "Inst";
private string licenseCss = "bg-warning text-secondary";
private string Licenze = "#";
private string mainCss = "alert alert-info";
private string MastKey = "########################";
private string Messaggio = "";
private string remSrvCss = "bg-warning text-secondary";
private DateTime Scadenza = DateTime.Today;
private string ServerStatus = "SrvState";
private string Titolo = "";
#endregion Private Fields
#region Private Methods
private async Task reloadLicenseData()
{
int cDelay = 5;
int cDelay = 10;
// recupero dati
await Task.Delay(cDelay);
try
@@ -56,13 +50,14 @@ namespace MP.Land.Pages
Installazione = LicServ.Installazione;
Applicazione = LicServ.Applicazione;
MastKey = LicServ.MasterKey;
Scadenza = LicServ.getLicenseExpiry(LicServ.MasterKey);
await Task.Delay(cDelay);
var fatto = await LicServ.RefreshLicense();
await Task.Delay(cDelay);
Licenze = $"{LicServ.NumLicDb}/{LicServ.NumLicRemote}";
licenseCss = "";
}
catch(Exception exc)
catch (Exception exc)
{
licenseCss = "bg-dark text-warning";
Log.Error($"Eccezione in reloadLicenseData:{Environment.NewLine}{exc}");
@@ -86,5 +81,7 @@ namespace MP.Land.Pages
AppMService.PageName = "About";
AppMService.PageIcon = "fas fa-info-circle pr-2";
}
#endregion Private Methods
}
}
-14
View File
@@ -69,17 +69,3 @@
</div>
</div>
@code {
protected string Titolo = "";
protected string Messaggio = "";
protected override void OnInitialized()
{
Titolo = "Mapo MES";
Messaggio = "I nostri contattatti e siti di supporto";
AppMService.ShowSearch = false;
AppMService.PageName = "Contacts";
AppMService.PageIcon = "fas fa-envelope pr-2";
}
}
+36
View File
@@ -0,0 +1,36 @@
using System;
namespace MP.Land.Pages
{
public partial class Contacts : IDisposable
{
#region Public Methods
public void Dispose()
{
GC.Collect();
}
#endregion Public Methods
#region Protected Fields
protected string Messaggio = "";
protected string Titolo = "";
#endregion Protected Fields
#region Protected Methods
protected override void OnInitialized()
{
Titolo = "Mapo MES";
Messaggio = "I nostri contattatti e siti di supporto";
AppMService.ShowSearch = false;
AppMService.PageName = "Contacts";
AppMService.PageIcon = "fas fa-envelope pr-2";
}
#endregion Protected Methods
}
}
+17 -10
View File
@@ -1,22 +1,23 @@
using System;
using Microsoft.AspNetCore.Components;
using MP.Land.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using MP.Land.Data;
using MP.Land.Components;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Configuration;
using MP.AppAuth.Models;
namespace MP.Land.Pages
{
public partial class Index
public partial class Index : IDisposable
{
#region Private Fields
#region Public Methods
private List<MP.AppAuth.Models.UpdMan> ListRecords;
public void Dispose()
{
ListRecords = null;
GC.Collect();
}
#endregion Private Fields
#endregion Public Methods
#region Protected Fields
@@ -63,5 +64,11 @@ namespace MP.Land.Pages
}
#endregion Protected Methods
#region Private Fields
private List<MP.AppAuth.Models.UpdMan> ListRecords;
#endregion Private Fields
}
}
+7 -55
View File
@@ -42,25 +42,25 @@
<div class="list-group">
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Environment</h5>
<b class="mb-1">Environment</b>
</div>
<p class="mb-1">@Environment</p>
</div>
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Main DB Conf</h5>
<b class="mb-1">Main DB Conf</b>
</div>
<p class="mb-1">@DbNameExample</p>
</div>
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">.net framework</h5>
<b class="mb-1">.net framework</b>
</div>
<p class="mb-1">@currHwSwInfo.runtimeImg</p>
</div>
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Main Assembly</h5>
<b class="mb-1">Main Assembly</b>
</div>
<p class="mb-1">@currHwSwInfo.mainAssembly</p>
</div>
@@ -81,7 +81,7 @@
<div class="list-group">
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Server Stats</h5>
<b class="mb-1">Server Stats</b>
</div>
<p class="mb-1">
<pre>@currHwSwInfo.ServerStats</pre>
@@ -89,7 +89,7 @@
</div>
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">IIS Stats</h5>
<b class="mb-1">IIS Stats</b>
</div>
<p class="mb-1">
<pre>@currHwSwInfo.IISStats</pre>
@@ -112,7 +112,7 @@
<div class="list-group">
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Elenco librerie</h5>
<b class="mb-1">Elenco librerie</b>
<span>@currHwSwInfo.numLibraries</span>
</div>
<p class="mb-1">
@@ -133,51 +133,3 @@
</div>
</div>
</div>
@code {
// imposto i vari dati da mostrare a video senza indicare come bypassare...
protected string Titolo = "MAPO System Info";
protected string Messaggio = "HW & SW details";
protected HwSwInfo currHwSwInfo = HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly());
protected string masterLic = "";
protected override async Task OnInitializedAsync()
{
await ReloadData();
}
protected async Task ReloadData()
{
var akvList = await DataService.AnagKeyValList();
var licRecord = akvList
.Where(x => x.NomeVar == "MAPO")
.FirstOrDefault();
if (licRecord != null)
{
masterLic = licRecord.ValString;
}
}
protected string DbNameExample
{
get
{
string answ = Configuration["ConnectionStrings:DefaultConnection"];
if (answ.IndexOf(";User ID=") > 0)
{
answ = answ.Substring(0, answ.IndexOf(";User ID="));
}
return answ;
}
}
protected string Environment
{
get
{
string answ = Configuration["Environment"];
return answ;
}
}
}
+72
View File
@@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using System.Net.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Web.Virtualization;
using Microsoft.JSInterop;
using MP.Land;
using MP.Land.Shared;
using MP.AppAuth;
using MP.Land.Data;
using Microsoft.Extensions.Configuration;
namespace MP.Land.Pages
{
public partial class SysInfo : IDisposable
{
public void Dispose()
{
GC.Collect();
}
// imposto i vari dati da mostrare a video senza indicare come bypassare...
protected string Titolo = "MAPO System Info";
protected string Messaggio = "HW & SW details";
protected HwSwInfo currHwSwInfo = HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly());
protected string masterLic = "";
protected override async Task OnInitializedAsync()
{
await ReloadData();
}
protected async Task ReloadData()
{
var akvList = await DataService.AnagKeyValList();
var licRecord = akvList.Where(x => x.NomeVar == "MAPO").FirstOrDefault();
if (licRecord != null)
{
masterLic = licRecord.ValString;
}
}
protected string DbNameExample
{
get
{
string answ = Configuration["ConnectionStrings:DefaultConnection"];
if (answ.IndexOf(";User ID=") > 0)
{
answ = answ.Substring(0, answ.IndexOf(";User ID="));
}
return answ;
}
}
protected string Environment
{
get
{
string answ = Configuration["Environment"];
return answ;
}
}
}
}
+34 -28
View File
@@ -10,22 +10,24 @@ using System.Threading.Tasks;
namespace MP.Land.Pages
{
public partial class UpdateManager
public partial class UpdateManager : IDisposable
{
#region Private Fields
#region Public Methods
private List<MP.AppAuth.Models.UpdMan> ListRecords;
public void Dispose()
{
ListRecords = null;
GC.Collect();
}
#endregion Private Fields
#endregion Public Methods
#region Protected Fields
protected int numDone = 0;
protected int numTot = 0;
protected int totalCount = 0;
protected double TotalMb = 0;
protected UpdateMan updateManAuth = new UpdateMan("SWDownloader", "viaD@nte16");
#endregion Protected Fields
@@ -42,34 +44,12 @@ namespace MP.Land.Pages
protected AppAuthService DataService { get; set; }
protected string outMessages { get; set; } = "";
protected int percLoading { get; set; } = 0;
protected bool showProgress { get; set; } = false;
protected bool showUpdate { get; set; } = false;
#endregion Protected Properties
#region Private Methods
private async Task<long> scaricaSingolo(AppAuth.Models.UpdMan item)
{
long size = 0;
if (item.IsAuth)
{
size = updateManAuth.downloadLatest(item.ManifestUrl, localPath(item.LocalRepo), item.PackName);
}
else
{
size = UpdateMan.obj.downloadLatest(item.ManifestUrl, localPath(item.LocalRepo), item.PackName);
}
numDone++;
percLoading = 100 * numDone / numTot;
return await Task.FromResult(size);
}
#endregion Private Methods
#region Protected Methods
/// <summary>
@@ -151,5 +131,31 @@ namespace MP.Land.Pages
}
#endregion Protected Methods
#region Private Fields
private List<MP.AppAuth.Models.UpdMan> ListRecords;
#endregion Private Fields
#region Private Methods
private async Task<long> scaricaSingolo(AppAuth.Models.UpdMan item)
{
long size = 0;
if (item.IsAuth)
{
size = updateManAuth.downloadLatest(item.ManifestUrl, localPath(item.LocalRepo), item.PackName);
}
else
{
size = UpdateMan.obj.downloadLatest(item.ManifestUrl, localPath(item.LocalRepo), item.PackName);
}
numDone++;
percLoading = 100 * numDone / numTot;
return await Task.FromResult(size);
}
#endregion Private Methods
}
}
+3
View File
@@ -16,6 +16,9 @@ namespace MP.Land.Pages
public void Dispose()
{
AppMService.EA_SearchUpdated -= OnSeachUpdated;
AppMService.EA_FilterUpdated -= OnFilterUpdated;
ListRecords = null;
GC.Collect();
}
#endregion Public Methods
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo gestione Programmi MAPO</i>
<h4>Versione: 6.16.2209.2118</h4>
<h4>Versione: 6.16.2211.0416</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
6.16.2209.2118
6.16.2211.0416
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2209.2118</version>
<version>6.16.2211.0416</version>
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
-32
View File
@@ -26,35 +26,3 @@
</CascadingValue>
</div>
@code {
bool ShowSearch { get; set; } = false;
protected override void OnInitialized()
{
AppMService.EA_ShowSearch += OnShowSearch;
AppMService.EA_HideSearch += OnHideSearch;
}
public void OnShowSearch()
{
ShowSearch = true;
InvokeAsync(() =>
{
StateHasChanged();
});
}
public void OnHideSearch()
{
ShowSearch = false;
InvokeAsync(() =>
{
StateHasChanged();
});
}
public void Dispose()
{
AppMService.EA_ShowSearch -= OnShowSearch;
AppMService.EA_ShowSearch -= OnHideSearch;
}
}
+52
View File
@@ -0,0 +1,52 @@
using System;
namespace MP.Land.Shared
{
public partial class MainLayout
{
#region Public Methods
public void Dispose()
{
AppMService.EA_ShowSearch -= OnShowSearch;
AppMService.EA_ShowSearch -= OnHideSearch;
GC.Collect();
}
public void OnHideSearch()
{
ShowSearch = false;
InvokeAsync(() =>
{
StateHasChanged();
});
}
public void OnShowSearch()
{
ShowSearch = true;
InvokeAsync(() =>
{
StateHasChanged();
});
}
#endregion Public Methods
#region Protected Methods
protected override void OnInitialized()
{
AppMService.EA_ShowSearch += OnShowSearch;
AppMService.EA_HideSearch += OnHideSearch;
}
#endregion Protected Methods
#region Private Properties
private bool ShowSearch { get; set; } = false;
#endregion Private Properties
}
}
+3
View File
@@ -48,6 +48,9 @@
<None Update="logs\.placeholder">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="post-build.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
+4 -5
View File
@@ -26,13 +26,12 @@ namespace MP.SPEC.Components.Chart
public ChartType Type { get; set; }
[Parameter]
public double[] Data { get; set; }
public double[] Data { get; set; } = null!;
[Parameter]
public List<DoughnutStyling> BackgroundColor { get; set; } = null!;
[Parameter]
public List<DoughnutStyling> BackgroundColor { get; set; }
[Parameter]
public string[] Labels { get; set; }
public string[] Labels { get; set; } = null!;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
+2 -1
View File
@@ -39,7 +39,8 @@ namespace MP.SPEC.Components
protected override void OnInitialized()
{
version = typeof(Program).Assembly.GetName().Version;
var rawVers = typeof(Program).Assembly.GetName().Version; ;
version = rawVers != null ? rawVers : new Version("0.0.0.0");
}
#endregion Protected Methods
+5 -43
View File
@@ -10,7 +10,10 @@
<div class="px-2">
<i class="fas fa-user-alt"></i> <b>@userName</b>
</div>
<div class="px-2 flex-grow-1 text-end">
<div class="pe-2">
<button class="btn btn-primary" @onclick="() => flushCache()" title="Forza Refresh Dati correnti"> Force Reload </button>
</div>
@* <div class="px-2 flex-grow-1 text-end">
<span class="text-secondary">@TipoSearch</span>
</div>
<div class="px-2 text-end">
@@ -18,48 +21,7 @@
{
<SearchMod></SearchMod>
}
</div>
</div>*@
</div>
@code {
protected bool ShowSearch
{
get => MService.ShowSearch;
set => MService.ShowSearch = value;
}
private string userName = "";
private string TipoSearch
{
get => MService.TipoSearch;
set => MService.TipoSearch = value;
}
protected override async Task OnInitializedAsync()
{
MService.EA_ShowSearch += MService_EA_ShowSearch;
await forceReload();
}
private async void MService_EA_ShowSearch()
{
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
}
private async Task forceReload()
{
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
var user = authState.User;
if (user.Identity != null&& user.Identity.IsAuthenticated)
{
userName = $"{user.Identity.Name}";
}
else
{
userName = "N.A.";
}
}
}
+84
View File
@@ -0,0 +1,84 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.JSInterop;
using MP.SPEC.Data;
namespace MP.SPEC.Components
{
public partial class CmpTop
{
#region Public Methods
public async Task flushCache()
{
await Task.Delay(1);
await MDService.FlushRedisCache();
await Task.Delay(1);
// rimando a pagina corrente
NavManager.NavigateTo(NavManager.Uri, true);
}
#endregion Public Methods
#region Protected Properties
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
[Inject]
protected MpDataService MDService { get; set; } = null!;
protected bool ShowSearch { get => MService.ShowSearch; set => MService.ShowSearch = value; }
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
MService.EA_ShowSearch += MService_EA_ShowSearch;
await forceReload();
}
#endregion Protected Methods
#region Private Fields
private string userName = "";
#endregion Private Fields
#region Private Properties
[Inject]
private NavigationManager NavManager { get; set; } = null!;
private string TipoSearch { get => MService.TipoSearch; set => MService.TipoSearch = value; }
#endregion Private Properties
#region Private Methods
private async Task forceReload()
{
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
var user = authState.User;
if (user.Identity != null && user.Identity.IsAuthenticated)
{
userName = $"{user.Identity.Name}";
}
else
{
userName = "N.A.";
}
}
private async void MService_EA_ShowSearch()
{
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
}
#endregion Private Methods
}
}
+2 -2
View File
@@ -78,9 +78,9 @@ namespace MP.SPEC.Components
#region Public Methods
public async Task resetCurrPage()
public void resetCurrPage()
{
await Task.Delay(1);
//await Task.Delay(1);
currPage = 1;
}
+42 -16
View File
@@ -1,7 +1,25 @@
<div class="d-flex justify-content-end">
<a class="pt-2 text-dark" data-bs-toggle="offcanvas" data-bs-target="#paramsFilterExample" aria-controls="paramsFilterExample">
<i class="fa-solid fa-bars"></i>
</a>
<div class="d-flex justify-content-between pt-2">
@if (filtActive)
{
<div class=" rounded small d-flex justify-content-between" title="Filtri attivi">
@*<i class="fas fa-exclamation text-warning"></i>*@
@if (selMacchina != "*")
{
<button class="btn btn-outline-primary btn-sm mx-2" @onclick="()=>resetMacchina()" title="Rimuovi Filtro Impianto"><i class="fa-solid fa-hard-drive"></i> &nbsp <i class="fa-solid fa-xmark text-warning"></i></button>
}
@if (selArticolo != "*")
{
<button class="btn btn-outline-primary btn-sm mx-2" @onclick="()=>resetArticolo()" title="Rimuovi Filtro Articolo"><i class="fa-solid fa-sliders"></i> &nbsp <i class="fa-solid fa-xmark text-warning"></i></button>
}
</div>
}
<div class="p-2">
<a class="" data-bs-toggle="offcanvas" data-bs-target="#paramsFilterExample" aria-controls="paramsFilterExample">
<i class="fa-solid fa-bars text-dark"></i>
</a>
</div>
</div>
<div class="offcanvas offcanvas-end" tabindex="-1" id="paramsFilterExample" aria-labelledby="paramsFilterExampleLabel">
<div class="offcanvas-header">
<h3 class="offcanvas-title" id="paramsFilterExampleLabel"><b>FILTRI</b></h3>
@@ -11,7 +29,10 @@
<div>
Seleziona i filtri per:
</div>
<div class="input-group p-2">
<div class="small mt-2">
<label class="px-2" for="dtMin" title="Selezionare inizio periodo">Articolo</label>
</div>
<div class="input-group px-2">
<label class="input-group-text" for="macchina" title="Selezionare l'articolo"><i class="fa-solid fa-file"></i></label>
<select @bind="@selArticolo" class="form-select" id="macchina" title="Selezionare la macchina">
<option value="*">--- Tutti ---</option>
@@ -24,7 +45,10 @@
}
</select>
</div>
<div class="input-group p-2">
<div class="small mt-2">
<label class="px-2" for="dtMin" title="Selezionare inizio periodo">Macchina</label>
</div>
<div class="input-group px-2">
<label class="input-group-text" for="macchina" title="Selezionare la macchina"><i class="fa-solid fa-hard-drive"></i></label>
<select @bind="@selMacchina" class="form-select" id="macchina" title="Selezionare la macchina">
<option value="*">--- Tutti ---</option>
@@ -37,18 +61,20 @@
}
</select>
</div>
<div class="input-group p-2">
<label class="input-group-text" for="DtMin" title="Selezionare la data da visualizzare"><i class="fa-solid fa-calendar-check"></i></label>
<input @bind="@selDtRef" id="DtMin" class="form-control" type="datetime-local" title="Selezionare la data minima da visualizzare" />
<div class="small mt-2">
<label class="px-2" for="dtMin" title="Selezionare inizio periodo">Inizio Periodo</label>
</div>
<div class="input-group p-2">
<label class="input-group-text" for="maxRecord" title="Selezionare il numero massimo di record da visualizzare"><i class="fa-solid fa-list-ol"></i></label>
<select @bind="@selMaxRecord" class="form-select" id="maxRecord" title="Selezionare il numero massimo di record da visualizzare">
<option value="50">50</option>
<option value="100">100</option>
<option value="250">250</option>
<option value="500">500</option>
</select>
<div class="px-2 input-group">
<label class="input-group-text" for="dtMin" title="Selezionare inizio periodo"><i class="fa-regular fa-calendar-minus"></i></label>
<input class="form-control" @bind="@selDtMin" id="dtMin" type="datetime-local" title="Data minima eventi da visualizzare">
</div>
<div class="small mt-2">
<label class="px-2" for="dtMax" title="Selezionare fine periodo">Fine Periodo</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="dtMax" title="Selezionare fine periodo"><i class="fa-regular fa-calendar-plus"></i></label>
<input class="form-control" @bind="@selDtMax" id="dtMax" type="datetime-local" title="Selezionare fine periodo">
</div>
</div>
</div>
+36 -6
View File
@@ -38,19 +38,47 @@ namespace MP.SPEC.Components
}
}
}
protected DateTime selDtRef
private bool filtActive
{
get => selMacchina != "*" || selArticolo != "*";
}
protected void resetMacchina()
{
selMacchina = "*";
}
protected void resetArticolo()
{
selArticolo = "*";
}
protected DateTime selDtMax
{
get
{
return SelFilterDossier.DtRef;
return SelFilterDossier.DtEnd;
}
set
{
if (!SelFilterDossier.DtRef.Equals(value))
if (!SelFilterDossier.DtEnd.Equals(value))
{
SelFilterDossier.DtRef = value;
SelFilterDossier.DtEnd = value;
reportChange();
}
}
}
protected DateTime selDtMin
{
get
{
return SelFilterDossier.DtStart;
}
set
{
if (!SelFilterDossier.DtStart.Equals(value))
{
SelFilterDossier.DtStart = value;
reportChange();
}
}
@@ -101,7 +129,9 @@ namespace MP.SPEC.Components
protected override async Task OnInitializedAsync()
{
SelFilterDossier = new SelectDossierParams();
ListMacchine = await MDService.MacchineWithFlux();
DateTime dtEnd = SelFilterDossier.DtEnd;
DateTime dtStart = dtEnd.Subtract(SelFilterDossier.DtStart).TotalDays < 15 ? SelFilterDossier.DtStart : dtEnd.AddDays(-14);
ListMacchine = await MDService.MacchineWithFlux(dtStart, dtEnd);
ListArticoli = await MDService.ArticleWithDossier();
await FilterChanged.InvokeAsync(SelFilterDossier);
}
+235 -22
View File
@@ -1,6 +1,9 @@
@using MP.SPEC.Components
@using MP.SPEC.Data
@if (ListRecords == null)
{
<LoadingData></LoadingData>
@@ -11,20 +14,208 @@ else if (totalCount == 0)
}
else
{
<!-- INIZIO: MODIFICA FLUSSO -->
@if (currFluxLogDto != null)
{
<div class="row">
<div class="col-12">
<div class="card mb-5">
<div class="card-header bg-primary text-light d-flex justify-content-between">
<div>
Modifica Parametro
</div>
<div>
@if (isEditing)
{
<span class="text-light">PENDING CHANGES...</span>
}
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">MACCHINA</span>
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currFluxLogDto.IdxMacchina">
</div>
</div>
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">DATA</span>
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currFluxLogDto.dtEvento">
</div>
</div>
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">DATA TYPE</span>
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currFluxLogDto.CodFlux">
</div>
</div>
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">VALORE</span>
<input type="text" class="form-control" aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currFluxLogDto.ValoreEdit" @onclick="()=> enableEditing()">
</div>
</div>
</div>
<div class="row pt-4" style="visibility: @css()">
<div class="col-3 pe-0">
</div>
<div class="col-3 pe-0">
</div>
<div class="col-3 pe-0">
<div class="d-grid gap-2">
<button @onclick="() => cancel()" class="btn btn-warning">Annulla <i class="bi bi-x-circle"></i></button>
</div>
</div>
<div class="col-3 pe-0">
<div class="d-grid gap-2">
<button @onclick="() => update(currFluxLogDto)" class="btn btn-success">Save <i class="bi bi-save"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
}
<!-- FINE: MODIFICA FLUSSO -->
<!-- INIZIO: NUOVO DOSSIER -->
@if (currRecordClone != null)
{
<div class="row">
<div class="col-12">
<div class="card mb-5">
<div class="card-header bg-primary text-light d-flex justify-content-between">
<div>
Nuovo Dossier
</div>
</div>
<div class="card-body">
<!--INIZIO PRIMA RIGA-->
<div class="row">
<div class="col-4 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">MACCHINA</span>
<select @bind="@currRecordClone.IdxMacchina" class="form-select" id="macchina" title="Selezionare la macchina" @onclick="()=> enableEditing()">
@if (ListMacchine != null)
{
foreach (var item in ListMacchine)
{
@if (item.IdxMacchina == currRecordClone.IdxMacchina)
{
<option value="@item.IdxMacchina" selected>@item.IdxMacchina | @item.Descrizione</option>
}
else
{
<option value="@item.IdxMacchina">@item.IdxMacchina | @item.Descrizione</option>
}
}
}
</select>
</div>
</div>
<div class="col-4 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">FASE</span>
<select class="form-select" @bind="@currRecordClone.KeyRichiesta" @onclick="()=> enableEditing()" title="Selezionare la fase">
@if (ListStati != null)
{
foreach (var item in ListStati)
{
@if (item.value == currRecordClone.KeyRichiesta)
{
<option value="@item.value" selected>@item.label</option>
}
else
{
<option value="@item.value">@item.label</option>
}
}
}
</select>
</div>
</div>
<div class="col-4 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm" @onclick="()=> enableEditing()">ARTICOLI</span>
<select @bind="@currRecordClone.CodArticolo" class="form-select" id="macchina" title="Selezionare l'articolo">
@if (ListArticoli != null)
{
foreach (var item in ListArticoli)
{
@if (item.CodArticolo == currRecordClone.CodArticolo)
{
<option value="@item.CodArticolo" selected>@item.CodArticolo | @item.DescArticolo</option>
}
else
{
<option value="@item.CodArticolo">@item.CodArticolo | @item.DescArticolo</option>
}
}
}
</select>
</div>
</div>
</div>
<!--FINE PRIMA RIGA-->
<div class="row pt-4">
<div class="col-3 pe-0">
</div>
<div class="col-3 pe-0">
</div>
<div class="col-3 pe-0">
<div class="d-grid gap-2">
<button @onclick="() => cancelNewDoss()" class="btn btn-warning">Annulla <i class="bi bi-x-circle"></i></button>
</div>
</div>
<div class="col-3 pe-0">
<div class="d-grid gap-2">
<button @onclick="() => newDossier(currRecordClone)" class="btn btn-success">Save <i class="bi bi-save"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
}
<!-- FINE: NUOVO DOSSIER -->
<div class="row">
<div class="d-flex justify justify-content-between">
<table class="table table-sm table-striped small">
<thead>
<tr>
<th>
<button @onclick="() => unToggleTableFlux()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
<div class="text-nowrap">
@if (currRecord != null)
{
<button @onclick="() => closeTableFlux()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
<button @onclick="()=> cloneRecord(currRecord)" class="btn btn-info btn-sm" title="Duplica Record"><i class="bi bi-clipboard-check"></i></button>
}
</div>
</th>
<th><i class="fa-solid fa-file"></i> Articolo</th>
<th><i class="fa-solid fa-screwdriver-wrench"></i> Fase</th>
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
<th><i class="fa-regular fa-calendar-days"></i> Data Snap</th>
<th><i class="fa-solid fa-sliders"></i> ODL</th>
@*<th><i class="fa-solid fa-circle-info"></i> DATA TYPE</th>*@
<th></th>
</tr>
</thead>
@@ -33,18 +224,28 @@ else
{
<tr class="@checkSelect(@record)">
<td>
<button class="btn btn-primary btn-sm" @onclick="() => selRecord(record)"><i class="fa-solid fa-magnifying-glass"></i></button>
@if (isEditing == false)
{
<!--SEL RECORD PER VISUALIZZAZIONE FLUSSI-->
<button class="btn btn-primary btn-sm" @onclick="() => selRecord(record)"><i class="fa-solid fa-magnifying-glass"></i></button>
<!--SEL RECORD PER CLONA DOSSIER-->
@*<button @onclick="()=> cloneRecord(record)" class="btn btn-info btn-sm" title="Duplica Record"><i class="bi bi-clipboard-check"></i></button>*@
}
else
{
<button class="btn btn-secondary btn-sm disabled"><i class="fa-solid fa-magnifying-glass"></i></button>
}
</td>
<td>
@record.OdlNav.CodArticolo
<div class="small textConsensed text-secondary">@record.OdlNav.ArticoloNav.DescArticolo</div>
@record.CodArticolo
<div class="small textConsensed text-secondary">@record.ArticoloNav.DescArticolo</div>
</td>
<td>
@tradFase(record.OdlNav.KeyRichiesta)
@tradFase(record.KeyRichiesta)
</td>
<td>
@record.IdxMacchina
<div class="small textConsensed text-secondary">@record.MachineNav.Descrizione</div>
@*<div class="small textConsensed text-secondary">@record.MachineNav.Descrizione</div>*@
</td>
<td>
@record.DtRif
@@ -52,11 +253,17 @@ else
<td>
@record.IdxODL
</td>
@*<td>
@record.DataType
</td>*@
<td>
<button @onclick="() => deleteRecord(record)" class="btn btn-danger btn-sm"><i class="bi bi-trash-fill"></i></button>
@if (isEditing == false)
{
<button @onclick="() => deleteRecord(record)" class="btn btn-danger btn-sm"><i class="bi bi-trash-fill"></i></button>
}
else
{
<button class="btn btn-secondary btn-sm disabled"><i class="bi bi-trash-fill"></i></button>
}
</td>
</tr>
}
@@ -75,23 +282,21 @@ else
<table class="table table-light table-sm table-striped small mb-0">
<thead>
<tr>
<th></th>
<th>
<button class="btn btn-info" @onclick="() => closeTableFlux()"><i class="fa-solid fa-xmark"></i></button>
</th>
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
<th><i class="fa-regular fa-calendar-days"></i> Data</th>
<th><i class="fa-solid fa-sliders"></i> Data Type</th>
<th>
<div class="d-flex justify-content-between col-12">
<span class="col-11" style="text-align: right;"> Valore </span>
<button class="btn btn-primary btn-sm py-0" @onclick="() => unToggleTableFlux()"><i class="fa-solid fa-xmark"></i></button>
</div>
<th style="text-align: right;">
<span class="col-11"> Valore </span>
</th>
</tr>
</thead>
<tbody>
@foreach (var record in listaFlux)
{
<tr>
<tr class="@checkSelPar(@record)">
<td>
<button @onclick="() => editRecord(record)" class="btn btn-primary btn-sm" title="Modifica Record"><i class="bi bi-pencil-square"></i></button>
</td>
@@ -102,11 +307,19 @@ else
@record.dtEvento
</td>
<td>
@record.CodFlux
@traduci(record.CodFlux)
<div class="small textConsensed text-secondary" title="Valore Registrato">@record.CodFlux</div>
</td>
<td style="text-align: right;">
<div><span class="small text-dark">Modificato: </span><b>@record.ValoreEdit</b></div>
<div class="small text-secondary"><span class="small text-dark">Originale: </span><i>@record.Valore</i></div>
@if (record.ValoreEdit != record.Valore)
{
<div title="Valore Modificato"><span class="small text-dark"></span><b>@record.ValoreEdit</b></div>
<div class="small text-secondary" title="Valore Registrato">(<i>@record.Valore</i>)</div>
}
else
{
<div><span class="small text-dark"></span>@record.ValoreEdit</div>
}
</td>
</tr>
}
+241 -29
View File
@@ -3,15 +3,16 @@ using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using MP.SPEC.Data;
using Newtonsoft.Json;
namespace MP.SPEC.Components
{
public partial class ListDossiers: IDisposable
public partial class ListDossiers : IDisposable
{
#region Public Properties
[Parameter]
public EventCallback<Dossiers> RecordSel { get; set; }
public EventCallback<DossierModel> RecordSel { get; set; }
[Parameter]
public EventCallback<FluxLogDTO> RecordSelFlux { get; set; }
@@ -26,7 +27,7 @@ namespace MP.SPEC.Components
#region Public Methods
public string checkSelect(Dossiers recordSel)
public string checkSelect(DossierModel recordSel)
{
string answ = "";
if (currRecord != null)
@@ -40,16 +41,38 @@ namespace MP.SPEC.Components
}
return answ;
}
public string checkSelPar(FluxLogDTO recordSel)
{
string answ = "";
if (currFluxLogDto != null)
{
try
{
answ = (currFluxLogDto.CodFlux == recordSel.CodFlux && currFluxLogDto.dtEvento == recordSel.dtEvento) ? "table-info" : "";
}
catch
{ }
}
return answ;
}
public void Dispose()
{
MessageService.EA_PageUpdated -= MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated -= OnSeachUpdated;
currRecord = null;
SearchRecords = null;
ListRecords = null;
GC.Collect();
}
public async Task flushCache()
{
await Task.Delay(1);
await MDService.FlushRedisCache();
await Task.Delay(1);
// rimando a pagina corrente
NavManager.NavigateTo(NavManager.Uri, true);
}
#endregion Public Methods
@@ -61,19 +84,62 @@ namespace MP.SPEC.Components
[Inject]
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MessageService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected async Task cancel()
{
var alert = await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler annullare TUTTE le modifiche? i dati saranno ricaricati.");
if (alert)
{
currFluxLogDto = null;
isEditing = false;
await Task.Delay(1);
if (currRecord != null)
{
listaFlux = MDService.getFluxLog(currRecord.Valore);
}
StateHasChanged();
}
}
protected async Task cancelNewDoss()
{
var alert = await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler annullare l'aggiunta di un nuovo dossier? i dati saranno ricaricati.");
if (alert)
{
currRecordClone = null;
isEditing = false;
await Task.Delay(1);
StateHasChanged();
}
}
protected async Task cloneRecord(DossierModel selRec)
{
// creo record duplicato...
DossierModel newRec = new DossierModel()
{
//IdxDossier = 0,
DataType = selRec.DataType,
KeyRichiesta = selRec.KeyRichiesta,
DtRif = DateTime.Now,
IdxMacchina = selRec.IdxMacchina,
CodArticolo = selRec.CodArticolo,
IdxODL = 0,
Valore = selRec.Valore,
};
currRecordClone = newRec;
await Task.Delay(1);
}
/// <summary>
/// Eliminazione record selezionato (previa conferma)
/// </summary>
/// <param name="selRec"></param>
/// <returns></returns>
protected async Task deleteRecord(Dossiers selRec)
protected async Task deleteRecord(DossierModel selRec)
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Eliminazione Dossier: sei sicuro di voler procedere?"))
return;
@@ -87,18 +153,85 @@ namespace MP.SPEC.Components
protected async Task editRecord(FluxLogDTO selRec)
{
currFluxLogDto = selRec;
// indico record selezionato
await RecordSelFlux.InvokeAsync(selRec);
}
protected async Task newDossier(DossierModel selRec)
{
var alert = await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler creare un nuovo Dossier per l'impianto/articolo selezioanto?");
if (alert)
{
await Task.Delay(1);
if (currRecordClone != null)
{
// serializzo valore x flux log...
DossierFluxLogDTO? valoreDeserializzato = JsonConvert.DeserializeObject<DossierFluxLogDTO>(selRec.Valore);
if (valoreDeserializzato != null)
{
listaFlux = valoreDeserializzato
.ODL
.OrderBy(x => x.CodFlux)
.ToList();
}
if (listaFlux != null)
{
foreach (var item in listaFlux)
{
item.IdxMacchina = selRec.IdxMacchina;
item.Valore = "0";
item.dtEvento = DateTime.Now;
}
}
DossierFluxLogDTO updatedResult = new DossierFluxLogDTO() { ODL = listaFlux };
string newVal = JsonConvert.SerializeObject(updatedResult);
// preparo x insert
currRecordClone.DtRif = DateTime.Now;
currRecordClone.IdxMacchina = selRec.IdxMacchina;
currRecordClone.CodArticolo = selRec.CodArticolo;
currRecordClone.KeyRichiesta = selRec.KeyRichiesta;
currRecordClone.Valore = newVal;
// METODO PER INSERT DOSSIER + FLUX
await MDService.DossiersInsert(currRecordClone);
//await reloadData(true);
currRecordClone = null;
isEditing = false;
await Task.Delay(1);
await flushCache();
}
return;
}
else
{
currRecordClone = null;
await Task.Delay(1);
NavManager.NavigateTo(NavManager.Uri, true);
}
}
protected override async Task OnInitializedAsync()
{
MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated += OnSeachUpdated;
ListGruppiFase = await MDService.ElencoGruppiFase();
ListStati = await MDService.AnagStatiComm();
ListArticoli = await MDService.ArticoliGetSearch(100000, "BAGLIETTO", "");
ListMacchine = await MDService.MacchineGetAll();
await reloadData(true);
}
protected override async Task OnParametersSetAsync()
{
if (!lastFilter.Equals(SelFilter))
{
lastFilter = SelFilter.clone();
await reloadData(true);
}
}
protected async void OnSeachUpdated()
{
await InvokeAsync(() =>
@@ -108,7 +241,7 @@ namespace MP.SPEC.Components
});
}
protected async Task selRecord(Dossiers selRec)
protected async Task selRecord(DossierModel selRec)
{
currRecord = selRec;
await RecordSel.InvokeAsync(selRec);
@@ -116,6 +249,37 @@ namespace MP.SPEC.Components
await toggleTableFlux();
}
protected async Task update(FluxLogDTO selRec)
{
var alert = await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler salvare TUTTE le modifiche? queste saranno parte del dossier inviato all'impianto");
if (alert)
{
await Task.Delay(1);
if (currRecord != null)
{
// serializzo valore x flux log...
DossierFluxLogDTO updatedResult = new DossierFluxLogDTO() { ODL = listaFlux };
string newVal = JsonConvert.SerializeObject(updatedResult);
currRecord.Valore = newVal;
// METODO PER UPDATE FLUX
await MDService.DossiersUpdateValore(currRecord);
currFluxLogDto = null;
isEditing = false;
await Task.Delay(1);
StateHasChanged();
}
return;
}
else
{
currFluxLogDto = null;
await Task.Delay(1);
// rimando a pagina corrente
NavManager.NavigateTo(NavManager.Uri, true);
}
}
protected async Task UpdateData()
{
currRecord = null;
@@ -128,13 +292,21 @@ namespace MP.SPEC.Components
private int _totalCount = 0;
private Dossiers? currRecord = null;
private FluxLogDTO? currFluxLogDto = null;
private DossierModel? currRecord = null;
private DossierModel? currRecordClone = null;
private List<AnagArticoli>? ListArticoli;
private List<AnagGruppi>? ListGruppiFase;
private List<Macchine>? ListMacchine;
private List<DossierModel>? ListRecords;
private FluxLogDTO? currRecordFlux;
private List<Dossiers>? ListRecords;
private List<ListValues>? ListStati;
private List<Dossiers>? SearchRecords;
private List<DossierModel>? SearchRecords;
#endregion Private Fields
@@ -142,12 +314,20 @@ namespace MP.SPEC.Components
private int currPage
{
get => MessageService.currPage;
set => MessageService.currPage = value;
get => SelFilter.CurrPage;
set => SelFilter.CurrPage = value;
}
private bool isEditing
{
get => SelFilter.isEditing;
set => SelFilter.isEditing = value;
}
private bool isLoading { get; set; } = false;
private SelectDossierParams lastFilter { get; set; } = new SelectDossierParams() { CurrPage = -1 };
private List<FluxLogDTO>? listaFlux { get; set; } = null;
private int MaxRecord
@@ -155,10 +335,13 @@ namespace MP.SPEC.Components
get => SelFilter.MaxRecord;
}
[Inject]
private NavigationManager NavManager { get; set; } = null!;
private int numRecord
{
get => MessageService.numRecord;
set => MessageService.numRecord = value;
get => SelFilter.NumRec;
set => SelFilter.NumRec = value;
}
private string SelArticolo
@@ -166,9 +349,14 @@ namespace MP.SPEC.Components
get => SelFilter.CodArticolo;
}
private DateTime SelDtRef
private DateTime SelDtEnd
{
get => SelFilter.DtRef;
get => SelFilter.DtEnd;
}
private DateTime SelDtStart
{
get => SelFilter.DtStart;
}
private string SelMacchina
@@ -195,15 +383,40 @@ namespace MP.SPEC.Components
#region Private Methods
private async void MessageService_EA_PageUpdated()
private async Task closeTableFlux()
{
await reloadData(true);
currFluxLogDto = null;
currRecord = null;
currRecordClone = null;
visualizzaFlux = true;
isEditing = false;
await RecordSelFlux.InvokeAsync(currFluxLogDto);
await Task.Delay(1);
}
private string css()
{
string answ = "";
if (isEditing)
{
answ = "visible";
}
else
{
answ = "hidden";
}
return answ;
}
private void enableEditing()
{
isEditing = true;
}
private async Task reloadData(bool setChanged)
{
isLoading = true;
SearchRecords = await MDService.DossiersGetLastFilt(SelMacchina, SelArticolo, SelDtRef, MaxRecord);
SearchRecords = await MDService.DossiersGetLastFilt(SelMacchina, SelArticolo, SelDtStart, SelDtEnd);
totalCount = SearchRecords.Count;
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
await Task.Delay(1);
@@ -234,11 +447,10 @@ namespace MP.SPEC.Components
return answ;
}
private async Task unToggleTableFlux()
private string traduci(string lemma)
{
currRecord = null;
visualizzaFlux = true;
await Task.Delay(1);
var answ = MDService.Traduci(lemma, "IT");
return answ;
}
#endregion Private Methods
+20 -6
View File
@@ -31,7 +31,10 @@ else
<thead>
<tr>
<th>
<button @onclick="() => resetSel()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
@if (currRecord != null)
{
<button @onclick="() => resetSel()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
}
</th>
<th><i class="fa-solid fa-file"></i> Articolo</th>
<th><i class="fa-solid fa-screwdriver-wrench"></i> Fase</th>
@@ -198,6 +201,17 @@ else
</div>
}
</td>
<td>
<div class="input-group input-group-sm">
<div class="input-group-text">
<span class="me-1 @leftStringCSS">Tutti gli Stati</span>
<span class="form-check form-check-sm form-switch py-1" title="Mostra/Nascondi macchina spenta">
<input class="form-check-input" type="checkbox" id="switchSpenta" @onchange="() => toggleSpenta()" value="@hideSpenta">
</span>
<span class="@rightStringCSS">Nascondi Spenta</span>
</div>
</div>
</td>
</tr>
</tbody>
</table>
@@ -205,10 +219,9 @@ else
<div>
@if (statRecord != null)
{
@if (ListOdlStats != null)
@if (ListOdlStatsAct != null)
{
@foreach (var stat in ListOdlStats)
@foreach (var stat in ListOdlStatsAct)
{
<div class="p-1">
<div class="d-flex justify-content-between">
@@ -234,11 +247,12 @@ else
@if (statRecord != null && ListOdlStats != null)
{
<div class="dcBox">
<ODLPlot SelectedOdl="@statRecord.IdxOdl"></ODLPlot>
<ODLPlot SelectedOdl="@statRecord.IdxOdl" hideSpenta="@hideSpenta"></ODLPlot>
</div>
<div class="dcBox dcOverlay d-flex">
<div class="align-self-center text-center w-100">
<b class="fs-3">@statRecord.DurataMinuti</b>
<b class="fs-3">@durataFilt</b>
@*<b class="fs-3">@statRecord.DurataMinuti</b>*@
</div>
</div>
}
+102 -28
View File
@@ -3,6 +3,7 @@ using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.SPEC.Data;
using MP.SPEC.Services;
using NLog;
namespace MP.SPEC.Components
{
@@ -45,6 +46,7 @@ namespace MP.SPEC.Components
ListRecords = null;
ListStati = null;
ListOdlStats = null;
ListOdlStatsNetto = null;
statRecord = null;
GC.Collect();
}
@@ -84,8 +86,9 @@ namespace MP.SPEC.Components
{
// effettua chiusura sul DB
await MDService.ODLClose(currRecord.IdxOdl, currRecord.IdxMacchina, 0, true);
Log.Info($"Effettuata chiusura ODL {currRecord.IdxOdl}");
// ricarica...
await selectRecord(null);
await selRecord(null);
}
await reloadData();
}
@@ -112,8 +115,9 @@ namespace MP.SPEC.Components
if (currRecord != null)
{
await callSyncDb(currRecord.IdxMacchina);
Log.Info($"Richiesto forceSyncDb per idxMacc {currRecord.IdxMacchina}");
// ricarica...
await selectRecord(null);
await selRecord(null);
}
await reloadData();
}
@@ -140,27 +144,10 @@ namespace MP.SPEC.Components
protected async Task resetSel()
{
await selectRecord(null);
await selRecord(null);
await reloadData();
}
protected async Task selectRecord(ODLModel? currRec)
{
showStats = true;
await Task.Delay(1);
currRecord = currRec;
if (currRec != null)
{
showStats = true;
ListOdlStats = await MDService.StatOdl(currRec.IdxOdl);
}
else
{
showStats = false;
ListOdlStats = null;
}
}
protected async Task selectStatRecord(ODLModel? currRec)
{
showStats = true;
@@ -168,8 +155,7 @@ namespace MP.SPEC.Components
statRecord = currRec;
if (currRec != null)
{
showStats = true;
ListOdlStats = await MDService.StatOdl(currRec.IdxOdl);
await reloadStatsData(currRec);
}
else
{
@@ -185,11 +171,22 @@ namespace MP.SPEC.Components
currRecord = currRec;
showStats = false;
ListOdlStats = null;
ListOdlStatsNetto = null;
}
protected async Task toggleSpenta()
{
hideSpenta = !hideSpenta;
await Task.Delay(1);
if (statRecord != null)
{
await reloadStatsData(statRecord);
}
}
protected async Task UpdateData()
{
await selectRecord(null);
await selRecord(null);
await reloadData();
}
@@ -197,10 +194,14 @@ namespace MP.SPEC.Components
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
private ODLModel? currRecord = null;
private List<StatODLModel>? ListOdlStats;
private List<StatODLModel>? ListOdlStatsNetto;
private List<ODLModel>? ListRecords;
private List<ListValues>? ListStati;
@@ -221,6 +222,39 @@ namespace MP.SPEC.Components
set => currFilter.CurrPage = value;
}
private string durataFilt
{
get
{
string answ = "ND";
if (statRecord != null)
{
if (hideSpenta)
{
if (ListOdlStatsNetto != null)
{
var tsDurata = TimeSpan.FromMinutes(ListOdlStatsNetto.Sum(x => x.TotDurata));
if (tsDurata.TotalDays < 1)
{
answ = $"{tsDurata.Hours:00}h {tsDurata.Minutes:00}'";
}
else
{
answ = $"{tsDurata.Days}gg {tsDurata.Hours:00}h";
}
}
}
else
{
answ = statRecord.DurataMinuti;
}
}
return answ;
}
}
private bool hideSpenta { get; set; } = false;
/// <summary>
/// Indica se si tratti di ODL correnti
/// </summary>
@@ -231,12 +265,39 @@ namespace MP.SPEC.Components
private bool isLoading { get; set; } = false;
private string leftStringCSS
{
get => hideSpenta ? "text-secondary" : "text-dark fw-bold";
}
private List<StatODLModel>? ListOdlStatsAct
{
get
{
List<StatODLModel>? answ = new List<StatODLModel>();
if (hideSpenta)
{
answ = ListOdlStatsNetto;
}
else
{
answ = ListOdlStats;
}
return answ;
}
}
private int numRecord
{
get => currFilter.NumRec;
set => currFilter.NumRec = value;
}
private string rightStringCSS
{
get => hideSpenta ? "text-dark fw-bold" : "text-secondary";
}
private DateTime selDtFine { get; set; } = DateTime.Now;
private bool showStats { get; set; } = false;
@@ -273,6 +334,7 @@ namespace MP.SPEC.Components
}
catch (Exception exc)
{
Log.Error($"Errore durante chiamata: {Environment.NewLine}{exc}");
}
}
@@ -281,12 +343,9 @@ namespace MP.SPEC.Components
double answ = 0;
double tot = 0;
if (ListOdlStats != null)
if (ListOdlStatsAct != null)
{
foreach (var item in ListOdlStats)
{
tot += item.TotDurata;
}
tot = ListOdlStatsAct.Sum(x => x.TotDurata);
double perc = (durata / tot) * 100;
if (perc > 1)
@@ -344,6 +403,21 @@ namespace MP.SPEC.Components
isLoading = false;
}
private async Task reloadStatsData(ODLModel? currRec)
{
showStats = true;
if (currRec != null)
{
ListOdlStats = await MDService.StatOdl(currRec.IdxOdl);
ListOdlStatsNetto = ListOdlStats.Where(x => x.Semaforo != "sGr").ToList();
}
else
{
ListOdlStats = null;
ListOdlStatsNetto = null;
}
}
private string tradFase(string codFase)
{
string answ = codFase;
+8 -1
View File
@@ -17,11 +17,15 @@ else
<thead>
<tr>
<th>
<button @onclick="() => resetSel()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
@if (currRecord != null)
{
<button @onclick="() => resetSel()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
}
</th>
<th><i class="fa-regular fa-calendar-days"></i> Data</th>
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
<th><i class="fa-solid fa-sliders"></i> Parametro</th>
<th><i class="fa-solid fa-sliders"></i> Nome</th>
<th style="text-align: right">Valore</th>
</tr>
</thead>
@@ -41,6 +45,9 @@ else
<td>
@record.CodFlux
</td>
<td>
@traduci(record.CodFlux)
</td>
<td style="text-align: right">
<b>@record.Valore</b>
</td>
+57 -24
View File
@@ -3,6 +3,7 @@ using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.SPEC.Data;
using System.Diagnostics;
using MP.Data;
namespace MP.SPEC.Components
{
@@ -25,7 +26,7 @@ namespace MP.SPEC.Components
#endregion Public Properties
#region Public Methods
private SelectFluxParams lastFilter { get; set; } = new SelectFluxParams() { CurrPage = -1 };
public string checkSelect(FluxLog selRecord)
{
string answ = "";
@@ -45,10 +46,10 @@ namespace MP.SPEC.Components
{
await Task.Delay(1);
// se sono cambiati --> rileggo...
if (LastFilter==null || !SelFilter.Equals(LastFilter))
if (!lastFilter.Equals(SelFilter))
{
await reloadData(false);
LastFilter = SelFilter;
lastFilter = SelFilter.clone();
await reloadData(true);
}
}
@@ -58,8 +59,6 @@ namespace MP.SPEC.Components
public void Dispose()
{
aTimer.Elapsed -= ElapsedTimer;
MessageService.EA_PageUpdated -= MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated -= OnSeachUpdated;
aTimer.Stop();
aTimer.Dispose();
currRecord = null;
@@ -94,12 +93,18 @@ namespace MP.SPEC.Components
public async Task reloadData(bool setChanged)
{
isLoading = true;
DateTime limitData = DateTime.Now;
DateTime dataFrom = DateTime.Today.AddMonths(-1);
DateTime dataTo = DateTime.Now.AddMinutes(5);
if (SelFilter != null && SelFilter.dtMin != null)
{
dataFrom = (DateTime)SelFilter.dtMin;
}
if (SelDtMax != null)
{
limitData = (DateTime)SelDtMax;
dataTo = (DateTime)SelDtMax;
}
SearchRecords = await MDService.FluxLogGetLastFilt(limitData, SelMacchina, SelFlux, MaxRecord);
SearchRecords = await MDService.FluxLogGetLastFilt(dataTo, dataFrom, SelMacchina, SelFlux, MaxRecord);
totalCount = SearchRecords.Count;
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
await Task.Delay(1);
@@ -128,9 +133,6 @@ namespace MP.SPEC.Components
[Inject]
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MessageService { get; set; } = null!;
protected int RefreshPeriod
{
get => SelFilter.TempoAgg;
@@ -140,10 +142,8 @@ namespace MP.SPEC.Components
#region Protected Methods
protected override async Task OnInitializedAsync()
protected override void OnInitialized()
{
MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated += OnSeachUpdated;
StartTimer();
}
@@ -163,6 +163,7 @@ namespace MP.SPEC.Components
protected async Task resetSel()
{
currRecord = null;
setDtMax();
await RecordSel.InvokeAsync(null);
}
@@ -170,8 +171,13 @@ namespace MP.SPEC.Components
{
currRecord = selRec;
SelFilter.IdxMacchina = selRec.IdxMacchina;
SelDtMax = selRec.dtEvento;
// imposto pag 1 filtro
SelFilter.CurrPage = 1;
//selDtMin = RoundDatetime(5).AddHours(-25);
await reloadData(false);
await RecordSel.InvokeAsync(selRec);
await PagerResetReq.InvokeAsync(true);
}
protected async Task UpdateData()
@@ -182,6 +188,13 @@ namespace MP.SPEC.Components
#endregion Protected Methods
private string traduci(string lemma)
{
var answ = MDService.Traduci(lemma, "IT");
return answ;
}
#region Private Fields
private static System.Timers.Timer aTimer = null!;
@@ -197,8 +210,8 @@ namespace MP.SPEC.Components
private int currPage
{
get => MessageService.currPage;
set => MessageService.currPage = value;
get => SelFilter.CurrPage;
set => SelFilter.CurrPage = value;
}
private bool isLoading { get; set; } = false;
@@ -215,8 +228,8 @@ namespace MP.SPEC.Components
private int numRecord
{
get => MessageService.numRecord;
set => MessageService.numRecord = value;
get => SelFilter.NumRec;
set => SelFilter.NumRec = value;
}
private string SelFlux
@@ -231,8 +244,33 @@ namespace MP.SPEC.Components
private DateTime? SelDtMax
{
get => SelFilter.dtMax;
set => SelFilter.dtMax = value;
}
protected void setDtMax()
{
// copio il filtro
var currFilt = SelFilter;
// fermo update
//currFilt.LiveUpdate = true;
currFilt.CurrPage = 0;
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
currFilt.dtMax = RoundDatetime(5);
currFilt.dtMin = RoundDatetime(5).AddHours(-25);
SelFilter = currFilt;
}
/// <summary>
/// Inizializzazione con periodo e arrotondamento
/// </summary>
/// <param name="minRound"></param>
/// <returns></returns>
public static DateTime RoundDatetime(int minRound)
{
TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today);
int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound;
DateTime endRounded = DateTime.Today.AddMinutes(minDay);
return endRounded;
}
private int totalCount
{
get => _totalCount;
@@ -250,11 +288,6 @@ namespace MP.SPEC.Components
#region Private Methods
private async void MessageService_EA_PageUpdated()
{
await reloadData(true);
}
#endregion Private Methods
}
}
+9 -5
View File
@@ -17,7 +17,10 @@ else
<thead>
<tr>
<th>
<button @onclick="() => resetSel()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
@if (currRecord != null)
{
<button @onclick="() => resetSel()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
}
</th>
<th><i class="fa-solid fa-file"></i> Articolo</th>
<th><i class="fa-solid fa-screwdriver-wrench"></i> Fase</th>
@@ -37,15 +40,16 @@ else
<button @onclick="() => cloneRecord(record)" class="btn btn-info btn-sm" title="Duplica Record"><i class="bi bi-clipboard-check"></i></button>
@if (canStartOdl(record.IdxMacchina))
{
<button @onclick="() => startOdl(record)" class="btn btn-success btn-sm" title="Avvia PODL">
<button @onclick="() => startOdl(record)" class="btn btn-success btn-sm mx-1" title="Avvia PODL">
<i class="far fa-play-circle"></i>
</button>
}
else
{
<button class="btn btn-secondary btn-sm disabled" title="ODL ancora in corso">
{
<button class="btn btn-secondary btn-sm disabled mx-1" title="ODL ancora in corso">
<i class="far fa-play-circle"></i>
</button>}
</button>
}
</td>
<td>
@record.CodArticolo
+25 -8
View File
@@ -3,6 +3,7 @@ using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.SPEC.Data;
using MP.SPEC.Services;
using NLog;
namespace MP.SPEC.Components
{
@@ -13,8 +14,6 @@ namespace MP.SPEC.Components
[Parameter]
public SelectPOdlParams actFilter { get; set; } = new SelectPOdlParams();
private SelectPOdlParams lastFilter { get; set; } = new SelectPOdlParams() { CurrPage = -1 };
[Parameter]
public EventCallback<bool> PagerResetReq { get; set; }
@@ -43,8 +42,6 @@ namespace MP.SPEC.Components
return answ;
}
#endregion Public Methods
public void Dispose()
{
currRecord = null;
@@ -54,6 +51,8 @@ namespace MP.SPEC.Components
GC.Collect();
}
#endregion Public Methods
#region Protected Properties
[Inject]
@@ -211,12 +210,21 @@ namespace MP.SPEC.Components
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
private PODLModel? currRecord = null;
private List<PODLModel>? ListRecords;
private List<ListValues>? ListStati;
/// <summary>
/// scadenza validità lista ODL correnti
/// </summary>
private DateTime odlCurrExp = DateTime.Now.AddMinutes(-1);
/// <summary>
/// Elenco ODL correnti...
/// </summary>
private List<string> odlCurrList = new List<string>();
private List<PODLModel>? SearchRecords;
#endregion Private Fields
@@ -232,6 +240,7 @@ namespace MP.SPEC.Components
}
private bool isLoading { get; set; } = false;
private SelectPOdlParams lastFilter { get; set; } = new SelectPOdlParams() { CurrPage = -1 };
private int numRecord
{
@@ -282,6 +291,7 @@ namespace MP.SPEC.Components
}
catch (Exception exc)
{
Log.Error($"Errore durante chiamata: {Environment.NewLine}{exc}");
}
}
@@ -325,8 +335,15 @@ namespace MP.SPEC.Components
/// <returns></returns>
private bool canStartOdl(string idxMacchina)
{
var listOdlCurr = MDService.OdlGetCurrent();
bool answ = !listOdlCurr.Contains(idxMacchina);
// controllo se lista scaduta...
bool answ = false;
DateTime adesso = DateTime.Now;
if (adesso > odlCurrExp || odlCurrList == null || odlCurrList.Count == 0)
{
odlCurrList = MDService.OdlGetCurrent();
odlCurrExp = adesso.AddSeconds(2);
}
answ = !odlCurrList.Contains(idxMacchina);
return answ;
}
+35 -17
View File
@@ -1,14 +1,25 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.SPEC.Components;
using MP.SPEC.Data;
namespace MP.SPEC.Components
{
public partial class ODLPlot
{
#region Public Properties
#region Public Fields
public List<DoughnutStyling> colors = new List<DoughnutStyling>();
public List<double> Data = new List<double>();
public List<string> Labels = new List<string>();
#endregion Public Fields
#region Public Properties
[Parameter]
public bool hideSpenta { get; set; }
public int OdlId
{
@@ -29,34 +40,36 @@ namespace MP.SPEC.Components
//protected DataLogFilter _SelFilter { get; set; } = new DataLogFilter();
protected int _selParam { get; set; } = -1;
[Inject]
protected MpDataService MDService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
private bool isLoading { get; set; } = false;
protected override async Task OnInitializedAsync()
{
isLoading = true;
await Task.Delay(1);
}
private List<StatODLModel>? ListRecords = null;
protected override async Task OnParametersSetAsync()
{
await ReloadData();
await Task.Delay(1);
}
public List<double> Data = new List<double>();
public List<string> Labels = new List<string>();
public List<DoughnutStyling> colors = new List<DoughnutStyling>();
protected async Task ReloadData()
{
Data.Clear();
Labels.Clear();
colors.Clear();
ListRecords = await MDService.StatOdl(SelectedOdl);
// se hideSpenta --> filtro stato 11 = spenta...
if (hideSpenta)
{
ListRecords = ListRecords.Where(x => x.Semaforo != "sGr").ToList();
}
foreach (var record in ListRecords)
{
Data.Add(record.TotDurata);
@@ -73,18 +86,23 @@ namespace MP.SPEC.Components
{
colors.Add(new DoughnutStyling(record.Css, "ccc"));
}
}
await Task.Delay(1);
isLoading = false;
}
[Inject]
protected MpDataService MDService { get; set; } = null!;
#endregion Protected Methods
#region Private Fields
private List<StatODLModel>? ListRecords = null;
#endregion Private Fields
#region Private Properties
private bool isLoading { get; set; } = false;
#endregion Private Properties
}
}
+97 -81
View File
@@ -1,16 +1,15 @@
<div class="d-flex justify-content-between">
<div class="d-flex justify-content-between pt-1 mb-1">
<div class="px-2">
@if (!liveUpdate)
{
<button class="btn btn-secondary" type="button" @onclick="() => toggleUpdate()" title="Click per tornare a Valori Live">
<button class="btn btn-secondary" type="button" @onclick="() => live()" title="Click per tornare a Valori Live">
<small>@lastUpdate</small>
</button>
}
else
{
<button class="btn btn-primary" type="button" @onclick="() => toggleUpdate()">
<button class="btn btn-primary" type="button" @onclick="() => notLive()">
<span class="spinner-grow spinner-grow-sm" role="status" aria-hidden="true"></span>
Valori live
</button>
@@ -39,89 +38,106 @@
</div>
</div>
<a class="pt-2" data-bs-toggle="offcanvas" data-bs-target="#paramsFilterExample" aria-controls="paramsFilterExample" @onclick="setDtMax">
<i class="fa-solid fa-bars text-dark"></i>
</a>
<div class="offcanvas offcanvas-end" tabindex="-1" id="paramsFilterExample" aria-labelledby="paramsFilterExampleLabel">
<div class="offcanvas-header">
<h3 class="offcanvas-title" id="paramsFilterExampleLabel"><b>FILTRI</b></h3>
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
<div class="d-flex justify-content-between pt-2">
@if (filtActive)
{
@*<i class="fas fa-exclamation text-warning"></i>*@
@if (selMacchina != "*")
{
<button class="btn btn-outline-primary btn-sm mx-2" @onclick="()=>resetMacchina()" title="Rimuovi Filtro Impianto"><i class="fa-solid fa-hard-drive"></i> &nbsp <i class="fa-solid fa-xmark text-warning"></i></button>
}
@if (selFlux != "*")
{
<button class="btn btn-outline-primary btn-sm mx-2" @onclick="()=>resetFase()" title="Rimuovi Filtro Parametro"><i class="fa-solid fa-sliders"></i> &nbsp <i class="fa-solid fa-xmark text-warning"></i></button>
}
}
<div class="p-2">
<a class="" data-bs-toggle="offcanvas" data-bs-target="#paramsFilterExample" aria-controls="paramsFilterExample">
<i class="fa-solid fa-bars text-dark"></i>
</a>
</div>
<div class="offcanvas-body">
<div class="small">
<label class="px-2" for="macchina" title="Selezionare impianto">Impianto</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="macchina" title="Selezionare impianto"><i class="fa-solid fa-hard-drive"></i></label>
<select @bind="@selMacchina" class="form-select" id="macchina" title="Selezionare impianto">
<option value="*">--- Tutti ---</option>
@if (ListMacchine != null)
</div>
</div>
<div class="offcanvas offcanvas-end" tabindex="-1" id="paramsFilterExample" aria-labelledby="paramsFilterExampleLabel">
<div class="offcanvas-header">
<h3 class="offcanvas-title" id="paramsFilterExampleLabel"><b>FILTRI</b></h3>
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div class="small">
<label class="px-2" for="macchina" title="Selezionare impianto">Impianto</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="macchina" title="Selezionare impianto"><i class="fa-solid fa-hard-drive"></i></label>
<select @bind="@selMacchina" class="form-select" id="macchina" title="Selezionare impianto">
<option value="*">--- Tutti ---</option>
@if (ListMacchine != null)
{
foreach (var item in ListMacchine)
{
foreach (var item in ListMacchine)
{
<option value="@item">@item</option>
}
<option value="@item">@item</option>
}
</select>
</div>
<div class="small mt-2">
<label class="px-2" for="flusso" title="Selezionare il parametro">Parametro</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="flusso" title="Selezionare il parametro"><i class="fa-solid fa-sliders"></i></label>
<select @bind="@selFlux" class="form-select" id="flusso" title="Selezionare il parametro">
<option value="*">--- Tutti ---</option>
@if (ListFlux != null)
}
</select>
</div>
<div class="small mt-2">
<label class="px-2" for="flusso" title="Selezionare il parametro">Parametro</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="flusso" title="Selezionare il parametro"><i class="fa-solid fa-sliders"></i></label>
<select @bind="@selFlux" class="form-select" id="flusso" title="Selezionare il parametro">
<option value="*">--- Tutti ---</option>
@if (ListFlux != null)
{
foreach (var item in ListFlux)
{
foreach (var item in ListFlux)
{
<option value="@item">@item</option>
}
<option value="@item">@item</option>
}
</select>
</div>
<div class="small mt-2">
<label class="px-2" for="dtMin" title="Selezionare inizio periodo">Inizio Periodo</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="dtMin" title="Selezionare inizio periodo"><i class="fa-regular fa-calendar-minus"></i></label>
<input class="form-control" @bind="@selDtMin" id="dtMin" type="datetime-local" title="Data minima eventi da visualizzare">
</div>
<div class="small mt-2">
<label class="px-2" for="dtMax" title="Selezionare fine periodo">Fine Periodo</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="dtMax" title="Selezionare fine periodo"><i class="fa-regular fa-calendar-plus"></i></label>
<input class="form-control" @bind="@selDtMax" id="dtMax" type="datetime-local" title="Selezionare fine periodo">
</div>
<div class="small mt-2">
<label class="px-2" for="tempoAgg" title="Selezionare refresh rate (sec) periodo">Refresh rate (sec)</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="tempoAgg" title="Selezionare refresh rate (sec)"><i class="fa-solid fa-clock"></i></label>
<select @bind="@selTempoAgg" class="form-select" id="tempoAgg" title="Selezionare refresh rate (sec)" style="width: 3em;">
<option value="2">2</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="30">30</option>
<option value="60">60</option>
</select>
</div>
<div class="small mt-2">
<label class="px-2" for="maxRecord" title="Numero massimo record da mostrare">Max Record</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="maxRecord" title="Numero massimo record da mostrare"><i class="fa-solid fa-list-ol"></i></label>
<select @bind="@selMaxRecord" class="form-select" id="maxRecord" title="Numero massimo record da mostrare">
<option value="50">50</option>
<option value="100">100</option>
<option value="250">250</option>
<option value="500">500</option>
<option value="1000">1000</option>
<option value="2500">2500</option>
<option value="5000">5000</option>
</select>
</div>
}
</select>
</div>
<div class="small mt-2">
<label class="px-2" for="dtMin" title="Selezionare inizio periodo">Inizio Periodo</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="dtMin" title="Selezionare inizio periodo"><i class="fa-regular fa-calendar-minus"></i></label>
<input class="form-control" @bind="@selDtMin" id="dtMin" type="datetime-local" title="Data minima eventi da visualizzare">
</div>
<div class="small mt-2">
<label class="px-2" for="dtMax" title="Selezionare fine periodo">Fine Periodo</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="dtMax" title="Selezionare fine periodo"><i class="fa-regular fa-calendar-plus"></i></label>
<input class="form-control" @bind="@selDtMax" id="dtMax" type="datetime-local" title="Selezionare fine periodo">
</div>
<div class="small mt-2">
<label class="px-2" for="tempoAgg" title="Selezionare refresh rate (sec) periodo">Refresh rate (sec)</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="tempoAgg" title="Selezionare refresh rate (sec)"><i class="fa-solid fa-clock"></i></label>
<select @bind="@selTempoAgg" class="form-select" id="tempoAgg" title="Selezionare refresh rate (sec)" style="width: 3em;">
<option value="2">2</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="30">30</option>
<option value="60">60</option>
</select>
</div>
<div class="small mt-2">
<label class="px-2" for="maxRecord" title="Numero massimo record da mostrare">Max Record</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="maxRecord" title="Numero massimo record da mostrare"><i class="fa-solid fa-list-ol"></i></label>
<select @bind="@selMaxRecord" class="form-select" id="maxRecord" title="Numero massimo record da mostrare">
<option value="50">50</option>
<option value="100">100</option>
<option value="250">250</option>
<option value="500">500</option>
<option value="1000">1000</option>
<option value="2500">2500</option>
<option value="5000">5000</option>
</select>
</div>
</div>
</div>
+30 -13
View File
@@ -165,17 +165,26 @@ namespace MP.SPEC.Components
NavManager.NavigateTo("DOSS", true);
}
private bool filtActive
{
get => selMacchina != "*" || selFlux != "*";
}
protected override async Task OnInitializedAsync()
{
SelFilter = new SelectFluxParams();
ListMacchine = await MDService.MacchineWithFlux();
setDtMax();
DateTime dtStart = SelFilter.dtMin != null ? (DateTime)SelFilter.dtMin : DateTime.Now.AddDays(-7);
DateTime dtEnd = SelFilter.dtMax != null ? (DateTime)SelFilter.dtMax : DateTime.Now;
ListMacchine = await MDService.MacchineWithFlux(dtStart, dtEnd);
ListFlux = await MDService.ParametriGetFilt(selMacchina);
var configData = await MDService.ConfigGetAll();
var currRec = configData.FirstOrDefault(x => x.Chiave == "numOreAnticipoSnapshot");
if (currRec != null)
{
int.TryParse(currRec.Valore, out numOreAnticipoSnapshot);
var newInt = 40;
int.TryParse(currRec.Valore, out newInt);
numOreAnticipoSnapshot = newInt;
}
await FilterChanged.InvokeAsync(SelFilter);
@@ -186,7 +195,7 @@ namespace MP.SPEC.Components
// copio il filtro
var currFilt = SelFilter;
// fermo update
//currFilt.LiveUpdate = false;
currFilt.LiveUpdate = true;
currFilt.CurrPage = 0;
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
currFilt.dtMax = RoundDatetime(5);
@@ -202,6 +211,14 @@ namespace MP.SPEC.Components
aTimer.Enabled = true;
aTimer.Start();
}
protected void resetMacchina()
{
selMacchina = "*";
}
protected void resetFase()
{
selFlux = "*";
}
protected async Task takeSnapshot()
{
@@ -210,9 +227,8 @@ namespace MP.SPEC.Components
// se non ho data rif uso adesso...
DateTime dtMax = selDtMax == null ? RoundDatetime(5) : (DateTime)selDtMax;
DateTime dtMin = selDtMin == null ? RoundDatetime(5).AddHours(-numOreAnticipoSnapshot) : (DateTime)selDtMin;
// aggiungo 2 sec
// aggiungo 15 sec
dtMax = dtMax.AddSeconds(15);
//dtMin = dtMin.AddMinutes(-30);
await MDService.DossiersTakeParamsSnapshotLast(selMacchina, dtMin, dtMax);
lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
// indico snapshot fatto
@@ -226,18 +242,19 @@ namespace MP.SPEC.Components
selDtMax = null;
}
protected async Task toggleUpdate()
protected async Task notLive()
{
liveUpdate = !liveUpdate;
liveUpdate = false;
await Task.Delay(1);
if (!liveUpdate)
{
lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
}
else
{
selDtMax = null;
}
}
protected async Task live()
{
liveUpdate = true;
await Task.Delay(1);
}
#endregion Protected Methods
@@ -247,7 +264,7 @@ namespace MP.SPEC.Components
private static System.Timers.Timer aTimer = new System.Timers.Timer();
private List<string>? ListFlux = null;
private List<string>? ListMacchine = null;
private int numOreAnticipoSnapshot = 5;
private int numOreAnticipoSnapshot { get; set; } = 50;
private bool snapshotDone = false;
#endregion Private Fields
@@ -267,7 +284,7 @@ namespace MP.SPEC.Components
// copio il filtro
var currFilt = SelFilter;
// fermo update
currFilt.LiveUpdate = false;
currFilt.LiveUpdate = (value == null);
currFilt.CurrPage = 0;
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
currFilt.dtMax = value;
+4 -4
View File
@@ -4,13 +4,13 @@
{
#region Public Events
public event Action EA_PageUpdated;
public event Action EA_PageUpdated = null!;
public event Action EA_SearchUpdated;
public event Action EA_SearchUpdated = null!;
public event Action EA_ShowSearch;
public event Action EA_ShowSearch = null!;
public event Action EA_StatoSearch;
public event Action EA_StatoSearch = null!;
#endregion Public Events
+242 -60
View File
@@ -29,10 +29,6 @@ namespace MP.SPEC.Data
_logger.LogInformation("Redis INIT");
// setup canali pub/sub
dataPipe = new MessagePipe(redisConn, Constants.ACT_MSE_DATA_KEY);
blinkPipe = new MessagePipe(redisConn, Constants.ACT_BLINK_KEY);
// conf DB
string connStr = _configuration.GetConnectionString("Mp.Data");
if (string.IsNullOrEmpty(connStr))
@@ -52,15 +48,11 @@ namespace MP.SPEC.Data
public static MP.Data.Controllers.MpSpecController dbController { get; set; } = null!;
public MessagePipe blinkPipe { get; set; } = null!;
/// <summary>
/// Dizionario dei tag configurati per IOB
/// </summary>
public Dictionary<string, List<TagData>> currTagConf { get; set; } = new Dictionary<string, List<TagData>>();
public MessagePipe dataPipe { get; set; } = null!;
#endregion Public Properties
#region Public Methods
@@ -82,7 +74,7 @@ namespace MP.SPEC.Data
else
{
result = await Task.FromResult(dbController.AnagStatiComm());
// serializzp e salvo...
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(redisStatoCom, rawData, getRandTOut(redisLongTimeCache));
stopWatch.Stop();
@@ -100,26 +92,25 @@ namespace MP.SPEC.Data
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string source = "DB";
List<ListValues>? result = new List<ListValues>();
// cerco in redis...
RedisValue rawData = await redisDb.StringGetAsync(redisTipoArt);
if (!string.IsNullOrEmpty($"{rawData}"))
{
result = JsonConvert.DeserializeObject<List<ListValues>>($"{rawData}");
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"AnagTipoArtLV Read from REDIS: {ts.TotalMilliseconds}ms");
source = "REDIS";
}
else
{
result = await Task.FromResult(dbController.AnagTipoArtLV());
// serializzp e salvo...
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(redisTipoArt, rawData, getRandTOut(redisLongTimeCache));
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"AnagTipoArtLV Read from DB: {ts.TotalMilliseconds}ms");
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"AnagTipoArtLV Read from {source}: {ts.TotalMilliseconds}ms");
if (result == null)
{
result = new List<ListValues>();
@@ -148,7 +139,7 @@ namespace MP.SPEC.Data
else
{
result = await Task.FromResult(dbController.ArticleWithDossier());
// serializzp e salvo...
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
}
@@ -169,7 +160,9 @@ namespace MP.SPEC.Data
/// <returns></returns>
public async Task<bool> ArticoliDeleteRecord(AnagArticoli currRec)
{
return await dbController.ArticoliDeleteRecord(currRec);
bool fatto = await dbController.ArticoliDeleteRecord(currRec);
await resetCacheArticoli();
return fatto;
}
/// <summary>
@@ -180,7 +173,33 @@ namespace MP.SPEC.Data
/// <returns></returns>
public async Task<List<AnagArticoli>> ArticoliGetSearch(int numRecord, string azienda, string searchVal)
{
return await Task.FromResult(dbController.ArticoliGetSearch(numRecord, azienda, searchVal));
List<AnagArticoli>? result = new List<AnagArticoli>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
string currKey = $"{redisArtList}:{azienda}";
// cerco in redis dato valore sel macchina...
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<AnagArticoli>>($"{rawData}");
readType = "REDIS";
}
else
{
result = await Task.FromResult(dbController.ArticoliGetSearch(numRecord, azienda, searchVal));
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache / 5));
}
if (result == null)
{
result = new List<AnagArticoli>();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"ArticoliGetSearch | Read from {readType}: {ts.TotalMilliseconds}ms");
return result;
}
/// <summary>
@@ -190,7 +209,9 @@ namespace MP.SPEC.Data
/// <returns></returns>
public async Task<bool> ArticoliUpdateRecord(AnagArticoli currRec)
{
return await dbController.ArticoliUpdateRecord(currRec);
bool fatto = await dbController.ArticoliUpdateRecord(currRec);
await resetCacheArticoli();
return fatto;
}
/// <summary>
@@ -221,7 +242,7 @@ namespace MP.SPEC.Data
{
// cerco in cache se ci sia la tabella con gli articoli impiegati...
string rawTable = redisDb.StringGet(redKeyTabCheckArt);
List<string> artList = new List<string>();
List<string>? artList = new List<string>();
if (!string.IsNullOrEmpty(rawTable))
{
artList = JsonConvert.DeserializeObject<List<string>>(rawTable);
@@ -277,7 +298,7 @@ namespace MP.SPEC.Data
else
{
result = await Task.FromResult(dbController.ConfigGetAll());
// serializzp e salvo...
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(redisConfKey, rawData, getRandTOut(redisLongTimeCache));
stopWatch.Stop();
@@ -321,7 +342,7 @@ namespace MP.SPEC.Data
/// </summary>
/// <param name="selRecord">record dossier da eliminare</param>
/// <returns></returns>
public async Task<bool> DossiersDeleteRecord(Dossiers selRecord)
public async Task<bool> DossiersDeleteRecord(DossierModel selRecord)
{
bool result = false;
Stopwatch stopWatch = new Stopwatch();
@@ -341,33 +362,33 @@ namespace MP.SPEC.Data
/// macchina (ordinato x data registrazione)
/// </summary>
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
/// <param name="DtRef">Data di riferimento (Massima) per estrazione records</param>
/// <param name="MaxRec">numero massimo record da restituire</param>
/// <param name="DtStart">Data minima per estrazione records</param>
/// <param name="DtEnd">Data Massima per estrazione records</param>
/// <returns></returns>
public async Task<List<Dossiers>> DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtRef, int MaxRec)
public async Task<List<DossierModel>> DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtStart, DateTime DtEnd)
{
List<Dossiers>? result = new List<Dossiers>();
List<DossierModel>? result = new List<DossierModel>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
string currKey = $"{redisDossByMac}:{IdxMacchina}:{CodArticolo}:{DtRef}:{MaxRec}";
string currKey = $"{redisDossByMac}:{IdxMacchina}:{CodArticolo}:{DtStart:yyyyMMddHHmm}:{DtEnd:yyyyMMddHHmm}";
// cerco in redis dato valore sel macchina...
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<Dossiers>>($"{rawData}");
result = JsonConvert.DeserializeObject<List<DossierModel>>($"{rawData}");
readType = "REDIS";
}
else
{
result = await Task.FromResult(dbController.DossiersGetLastFilt(IdxMacchina, CodArticolo, DtRef, MaxRec));
// serializzp e salvo...
result = await Task.FromResult(dbController.DossiersGetLastFilt(IdxMacchina, CodArticolo, DtStart, DtEnd));
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache / 5));
}
if (result == null)
{
result = new List<Dossiers>();
result = new List<DossierModel>();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
@@ -375,6 +396,19 @@ namespace MP.SPEC.Data
return result;
}
/// <summary>
/// Inserimento nuovo record dossier
/// </summary>
/// <param name="currDoss"></param>
/// <returns></returns>
public async Task<bool> DossiersInsert(DossierModel currDoss)
{
// aggiorno record sul DB
bool answ = await dbController.DossiersInsert(currDoss);
return answ;
}
/// <summary>
/// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis
/// </summary>
@@ -388,11 +422,10 @@ namespace MP.SPEC.Data
await Task.Delay(1);
// chiamo stored x salvare parametri
dbController.DossiersTakeParamsSnapshot(IdxMacchina, MaxSec, DtRif);
// svuoto cache redis x macchina
string currKey = $"{redisDossByMac}:{IdxMacchina}";
redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1));
currKey = $"{redisDossByMac}:*";
redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1));
// elimino cache redis...
RedisValue pattern = new RedisValue($"{redisDossByMac}:*");
answ = await ExecFlushRedisPattern(pattern);
Log.Info($"Svuotata cache dossier | {pattern}");
return answ;
}
@@ -407,13 +440,26 @@ namespace MP.SPEC.Data
{
bool answ = false;
await Task.Delay(1);
Log.Info($"Richiesta snapshot per macchina {IdxMacchina} | periodo {dtMin} --> {dtMax}");
// chiamo stored x salvare parametri
dbController.DossiersTakeParamsSnapshotLast(IdxMacchina, dtMin, dtMax);
// svuoto cache redis x macchina
string currKey = $"{redisDossByMac}:{IdxMacchina}";
redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1));
currKey = $"{redisDossByMac}:*";
redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1));
// elimino cache redis...
RedisValue pattern = new RedisValue($"{redisDossByMac}:*");
answ = await ExecFlushRedisPattern(pattern);
Log.Info($"Svuotata cache dossier | {pattern}");
return answ;
}
/// <summary>
/// Update valore dossier
/// </summary>
/// <param name="currDoss"></param>
/// <returns></returns>
public async Task<bool> DossiersUpdateValore(DossierModel currDoss)
{
// aggiorno record sul DB
bool answ = await dbController.DossiersUpdateValore(currDoss);
return answ;
}
@@ -455,26 +501,49 @@ namespace MP.SPEC.Data
await Task.Delay(1);
RedisValue pattern = new RedisValue($"{redisBaseAddr}*");
bool answ = await ExecFlushRedisPattern(pattern);
// rileggo vocabolario.,..
ObjVocabolario = VocabolarioGetAll();
return answ;
}
/// <summary>
/// Elenco ultimi n record flux log dato macchina e flusso (ordinato x data registrazione)
/// </summary>
/// <param name="DtMax">Data massima (recupera eventi antecedenti)</param>
/// <param name="DtMax">Data massima x eventi</param>
/// <param name="DtMin">Data minima x eventi</param>
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
/// <param name="CodFlux">*=tutti, altrimenti solo selezionato</param>
/// <param name="MaxRec">numero massimo record da restituire</param>
/// <returns></returns>
public async Task<List<FluxLog>> FluxLogGetLastFilt(DateTime DtMax, string IdxMacchina, string CodFlux, int MaxRec)
public async Task<List<FluxLog>> FluxLogGetLastFilt(DateTime DtMax, DateTime DtMin, string IdxMacchina, string CodFlux, int MaxRec)
{
List<FluxLog>? result = new List<FluxLog>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
var results = await Task.FromResult(dbController.FluxLogGetLastFilt(DtMax, IdxMacchina, CodFlux, MaxRec));
string readType = "DB";
string currKey = $"{redisFluxLogFilt}:{IdxMacchina}:{CodFlux}:{MaxRec}:{DtMax:yyyyMMddHHmm}:{DtMin:yyyyMMddHHmm}";
// cerco in redis dato valore sel macchina...
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<FluxLog>>($"{rawData}");
readType = "REDIS";
}
else
{
result = await Task.FromResult(dbController.FluxLogGetLastFilt(DtMax, DtMin, IdxMacchina, CodFlux, MaxRec));
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(10));
}
if (result == null)
{
result = new List<FluxLog>();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"FluxLogGetLastFilt | Read from DB: {ts.TotalMilliseconds}ms");
return results;
Log.Debug($"FluxLogGetLastFilt | Read from {readType}: {ts.TotalMilliseconds}ms");
return result;
}
/// <summary>
@@ -546,7 +615,33 @@ namespace MP.SPEC.Data
/// <returns></returns>
public async Task<List<PODLModel>> ListPODLFilt(string codArt, string keyRichPart)
{
return await Task.FromResult(dbController.ListPODLFilt(codArt, keyRichPart));
List<PODLModel>? result = new List<PODLModel>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
string currKey = $"{redisPOdlList}:{codArt}:{keyRichPart}";
// cerco in redis dato valore sel macchina...
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<PODLModel>>($"{rawData}");
readType = "REDIS";
}
else
{
result = await Task.FromResult(dbController.ListPODLFilt(codArt, keyRichPart));
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(3));
}
if (result == null)
{
result = new List<PODLModel>();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"ListPODLFilt | Read from {readType}: {ts.TotalMilliseconds}ms");
return result;
}
/// <summary>
@@ -570,7 +665,7 @@ namespace MP.SPEC.Data
else
{
result = await Task.FromResult(dbController.MacchineGetAll());
// serializzp e salvo...
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
}
@@ -585,16 +680,18 @@ namespace MP.SPEC.Data
}
/// <summary>
/// Elenco ID macchine con dati FluxLog gestite
/// Elenco id Macchine che abbiano dati FLuxLog, nel periodo indicato
/// </summary>
/// <param name="dtStart"></param>
/// <param name="dtEnd"></param>
/// <returns></returns>
public async Task<List<string>> MacchineWithFlux()
public async Task<List<string>> MacchineWithFlux(DateTime dtStart, DateTime dtEnd)
{
List<string>? result = new List<string>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
string currKey = redisMacByFlux;
string currKey = $"{redisMacByFlux}:{dtStart:yyyyMMddHHmm}:{dtEnd:yyyyMMddHHmm}";
// cerco in redis dato valore sel macchina...
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue)
@@ -604,8 +701,8 @@ namespace MP.SPEC.Data
}
else
{
result = await dbController.MacchineWithFlux();
// serializzp e salvo...
result = await dbController.MacchineWithFlux(dtStart, dtEnd);
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
}
@@ -671,7 +768,7 @@ namespace MP.SPEC.Data
/// <returns></returns>
public List<string> OdlGetCurrent()
{
List<string> dbResult = new List<string>();
List<string>? dbResult = new List<string>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
@@ -702,7 +799,6 @@ namespace MP.SPEC.Data
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"OdlGetCurrent | Read from {readType}: {ts.TotalMilliseconds}ms");
return dbResult;
}
@@ -728,7 +824,7 @@ namespace MP.SPEC.Data
else
{
result = await Task.FromResult(dbController.ParametriGetFilt(IdxMacchina));
// serializzp e salvo...
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
}
@@ -779,7 +875,12 @@ namespace MP.SPEC.Data
/// <returns></returns>
public async Task<bool> POdlUpdateRecord(PODLModel currRec)
{
return await dbController.PODLUpdateRecord(currRec);
var dbResult = await dbController.PODLUpdateRecord(currRec);
// elimino cache redis...
RedisValue pattern = new RedisValue($"{redisPOdlList}:*");
bool answ = await ExecFlushRedisPattern(pattern);
return dbResult;
}
/// <summary>
@@ -791,7 +892,30 @@ namespace MP.SPEC.Data
return dbController.OdlStart(IdxOdl);
}
public async Task<bool> updateDossierValue(Dossiers currDoss, FluxLogDTO editFL)
/// <summary>
/// Esegue traduzione dato vocabolario da Lingua + Lemma
/// </summary>
/// <param name="lemma"></param>
/// <param name="lingua"></param>
/// <returns></returns>
public string Traduci(string lemma, string lingua)
{
string answ = $"[{lemma}]";
// verifico se ho qualcosa nell'obj vocabolario...
if (ObjVocabolario == null || ObjVocabolario.Count == 0)
{
// inizializzo il vocabolario...
ObjVocabolario = VocabolarioGetAll();
}
var record = ObjVocabolario.Where(x => x.Lingua == lingua && x.Lemma == lemma).FirstOrDefault();
if (record != null)
{
answ = record.Traduzione;
}
return answ;
}
public async Task<bool> updateDossierValue(DossierModel currDoss, FluxLogDTO editFL)
{
bool answ = false;
// recupero intero set valori dossier deserializzando...
@@ -831,6 +955,40 @@ namespace MP.SPEC.Data
return answ;
}
/// <summary>
/// Elenco completo tabella Vocabolario
/// </summary>
/// <returns></returns>
public List<VocabolarioModel> VocabolarioGetAll()
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
List<VocabolarioModel>? result = new List<VocabolarioModel>();
string source = "REDIS";
// cerco in redis...
RedisValue rawData = redisDb.StringGet(redisVocabolario);
if (!string.IsNullOrEmpty($"{rawData}"))
{
result = JsonConvert.DeserializeObject<List<VocabolarioModel>>($"{rawData}");
}
else
{
result = dbController.VocabolarioGetAll();
// serializzo e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(redisVocabolario, rawData, getRandTOut(redisLongTimeCache / 5));
source = "DB";
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"VocabolarioGetAll Read from {source}: {ts.TotalMilliseconds}ms");
if (result == null)
{
result = new List<VocabolarioModel>();
}
return result;
}
#endregion Public Methods
#region Protected Fields
@@ -857,6 +1015,9 @@ namespace MP.SPEC.Data
#region Private Fields
private const string redisArtByDossier = redisBaseAddr + "SPEC:Cache:ArtByDossier";
private const string redisArtList = redisBaseAddr + "SPEC:Cache:ArtList";
private const string redisBaseAddr = "MP:";
private const string redisConfKey = redisBaseAddr + "SPEC:Cache:Config";
@@ -864,21 +1025,34 @@ namespace MP.SPEC.Data
private const string redisDossByMac = redisBaseAddr + "SPEC:Cache:DossByMac";
private const string redisFluxByMac = redisBaseAddr + "SPEC:Cache:FluxByMac";
private const string redisOdlCurrByMac = redisBaseAddr + "SPEC:Cache:OdlByMac";
private const string redisFluxLogFilt = redisBaseAddr + "SPEC:Cache:FluxLogFilt";
private const string redisMacByFlux = redisBaseAddr + "SPEC:Cache:MacByFlux";
private const string redisMacList = redisBaseAddr + "SPEC:Cache:MacList";
private const string redisOdlCurrByMac = redisBaseAddr + "SPEC:Cache:OdlByMac";
private const string redisPOdlList = redisBaseAddr + "SPEC:Cache:POdlList";
private const string redisStatoCom = redisBaseAddr + "SPEC:Cache:StatoCom";
private const string redisTipoArt = redisBaseAddr + "SPEC:Cache:TipoArt";
private const string redisVocabolario = redisBaseAddr + "SPEC:Cache:Vocabolario";
private static IConfiguration _configuration = null!;
private static ILogger<MpDataService> _logger = null!;
private static Logger Log = LogManager.GetCurrentClassLogger();
/// <summary>
/// Oggetto vocabolario x uso continuo traduzione
/// </summary>
private List<VocabolarioModel> ObjVocabolario = new List<VocabolarioModel>();
/// <summary>
/// Oggetto per connessione a REDIS
/// </summary>
@@ -929,6 +1103,14 @@ namespace MP.SPEC.Data
return answ;
}
private async Task resetCacheArticoli()
{
RedisValue pattern = new RedisValue($"{redisArtByDossier}:*");
await ExecFlushRedisPattern(pattern);
pattern = new RedisValue($"{redisArtList}:*");
await ExecFlushRedisPattern(pattern);
}
#endregion Private Methods
}
}
+74
View File
@@ -0,0 +1,74 @@
namespace MP.SPEC.Data
{
public class SelectArticoliParams
{
#region Public Constructors
public SelectArticoliParams()
{ }
#endregion Public Constructors
#region Public Properties
public int CurrPage { get; set; } = 1;
public string IdxMacchina { get; set; } = "*";
public string Azienda { get; set; } = "*";
public int MaxRecord { get; set; } = 100;
public int NumRec { get; set; } = 10;
public int TotCount { get; set; } = 0;
#endregion Public Properties
#region Public Methods
public SelectArticoliParams clone()
{
SelectArticoliParams clonedData = new SelectArticoliParams()
{
CurrPage = this.CurrPage,
IdxMacchina = this.IdxMacchina,
Azienda = this.Azienda,
MaxRecord = this.MaxRecord,
NumRec = this.NumRec,
TotCount = this.TotCount
};
return clonedData;
}
public override bool Equals(object obj)
{
if (!(obj is SelectArticoliParams item))
return false;
if (MaxRecord != item.MaxRecord)
return false;
if (NumRec != item.NumRec)
return false;
if (TotCount != item.TotCount)
return false;
if (CurrPage != item.CurrPage)
return false;
if (IdxMacchina != item.IdxMacchina)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
#endregion Public Methods
}
}
+29 -17
View File
@@ -1,4 +1,6 @@
namespace MP.SPEC.Data
using MP.Data;
namespace MP.SPEC.Data
{
public class SelectDossierParams
{
@@ -13,29 +15,35 @@
public int CurrPage { get; set; } = 1;
public DateTime DtRef { get; set; } = InitDatetime(5);
public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 15);
public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 15).AddDays(-730);
public string IdxMacchina { get; set; } = "*";
public string CodArticolo { get; set; } = "*";
public int NumRec { get; set; } = 10;
public int TotCount { get; set; } = 0;
public int MaxRecord { get; set; } = 100;
public bool isEditing { get; set; } = false;
#endregion Public Properties
#region Public Methods
/// <summary>
/// Inizializzazione con periodo e arrotondamento
/// </summary>
/// <param name="minRound"></param>
/// <returns></returns>
public static DateTime InitDatetime(int minRound)
public SelectDossierParams clone()
{
TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today);
int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound;
DateTime endRounded = DateTime.Today.AddMinutes(minDay);
return endRounded;
SelectDossierParams clonedData = new SelectDossierParams()
{
DtEnd = this.DtEnd,
DtStart = this.DtStart,
CurrPage = this.CurrPage,
IdxMacchina = this.IdxMacchina,
CodArticolo = this.CodArticolo,
MaxRecord = this.MaxRecord,
NumRec = this.NumRec,
TotCount = this.TotCount
};
return clonedData;
}
public override bool Equals(object obj)
@@ -52,14 +60,18 @@
if (MaxRecord != item.MaxRecord)
return false;
if (DtRef != item.DtRef)
if (TotCount != item.TotCount)
return false;
if (NumRec != item.NumRec)
return false;
if (DtEnd != item.DtEnd)
return false;
if (CurrPage != item.CurrPage)
return false;
//if (lastUpdate != item.lastUpdate)
// return false;
return true;
}
+27 -2
View File
@@ -19,14 +19,33 @@
public string IdxMacchina { get; set; } = "*";
public string lastUpdate { get; set; } = "-";
public bool LiveUpdate { get; set; } = true;
public int NumRec { get; set; } = 10;
public int MaxRecord { get; set; } = 100;
public int TempoAgg { get; set; } = 10000;
public int TotCount { get; set; } = 0;
#endregion Public Properties
#region Public Methods
public SelectFluxParams clone()
{
SelectFluxParams clonedData = new SelectFluxParams()
{
CodFlux = this.CodFlux,
CurrPage = this.CurrPage,
dtRif = this.dtRif,
dtMax = this.dtMax,
dtMin = this.dtMin,
IdxMacchina = this.IdxMacchina,
lastUpdate = this.lastUpdate,
LiveUpdate = this.LiveUpdate,
NumRec = this.NumRec,
MaxRecord = this.MaxRecord,
TotCount = this.TotCount,
TempoAgg = this.TempoAgg
};
return clonedData;
}
public override bool Equals(object obj)
{
if (!(obj is SelectFluxParams item))
@@ -46,6 +65,12 @@
if (TempoAgg != item.TempoAgg)
return false;
if (NumRec!= item.NumRec)
return false;
if (TotCount!= item.TotCount)
return false;
if (CurrPage != item.CurrPage)
return false;
+1 -1
View File
@@ -19,7 +19,7 @@ namespace MP.SPEC.Data
public int NumRec { get; set; } = 10;
public int TotCount { get; set; } = 0;
public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5);
public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-7);
public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-10);
public int MaxRecord { get; set; } = 100;
public bool IsActive { get; set; } = true;
public string SearchVal { get; set; } = "*";
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2210.1817</Version>
<Version>6.16.2211.417</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -39,7 +39,7 @@
Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f"
<logger name="*" minlevel="Debug" writeTo="f" />
-->
<logger name="*" minlevel="Debug" writeTo="consoleTarget" />
<logger name="*" minlevel="Trace" writeTo="consoleTarget" />
<!--<logger name="Microsoft.*" maxlevel="Info" final="true" />-->
<logger name="*" minlevel="Info" writeTo="fileTarget" />
</rules>
+28 -20
View File
@@ -40,33 +40,21 @@
<div class="card-body">
<div class="row">
<div class="col-4">
<div class="col-3">
<div class="input-group">
<span class="input-group-text">Codice</span>
<input type="text" class="form-control" placeholder="Articolo" @bind-value="@currRecord.CodArticolo">
</div>
</div>
<div class="col-4">
<div class="col-5">
<div class="input-group">
<span class="input-group-text">Disegno</span>
<input type="text" class="form-control" placeholder="Disegno" @bind-value="@currRecord.Disegno">
</div>
</div>
<div class="col-1">
<div class="input-group" title="Tipo">
<select @bind="@currRecord.Tipo" class="form-select text-end">
@if (ListTipoArt != null)
{
foreach (var item in ListTipoArt)
{
<option value="@item.value">@item.label</option>
}
}
</select>
</div>
</div>
<div class="col-3">
<div class="col-4">
<div class="input-group" title="Azienda">
<span class="input-group-text">Azienda</span>
<select @bind="@currRecord.Azienda" class="form-select text-end">
@if (ListAziende != null)
{
@@ -81,8 +69,25 @@
</div>
</div>
<div class="row mt-2">
<div class="col-8">
<input type="text" class="form-control" placeholder="Descrizione Articolo" @bind-value="@currRecord.DescArticolo">
<div class="col-3">
<div class="input-group" title="Tipo">
<span class="input-group-text">Tipo</span>
<select @bind="@currRecord.Tipo" class="form-select text-end">
@if (ListTipoArt != null)
{
foreach (var item in ListTipoArt)
{
<option value="@item.value">@item.label</option>
}
}
</select>
</div>
</div>
<div class="col-5">
<div class="input-group">
<span class="input-group-text">Descrizione</span>
<input type="text" class="form-control" placeholder="Descrizione Articolo" @bind-value="@currRecord.DescArticolo">
</div>
</div>
<div class="col-2">
<div class="d-grid gap-2">
@@ -120,7 +125,10 @@
<thead>
<tr>
<th>
<button @onclick="() => resetSel()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
@if (currRecord != null)
{
<button @onclick="() => resetSel()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
}
</th>
<th><i class="fa-solid fa-file"></i> Articolo</th>
<th><i class="fa-solid fa-compass-drafting"></i> Disegno</th>
@@ -136,7 +144,7 @@
<tr class="@checkSelect(@record.CodArticolo)">
<td>
<button @onclick="() => selRecord(record)" class="btn btn-primary btn-sm" title="Modifica Record"><i class="bi bi-pencil-square"></i></button>
<button @onclick="() => cloneRecord(record)" class="btn btn-info btn-sm" title="Duplica Record"><i class="bi bi-clipboard-check"></i></button>
<button @onclick="() => cloneRecord(record)" class="btn btn-info btn-sm" title="Duplica Record"><i class="bi bi-clipboard-check"></i></button>
</td>
<td>
<div>@record.CodArticolo</div>
+7 -12
View File
@@ -24,9 +24,10 @@ namespace MP.SPEC.Pages
return answ;
}
private SelectArticoliParams currFilter = new SelectArticoliParams();
public void Dispose()
{
MessageService.EA_SearchUpdated -= OnSeachUpdated;
currRecord = null;
ListTipoArt = null;
ListAziende = null;
@@ -56,10 +57,7 @@ namespace MP.SPEC.Pages
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MessageService { get; set; } = null!;
[Inject]
protected NavigationManager NavManager { get; set; }
protected NavigationManager NavManager { get; set; } = null!;
protected int totalCount
{
@@ -131,9 +129,6 @@ namespace MP.SPEC.Pages
protected override async Task OnInitializedAsync()
{
numRecord = 10;
// mostro ricerca
MessageService.ShowSearch = true;
MessageService.EA_SearchUpdated += OnSeachUpdated;
configData = await MDService.ConfigGetAll();
var currRec = configData.FirstOrDefault(x => x.Chiave == "AZIENDA");
if (currRec != null)
@@ -172,14 +167,14 @@ namespace MP.SPEC.Pages
{
Azienda = selRec.Azienda,
CodArticolo = selRec.CodArticolo,
DescArticolo = $"CLONE - { selRec.DescArticolo }",
DescArticolo = $"CLONE - {selRec.DescArticolo}",
Disegno = selRec.Disegno,
Tipo=selRec.Tipo
Tipo = selRec.Tipo
};
currRecord = newRec;
await Task.Delay(1);
}
protected async Task update(AnagArticoli selRec)
{
@@ -294,7 +289,7 @@ namespace MP.SPEC.Pages
private async Task reloadData()
{
isLoading = true;
SearchRecords = await MDService.ArticoliGetSearch(100000, selAzienda, MessageService.SearchVal);
SearchRecords = await MDService.ArticoliGetSearch(100000, selAzienda, "");
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
isLoading = false;
}
+71
View File
@@ -0,0 +1,71 @@
@page "/Contacts"
@using MP.SPEC.Data
@inject MessageService AppMService
<div class="row mx-2">
<div class="col-12 col-lg-8 offset-lg-2">
<div class="card">
<div class="card-header text-center">
<div class="row">
<div class="col-4"></div>
<div class="col-4">
<h2>@Titolo</h2>
</div>
<div class="col-4">
<div class="badge rounded-pill bg-dark px-4 py-2">
<div class="px-1">
<a class="btn text-light text-decoration-none" href="https://www.egalware.com/" target="_blank">powered by&nbsp;EgalWare <img width="24" class="img-fluid" src="images/LogoEgw.png" /></a>
</div>
</div>
</div>
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-3"></div>
<div class="col-12 col-lg-6 py-3">
<img src="images/LogoMapoFull.png" class="img-fluid" />
</div>
<div class="col-lg-3"></div>
<div class="col-12">
<h4 class="card-title">@Messaggio</h4>
</div>
<div class="col-sm-4">
<h4>Sede Operativa</h4>
<address>
<strong>EgalWare s.r.l.</strong><br />
via Nazionale, 93<br />
24068 Seriate - BG<br />
<abbr title="Phone">P:</abbr>
035.290178<br />
<abbr title="Phone">P:</abbr>
035.460560
</address>
</div>
<div class="col-sm-4">
<h4>Sede Legale</h4>
<address>
<strong>EgalWare s.r.l.</strong><br />
via Nazionale, 93<br />
24068 Seriate - BG<br />
<br />
<abbr title="P.Iva">VAT:</abbr>03985390164
</address>
</div>
<div class="col-sm-4">
<h4>Supporto</h4>
<address>
<strong>Web:</strong><br />
Accedi al supporto dal <a href="https://support.egalware.com/" target="_blank">nostro sito web</a><br />
<br />
<strong>Email:</strong><br />
Scrivi un email a <a href="mailto:info@egalware.com">info at egalware.com</a>
</address>
</div>
</div>
</div>
</div>
</div>
</div>
+32
View File
@@ -0,0 +1,32 @@
namespace MP.SPEC.Pages
{
public partial class Contacts : IDisposable
{
#region Public Methods
public void Dispose()
{
GC.Collect();
}
#endregion Public Methods
#region Protected Fields
protected string Messaggio = "";
protected string Titolo = "";
#endregion Protected Fields
#region Protected Methods
protected override void OnInitialized()
{
Titolo = "MP SPEC";
Messaggio = "I nostri contattatti e siti di supporto";
AppMService.ShowSearch = false;
}
#endregion Protected Methods
}
}
+9 -65
View File
@@ -21,72 +21,16 @@
</div>
</div>
<div class="card-body">
@if (currDetFluxLogRecord != null)
@if (isLoading)
{
<div class="row">
<div class="col-12">
<div class="card mb-5">
<div class="card-header bg-primary text-light">Modifica Parametro</div>
<div class="card-body">
<div class="row">
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">MACCHINA</span>
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currDetFluxLogRecord.IdxMacchina">
</div>
</div>
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">DATA</span>
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currDetFluxLogRecord.dtEvento">
</div>
</div>
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">DATA TYPE</span>
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currDetFluxLogRecord.CodFlux">
</div>
</div>
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">VALORE</span>
<input type="text" class="form-control" aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currDetFluxLogRecord.ValoreEdit">
</div>
</div>
</div>
<div class="row pt-4">
<div class="col-3 pe-0">
</div>
<div class="col-3 pe-0">
</div>
<div class="col-3 pe-0">
<div class="d-grid gap-2">
<button @onclick="() => cancel()" class="btn btn-warning">Annulla <i class="bi bi-x-circle"></i></button>
</div>
</div>
<div class="col-3 pe-0">
<div class="d-grid gap-2">
<button @onclick="() => update(currDetFluxLogRecord)" class="btn btn-success">Save <i class="bi bi-save"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<LoadingData></LoadingData>
}
else
{
<ListDossiers SelFilter="@currFilter" RecordSel="@selRecordDoss" TotRecordChanged="updateTotal"></ListDossiers>
}
</div>
@if (isLoading)
{
<LoadingData></LoadingData>
}
else
{
<ListDossiers SelFilter="@currFilter" RecordSel="@selRecordDoss" RecordSelFlux="@selRecordFlux" TotRecordChanged="updateTotal"></ListDossiers>
}
<div class="card-footer py-1">
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
</div>
</div>
<div class="card-footer py-1">
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
</div>
+44 -54
View File
@@ -1,7 +1,6 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using MP.SPEC.Components;
using MP.SPEC.Data;
@@ -11,7 +10,7 @@ namespace MP.SPEC.Pages
{
#region Protected Fields
protected DataPager pagerODL = null!;
protected DataPager? pagerODL = null!;
#endregion Protected Fields
@@ -23,19 +22,10 @@ namespace MP.SPEC.Pages
[Inject]
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MsgService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected async Task cancel()
{
currDetFluxLogRecord = null;
await Task.Delay(1);
}
protected void ForceReload(int newNum)
{
numRecord = newNum;
@@ -51,9 +41,6 @@ namespace MP.SPEC.Pages
{
isLoading = true;
isFiltering = true;
// disabilito ricerca...
MsgService.SearchVal = "";
MsgService.ShowSearch = false;
// fix pagina
await Task.Delay(1);
var modFilter = currFilter;
@@ -63,78 +50,81 @@ namespace MP.SPEC.Pages
isFiltering = false;
}
protected async Task selRecordDoss(Dossiers selDoss)
protected async Task selRecordDoss(DossierModel selDoss)
{
currRecordDoss = selDoss;
await Task.Delay(1);
}
protected async Task selRecordFlux(FluxLogDTO selRec)
{
currDetFluxLogRecord = selRec;
await Task.Delay(1);
}
protected async Task update(FluxLogDTO selRec)
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler salvare le modifiche? queste saranno parte del dossier inviato all'impianto"))
return;
await Task.Delay(1);
if (currRecordDoss != null)
{
// METODO PER UPDATE FLUX
await MDService.updateDossierValue(currRecordDoss, selRec);
}
currDetFluxLogRecord = null;
await Task.Delay(1);
}
protected void updateTotal(int newTotCount)
{
totalCount = newTotCount;
}
protected void UpdateTotCount(int newTotCount)
{
totalCount = newTotCount;
}
#endregion Protected Methods
#region Private Fields
private FluxLogDTO? _currDetFluxLogRecord = null;
#endregion Private Fields
#region Private Properties
private FluxLogDTO? currDetFluxLogRecord
{
get => _currDetFluxLogRecord;
set { _currDetFluxLogRecord = value; }
}
private SelectDossierParams currFilter { get; set; } = new SelectDossierParams();
private int currPage
{
get => MsgService.currPage;
set => MsgService.currPage = value;
get => currFilter.CurrPage;
set => currFilter.CurrPage = value;
}
private DossierModel? currRecordDoss { get; set; } = null;
private bool isEditing
{
get => currFilter.isEditing;
set => currFilter.isEditing = value;
}
private Dossiers? currRecordDoss { get; set; } = null;
private bool isFiltering { get; set; } = false;
private bool isLoading { get; set; } = true;
private int numRecord
{
get => MsgService.numRecord;
set => MsgService.numRecord = value;
get => currFilter.NumRec;
set => currFilter.NumRec = value;
}
private int totalCount { get; set; } = 0;
private int totalCount
{
get => currFilter.TotCount;
set => currFilter.TotCount = value;
}
#endregion Private Properties
#region Private Methods
private string css()
{
string answ = "";
if (isEditing == false)
{
answ = "hidden";
}
else
{
answ = "visible";
}
return answ;
}
private void enableEditing()
{
isEditing = true;
}
private async Task updateFilter(SelectDossierParams newParams)
{
isFiltering = false;
+1 -1
View File
@@ -11,7 +11,7 @@
<div class="p-2 align-content-center fs-1">
<b>MAPO SPEC</b>
</div>
<div class="p-2 bg-light">
<div class="p-2">
<img src="images/LogoEgw.png" class="image-fluid" height="64" />
</div>
</div>
+1 -1
View File
@@ -18,7 +18,7 @@ namespace MP.SPEC.Pages
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MessageService { get; set; }
protected MessageService MessageService { get; set; } = null!;
#endregion Protected Properties
+21 -3
View File
@@ -20,9 +20,27 @@
</div>
</div>
<div class="d-flex justify-content-end">
<a class="pt-2 text-dark" data-bs-toggle="offcanvas" data-bs-target="#paramsFilterExample" aria-controls="paramsFilterExample" @onclick="setDtMax">
<i class="fa-solid fa-bars"></i>
</a>
<div class="d-flex justify-content-between">
@if (filtActive)
{
<div class=" rounded small d-flex justify-content-between" title="Filtri attivi">
@*<i class="fas fa-exclamation text-warning"></i>*@
@if (selMacchina != "*")
{
<button class="btn btn-outline-primary btn-sm mx-2" @onclick="()=>resetMacchina()" title="Rimuovi Filtro Impianto"><i class="fa-solid fa-hard-drive"></i> &nbsp <i class="fa-solid fa-xmark text-warning"></i></button>
}
@if (selStato != "*")
{
<button class="btn btn-outline-primary btn-sm mx-2" @onclick="()=>resetFase()" title="Rimuovi Filtro Parametro"><i class="fa-solid fa-sliders"></i> &nbsp <i class="fa-solid fa-xmark text-warning"></i></button>
}
</div>
}
<div class="p-2">
<a class="pt-2 text-dark" data-bs-toggle="offcanvas" data-bs-target="#paramsFilterExample" aria-controls="paramsFilterExample" @onclick="setDtMax">
<i class="fa-solid fa-bars"></i>
</a>
</div>
</div>
<div class="offcanvas offcanvas-end" tabindex="-1" id="paramsFilterExample" aria-labelledby="paramsFilterExampleLabel">
<div class="offcanvas-header">
<h3 class="offcanvas-title" id="paramsFilterExampleLabel"><b>FILTRI</b></h3>
+20 -4
View File
@@ -26,7 +26,7 @@ namespace MP.SPEC.Pages
#region Protected Fields
protected DataPager pagerODL = null!;
protected DataPager? pagerODL = null!;
#endregion Protected Fields
@@ -71,7 +71,19 @@ namespace MP.SPEC.Pages
#endregion Protected Properties
#region Protected Methods
private bool filtActive
{
get => selMacchina != "*" || selStato != "*";
}
protected void resetMacchina()
{
selMacchina = "*";
}
protected void resetFase()
{
selStato = "*";
}
protected void ForceReload(int newNum)
{
numRecord = newNum;
@@ -85,14 +97,18 @@ namespace MP.SPEC.Pages
protected override async Task OnInitializedAsync()
{
ListStati = await MDService.AnagStatiComm();
ListMacchine = await MDService.MacchineWithFlux();
ListMacchine = await MDService.MacchineWithFlux(currFilter.DtStart, currFilter.DtEnd);
}
protected async Task pgResetReq(bool doReset)
{
if (doReset)
{
await pagerODL.resetCurrPage();
await Task.Delay(1);
if (pagerODL != null)
{
pagerODL.resetCurrPage();
}
}
}
@@ -100,7 +116,7 @@ namespace MP.SPEC.Pages
{
// copio il filtro
currFilter.DtEnd = RoundDatetime(5);
currFilter.DtStart = RoundDatetime(5).AddDays(-1);
currFilter.DtStart = RoundDatetime(5).AddDays(-10);
}
protected void UpdateTotCount(int newTotCount)
+1 -3
View File
@@ -25,12 +25,10 @@
}
else
{
<ListPARAMS SelFilter="@currFilter" TotRecordChanged="@updateTotal" RecordSel="@detailSel"></ListPARAMS>
<ListPARAMS SelFilter="@currFilter" TotRecordChanged="@UpdateTotCount" RecordSel="@detailSel"></ListPARAMS>
}
</div>
<div class="card-footer py-1">
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
</div>
</div>
+18 -15
View File
@@ -9,14 +9,12 @@ namespace MP.SPEC.Pages
{
#region Protected Fields
protected DataPager pagerODL = null!;
protected DataPager? pagerODL = null!;
#endregion Protected Fields
#region Protected Properties
[Inject]
protected MessageService MsgService { get; set; } = null!;
#endregion Protected Properties
@@ -32,7 +30,8 @@ namespace MP.SPEC.Pages
currPage = newNum;
DateTime adesso = DateTime.Now.AddSeconds(1);
var updFilter = currFilter;
updFilter.LiveUpdate = (currPage == 1);
//updFilter.LiveUpdate = (currPage == 1);
updFilter.LiveUpdate = (currFilter.CurrPage == 1);
updFilter.lastUpdate = updFilter.LiveUpdate ? "-" : $"{adesso:yyyy/MM/dd HH:mm:ss}";
// salvo filtro
currFilter = updFilter;
@@ -43,9 +42,6 @@ namespace MP.SPEC.Pages
{
isLoading = true;
isFiltering = true;
// disabilito ricerca...
MsgService.SearchVal = "";
MsgService.ShowSearch = false;
// fix pagina
await Task.Delay(1);
var modFilter = currFilter;
@@ -60,7 +56,11 @@ namespace MP.SPEC.Pages
{
if (doReset)
{
await pagerODL.resetCurrPage();
await Task.Delay(1);
if (pagerODL != null)
{
pagerODL.resetCurrPage();
}
}
}
@@ -100,8 +100,8 @@ namespace MP.SPEC.Pages
private int currPage
{
get => MsgService.currPage;
set => MsgService.currPage = value;
get => currFilter.CurrPage;
set => currFilter.CurrPage = value;
}
private bool isFiltering { get; set; } = false;
@@ -109,8 +109,8 @@ namespace MP.SPEC.Pages
private int numRecord
{
get => MsgService.numRecord;
set => MsgService.numRecord = value;
get => currFilter.NumRec;
set => currFilter.NumRec = value;
}
private int totalCount { get; set; } = 0;
@@ -128,18 +128,21 @@ namespace MP.SPEC.Pages
if (newParams.CurrPage == 0)
{
newParams.CurrPage = 1;
newParams.LiveUpdate = false;
//newParams.LiveUpdate = false;
}
else
{
newParams.LiveUpdate = (currPage == 1);
//newParams.LiveUpdate = (currPage == 1);
}
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
currFilter = newParams;
isLoading = false;
}
protected void UpdateTotCount(int newTotCount)
{
totalCount = newTotCount;
}
#endregion Private Methods
}
}
+17 -9
View File
@@ -12,7 +12,7 @@
<div class="px-2">
@if (addEnabled)
{
<button class="btn btn-success" @onclick="() => reqNewPODL()">@btnNewText <i class="bi bi-plus-square"></i></button>
<button class="btn btn-success" @onclick="() => reqNewPODL()">Nuovo PODL <i class="bi bi-plus-square"></i></button>
}
</div>
</div>
@@ -21,19 +21,20 @@
<div class="input-group input-group-sm">
@*<label class="input-group-text" for="maxRecord" title="Selezionare l'azienda da visualizzare"><i class="fa-solid fa-industry"></i></label>
<select @bind="@currAzienda" class="form-select" title="Selezionare l'azienda da visualizzare">
@if (ListAziende != null)
{
foreach (var item in ListAziende)
{
<option value="@item.CodGruppo">@item.DescrGruppo</option>
}
}
@if (ListAziende != null)
{
foreach (var item in ListAziende)
{
<option value="@item.CodGruppo">@item.DescrGruppo</option>
}
}
</select>*@
<label class="input-group-text" for="maxRecord" title="Selezionare la fase da visualizzare"><i class="fa-solid fa-screwdriver-wrench"></i></label>
<select @bind="@currFase" class="form-select" title="Selezionare la fase da visualizzare">
<option value="*">--- Tutti ---</option>
@if (ListStati != null)
{
foreach (var item in ListStati)
{
<option value="@item.value">@item.label</option>
@@ -126,7 +127,14 @@
{
foreach (var item in ListMacchine)
{
<option value="@item.IdxMacchina">@item.IdxMacchina | @item.Descrizione</option>
if (selectFirst(item.IdxMacchina) == true)
{
<option selected value="@item.IdxMacchina">@item.IdxMacchina | @item.Descrizione</option>
}
else
{
<option value="@item.IdxMacchina">@item.IdxMacchina | @item.Descrizione</option>
}
}
}
</select>
+44 -15
View File
@@ -4,6 +4,7 @@ using MP.Data.DatabaseModels;
using MP.SPEC.Components;
using MP.SPEC.Data;
using MP.SPEC.Services;
using NLog;
namespace MP.SPEC.Pages
{
@@ -86,7 +87,8 @@ namespace MP.SPEC.Pages
{
if (doReset)
{
await pagerODL.resetCurrPage();
await Task.Delay(1);
pagerODL.resetCurrPage();
}
}
@@ -150,6 +152,9 @@ namespace MP.SPEC.Pages
await callSyncDb(selRec);
currRecord = null;
await reloadData();
// forzo update parametri
await Task.Delay(1);
currFase = "*";
await Task.Delay(1);
}
@@ -162,6 +167,7 @@ namespace MP.SPEC.Pages
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
private PODLModel? _currRecord = null;
private List<AnagArticoli>? ListArticoli;
private List<AnagGruppi>? ListAziende;
@@ -198,6 +204,22 @@ namespace MP.SPEC.Pages
}
}
private bool selectFirst(string idxMacchina)
{
string firstMacchina="";
bool answ = false;
if (ListMacchine != null)
{
var rawData = ListMacchine.Select(x => x.IdxMacchina).FirstOrDefault();
firstMacchina = rawData != null ? rawData : "";
}
if (firstMacchina == idxMacchina)
{
answ = true;
}
return answ;
}
private string btnNewText
{
get => currArticolo == "" ? "Sel Articolo" : "Nuovo PODL";
@@ -223,6 +245,19 @@ namespace MP.SPEC.Pages
}
}
private string currFase
{
get => currFilter.CodFase;
set
{
if (!currFilter.CodFase.Equals(value))
{
currFilter.CodFase = value;
currPage = 1;
}
}
}
private SelectPOdlParams currFilter { get; set; } = new SelectPOdlParams();
private int currPage
@@ -249,19 +284,6 @@ namespace MP.SPEC.Pages
set => currFilter.NumRec = value;
}
private string currFase
{
get => currFilter.CodFase;
set
{
if (!currFilter.CodFase.Equals(value))
{
currFilter.CodFase = value;
currPage = 1;
}
}
}
private int totalCount
{
get => currFilter.TotCount;
@@ -282,7 +304,14 @@ namespace MP.SPEC.Pages
// chiamo aggiunta task SyncDb...
string idxMacc = selRec.IdxMacchina;
string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName=syncDbData&taskVal=";
var response = await MpIoApiCall.callMpIoUrlGet(restUrl);
try
{
var response = await MpIoApiCall.callMpIoUrlGet(restUrl);
}
catch (Exception exc)
{
Log.Error($"Errore durante chiamata: {Environment.NewLine}{exc}");
}
}
private async Task reloadData()
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2210.1817</h4>
<h4>Versione: 6.16.2211.417</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2210.1817
6.16.2211.417
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2210.1817</version>
<version>6.16.2211.417</version>
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+7
View File
@@ -1,5 +1,6 @@
using Microsoft.Extensions.Configuration;
using MP.SPEC.Data;
using NLog;
using System.Text.Json;
namespace MP.SPEC.Services
@@ -18,6 +19,9 @@ namespace MP.SPEC.Services
private static IConfiguration _configuration = null!;
private static Logger Log = LogManager.GetCurrentClassLogger();
private static string MpIoBaseUrl = "";
public IOApiService(IHttpClientFactory clientFactory, IConfiguration configuration, ILogger<MpDataService> logger)
@@ -40,15 +44,18 @@ namespace MP.SPEC.Services
var request = new HttpRequestMessage(HttpMethod.Get, $"{MpIoBaseUrl}{relUrl}");
request.Headers.Add("Accept", "application/vnd.github.v3+json");
var client = _clientFactory.CreateClient();
Log.Info($"Richiesta call per {MpIoBaseUrl}{relUrl}");
var response = await client.SendAsync(request);
if (response.IsSuccessStatusCode)
{
var stringResponse = await response.Content.ReadAsStringAsync();
result = stringResponse;
Log.Info($"Richiesta call per {MpIoBaseUrl}{relUrl}");
}
else
{
result = "NO";
Log.Error($"Errore in chaimata | code {response.StatusCode} | {response.Content}");
}
return result;
}
+1
View File
@@ -38,6 +38,7 @@
{
foreach (var item in ElencoLink)
{
<div class="nav-item px-2 col-12">
<NavLink class="nav-link px-2" href="@item.NavigateUrl">
<div class="col-2">
+6
View File
@@ -5,5 +5,11 @@
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ServerConf": {
"maxAge": "2000",
"cacheCheckArtUsato": 2,
"redisLongTimeCache": 15,
"MpIoBaseUrl": "https://iis01.egalware.com/MP/IO/"
}
}
+15
View File
@@ -0,0 +1,15 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ServerConf": {
"maxAge": "2000",
"cacheCheckArtUsato": 2,
"redisLongTimeCache": 15,
"MpIoBaseUrl": "http://localhost/MP/IO/"
}
}
+2 -2
View File
@@ -14,8 +14,8 @@
},
"ServerConf": {
"maxAge": "2000",
"cacheCheckArtUsato": 2,
"redisLongTimeCache": 15,
"cacheCheckArtUsato": "2",
"redisLongTimeCache": "15",
"MpIoBaseUrl": "http://localhost:20967/"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

+4 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>MP.Stats</RootNamespace>
<UserSecretsId>826e877c-ba70-4253-84cb-d0b1cafd4440</UserSecretsId>
<Version>6.16.2210.1708</Version>
<Version>6.16.2210.2110</Version>
</PropertyGroup>
<ItemGroup>
@@ -203,6 +203,9 @@
<None Update="logs\.placeholder">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="post-build.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="temp\.placeholder">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo statistiche MAPO</i>
<h4>Versione: 6.16.2210.1708</h4>
<h4>Versione: 6.16.2210.2110</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
6.16.2210.1708
6.16.2210.2110
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2210.1708</version>
<version>6.16.2210.2110</version>
<url>https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/MP.Stats.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>