Compare commits
70 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1cae70c244 | |||
| 18ee183b05 | |||
| d88c4cc2bd | |||
| 67922520b8 | |||
| c5b5b54586 | |||
| ae3864a614 | |||
| f878f1c496 | |||
| d453c1d944 | |||
| 921bf52659 | |||
| e948ae31af | |||
| b344180da2 | |||
| 4b885d780c | |||
| 01e181a4fc | |||
| 56f342a488 | |||
| ed72bdfa24 | |||
| 5e6924f0fe | |||
| cae7e50cbd | |||
| e769227bb3 | |||
| 60f757965e | |||
| 603ed3782f | |||
| 71177e04c7 | |||
| 1a211ebca5 | |||
| 591b66b52d | |||
| 96f4bb3b4c | |||
| f1c295993c | |||
| a293ce825e | |||
| e3b67ee6c0 | |||
| 0c5e41826e | |||
| 0d4e1aed88 | |||
| 93f4f09b85 | |||
| aebae6b406 | |||
| a2bf5f4a8b | |||
| 759373b5a4 | |||
| 0ea3ee6341 | |||
| a0ffe1bc6c | |||
| 6e75f590bb | |||
| 12473b5088 | |||
| f6406f833f | |||
| a21cd16362 | |||
| d659afacc2 | |||
| 56c3ba4064 | |||
| 8d0292d789 | |||
| 419863a684 | |||
| f56a7e5164 | |||
| 0cf6ecd38f | |||
| 094ce0d181 | |||
| b4de1c9880 | |||
| 67f0f74fbe | |||
| d00b4bbb8b | |||
| dd63bb292d | |||
| 57bc790074 | |||
| 41a00ffa45 | |||
| 633b5dda6e | |||
| 5d6bef0fc8 | |||
| d24b2ada0c | |||
| 0a9ccffe28 | |||
| 207d305327 | |||
| caa4b4f590 | |||
| e45cb0595e | |||
| 77e7e39985 | |||
| b2e9ae76d4 | |||
| 460eb769dc | |||
| 5e38749c65 | |||
| 91083b6c4a | |||
| de562b1287 | |||
| 470c9a2191 | |||
| 26e36e7124 | |||
| bef0ee6000 | |||
| 9e4822d529 | |||
| 7f9685a007 |
@@ -6,7 +6,6 @@ using NLog;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace MP.Data.Controllers
|
namespace MP.Data.Controllers
|
||||||
@@ -99,6 +98,25 @@ namespace MP.Data.Controllers
|
|||||||
return ListValuesFilt("AnagArticoli", "Tipo");
|
return ListValuesFilt("AnagArticoli", "Tipo");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco codice articoli che abbiano dati Dossier
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<string> ArticleWithDossier()
|
||||||
|
{
|
||||||
|
List<string> dbResult = new List<string>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetDossiers
|
||||||
|
.AsNoTracking()
|
||||||
|
.Select(i => i.OdlNav.CodArticolo)
|
||||||
|
.Distinct()
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Eliminazione Record
|
/// Eliminazione Record
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -192,26 +210,6 @@ namespace MP.Data.Controllers
|
|||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Statistiche ODL calcolate (da stored stp_STAT_ODL)
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<List<StatODLModel>> StatOdl(int IdxOdl)
|
|
||||||
{
|
|
||||||
List<StatODLModel> dbResult = new List<StatODLModel>();
|
|
||||||
using (var dbCtx = new MoonProContext(_configuration))
|
|
||||||
{
|
|
||||||
var IdxODL = new SqlParameter("@IdxODL", IdxOdl);
|
|
||||||
|
|
||||||
dbResult = await dbCtx
|
|
||||||
.DbSetStatOdl
|
|
||||||
.FromSqlRaw("EXEC stp_STAT_ODL @IdxODL", IdxODL)
|
|
||||||
.AsNoTracking()
|
|
||||||
.ToListAsync();
|
|
||||||
}
|
|
||||||
return dbResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update Record
|
/// Update Record
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -335,10 +333,10 @@ namespace MP.Data.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
|
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
|
||||||
/// <param name="CodArticolo">* = tutti, altrimenti solo x un dato articolo</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="DtStart">Data minima per estrazione records</param>
|
||||||
/// <param name="MaxRec">numero massimo record da restituire</param>
|
/// <param name="DtEnd">Data Massima per estrazione records</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<Dossiers> DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtRef, int MaxRec)
|
public List<Dossiers> DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtStart, DateTime DtEnd)
|
||||||
{
|
{
|
||||||
List<Dossiers> dbResult = new List<Dossiers>();
|
List<Dossiers> dbResult = new List<Dossiers>();
|
||||||
using (var dbCtx = new MoonProContext(_configuration))
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
@@ -346,12 +344,11 @@ namespace MP.Data.Controllers
|
|||||||
dbResult = dbCtx
|
dbResult = dbCtx
|
||||||
.DbSetDossiers
|
.DbSetDossiers
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && (CodArticolo == "*" || x.OdlNav.CodArticolo == CodArticolo) && x.DtRif <= DtRef)
|
.Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && (CodArticolo == "*" || x.OdlNav.CodArticolo == CodArticolo) && (x.DtRif >= DtStart && x.DtRif <= DtEnd))
|
||||||
.Include(m => m.MachineNav)
|
.Include(m => m.MachineNav)
|
||||||
.Include(o => o.OdlNav)
|
.Include(o => o.OdlNav)
|
||||||
.Include(a => a.OdlNav.ArticoloNav)
|
.Include(a => a.OdlNav.ArticoloNav)
|
||||||
.OrderByDescending(x => x.DtRif)
|
.OrderByDescending(x => x.DtRif)
|
||||||
.Take(MaxRec)
|
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
return dbResult;
|
return dbResult;
|
||||||
@@ -421,7 +418,7 @@ namespace MP.Data.Controllers
|
|||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
if (currRec != null)
|
if (currRec != null)
|
||||||
{
|
{
|
||||||
currRec.Valore= editRec.Valore;
|
currRec.Valore = editRec.Valore;
|
||||||
dbCtx.Entry(currRec).State = EntityState.Modified;
|
dbCtx.Entry(currRec).State = EntityState.Modified;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -440,6 +437,7 @@ namespace MP.Data.Controllers
|
|||||||
}
|
}
|
||||||
return fatto;
|
return fatto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco valori link (x home e navMenu laterale)
|
/// Elenco valori link (x home e navMenu laterale)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -449,6 +447,32 @@ namespace MP.Data.Controllers
|
|||||||
return ListLinkFilt("SpecLink");
|
return ListLinkFilt("SpecLink");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Aggiunta record EventList
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<bool> EvListInsert(EventListModel newRec)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var currRec = dbCtx
|
||||||
|
.DbSetEvList
|
||||||
|
.Add(newRec);
|
||||||
|
await dbCtx.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione durante EvListInsert{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await Task.Delay(1);
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco ultimi n record flux log dato macchina e flusso (ordinato x data registrazione)
|
/// Elenco ultimi n record flux log dato macchina e flusso (ordinato x data registrazione)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -497,14 +521,14 @@ namespace MP.Data.Controllers
|
|||||||
/// <param name="startDate">Data inizio</param>
|
/// <param name="startDate">Data inizio</param>
|
||||||
/// <param name="endDate">Data fine</param>
|
/// <param name="endDate">Data fine</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<ODLModel> ListODLFilt(bool inCorso, string codArt, string keyRichPart, DateTime startDate, DateTime endDate)
|
public List<ODLModel> ListODLFilt(bool inCorso, string codArt, string keyRichPart, string IdxMacchina, DateTime startDate, DateTime endDate)
|
||||||
{
|
{
|
||||||
List<ODLModel> dbResult = new List<ODLModel>();
|
List<ODLModel> dbResult = new List<ODLModel>();
|
||||||
using (var dbCtx = new MoonProContext(_configuration))
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
{
|
{
|
||||||
dbResult = dbCtx
|
dbResult = dbCtx
|
||||||
.DbSetODL
|
.DbSetODL
|
||||||
.Where(x => ((inCorso && x.DataFine == null) || ((!inCorso && x.DataFine != null) && x.DataInizio >= startDate && x.DataInizio <= endDate)) && (x.KeyRichiesta.Contains(keyRichPart) || keyRichPart == "*") && (codArt == "*" || x.CodArticolo.Contains(codArt)))
|
.Where(x => ((inCorso && x.DataFine == null) || ((!inCorso && x.DataFine != null) && x.DataInizio >= startDate && x.DataInizio <= endDate)) && (x.KeyRichiesta.Contains(keyRichPart) || keyRichPart == "*") && (x.IdxMacchina.Contains(IdxMacchina) || IdxMacchina == "*") && (codArt == "*" || x.CodArticolo.Contains(codArt)))
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.Include(m => m.MachineNav)
|
.Include(m => m.MachineNav)
|
||||||
.Include(a => a.ArticoloNav)
|
.Include(a => a.ArticoloNav)
|
||||||
@@ -577,10 +601,12 @@ namespace MP.Data.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco id Macchine che abbiano dati FLuxLog
|
/// Elenco id Macchine che abbiano dati FLuxLog, nel periodo indicato
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="dtStart"></param>
|
||||||
|
/// <param name="dtEnd"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<string>> MacchineWithFlux()
|
public async Task<List<string>> MacchineWithFlux(DateTime dtStart, DateTime dtEnd)
|
||||||
{
|
{
|
||||||
List<string> dbResult = new List<string>();
|
List<string> dbResult = new List<string>();
|
||||||
using (var dbCtx = new MoonProContext(_configuration))
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
@@ -588,6 +614,7 @@ namespace MP.Data.Controllers
|
|||||||
dbResult = await dbCtx
|
dbResult = await dbCtx
|
||||||
.DbSetFluxLog
|
.DbSetFluxLog
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
|
.Where(x => x.dtEvento >= dtStart && x.dtEvento <= dtEnd)
|
||||||
.Select(i => i.IdxMacchina)
|
.Select(i => i.IdxMacchina)
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
@@ -595,25 +622,6 @@ namespace MP.Data.Controllers
|
|||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Elenco codice articoli che abbiano dati Dossier
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public List<string> ArticleWithDossier()
|
|
||||||
{
|
|
||||||
List<string> dbResult = new List<string>();
|
|
||||||
using (var dbCtx = new MoonProContext(_configuration))
|
|
||||||
{
|
|
||||||
dbResult = dbCtx
|
|
||||||
.DbSetDossiers
|
|
||||||
.AsNoTracking()
|
|
||||||
.Select(i => i.OdlNav.CodArticolo)
|
|
||||||
.Distinct()
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
return dbResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco da tabella MappaStatoExpl
|
/// Elenco da tabella MappaStatoExpl
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -634,6 +642,147 @@ namespace MP.Data.Controllers
|
|||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Chiusura ODL con eventuale conferma pezzi
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idxOdl">idx odl da chiudere</param>
|
||||||
|
/// <param name="idxMacchina">idx macchina</param>
|
||||||
|
/// <param name="matrOpr">matricola operatore</param>
|
||||||
|
/// <param name="confPezzi">indica se confermare i pezzi prima di chiudere ODL</param>
|
||||||
|
/// <param name="confRett">Conferma con rettifica (ev 121) x pezzi lasciati in macchina</param>
|
||||||
|
/// <param name="modoConfProd">Modo conferma produzione (0=periodo, 1=giorno, 2=turno)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<bool> ODLClose(int idxOdl, string idxMacchina, int matrOpr, bool confPezzi, bool confRett, int modoConfProd)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
if (idxOdl > 0)
|
||||||
|
{
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
DateTime adesso = DateTime.Now;
|
||||||
|
// preparo i parametri
|
||||||
|
var IdxODL = new SqlParameter("@IdxODL", idxOdl);
|
||||||
|
var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||||
|
|
||||||
|
// FARE FIXME TODO !!! da valutare casi setup/autoconferma...
|
||||||
|
#if false
|
||||||
|
// controllo se HO pezzi da confermare...
|
||||||
|
var statoProd = StatoProdMacchina(idxMacchina);
|
||||||
|
if (statoProd.pezziNonConfermati < 1)
|
||||||
|
{ }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// se richiesto confermo produzione
|
||||||
|
if (confPezzi)
|
||||||
|
{
|
||||||
|
var MatrApp = new SqlParameter("@MatrApp", idxMacchina);
|
||||||
|
|
||||||
|
/* ----------------------------------
|
||||||
|
* CONFERMA PEZZI
|
||||||
|
*
|
||||||
|
* condizioni da verificare:
|
||||||
|
* - gestione rettifica (ev121) / pezzi da LASCIARE in macchina
|
||||||
|
* - conferma a zero pezzi (setup) oppure con i pezzi fatti e non ancora confermati
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
|
||||||
|
// recupero i dati dei pezzi da confermare... con DbSetPzProd + exec
|
||||||
|
// stp_PzProd_getByMacchina 'SIMUL_01'
|
||||||
|
|
||||||
|
// stp_ConfermaProduzCompletaFull
|
||||||
|
/*
|
||||||
|
* @idxMacchina NVARCHAR(50),
|
||||||
|
@MatrApp INT,
|
||||||
|
@dataFrom DATETIME,
|
||||||
|
@dataTo DATETIME,
|
||||||
|
@pezziConf INT,
|
||||||
|
@pezziLasciati INT, -- pezzi lasciati = evento 121 (-) pre conferma e (+) dopo --> da lasciare in macchina post conferma
|
||||||
|
@pezziScar INT = 0, -- pezzi scartati (registrati da 2016.11.20) DA INDICARE COME VALORE > 0!!! sennò faccio ABS...
|
||||||
|
@TipoConf INT = 0, -- Tipo intervallo conferma: 0 = periodo intero, 1 = per giorni, 2 = per turni
|
||||||
|
@DataOraApp DATETIME = NULL, -- di norma GETDATE() nel programma - serve per ricalcolo
|
||||||
|
@TestConferma BIT = 1 -- TestConferma : 1 = verifica conf. duplicata e inserisci in ElencoConfermeProd, 0 = nessuna verifica e inserimento ( per ricalcolo )
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
// ora chiudo ODL
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var dbResult = await dbCtx
|
||||||
|
.DbSetStatOdl
|
||||||
|
.FromSqlRaw("EXEC stp_ODL_fineProd @IdxODL, @IdxMacchina", IdxODL, IdxMacchina)
|
||||||
|
.AsNoTracking()
|
||||||
|
.ToListAsync();
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione durante ODLClose{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recupero odl data chiave
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idxOdl"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="NotImplementedException"></exception>
|
||||||
|
public ODLModel OdlGetByKey(int idxOdl)
|
||||||
|
{
|
||||||
|
ODLModel dbResult = new ODLModel();
|
||||||
|
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetODL
|
||||||
|
.FirstOrDefault(x => x.IdxOdl == idxOdl);
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recupero Odl CORRENTI
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<ODLModel> OdlGetCurrent()
|
||||||
|
{
|
||||||
|
List<ODLModel> dbResult = new List<ODLModel>();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetODL
|
||||||
|
.Where(x => x.DataInizio != null && x.DataFine == null)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Statistiche ODL calcolate (da stored stp_STAT_ODL)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<List<StatODLModel>> OdlStart(int IdxOdl)
|
||||||
|
{
|
||||||
|
List<StatODLModel> dbResult = new List<StatODLModel>();
|
||||||
|
if (IdxOdl > 0)
|
||||||
|
{
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
var IdxODL = new SqlParameter("@IdxODL", IdxOdl);
|
||||||
|
|
||||||
|
dbResult = await dbCtx
|
||||||
|
.DbSetStatOdl
|
||||||
|
.FromSqlRaw("EXEC stp_STAT_ODL @IdxODL", IdxODL)
|
||||||
|
.AsNoTracking()
|
||||||
|
.ToListAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco parametri validi x una data macchina
|
/// Elenco parametri validi x una data macchina
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -648,13 +797,89 @@ namespace MP.Data.Controllers
|
|||||||
.DbSetFluxLog
|
.DbSetFluxLog
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina))
|
.Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina))
|
||||||
|
.Take(1000)
|
||||||
.Select(i => i.CodFlux)
|
.Select(i => i.CodFlux)
|
||||||
.Distinct()
|
.Distinct()
|
||||||
|
.OrderBy(x => x)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recupero PODL da chiave
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idxPODL"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<PODLModel> PODL_getByKey(int idxPODL)
|
||||||
|
{
|
||||||
|
PODLModel dbResult = new PODLModel();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetPODL
|
||||||
|
.AsNoTracking()
|
||||||
|
.Where(x => x.IdxPromessa == idxPODL)
|
||||||
|
.FirstOrDefault();
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione durante PODL_getByKey{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await Task.Delay(1);
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Avvio setup ODL da PODL
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="editRec"></param>
|
||||||
|
/// <param name="matrOpr"></param>
|
||||||
|
/// <param name="tcRich"></param>
|
||||||
|
/// <param name="pzPallet"></param>
|
||||||
|
/// <param name="note"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<bool> PODL_startSetup(PODLModel editRec, int matrOpr, double tcRich, int pzPallet, string note)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var currRec = dbCtx
|
||||||
|
.DbSetPODL
|
||||||
|
.AsNoTracking()
|
||||||
|
.Where(x => x.IdxPromessa == editRec.IdxPromessa)
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
if (currRec != null)
|
||||||
|
{
|
||||||
|
// eseguo stored attrezzaggio
|
||||||
|
var IdxPromessa = new SqlParameter("@idxPromessa", editRec.IdxPromessa);
|
||||||
|
var MatrOpr = new SqlParameter("@MatrOpr", matrOpr);
|
||||||
|
var IdxMacchina = new SqlParameter("@IdxMacchina", editRec.IdxMacchina);
|
||||||
|
var TCRichAttr = new SqlParameter("@TCRichAttr", tcRich);
|
||||||
|
var PzPallet = new SqlParameter("@PzPallet", pzPallet);
|
||||||
|
var Note = new SqlParameter("@Note", note);
|
||||||
|
var callResult = await dbCtx
|
||||||
|
.Database
|
||||||
|
.ExecuteSqlRawAsync("EXEC stp_ODL_inizioSetupPromessa @idxPromessa, @MatrOpr, @IdxMacchina, @TCRichAttr, @PzPallet, @Note", IdxPromessa, MatrOpr, IdxMacchina, TCRichAttr, PzPallet, Note);
|
||||||
|
|
||||||
|
answ = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione durante PODL_doSetup{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await Task.Delay(1);
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Eliminazione Record
|
/// Eliminazione Record
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -710,6 +935,7 @@ namespace MP.Data.Controllers
|
|||||||
currRec.KeyRichiesta = editRec.KeyRichiesta;
|
currRec.KeyRichiesta = editRec.KeyRichiesta;
|
||||||
currRec.NumPezzi = editRec.NumPezzi;
|
currRec.NumPezzi = editRec.NumPezzi;
|
||||||
currRec.Tcassegnato = editRec.Tcassegnato;
|
currRec.Tcassegnato = editRec.Tcassegnato;
|
||||||
|
currRec.Attivabile = editRec.Attivabile;
|
||||||
currRec.Note = editRec.Note;
|
currRec.Note = editRec.Note;
|
||||||
dbCtx.Entry(currRec).State = EntityState.Modified;
|
dbCtx.Entry(currRec).State = EntityState.Modified;
|
||||||
}
|
}
|
||||||
@@ -755,6 +981,26 @@ namespace MP.Data.Controllers
|
|||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stato prod macchina
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idxMacchina"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public StatoProdModel StatoProdMacchina(string idxMacchina)
|
||||||
|
{
|
||||||
|
StatoProdModel dbResult = new StatoProdModel();
|
||||||
|
using (var dbCtx = new MoonProContext(_configuration))
|
||||||
|
{
|
||||||
|
var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetStatoProd
|
||||||
|
.FromSqlRaw("EXEC stp_PzProd_getByMacchina @IdxMacchina", IdxMacchina)
|
||||||
|
.AsNoTracking()
|
||||||
|
.FirstOrDefault();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
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("EventList")]
|
||||||
|
public partial class EventListModel
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string IdxMacchina { get; set; } = "NA";
|
||||||
|
public DateTime? InizioStato { get; set; } = DateTime.Now;
|
||||||
|
public int IdxTipo { get; set; } = 0;
|
||||||
|
|
||||||
|
[MaxLength(50)]
|
||||||
|
public string CodArticolo { get; set; } = "";
|
||||||
|
|
||||||
|
[MaxLength(250)]
|
||||||
|
public string Value { get; set; } = "";
|
||||||
|
|
||||||
|
public int MatrOpr { get; set; } = 0;
|
||||||
|
|
||||||
|
[MaxLength(20)]
|
||||||
|
public string pallet { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Navigazione oggetto Machine
|
||||||
|
/// </summary>
|
||||||
|
[ForeignKey("IdxMacchina")]
|
||||||
|
public virtual Macchine MachineNav { get; set; } = null!;
|
||||||
|
/// <summary>
|
||||||
|
/// Navigazione oggetto Articolo
|
||||||
|
/// </summary>
|
||||||
|
[ForeignKey("CodArticolo")]
|
||||||
|
public virtual AnagArticoli ArticoloNav { get; set; } = null!;
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
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
|
||||||
|
{
|
||||||
|
public partial class StatoProdModel
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
public string idxMacchina { get; set; } = "NA";
|
||||||
|
public int pezziNonConfermati { get; set; } = 0;
|
||||||
|
public DateTime DataFrom { get; set; } = DateTime.Now;
|
||||||
|
public DateTime DataTo { get; set; } = DateTime.Now;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -49,6 +49,8 @@ namespace MP.Data
|
|||||||
public virtual DbSet<FluxLog> DbSetFluxLog { get; set; }
|
public virtual DbSet<FluxLog> DbSetFluxLog { get; set; }
|
||||||
public virtual DbSet<Dossiers> DbSetDossiers { get; set; }
|
public virtual DbSet<Dossiers> DbSetDossiers { get; set; }
|
||||||
public virtual DbSet<StatODLModel> DbSetStatOdl { get; set; }
|
public virtual DbSet<StatODLModel> DbSetStatOdl { get; set; }
|
||||||
|
public virtual DbSet<StatoProdModel> DbSetStatoProd { get; set; }
|
||||||
|
public virtual DbSet<EventListModel> DbSetEvList { get; set; }
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
|
|
||||||
@@ -299,6 +301,12 @@ namespace MP.Data
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<EventListModel>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => new { e.IdxMacchina, e.InizioStato, e.IdxTipo});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
OnModelCreatingPartial(modelBuilder);
|
OnModelCreatingPartial(modelBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using Microsoft.JSInterop;
|
using Microsoft.JSInterop;
|
||||||
using MP.Data;
|
using MP.Data;
|
||||||
|
using MP.SPEC.Data;
|
||||||
using static System.Net.Mime.MediaTypeNames;
|
using static System.Net.Mime.MediaTypeNames;
|
||||||
|
|
||||||
namespace MP.SPEC.Components.Chart
|
namespace MP.SPEC.Components.Chart
|
||||||
@@ -28,7 +29,7 @@ namespace MP.SPEC.Components.Chart
|
|||||||
public double[] Data { get; set; }
|
public double[] Data { get; set; }
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string[] BackgroundColor { get; set; }
|
public List<DoughnutStyling> BackgroundColor { get; set; }
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string[] Labels { get; set; }
|
public string[] Labels { get; set; }
|
||||||
@@ -46,7 +47,7 @@ namespace MP.SPEC.Components.Chart
|
|||||||
{
|
{
|
||||||
Datasets = new[]
|
Datasets = new[]
|
||||||
{
|
{
|
||||||
new { Data = Data, BackgroundColor = BackgroundColor
|
new { Data = Data, BackgroundColor = BackgroundColor.Select(x=>x.color), borderColor = BackgroundColor.Select(x=>x.border), borderWidth= 0, offset= 1, borderRadius = 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Labels = Labels
|
Labels = Labels
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ namespace MP.SPEC.Components
|
|||||||
|
|
||||||
protected int _numRecord { get; set; } = 10;
|
protected int _numRecord { get; set; } = 10;
|
||||||
|
|
||||||
protected int percLoading { get; set; } = 0;
|
protected int percLoading { get; set; } = 0;
|
||||||
|
|
||||||
#endregion Protected Properties
|
#endregion Protected Properties
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,22 @@
|
|||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-group p-2">
|
|
||||||
|
<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="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>
|
<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" />
|
<input @bind="@selDtRef" id="DtMin" class="form-control" type="datetime-local" title="Selezionare la data minima da visualizzare" />
|
||||||
</div>
|
</div>
|
||||||
@@ -49,7 +64,7 @@
|
|||||||
<option value="250">250</option>
|
<option value="250">250</option>
|
||||||
<option value="500">500</option>
|
<option value="500">500</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>*@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -39,18 +39,35 @@ namespace MP.SPEC.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected DateTime selDtRef
|
protected DateTime selDtMax
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return SelFilterDossier.DtRef;
|
return SelFilterDossier.DtEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
set
|
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();
|
reportChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,7 +118,9 @@ namespace MP.SPEC.Components
|
|||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
SelFilterDossier = new SelectDossierParams();
|
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();
|
ListArticoli = await MDService.ArticleWithDossier();
|
||||||
await FilterChanged.InvokeAsync(SelFilterDossier);
|
await FilterChanged.InvokeAsync(SelFilterDossier);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
@using MP.SPEC.Components
|
@using MP.SPEC.Components
|
||||||
@using MP.SPEC.Data
|
@using MP.SPEC.Data
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@if (ListRecords == null)
|
@if (ListRecords == null)
|
||||||
{
|
{
|
||||||
<LoadingData></LoadingData>
|
<LoadingData></LoadingData>
|
||||||
@@ -11,20 +14,83 @@ else if (totalCount == 0)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@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>
|
||||||
|
}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="d-flex justify justify-content-between">
|
<div class="d-flex justify justify-content-between">
|
||||||
<table class="table table-sm table-striped small">
|
<table class="table table-sm table-striped small">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
<button @onclick="() => unToggleTableFlux()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
|
<button @onclick="() => closeTableFlux()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
|
||||||
</th>
|
</th>
|
||||||
<th><i class="fa-solid fa-file"></i> Articolo</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-screwdriver-wrench"></i> Fase</th>
|
||||||
<th><i class="fa-solid fa-hard-drive"></i> Macchina</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-regular fa-calendar-days"></i> Data Snap</th>
|
||||||
<th><i class="fa-solid fa-sliders"></i> ODL</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>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -33,7 +99,15 @@ else
|
|||||||
{
|
{
|
||||||
<tr class="@checkSelect(@record)">
|
<tr class="@checkSelect(@record)">
|
||||||
<td>
|
<td>
|
||||||
<button class="btn btn-primary btn-sm" @onclick="() => selRecord(record)"><i class="fa-solid fa-magnifying-glass"></i></button>
|
@if (isEditing == false)
|
||||||
|
{
|
||||||
|
|
||||||
|
<button class="btn btn-primary btn-sm" @onclick="() => selRecord(record)"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<button class="btn btn-secondary btn-sm disabled"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@record.OdlNav.CodArticolo
|
@record.OdlNav.CodArticolo
|
||||||
@@ -52,11 +126,17 @@ else
|
|||||||
<td>
|
<td>
|
||||||
@record.IdxODL
|
@record.IdxODL
|
||||||
</td>
|
</td>
|
||||||
@*<td>
|
|
||||||
@record.DataType
|
|
||||||
</td>*@
|
|
||||||
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
@@ -75,23 +155,21 @@ else
|
|||||||
<table class="table table-light table-sm table-striped small mb-0">
|
<table class="table table-light table-sm table-striped small mb-0">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<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-solid fa-hard-drive"></i> Macchina</th>
|
||||||
<th><i class="fa-regular fa-calendar-days"></i> Data</th>
|
<th><i class="fa-regular fa-calendar-days"></i> Data</th>
|
||||||
<th><i class="fa-solid fa-sliders"></i> Data Type</th>
|
<th><i class="fa-solid fa-sliders"></i> Data Type</th>
|
||||||
<th>
|
<th style="text-align: right;">
|
||||||
<div class="d-flex justify-content-between col-12">
|
<span class="col-11"> Valore </span>
|
||||||
<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>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach (var record in listaFlux)
|
@foreach (var record in listaFlux)
|
||||||
{
|
{
|
||||||
<tr>
|
<tr class="@checkSelPar(@record)">
|
||||||
<td>
|
<td>
|
||||||
<button @onclick="() => editRecord(record)" class="btn btn-primary btn-sm" title="Modifica Record"><i class="bi bi-pencil-square"></i></button>
|
<button @onclick="() => editRecord(record)" class="btn btn-primary btn-sm" title="Modifica Record"><i class="bi bi-pencil-square"></i></button>
|
||||||
</td>
|
</td>
|
||||||
@@ -105,8 +183,15 @@ else
|
|||||||
@record.CodFlux
|
@record.CodFlux
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align: right;">
|
<td style="text-align: right;">
|
||||||
<div><span class="small text-dark">Modificato: </span><b>@record.ValoreEdit</b></div>
|
@if (record.ValoreEdit != record.Valore)
|
||||||
<div class="small text-secondary"><span class="small text-dark">Originale: </span><i>@record.Valore</i></div>
|
{
|
||||||
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using Microsoft.AspNetCore.DataProtection;
|
||||||
using Microsoft.JSInterop;
|
using Microsoft.JSInterop;
|
||||||
using MP.Data.DatabaseModels;
|
using MP.Data.DatabaseModels;
|
||||||
using MP.Data.DTO;
|
using MP.Data.DTO;
|
||||||
using MP.SPEC.Data;
|
using MP.SPEC.Data;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace MP.SPEC.Components
|
namespace MP.SPEC.Components
|
||||||
{
|
{
|
||||||
public partial class ListDossiers
|
public partial class ListDossiers : IDisposable
|
||||||
{
|
{
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
@@ -26,6 +28,24 @@ namespace MP.SPEC.Components
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
private FluxLogDTO? currFluxLogDto = null;
|
||||||
|
|
||||||
|
|
||||||
|
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 string checkSelect(Dossiers recordSel)
|
public string checkSelect(Dossiers recordSel)
|
||||||
{
|
{
|
||||||
string answ = "";
|
string answ = "";
|
||||||
@@ -34,13 +54,29 @@ namespace MP.SPEC.Components
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
answ = (currRecord.IdxMacchina == recordSel.IdxMacchina && currRecord.DtRif == recordSel.DtRif) ? "table-info" : "";
|
answ = (currRecord.IdxMacchina == recordSel.IdxMacchina && currRecord.DtRif == recordSel.DtRif) ? "table-info" : "";
|
||||||
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{ }
|
{ }
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
currRecord = null;
|
||||||
|
SearchRecords = null;
|
||||||
|
ListRecords = null;
|
||||||
|
GC.Collect();
|
||||||
|
}
|
||||||
|
private SelectDossierParams lastFilter { get; set; } = new SelectDossierParams() { CurrPage = -1 };
|
||||||
|
protected override async Task OnParametersSetAsync()
|
||||||
|
{
|
||||||
|
if (!lastFilter.Equals(SelFilter))
|
||||||
|
{
|
||||||
|
lastFilter = SelFilter.clone();
|
||||||
|
await reloadData(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|
||||||
#region Protected Properties
|
#region Protected Properties
|
||||||
@@ -50,10 +86,6 @@ namespace MP.SPEC.Components
|
|||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
protected MpDataService MDService { get; set; } = null!;
|
protected MpDataService MDService { get; set; } = null!;
|
||||||
|
|
||||||
[Inject]
|
|
||||||
protected MessageService MessageService { get; set; } = null!;
|
|
||||||
|
|
||||||
#endregion Protected Properties
|
#endregion Protected Properties
|
||||||
|
|
||||||
#region Protected Methods
|
#region Protected Methods
|
||||||
@@ -77,26 +109,64 @@ namespace MP.SPEC.Components
|
|||||||
|
|
||||||
protected async Task editRecord(FluxLogDTO selRec)
|
protected async Task editRecord(FluxLogDTO selRec)
|
||||||
{
|
{
|
||||||
|
currFluxLogDto = selRec;
|
||||||
// indico record selezionato
|
// indico record selezionato
|
||||||
await RecordSelFlux.InvokeAsync(selRec);
|
await RecordSelFlux.InvokeAsync(selRec);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected string findRec(FluxLog record)
|
private void enableEditing()
|
||||||
{
|
{
|
||||||
string answ = "";
|
isEditing = true;
|
||||||
#if false
|
}
|
||||||
if (ListRecordsMod != null)
|
|
||||||
|
protected async Task cancel()
|
||||||
|
{
|
||||||
|
var alert = await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler annullare TUTTE le modifiche? i dati saranno ricaricati.");
|
||||||
|
if (alert)
|
||||||
{
|
{
|
||||||
answ = ListRecordsMod.Where(l => l.IdxMacchina == record.IdxMacchina && l.CodFlux == record.CodFlux).Select(x => x.Valore).SingleOrDefault();
|
currFluxLogDto = null;
|
||||||
|
isEditing = false;
|
||||||
|
await Task.Delay(1);
|
||||||
|
listaFlux = MDService.getFluxLog(currRecord.Valore);
|
||||||
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
#endif
|
}
|
||||||
return answ;
|
|
||||||
|
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);
|
||||||
|
await JSRuntime.InvokeAsync<bool>("location.reload");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
|
|
||||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
|
||||||
ListStati = await MDService.AnagStatiComm();
|
ListStati = await MDService.AnagStatiComm();
|
||||||
await reloadData(true);
|
await reloadData(true);
|
||||||
}
|
}
|
||||||
@@ -123,6 +193,19 @@ namespace MP.SPEC.Components
|
|||||||
currRecord = null;
|
currRecord = null;
|
||||||
await reloadData(true);
|
await reloadData(true);
|
||||||
}
|
}
|
||||||
|
private string css()
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
if (isEditing)
|
||||||
|
{
|
||||||
|
answ = "visible";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
answ = "hidden";
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Protected Methods
|
#endregion Protected Methods
|
||||||
|
|
||||||
@@ -144,8 +227,14 @@ namespace MP.SPEC.Components
|
|||||||
|
|
||||||
private int currPage
|
private int currPage
|
||||||
{
|
{
|
||||||
get => MessageService.currPage;
|
get => SelFilter.CurrPage;
|
||||||
set => MessageService.currPage = value;
|
set => SelFilter.CurrPage = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool isEditing
|
||||||
|
{
|
||||||
|
get => SelFilter.isEditing;
|
||||||
|
set => SelFilter.isEditing = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool isLoading { get; set; } = false;
|
private bool isLoading { get; set; } = false;
|
||||||
@@ -159,8 +248,8 @@ namespace MP.SPEC.Components
|
|||||||
|
|
||||||
private int numRecord
|
private int numRecord
|
||||||
{
|
{
|
||||||
get => MessageService.numRecord;
|
get => SelFilter.NumRec;
|
||||||
set => MessageService.numRecord = value;
|
set => SelFilter.NumRec = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string SelArticolo
|
private string SelArticolo
|
||||||
@@ -168,9 +257,13 @@ namespace MP.SPEC.Components
|
|||||||
get => SelFilter.CodArticolo;
|
get => SelFilter.CodArticolo;
|
||||||
}
|
}
|
||||||
|
|
||||||
private DateTime SelDtRef
|
private DateTime SelDtEnd
|
||||||
{
|
{
|
||||||
get => SelFilter.DtRef;
|
get => SelFilter.DtEnd;
|
||||||
|
}
|
||||||
|
private DateTime SelDtStart
|
||||||
|
{
|
||||||
|
get => SelFilter.DtStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string SelMacchina
|
private string SelMacchina
|
||||||
@@ -197,15 +290,10 @@ namespace MP.SPEC.Components
|
|||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|
||||||
private async void MessageService_EA_PageUpdated()
|
|
||||||
{
|
|
||||||
await reloadData(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task reloadData(bool setChanged)
|
private async Task reloadData(bool setChanged)
|
||||||
{
|
{
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
SearchRecords = await MDService.DossiersGetLastFilt(SelMacchina, SelArticolo, SelDtRef, MaxRecord);
|
SearchRecords = await MDService.DossiersGetLastFilt(SelMacchina, SelArticolo, SelDtStart, SelDtEnd);
|
||||||
totalCount = SearchRecords.Count;
|
totalCount = SearchRecords.Count;
|
||||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
@@ -236,10 +324,13 @@ namespace MP.SPEC.Components
|
|||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task unToggleTableFlux()
|
private async Task closeTableFlux()
|
||||||
{
|
{
|
||||||
|
currFluxLogDto = null;
|
||||||
currRecord = null;
|
currRecord = null;
|
||||||
visualizzaFlux = true;
|
visualizzaFlux = true;
|
||||||
|
isEditing = false;
|
||||||
|
await RecordSelFlux.InvokeAsync(currFluxLogDto);
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,10 +12,27 @@ else if (totalCount == 0)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@if (currRecord != null && !showStats && isCurrOdl)
|
||||||
|
{
|
||||||
|
<div class="col-6 col-lg-8">
|
||||||
|
<button @onclick="() => forceSyncDb()" class="btn btn-success btn-sm btn-">Forza sync dati ODL <i class="bi bi-fast-forward-circle"></i></button>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 col-lg-4 text-end">
|
||||||
|
@*<div class="px-2 input-group" title="Selezionare Data-Ora chiusura ODL">
|
||||||
|
<label class="input-group-text" for="dtMax"><i class="fa-regular fa-calendar-minus"></i></label>
|
||||||
|
<input class="form-control" @bind="@selDtFine" id="dtMax" type="datetime-local">
|
||||||
|
<button @onclick="() => chiudiOdl()" class="btn btn-danger btn-sm btn-">Registra chiusura ODL <i class="far fa-stop-circle"></i></button>
|
||||||
|
</div>*@
|
||||||
|
<button @onclick="() => chiudiOdl()" class="btn btn-danger btn-sm btn-">Registra chiusura ODL <i class="far fa-stop-circle"></i></button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<table class="table table-sm table-striped">
|
<table class="table table-sm table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>
|
||||||
|
<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-file"></i> Articolo</th>
|
||||||
<th><i class="fa-solid fa-screwdriver-wrench"></i> Fase</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-solid fa-hard-drive"></i> Macchina</th>
|
||||||
@@ -28,6 +45,17 @@ else
|
|||||||
@foreach (var record in ListRecords)
|
@foreach (var record in ListRecords)
|
||||||
{
|
{
|
||||||
<tr class="@checkSelect(@record.IdxOdl)">
|
<tr class="@checkSelect(@record.IdxOdl)">
|
||||||
|
|
||||||
|
<td>
|
||||||
|
@if (isCurrOdl)
|
||||||
|
{
|
||||||
|
<button class="btn btn-primary btn-sm" @onclick="() => selRecord(record)"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<button class="btn btn-secondary btn-sm disabled"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||||
|
}
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@record.CodArticolo
|
@record.CodArticolo
|
||||||
<div class="small textConsensed text-secondary">@record.ArticoloNav.DescArticolo</div>
|
<div class="small textConsensed text-secondary">@record.ArticoloNav.DescArticolo</div>
|
||||||
@@ -83,7 +111,7 @@ else
|
|||||||
<b>@record.DurataMinuti</b>
|
<b>@record.DurataMinuti</b>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button class="btn btn-sm btn-primary py-0" type="button" @onclick="() => selectRecord(record)" data-bs-toggle="modal" data-bs-target="#staticBackdrop" title="Mostra statistiche"><i class="fa-solid fa-chart-pie"></i></button>
|
<button class="btn btn-sm btn-primary py-0" type="button" @onclick="() => selectStatRecord(record)" data-bs-toggle="modal" data-bs-target="#myModal" title="Mostra statistiche"><i class="fa-solid fa-chart-pie"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
</td>
|
</td>
|
||||||
@@ -91,22 +119,22 @@ else
|
|||||||
}
|
}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="modal fade" id="staticBackdrop" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
|
<div class="modal fade" id="myModal" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered modal-xl">
|
<div class="modal-dialog modal-dialog-centered modal-xl">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header bg-primary col-12">
|
<div class="modal-header bg-primary col-12">
|
||||||
@if (currRecord != null)
|
@if (statRecord != null)
|
||||||
{
|
{
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<b class="modal-title fs-1" id="staticBackdropLabel"><b>ODL @currRecord.IdxOdl</b></b>
|
<b class="modal-title fs-1" id="staticBackdropLabel"><b>ODL @statRecord.IdxOdl</b></b>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6 fs-5">
|
<div class="col-6 fs-5">
|
||||||
<b>@currRecord.CodArticolo</b>
|
<b>@statRecord.CodArticolo</b>
|
||||||
<div class="small textConsensed text-light">@currRecord.ArticoloNav.DescArticolo</div>
|
<div class="small textConsensed text-light">@statRecord.ArticoloNav.DescArticolo</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-2 fs-5">
|
<div class="col-2 fs-5">
|
||||||
<b>@currRecord.IdxMacchina</b>
|
<b>@statRecord.IdxMacchina</b>
|
||||||
<div class="small textConsensed text-light">@currRecord.MachineNav.Descrizione</div>
|
<div class="small textConsensed text-light">@statRecord.MachineNav.Descrizione</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
<div class="col-1 text-end">
|
<div class="col-1 text-end">
|
||||||
@@ -114,7 +142,7 @@ else
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body col-12">
|
<div class="modal-body col-12">
|
||||||
@if (currRecord != null)
|
@if (statRecord != null && showStats)
|
||||||
{
|
{
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
@@ -123,23 +151,23 @@ else
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width: 270px">
|
<td style="width: 270px">
|
||||||
<div class="small textConsensed"><b>N° pezzi:</b> @currRecord.NumPezzi</div>
|
<div class="small textConsensed"><b>N° pezzi:</b> @statRecord.NumPezzi</div>
|
||||||
<div class="small textConsensed"><b>T. Ciclo:</b> @currRecord.Tcassegnato.ToString("N3")</div>
|
<div class="small textConsensed"><b>T. Ciclo:</b> @statRecord.Tcassegnato.ToString("N3")</div>
|
||||||
</td>
|
</td>
|
||||||
<td style="width: 300px">
|
<td style="width: 300px">
|
||||||
<div class="small d-flex justify-content-between">
|
<div class="small d-flex justify-content-between">
|
||||||
<div>
|
<div>
|
||||||
<div><b>@($"{@currRecord.DataInizio:yyyy/MM/dd}")</b></div>
|
<div><b>@($"{@statRecord.DataInizio:yyyy/MM/dd}")</b></div>
|
||||||
<div>@($"{@currRecord.DataInizio:ddd HH:mm:ss}")</div>
|
<div>@($"{@statRecord.DataInizio:ddd HH:mm:ss}")</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-0">
|
<div class="p-0">
|
||||||
<i class="fa-solid fa-angles-right"></i>
|
<i class="fa-solid fa-angles-right"></i>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@if (@currRecord.DataFine != null)
|
@if (@statRecord.DataFine != null)
|
||||||
{
|
{
|
||||||
<div><b>@($"{@currRecord.DataFine:yyyy/MM/dd}")</b></div>
|
<div><b>@($"{@statRecord.DataFine:yyyy/MM/dd}")</b></div>
|
||||||
<div>@($"{@currRecord.DataFine:ddd HH:mm:ss}")</div>
|
<div>@($"{@statRecord.DataFine:ddd HH:mm:ss}")</div>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -151,10 +179,6 @@ else
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
|
||||||
|
|
||||||
<!-- Modal -->
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -165,39 +189,49 @@ else
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div>
|
<div>
|
||||||
@tradFase(currRecord.KeyRichiesta)
|
@tradFase(statRecord.KeyRichiesta)
|
||||||
</div>
|
</div>
|
||||||
@if (currRecord.Note != "")
|
@if (statRecord.Note != "")
|
||||||
{
|
{
|
||||||
<div class="small textConsensed text-secondary badge text-bg-light border border-secondary rounded">
|
<div class="small textConsensed text-secondary badge text-bg-light border border-secondary rounded">
|
||||||
<b class="text-dark"></b> <span class="text-wrap text-start"> @currRecord.Note </span>
|
<b class="text-dark"></b> <span class="text-wrap text-start"> @statRecord.Note </span>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</td>
|
</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>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@if (currRecord != null)
|
@if (statRecord != null)
|
||||||
{
|
{
|
||||||
|
@if (ListOdlStatsAct != null)
|
||||||
@if (ListOdlStats != null)
|
|
||||||
{
|
{
|
||||||
@foreach (var statRecord in ListOdlStats)
|
@foreach (var stat in ListOdlStatsAct)
|
||||||
{
|
{
|
||||||
<div class="p-1">
|
<div class="p-1">
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<div class="text-uppercase">
|
<div class="text-uppercase">
|
||||||
@statRecord.Descrizione
|
@stat.Descrizione
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<b>@(formDurata(statRecord.TotDurata))</b>
|
<b>@(formDurata(stat.TotDurata))</b>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" style="width: @Math.Round(calcolaPerc(statRecord.TotDurata),0)%; background-color:@statRecord.Css;" aria-valuemax="100">@($"{calcolaPerc(statRecord.TotDurata):N1}%")</div>
|
<div class="progress-bar @colorChanger(@stat.Css)" role="progressbar" aria-valuenow="0" aria-valuemin="0" style="width: @Math.Round(calcolaPerc(stat.TotDurata),0)%; background-color:@pbStyle(@stat.Css);" aria-valuemax="100">@($"{calcolaPerc(stat.TotDurata):N1}%")</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -207,13 +241,16 @@ else
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4 dcContainer">
|
<div class="col-4 dcContainer">
|
||||||
@if (currRecord != null)
|
@if (statRecord != null && ListOdlStats != null)
|
||||||
{
|
{
|
||||||
<div class="dcBox">
|
<div class="dcBox">
|
||||||
<ODLPlot SelectedOdl="@currRecord.IdxOdl"></ODLPlot>
|
<ODLPlot SelectedOdl="@statRecord.IdxOdl" hideSpenta="@hideSpenta"></ODLPlot>
|
||||||
</div>
|
</div>
|
||||||
<div class="dcBox dcOverlay">
|
<div class="dcBox dcOverlay d-flex">
|
||||||
<b class="fs-3">@currRecord.DurataMinuti</b>
|
<div class="align-self-center text-center w-100">
|
||||||
|
<b class="fs-3">@durataFilt</b>
|
||||||
|
@*<b class="fs-3">@statRecord.DurataMinuti</b>*@
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@@ -227,5 +264,3 @@ else
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
<style>
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using Microsoft.JSInterop;
|
using Microsoft.JSInterop;
|
||||||
using MP.Data;
|
|
||||||
using MP.Data.DatabaseModels;
|
using MP.Data.DatabaseModels;
|
||||||
using MP.SPEC.Data;
|
using MP.SPEC.Data;
|
||||||
|
using MP.SPEC.Services;
|
||||||
|
using NLog;
|
||||||
|
|
||||||
namespace MP.SPEC.Components
|
namespace MP.SPEC.Components
|
||||||
{
|
{
|
||||||
public partial class ListODL
|
public partial class ListODL : IDisposable
|
||||||
{
|
{
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
@@ -38,9 +39,21 @@ namespace MP.SPEC.Components
|
|||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
currRecord = null;
|
||||||
|
SearchRecords = null;
|
||||||
|
ListRecords = null;
|
||||||
|
ListStati = null;
|
||||||
|
ListOdlStats = null;
|
||||||
|
ListOdlStatsNetto = null;
|
||||||
|
statRecord = null;
|
||||||
|
GC.Collect();
|
||||||
|
}
|
||||||
|
|
||||||
public string formDurata(double durataMin)
|
public string formDurata(double durataMin)
|
||||||
{
|
{
|
||||||
return Utils.FormDurata(durataMin);
|
return MP.Data.Utils.FormDurata(durataMin);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
@@ -54,12 +67,61 @@ namespace MP.SPEC.Components
|
|||||||
protected MpDataService MDService { get; set; } = null!;
|
protected MpDataService MDService { get; set; } = null!;
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
protected MessageService MessageService { get; set; } = null!;
|
protected IOApiService MpIoApiCall { get; set; } = null!;
|
||||||
|
|
||||||
#endregion Protected Properties
|
#endregion Protected Properties
|
||||||
|
|
||||||
#region Protected Methods
|
#region Protected Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Registra chiusura ODL alla data indicata
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected async Task chiudiOdl()
|
||||||
|
{
|
||||||
|
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Sei sicuro di voler chiudere l'ODL corrente?"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (currRecord != null)
|
||||||
|
{
|
||||||
|
// effettua chiusura sul DB
|
||||||
|
await MDService.ODLClose(currRecord.IdxOdl, currRecord.IdxMacchina, 0, true);
|
||||||
|
Log.Info($"Effettuata chiusura ODL {currRecord.IdxOdl}");
|
||||||
|
// ricarica...
|
||||||
|
await selRecord(null);
|
||||||
|
}
|
||||||
|
await reloadData();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected string colorChanger(string colorCSS)
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
if (colorCSS == "yellow")
|
||||||
|
{
|
||||||
|
answ = "text-dark";
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Richiesta invio sync all'IOB-WIN
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected async Task forceSyncDb()
|
||||||
|
{
|
||||||
|
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Sei sicuro di voler reinviare i dati (Articoli, PODL) all'impianto?"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (currRecord != null)
|
||||||
|
{
|
||||||
|
await callSyncDb(currRecord.IdxMacchina);
|
||||||
|
Log.Info($"Richiesto forceSyncDb per idxMacc {currRecord.IdxMacchina}");
|
||||||
|
// ricarica...
|
||||||
|
await selRecord(null);
|
||||||
|
}
|
||||||
|
await reloadData();
|
||||||
|
}
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
ListStati = await MDService.AnagStatiComm();
|
ListStati = await MDService.AnagStatiComm();
|
||||||
@@ -75,29 +137,56 @@ namespace MP.SPEC.Components
|
|||||||
await InvokeAsync(() =>
|
await InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
PagerResetReq.InvokeAsync(true);
|
PagerResetReq.InvokeAsync(true);
|
||||||
//currPage = 1;
|
|
||||||
Task task = UpdateData();
|
Task task = UpdateData();
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async Task selectRecord(ODLModel? currRec)
|
protected async Task resetSel()
|
||||||
{
|
{
|
||||||
|
await selRecord(null);
|
||||||
|
await reloadData();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async Task selectStatRecord(ODLModel? currRec)
|
||||||
|
{
|
||||||
|
showStats = true;
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
currRecord = currRec;
|
statRecord = currRec;
|
||||||
if (currRec != null)
|
if (currRec != null)
|
||||||
{
|
{
|
||||||
ListOdlStats = await MDService.StatOdl(currRec.IdxOdl);
|
await reloadStatsData(currRec);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
showStats = false;
|
||||||
ListOdlStats = null;
|
ListOdlStats = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected async Task selRecord(ODLModel? currRec)
|
||||||
|
{
|
||||||
|
await Task.Delay(1);
|
||||||
|
selDtFine = DateTime.Now;
|
||||||
|
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()
|
protected async Task UpdateData()
|
||||||
{
|
{
|
||||||
await selectRecord(null);
|
await selRecord(null);
|
||||||
await reloadData();
|
await reloadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,49 +194,158 @@ namespace MP.SPEC.Components
|
|||||||
|
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
|
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
private ODLModel? currRecord = null;
|
private ODLModel? currRecord = null;
|
||||||
|
|
||||||
private List<StatODLModel>? ListOdlStats;
|
private List<StatODLModel>? ListOdlStats;
|
||||||
private List<double>? ListOdlStatsData = new List<double>();
|
|
||||||
private List<string>? ListOdlStatsLabels = new List<string>();
|
private List<StatODLModel>? ListOdlStatsNetto;
|
||||||
|
|
||||||
private List<ODLModel>? ListRecords;
|
private List<ODLModel>? ListRecords;
|
||||||
|
|
||||||
private List<ListValues>? ListStati;
|
private List<ListValues>? ListStati;
|
||||||
|
|
||||||
private List<ODLModel>? SearchRecords;
|
private List<ODLModel>? SearchRecords;
|
||||||
|
|
||||||
|
private ODLModel? statRecord = null;
|
||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
|
|
||||||
#region Private Properties
|
#region Private Properties
|
||||||
|
|
||||||
|
private int _totalCount { get; set; } = 0;
|
||||||
|
|
||||||
private int currPage
|
private int currPage
|
||||||
{
|
{
|
||||||
get => MessageService.currPage;
|
get => currFilter.CurrPage;
|
||||||
set => MessageService.currPage = value;
|
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>
|
||||||
|
private bool isCurrOdl
|
||||||
|
{
|
||||||
|
get => currFilter.IsActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool isLoading { get; set; } = false;
|
private bool isLoading { get; set; } = false;
|
||||||
|
|
||||||
private int numRecord
|
private string leftStringCSS
|
||||||
{
|
{
|
||||||
get => MessageService.numRecord;
|
get => hideSpenta ? "text-secondary" : "text-dark fw-bold";
|
||||||
set => MessageService.numRecord = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int totalCount { get; set; } = 0;
|
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;
|
||||||
|
|
||||||
|
private int totalCount
|
||||||
|
{
|
||||||
|
get => _totalCount;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_totalCount != value)
|
||||||
|
{
|
||||||
|
_totalCount = value;
|
||||||
|
updateRecordCount.InvokeAsync(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Private Properties
|
#endregion Private Properties
|
||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Chiama metodo x chiedere sync DB
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="selRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task addTask2Exe(string idxMacc, string taskName, string taskVal)
|
||||||
|
{
|
||||||
|
// compongo URL e chiamo
|
||||||
|
string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName={taskName}&taskVal={taskVal}";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var response = await MpIoApiCall.callMpIoUrlGet(restUrl);
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Errore durante chiamata: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private double calcolaPerc(double durata)
|
private double calcolaPerc(double durata)
|
||||||
{
|
{
|
||||||
double answ = 0;
|
double answ = 0;
|
||||||
|
|
||||||
double tot = 0;
|
double tot = 0;
|
||||||
if (ListOdlStats != null)
|
if (ListOdlStatsAct != null)
|
||||||
{
|
{
|
||||||
foreach (var item in ListOdlStats)
|
tot = ListOdlStatsAct.Sum(x => x.TotDurata);
|
||||||
{
|
|
||||||
tot += item.TotDurata;
|
|
||||||
}
|
|
||||||
|
|
||||||
double perc = (durata / tot) * 100;
|
double perc = (durata / tot) * 100;
|
||||||
if (perc > 1)
|
if (perc > 1)
|
||||||
@@ -162,23 +360,64 @@ namespace MP.SPEC.Components
|
|||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void MessageService_EA_PageUpdated()
|
/// <summary>
|
||||||
|
/// Chiama metodo x chiedere sync DB
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="IdxMacc"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task callSyncDb(string IdxMacc)
|
||||||
{
|
{
|
||||||
await reloadData();
|
// chiamo aggiunta task SyncDb...
|
||||||
|
await addTask2Exe(IdxMacc, "syncDbData", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
private string pbStyle(string css)
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
if (ListOdlStats != null)
|
||||||
|
{
|
||||||
|
if (css == "yellow")
|
||||||
|
{
|
||||||
|
answ = "orange";
|
||||||
|
}
|
||||||
|
else if (css == "blue")
|
||||||
|
{
|
||||||
|
answ = "#2874A6";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
answ = css;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task reloadData()
|
private async Task reloadData()
|
||||||
{
|
{
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
SearchRecords = await MDService.ListODLFilt(currFilter.IsActive, currFilter.SearchVal, currFilter.CodStato, currFilter.DtStart, currFilter.DtEnd);
|
SearchRecords = await MDService.ListODLFilt(currFilter.IsActive, currFilter.SearchVal, currFilter.CodStato, currFilter.IdxMacchina, currFilter.DtStart, currFilter.DtEnd);
|
||||||
totalCount = SearchRecords.Count;
|
totalCount = SearchRecords.Count;
|
||||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
await InvokeAsync(() => StateHasChanged());
|
await InvokeAsync(() => StateHasChanged());
|
||||||
await updateRecordCount.InvokeAsync(totalCount);
|
|
||||||
isLoading = false;
|
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)
|
private string tradFase(string codFase)
|
||||||
{
|
{
|
||||||
string answ = codFase;
|
string answ = codFase;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace MP.SPEC.Components
|
|||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
private SelectFluxParams lastFilter { get; set; } = new SelectFluxParams() { CurrPage = -1 };
|
||||||
public string checkSelect(FluxLog selRecord)
|
public string checkSelect(FluxLog selRecord)
|
||||||
{
|
{
|
||||||
string answ = "";
|
string answ = "";
|
||||||
@@ -45,10 +45,10 @@ namespace MP.SPEC.Components
|
|||||||
{
|
{
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
// se sono cambiati --> rileggo...
|
// se sono cambiati --> rileggo...
|
||||||
if (LastFilter==null || !SelFilter.Equals(LastFilter))
|
if (!lastFilter.Equals(SelFilter))
|
||||||
{
|
{
|
||||||
await reloadData(false);
|
lastFilter = SelFilter.clone();
|
||||||
LastFilter = SelFilter;
|
await reloadData(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,10 +58,12 @@ namespace MP.SPEC.Components
|
|||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
aTimer.Elapsed -= ElapsedTimer;
|
aTimer.Elapsed -= ElapsedTimer;
|
||||||
MessageService.EA_PageUpdated -= MessageService_EA_PageUpdated;
|
|
||||||
MessageService.EA_SearchUpdated -= OnSeachUpdated;
|
|
||||||
aTimer.Stop();
|
aTimer.Stop();
|
||||||
aTimer.Dispose();
|
aTimer.Dispose();
|
||||||
|
currRecord = null;
|
||||||
|
SearchRecords = null;
|
||||||
|
ListRecords = null;
|
||||||
|
GC.Collect();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
|
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
|
||||||
@@ -124,9 +126,6 @@ namespace MP.SPEC.Components
|
|||||||
[Inject]
|
[Inject]
|
||||||
protected MpDataService MDService { get; set; } = null!;
|
protected MpDataService MDService { get; set; } = null!;
|
||||||
|
|
||||||
[Inject]
|
|
||||||
protected MessageService MessageService { get; set; } = null!;
|
|
||||||
|
|
||||||
protected int RefreshPeriod
|
protected int RefreshPeriod
|
||||||
{
|
{
|
||||||
get => SelFilter.TempoAgg;
|
get => SelFilter.TempoAgg;
|
||||||
@@ -138,8 +137,6 @@ namespace MP.SPEC.Components
|
|||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
|
|
||||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
|
||||||
StartTimer();
|
StartTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,8 +190,8 @@ namespace MP.SPEC.Components
|
|||||||
|
|
||||||
private int currPage
|
private int currPage
|
||||||
{
|
{
|
||||||
get => MessageService.currPage;
|
get => SelFilter.CurrPage;
|
||||||
set => MessageService.currPage = value;
|
set => SelFilter.CurrPage = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool isLoading { get; set; } = false;
|
private bool isLoading { get; set; } = false;
|
||||||
@@ -211,8 +208,8 @@ namespace MP.SPEC.Components
|
|||||||
|
|
||||||
private int numRecord
|
private int numRecord
|
||||||
{
|
{
|
||||||
get => MessageService.numRecord;
|
get => SelFilter.NumRec;
|
||||||
set => MessageService.numRecord = value;
|
set => SelFilter.NumRec = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string SelFlux
|
private string SelFlux
|
||||||
@@ -246,11 +243,6 @@ namespace MP.SPEC.Components
|
|||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|
||||||
private async void MessageService_EA_PageUpdated()
|
|
||||||
{
|
|
||||||
await reloadData(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Private Methods
|
#endregion Private Methods
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
@using MP.SPEC.Components
|
@using MP.SPEC.Components
|
||||||
@using MP.SPEC.Data
|
@using MP.SPEC.Data
|
||||||
|
|
||||||
@if (ListRecords == null)
|
@if (ListRecords == null || isLoading)
|
||||||
{
|
{
|
||||||
<LoadingData></LoadingData>
|
<LoadingData></LoadingData>
|
||||||
}
|
}
|
||||||
@@ -35,6 +35,17 @@ else
|
|||||||
<td class="text-nowrap">
|
<td class="text-nowrap">
|
||||||
<button @onclick="() => selRecord(record)" class="btn btn-primary btn-sm" title="Modifica Record"><i class="bi bi-pencil-square"></i></button>
|
<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>
|
||||||
|
@if (canStartOdl(record.IdxMacchina))
|
||||||
|
{
|
||||||
|
<button @onclick="() => startOdl(record)" class="btn btn-success btn-sm" 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">
|
||||||
|
<i class="far fa-play-circle"></i>
|
||||||
|
</button>}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@record.CodArticolo
|
@record.CodArticolo
|
||||||
|
|||||||
@@ -3,13 +3,17 @@ using Microsoft.JSInterop;
|
|||||||
using MP.Data.DatabaseModels;
|
using MP.Data.DatabaseModels;
|
||||||
using MP.SPEC.Data;
|
using MP.SPEC.Data;
|
||||||
using MP.SPEC.Services;
|
using MP.SPEC.Services;
|
||||||
|
using NLog;
|
||||||
|
|
||||||
namespace MP.SPEC.Components
|
namespace MP.SPEC.Components
|
||||||
{
|
{
|
||||||
public partial class ListPODL
|
public partial class ListPODL : IDisposable
|
||||||
{
|
{
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public SelectPOdlParams actFilter { get; set; } = new SelectPOdlParams();
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public EventCallback<bool> PagerResetReq { get; set; }
|
public EventCallback<bool> PagerResetReq { get; set; }
|
||||||
|
|
||||||
@@ -38,6 +42,15 @@ namespace MP.SPEC.Components
|
|||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
currRecord = null;
|
||||||
|
SearchRecords = null;
|
||||||
|
ListRecords = null;
|
||||||
|
ListStati = null;
|
||||||
|
GC.Collect();
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|
||||||
#region Protected Properties
|
#region Protected Properties
|
||||||
@@ -49,10 +62,7 @@ namespace MP.SPEC.Components
|
|||||||
protected MpDataService MDService { get; set; } = null!;
|
protected MpDataService MDService { get; set; } = null!;
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
protected IOApiService MpIoApiCall { get; set; }
|
protected IOApiService MpIoApiCall { get; set; } = null!;
|
||||||
|
|
||||||
[Inject]
|
|
||||||
protected MessageService MsgService { get; set; } = null!;
|
|
||||||
|
|
||||||
#endregion Protected Properties
|
#endregion Protected Properties
|
||||||
|
|
||||||
@@ -95,7 +105,7 @@ namespace MP.SPEC.Components
|
|||||||
return;
|
return;
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
var done = await MDService.PODLDeleteRecord(selRec);
|
var done = await MDService.PODLDeleteRecord(selRec);
|
||||||
await callSyncDb(selRec);
|
await callSyncDb(selRec.IdxMacchina);
|
||||||
currRecord = null;
|
currRecord = null;
|
||||||
await reloadData();
|
await reloadData();
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
@@ -103,15 +113,17 @@ namespace MP.SPEC.Components
|
|||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
MsgService.EA_PageUpdated += MessageService_EA_PageUpdated;
|
//await FilterChanged.InvokeAsync(actFilter);
|
||||||
MsgService.EA_SearchUpdated += OnSeachUpdated;
|
|
||||||
MsgService.EA_StatoSearch += MsgService_EA_StatoSearch;
|
|
||||||
ListStati = await MDService.AnagStatiComm();
|
ListStati = await MDService.AnagStatiComm();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task OnParametersSetAsync()
|
protected override async Task OnParametersSetAsync()
|
||||||
{
|
{
|
||||||
await reloadData();
|
if (!lastFilter.Equals(actFilter))
|
||||||
|
{
|
||||||
|
lastFilter = actFilter.clone();
|
||||||
|
await reloadData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async void OnSeachUpdated()
|
protected async void OnSeachUpdated()
|
||||||
@@ -142,6 +154,52 @@ namespace MP.SPEC.Components
|
|||||||
await RecordSel.InvokeAsync(selRec);
|
await RecordSel.InvokeAsync(selRec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected async Task startOdl(PODLModel selRec)
|
||||||
|
{
|
||||||
|
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Sei sicuro di voler avviare PODL selezionato?"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (selRec != null)
|
||||||
|
{
|
||||||
|
int idxEvento = 0;
|
||||||
|
string evMess = "";
|
||||||
|
// verifico ancora NON ci sia ODL corrente/aperto
|
||||||
|
if (canStartOdl(selRec.IdxMacchina))
|
||||||
|
{
|
||||||
|
await callStartSetup(selRec.IdxMacchina);
|
||||||
|
await Task.Delay(1);
|
||||||
|
// chiamo stored stp_ODL_inizioSetupPromessa e recupero ODL corrente
|
||||||
|
bool fatto = await MDService.POdlDoSetup(selRec);
|
||||||
|
if (fatto)
|
||||||
|
{
|
||||||
|
var currPOdl = await MDService.PODL_getByKey(selRec.IdxPromessa);
|
||||||
|
var newOdl = await MDService.OdlGetByKey(currPOdl.IdxOdl);
|
||||||
|
|
||||||
|
// registro evento...
|
||||||
|
idxEvento = 2;
|
||||||
|
evMess = $"Inizio Setup | PODL {selRec.IdxPromessa}";
|
||||||
|
processaEvento(selRec.IdxMacchina, idxEvento, evMess, newOdl.IdxOdl, newOdl.CodArticolo);
|
||||||
|
|
||||||
|
// aspetto 1 sec
|
||||||
|
await Task.Delay(1000);
|
||||||
|
|
||||||
|
// registro inizio produzione
|
||||||
|
idxEvento = 2;
|
||||||
|
evMess = $"Registrata inizio Produzione | PODL {selRec.IdxPromessa} | ODL {newOdl.IdxOdl} | ART {newOdl.CodArticolo}";
|
||||||
|
processaEvento(selRec.IdxMacchina, idxEvento, evMess, newOdl.IdxOdl, newOdl.CodArticolo);
|
||||||
|
|
||||||
|
// chiamo task x IOB
|
||||||
|
await callForceUpdate(selRec.IdxMacchina);
|
||||||
|
await Task.Delay(1);
|
||||||
|
await callForceUpdate(selRec.IdxMacchina);
|
||||||
|
await Task.Delay(1);
|
||||||
|
await callSyncDb(selRec.IdxMacchina);
|
||||||
|
await Task.Delay(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected async Task UpdateData()
|
protected async Task UpdateData()
|
||||||
{
|
{
|
||||||
currRecord = null;
|
currRecord = null;
|
||||||
@@ -152,44 +210,67 @@ namespace MP.SPEC.Components
|
|||||||
|
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
|
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
private PODLModel? currRecord = null;
|
private PODLModel? currRecord = null;
|
||||||
|
|
||||||
private List<PODLModel>? ListRecords;
|
private List<PODLModel>? ListRecords;
|
||||||
|
|
||||||
private List<ListValues>? ListStati;
|
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;
|
private List<PODLModel>? SearchRecords;
|
||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
|
|
||||||
#region Private Properties
|
#region Private Properties
|
||||||
|
|
||||||
|
private int _totalCount { get; set; } = 0;
|
||||||
|
|
||||||
private int currPage
|
private int currPage
|
||||||
{
|
{
|
||||||
get => MsgService.currPage;
|
get => actFilter.CurrPage;
|
||||||
set => MsgService.currPage = value;
|
set => actFilter.CurrPage = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool isLoading { get; set; } = false;
|
private bool isLoading { get; set; } = false;
|
||||||
|
private SelectPOdlParams lastFilter { get; set; } = new SelectPOdlParams() { CurrPage = -1 };
|
||||||
|
|
||||||
private int numRecord
|
private int numRecord
|
||||||
{
|
{
|
||||||
get => MsgService.numRecord;
|
get => actFilter.NumRec;
|
||||||
set => MsgService.numRecord = value;
|
set => actFilter.NumRec = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string SearchVal
|
private string SearchVal
|
||||||
{
|
{
|
||||||
get => string.IsNullOrEmpty(MsgService.SearchVal) ? "*" : MsgService.SearchVal;
|
get => string.IsNullOrEmpty(actFilter.SearchVal) ? "*" : actFilter.SearchVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string StatoSel
|
private string StatoSel
|
||||||
{
|
{
|
||||||
get => MsgService.StateSel;
|
get => actFilter.CodFase;
|
||||||
set => MsgService.StateSel = value;
|
set => actFilter.CodFase = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int totalCount { get; set; } = 0;
|
private int totalCount
|
||||||
|
{
|
||||||
|
get => _totalCount;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_totalCount != value)
|
||||||
|
{
|
||||||
|
_totalCount = value;
|
||||||
|
updateRecordCount.InvokeAsync(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Private Properties
|
#endregion Private Properties
|
||||||
|
|
||||||
@@ -200,28 +281,104 @@ namespace MP.SPEC.Components
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="selRec"></param>
|
/// <param name="selRec"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private async Task callSyncDb(PODLModel selRec)
|
private async Task addTask2Exe(string idxMacc, string taskName, string taskVal)
|
||||||
|
{
|
||||||
|
// compongo URL e chiamo
|
||||||
|
string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName={taskName}&taskVal={taskVal}";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var response = await MpIoApiCall.callMpIoUrlGet(restUrl);
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Errore durante chiamata: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Chiama metodo x chiedere force Update
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="selRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task callForceUpdate(string IdxMacc)
|
||||||
{
|
{
|
||||||
// chiamo aggiunta task SyncDb...
|
// chiamo aggiunta task SyncDb...
|
||||||
string idxMacc = selRec.IdxMacchina;
|
await addTask2Exe(IdxMacc, "ForceUpdate", $"SPEC|TS:{DateTime.Now:yyMMddHHmmss}");
|
||||||
string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName=syncDbData&taskVal=";
|
|
||||||
var response = await MpIoApiCall.callMpIoUrlGet(restUrl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void MessageService_EA_PageUpdated()
|
/// <summary>
|
||||||
|
/// Chiama metodo x indicare inizio setup
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="selRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task callStartSetup(string IdxMacc)
|
||||||
{
|
{
|
||||||
await reloadData();
|
// chiamo evento inizio setup
|
||||||
|
await addTask2Exe(IdxMacc, "startSetup", $"SPEC|TS:{DateTime.Now:yyMMddHHmmss}");
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void MsgService_EA_StatoSearch()
|
/// <summary>
|
||||||
|
/// Chiama metodo x chiedere sync DB
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="IdxMacc"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task callSyncDb(string IdxMacc)
|
||||||
{
|
{
|
||||||
await InvokeAsync(() =>
|
// chiamo aggiunta task SyncDb...
|
||||||
|
await addTask2Exe(IdxMacc, "syncDbData", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// verifica se sia avviabile ODL x macchina
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idxMacchina"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private bool canStartOdl(string idxMacchina)
|
||||||
|
{
|
||||||
|
// controllo se lista scaduta...
|
||||||
|
bool answ = false;
|
||||||
|
DateTime adesso = DateTime.Now;
|
||||||
|
if (adesso > odlCurrExp || odlCurrList == null || odlCurrList.Count == 0)
|
||||||
{
|
{
|
||||||
PagerResetReq.InvokeAsync(true);
|
odlCurrList = MDService.OdlGetCurrent();
|
||||||
//currPage = 1;
|
odlCurrExp = adesso.AddSeconds(2);
|
||||||
Task task = UpdateData();
|
}
|
||||||
StateHasChanged();
|
answ = !odlCurrList.Contains(idxMacchina);
|
||||||
});
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// processa evento richiesto
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idxMacc"></param>
|
||||||
|
/// <param name="idxEvento"></param>
|
||||||
|
/// <param name="userMsg"></param>
|
||||||
|
/// <param name="idxODL"></param>
|
||||||
|
private async void processaEvento(string idxMacc, int idxEvento, string userMsg, int idxODL, string codArticolo)
|
||||||
|
{
|
||||||
|
// se manca codart calcolo...
|
||||||
|
if (string.IsNullOrEmpty(codArticolo))
|
||||||
|
{
|
||||||
|
var currOdl = await MDService.OdlGetByKey(idxODL);
|
||||||
|
if (currOdl != null)
|
||||||
|
{
|
||||||
|
codArticolo = currOdl.CodArticolo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// scrivo evento scriviRigaEventoBarcode
|
||||||
|
EventListModel newRec = new EventListModel()
|
||||||
|
{
|
||||||
|
IdxMacchina = idxMacc,
|
||||||
|
InizioStato = DateTime.Now,
|
||||||
|
IdxTipo = idxEvento,
|
||||||
|
CodArticolo = codArticolo,
|
||||||
|
MatrOpr = 0,
|
||||||
|
pallet = "",
|
||||||
|
Value = userMsg
|
||||||
|
};
|
||||||
|
|
||||||
|
await MDService.EvListInsert(newRec);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task reloadData()
|
private async Task reloadData()
|
||||||
@@ -232,7 +389,7 @@ namespace MP.SPEC.Components
|
|||||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
await InvokeAsync(() => StateHasChanged());
|
await InvokeAsync(() => StateHasChanged());
|
||||||
await updateRecordCount.InvokeAsync(totalCount);
|
//await updateRecordCount.InvokeAsync(totalCount);
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<MP.SPEC.Components.Chart.Doughnut Type="@Chart.Doughnut.ChartType.Doughnut" Data="@Data.ToArray()" BackgroundColor="@colors.ToArray()"></MP.SPEC.Components.Chart.Doughnut>
|
<MP.SPEC.Components.Chart.Doughnut Type="@Chart.Doughnut.ChartType.Doughnut" Data="@Data.ToArray()" BackgroundColor="@colors"></MP.SPEC.Components.Chart.Doughnut>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,25 @@
|
|||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using Microsoft.JSInterop;
|
|
||||||
using MP.Data.DatabaseModels;
|
using MP.Data.DatabaseModels;
|
||||||
using MP.SPEC.Components;
|
|
||||||
using MP.SPEC.Data;
|
using MP.SPEC.Data;
|
||||||
|
|
||||||
namespace MP.SPEC.Components
|
namespace MP.SPEC.Components
|
||||||
{
|
{
|
||||||
public partial class ODLPlot
|
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
|
public int OdlId
|
||||||
{
|
{
|
||||||
@@ -29,49 +40,69 @@ namespace MP.SPEC.Components
|
|||||||
//protected DataLogFilter _SelFilter { get; set; } = new DataLogFilter();
|
//protected DataLogFilter _SelFilter { get; set; } = new DataLogFilter();
|
||||||
protected int _selParam { get; set; } = -1;
|
protected int _selParam { get; set; } = -1;
|
||||||
|
|
||||||
|
[Inject]
|
||||||
|
protected MpDataService MDService { get; set; } = null!;
|
||||||
|
|
||||||
#endregion Protected Properties
|
#endregion Protected Properties
|
||||||
|
|
||||||
#region Protected Methods
|
#region Protected Methods
|
||||||
|
|
||||||
private bool isLoading { get; set; } = false;
|
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
}
|
}
|
||||||
private List<StatODLModel>? ListRecords = null;
|
|
||||||
protected override async Task OnParametersSetAsync()
|
protected override async Task OnParametersSetAsync()
|
||||||
{
|
{
|
||||||
await ReloadData();
|
await ReloadData();
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<double> Data = new List<double>();
|
|
||||||
public List<string> Labels = new List<string>();
|
|
||||||
public List<string> colors = new List<string>();
|
|
||||||
|
|
||||||
protected async Task ReloadData()
|
protected async Task ReloadData()
|
||||||
{
|
{
|
||||||
Data.Clear();
|
Data.Clear();
|
||||||
Labels.Clear();
|
Labels.Clear();
|
||||||
colors.Clear();
|
colors.Clear();
|
||||||
ListRecords = await MDService.StatOdl(SelectedOdl);
|
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)
|
foreach (var record in ListRecords)
|
||||||
{
|
{
|
||||||
Data.Add(record.TotDurata);
|
Data.Add(record.TotDurata);
|
||||||
Labels.Add($"{record.Descrizione} - {record.TotDurata:N1}min");
|
Labels.Add($"{record.Descrizione} - {record.TotDurata:N1}min");
|
||||||
colors.Add(record.Css);
|
if (record.Css == "yellow")
|
||||||
|
{
|
||||||
|
colors.Add(new DoughnutStyling("orange", "ccc"));
|
||||||
|
}
|
||||||
|
else if (record.Css == "blue")
|
||||||
|
{
|
||||||
|
colors.Add(new DoughnutStyling("#2874A6", "ccc"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
colors.Add(new DoughnutStyling(record.Css, "ccc"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[Inject]
|
|
||||||
protected MpDataService MDService { get; set; } = null!;
|
|
||||||
|
|
||||||
#endregion Protected Methods
|
#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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<div class="d-flex justify-content-between pt-1 mb-1">
|
<div class="d-flex justify-content-between pt-1 mb-1">
|
||||||
<div class="px-2">
|
<div class="px-2">
|
||||||
|
|
||||||
@if (!liveUpdate)
|
@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="() => toggleUpdate()" title="Click per tornare a Valori Live">
|
||||||
|
|||||||
@@ -168,7 +168,10 @@ namespace MP.SPEC.Components
|
|||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
SelFilter = new SelectFluxParams();
|
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);
|
ListFlux = await MDService.ParametriGetFilt(selMacchina);
|
||||||
|
|
||||||
var configData = await MDService.ConfigGetAll();
|
var configData = await MDService.ConfigGetAll();
|
||||||
@@ -186,7 +189,7 @@ namespace MP.SPEC.Components
|
|||||||
// copio il filtro
|
// copio il filtro
|
||||||
var currFilt = SelFilter;
|
var currFilt = SelFilter;
|
||||||
// fermo update
|
// fermo update
|
||||||
//currFilt.LiveUpdate = false;
|
currFilt.LiveUpdate = true;
|
||||||
currFilt.CurrPage = 0;
|
currFilt.CurrPage = 0;
|
||||||
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||||
currFilt.dtMax = RoundDatetime(5);
|
currFilt.dtMax = RoundDatetime(5);
|
||||||
@@ -210,9 +213,8 @@ namespace MP.SPEC.Components
|
|||||||
// se non ho data rif uso adesso...
|
// se non ho data rif uso adesso...
|
||||||
DateTime dtMax = selDtMax == null ? RoundDatetime(5) : (DateTime)selDtMax;
|
DateTime dtMax = selDtMax == null ? RoundDatetime(5) : (DateTime)selDtMax;
|
||||||
DateTime dtMin = selDtMin == null ? RoundDatetime(5).AddHours(-numOreAnticipoSnapshot) : (DateTime)selDtMin;
|
DateTime dtMin = selDtMin == null ? RoundDatetime(5).AddHours(-numOreAnticipoSnapshot) : (DateTime)selDtMin;
|
||||||
// aggiungo 2 sec
|
// aggiungo 15 sec
|
||||||
dtMax = dtMax.AddSeconds(15);
|
dtMax = dtMax.AddSeconds(15);
|
||||||
//dtMin = dtMin.AddMinutes(-30);
|
|
||||||
await MDService.DossiersTakeParamsSnapshotLast(selMacchina, dtMin, dtMax);
|
await MDService.DossiersTakeParamsSnapshotLast(selMacchina, dtMin, dtMax);
|
||||||
lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||||
// indico snapshot fatto
|
// indico snapshot fatto
|
||||||
@@ -267,7 +269,7 @@ namespace MP.SPEC.Components
|
|||||||
// copio il filtro
|
// copio il filtro
|
||||||
var currFilt = SelFilter;
|
var currFilt = SelFilter;
|
||||||
// fermo update
|
// fermo update
|
||||||
currFilt.LiveUpdate = false;
|
currFilt.LiveUpdate = (value == null);
|
||||||
currFilt.CurrPage = 0;
|
currFilt.CurrPage = 0;
|
||||||
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||||
currFilt.dtMax = value;
|
currFilt.dtMax = value;
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
namespace MP.SPEC.Data
|
||||||
|
{
|
||||||
|
public class DoughnutStyling
|
||||||
|
{
|
||||||
|
public string color { get; set; }
|
||||||
|
public string border { get; set; }
|
||||||
|
|
||||||
|
public DoughnutStyling(string color, string border)
|
||||||
|
{
|
||||||
|
this.color = color;
|
||||||
|
this.border = border;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+292
-112
@@ -82,7 +82,7 @@ namespace MP.SPEC.Data
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = await Task.FromResult(dbController.AnagStatiComm());
|
result = await Task.FromResult(dbController.AnagStatiComm());
|
||||||
// serializzp e salvo...
|
// serializzo e salvo...
|
||||||
rawData = JsonConvert.SerializeObject(result);
|
rawData = JsonConvert.SerializeObject(result);
|
||||||
await redisDb.StringSetAsync(redisStatoCom, rawData, getRandTOut(redisLongTimeCache));
|
await redisDb.StringSetAsync(redisStatoCom, rawData, getRandTOut(redisLongTimeCache));
|
||||||
stopWatch.Stop();
|
stopWatch.Stop();
|
||||||
@@ -113,7 +113,7 @@ namespace MP.SPEC.Data
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = await Task.FromResult(dbController.AnagTipoArtLV());
|
result = await Task.FromResult(dbController.AnagTipoArtLV());
|
||||||
// serializzp e salvo...
|
// serializzo e salvo...
|
||||||
rawData = JsonConvert.SerializeObject(result);
|
rawData = JsonConvert.SerializeObject(result);
|
||||||
await redisDb.StringSetAsync(redisTipoArt, rawData, getRandTOut(redisLongTimeCache));
|
await redisDb.StringSetAsync(redisTipoArt, rawData, getRandTOut(redisLongTimeCache));
|
||||||
stopWatch.Stop();
|
stopWatch.Stop();
|
||||||
@@ -127,6 +127,41 @@ namespace MP.SPEC.Data
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco Codice articolo con dati dossier gestiti
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<List<string>> ArticleWithDossier()
|
||||||
|
{
|
||||||
|
List<string>? result = new List<string>();
|
||||||
|
Stopwatch stopWatch = new Stopwatch();
|
||||||
|
stopWatch.Start();
|
||||||
|
string readType = "DB";
|
||||||
|
string currKey = redisArtByDossier;
|
||||||
|
// cerco in redis dato valore sel macchina...
|
||||||
|
RedisValue rawData = redisDb.StringGet(currKey);
|
||||||
|
if (rawData.HasValue)
|
||||||
|
{
|
||||||
|
result = JsonConvert.DeserializeObject<List<string>>($"{rawData}");
|
||||||
|
readType = "REDIS";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result = await Task.FromResult(dbController.ArticleWithDossier());
|
||||||
|
// serializzo e salvo...
|
||||||
|
rawData = JsonConvert.SerializeObject(result);
|
||||||
|
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
||||||
|
}
|
||||||
|
if (result == null)
|
||||||
|
{
|
||||||
|
result = new List<string>();
|
||||||
|
}
|
||||||
|
stopWatch.Stop();
|
||||||
|
TimeSpan ts = stopWatch.Elapsed;
|
||||||
|
Log.Debug($"ArticleWithDossier | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Eliminazione record selezionato
|
/// Eliminazione record selezionato
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -242,7 +277,7 @@ namespace MP.SPEC.Data
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = await Task.FromResult(dbController.ConfigGetAll());
|
result = await Task.FromResult(dbController.ConfigGetAll());
|
||||||
// serializzp e salvo...
|
// serializzo e salvo...
|
||||||
rawData = JsonConvert.SerializeObject(result);
|
rawData = JsonConvert.SerializeObject(result);
|
||||||
await redisDb.StringSetAsync(redisConfKey, rawData, getRandTOut(redisLongTimeCache));
|
await redisDb.StringSetAsync(redisConfKey, rawData, getRandTOut(redisLongTimeCache));
|
||||||
stopWatch.Stop();
|
stopWatch.Stop();
|
||||||
@@ -274,69 +309,6 @@ namespace MP.SPEC.Data
|
|||||||
return await Task.FromResult(dbController.ConfigUpdate(updRec));
|
return await Task.FromResult(dbController.ConfigUpdate(updRec));
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<FluxLogDTO> getFluxLog(string Valore)
|
|
||||||
{
|
|
||||||
List<FluxLogDTO> answ = new List<FluxLogDTO>();
|
|
||||||
DossierFluxLogDTO? result = JsonConvert.DeserializeObject<DossierFluxLogDTO>(Valore);
|
|
||||||
if (result != null)
|
|
||||||
{
|
|
||||||
if (result.ODL != null)
|
|
||||||
{
|
|
||||||
answ = result
|
|
||||||
.ODL
|
|
||||||
.OrderBy(x => x.CodFlux)
|
|
||||||
.ToList();
|
|
||||||
// inizializzo SE necessario
|
|
||||||
foreach (var item in answ)
|
|
||||||
{
|
|
||||||
item.ValoreEdit = String.IsNullOrEmpty(item.ValoreEdit) ? item.Valore : item.ValoreEdit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<bool> updateDossierValue(Dossiers currDoss, FluxLogDTO editFL)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
// recupero intero set valori dossier deserializzando...
|
|
||||||
var fluxLogList = getFluxLog(currDoss.Valore);
|
|
||||||
await Task.Delay(1);
|
|
||||||
|
|
||||||
// se tutto ok
|
|
||||||
if (fluxLogList != null)
|
|
||||||
{
|
|
||||||
// da provare...!!!!
|
|
||||||
|
|
||||||
// elimino vecchio record
|
|
||||||
var currRec = fluxLogList.FirstOrDefault(x => x.CodFlux == editFL.CodFlux && x.dtEvento == editFL.dtEvento);
|
|
||||||
if (currRec != null)
|
|
||||||
{
|
|
||||||
fluxLogList.Remove(currRec);
|
|
||||||
// aggiungo nuovo
|
|
||||||
fluxLogList.Add(editFL);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// serializzo nuovamente valore
|
|
||||||
DossierFluxLogDTO? result = new DossierFluxLogDTO();
|
|
||||||
var ODLflux = result.ODL.ToList();
|
|
||||||
foreach (var item in fluxLogList)
|
|
||||||
{
|
|
||||||
ODLflux.Add(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
DossierFluxLogDTO updatedResult = new DossierFluxLogDTO(){ODL = ODLflux};
|
|
||||||
|
|
||||||
string rawVal = JsonConvert.SerializeObject(updatedResult);
|
|
||||||
currDoss.Valore = rawVal;
|
|
||||||
// aggiorno record sul DB
|
|
||||||
await dbController.DossiersUpdateValore(currDoss);
|
|
||||||
}
|
|
||||||
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
// Clear database controller
|
// Clear database controller
|
||||||
@@ -369,16 +341,16 @@ namespace MP.SPEC.Data
|
|||||||
/// macchina (ordinato x data registrazione)
|
/// macchina (ordinato x data registrazione)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
|
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
|
||||||
/// <param name="DtRef">Data di riferimento (Massima) per estrazione records</param>
|
/// <param name="DtStart">Data minima per estrazione records</param>
|
||||||
/// <param name="MaxRec">numero massimo record da restituire</param>
|
/// <param name="DtEnd">Data Massima per estrazione records</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<Dossiers>> DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtRef, int MaxRec)
|
public async Task<List<Dossiers>> DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtStart, DateTime DtEnd)
|
||||||
{
|
{
|
||||||
List<Dossiers>? result = new List<Dossiers>();
|
List<Dossiers>? result = new List<Dossiers>();
|
||||||
Stopwatch stopWatch = new Stopwatch();
|
Stopwatch stopWatch = new Stopwatch();
|
||||||
stopWatch.Start();
|
stopWatch.Start();
|
||||||
string readType = "DB";
|
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...
|
// cerco in redis dato valore sel macchina...
|
||||||
RedisValue rawData = redisDb.StringGet(currKey);
|
RedisValue rawData = redisDb.StringGet(currKey);
|
||||||
if (rawData.HasValue)
|
if (rawData.HasValue)
|
||||||
@@ -388,8 +360,8 @@ namespace MP.SPEC.Data
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = await Task.FromResult(dbController.DossiersGetLastFilt(IdxMacchina, CodArticolo, DtRef, MaxRec));
|
result = await Task.FromResult(dbController.DossiersGetLastFilt(IdxMacchina, CodArticolo, DtStart, DtEnd));
|
||||||
// serializzp e salvo...
|
// serializzo e salvo...
|
||||||
rawData = JsonConvert.SerializeObject(result);
|
rawData = JsonConvert.SerializeObject(result);
|
||||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache / 5));
|
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache / 5));
|
||||||
}
|
}
|
||||||
@@ -454,16 +426,6 @@ namespace MP.SPEC.Data
|
|||||||
return Task.FromResult(dbController.AnagGruppiAziende());
|
return Task.FromResult(dbController.AnagGruppiAziende());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Statistiche ODL calcolate (da stored stp_STAT_ODL)
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public Task<List<StatODLModel>> StatOdl(int IdxOdl)
|
|
||||||
{
|
|
||||||
return dbController.StatOdl(IdxOdl);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Restitusice elenco fasi
|
/// Restitusice elenco fasi
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -478,6 +440,16 @@ namespace MP.SPEC.Data
|
|||||||
return Task.FromResult(dbController.ElencoLink());
|
return Task.FromResult(dbController.ElencoLink());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Aggiunta record EventList
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<bool> EvListInsert(EventListModel newRec)
|
||||||
|
{
|
||||||
|
return await dbController.EvListInsert(newRec);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<bool> FlushRedisCache()
|
public async Task<bool> FlushRedisCache()
|
||||||
{
|
{
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
@@ -496,13 +468,33 @@ namespace MP.SPEC.Data
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<FluxLog>> FluxLogGetLastFilt(DateTime DtMax, string IdxMacchina, string CodFlux, int MaxRec)
|
public async Task<List<FluxLog>> FluxLogGetLastFilt(DateTime DtMax, string IdxMacchina, string CodFlux, int MaxRec)
|
||||||
{
|
{
|
||||||
|
List<FluxLog>? result = new List<FluxLog>();
|
||||||
Stopwatch stopWatch = new Stopwatch();
|
Stopwatch stopWatch = new Stopwatch();
|
||||||
stopWatch.Start();
|
stopWatch.Start();
|
||||||
var results = await Task.FromResult(dbController.FluxLogGetLastFilt(DtMax, IdxMacchina, CodFlux, MaxRec));
|
string readType = "DB";
|
||||||
|
string currKey = $"{redisFluxLogFilt}:{IdxMacchina}:{CodFlux}:{MaxRec}:{DtMax:yyyyMMdd}:{DtMax:HHmm}";
|
||||||
|
// 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, 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();
|
stopWatch.Stop();
|
||||||
TimeSpan ts = stopWatch.Elapsed;
|
TimeSpan ts = stopWatch.Elapsed;
|
||||||
Log.Debug($"FluxLogGetLastFilt | Read from DB: {ts.TotalMilliseconds}ms");
|
Log.Debug($"FluxLogGetLastFilt | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||||
return results;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -514,6 +506,28 @@ namespace MP.SPEC.Data
|
|||||||
return Task.FromResult(currTagConf);
|
return Task.FromResult(currTagConf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<FluxLogDTO> getFluxLog(string Valore)
|
||||||
|
{
|
||||||
|
List<FluxLogDTO> answ = new List<FluxLogDTO>();
|
||||||
|
DossierFluxLogDTO? result = JsonConvert.DeserializeObject<DossierFluxLogDTO>(Valore);
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
if (result.ODL != null)
|
||||||
|
{
|
||||||
|
answ = result
|
||||||
|
.ODL
|
||||||
|
.OrderBy(x => x.CodFlux)
|
||||||
|
.ToList();
|
||||||
|
// inizializzo SE necessario
|
||||||
|
foreach (var item in answ)
|
||||||
|
{
|
||||||
|
item.ValoreEdit = String.IsNullOrEmpty(item.ValoreEdit) ? item.Valore : item.ValoreEdit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// restituisce il valore da REDIS associato al tag richeisto
|
/// restituisce il valore da REDIS associato al tag richeisto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -537,10 +551,11 @@ namespace MP.SPEC.Data
|
|||||||
/// <param name="inCorso">Stato ODL: true=in corso/completato</param>
|
/// <param name="inCorso">Stato ODL: true=in corso/completato</param>
|
||||||
/// <param name="codArt">Cod articolo</param>
|
/// <param name="codArt">Cod articolo</param>
|
||||||
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
|
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
|
||||||
|
/// <param name="IdxMacchina">id macchina da cercare</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<ODLModel>> ListODLFilt(bool inCorso, string codArt, string keyRichPart, DateTime startDate, DateTime endDate)
|
public async Task<List<ODLModel>> ListODLFilt(bool inCorso, string codArt, string keyRichPart, string IdxMacchina, DateTime startDate, DateTime endDate)
|
||||||
{
|
{
|
||||||
return await Task.FromResult(dbController.ListODLFilt(inCorso, codArt, keyRichPart, startDate, endDate));
|
return await Task.FromResult(dbController.ListODLFilt(inCorso, codArt, keyRichPart, IdxMacchina, startDate, endDate));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -551,7 +566,35 @@ namespace MP.SPEC.Data
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<PODLModel>> ListPODLFilt(string codArt, string keyRichPart)
|
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>
|
/// <summary>
|
||||||
@@ -575,7 +618,7 @@ namespace MP.SPEC.Data
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = await Task.FromResult(dbController.MacchineGetAll());
|
result = await Task.FromResult(dbController.MacchineGetAll());
|
||||||
// serializzp e salvo...
|
// serializzo e salvo...
|
||||||
rawData = JsonConvert.SerializeObject(result);
|
rawData = JsonConvert.SerializeObject(result);
|
||||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
||||||
}
|
}
|
||||||
@@ -590,16 +633,18 @@ namespace MP.SPEC.Data
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco ID macchine con dati FluxLog gestite
|
/// Elenco id Macchine che abbiano dati FLuxLog, nel periodo indicato
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="dtStart"></param>
|
||||||
|
/// <param name="dtEnd"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<string>> MacchineWithFlux()
|
public async Task<List<string>> MacchineWithFlux(DateTime dtStart, DateTime dtEnd)
|
||||||
{
|
{
|
||||||
List<string>? result = new List<string>();
|
List<string>? result = new List<string>();
|
||||||
Stopwatch stopWatch = new Stopwatch();
|
Stopwatch stopWatch = new Stopwatch();
|
||||||
stopWatch.Start();
|
stopWatch.Start();
|
||||||
string readType = "DB";
|
string readType = "DB";
|
||||||
string currKey = redisMacByFlux;
|
string currKey = $"{redisMacByFlux}:{dtStart:yyyyMMddHHmm}:{dtEnd:yyyyMMddHHmm}";
|
||||||
// cerco in redis dato valore sel macchina...
|
// cerco in redis dato valore sel macchina...
|
||||||
RedisValue rawData = redisDb.StringGet(currKey);
|
RedisValue rawData = redisDb.StringGet(currKey);
|
||||||
if (rawData.HasValue)
|
if (rawData.HasValue)
|
||||||
@@ -609,8 +654,8 @@ namespace MP.SPEC.Data
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = await dbController.MacchineWithFlux();
|
result = await dbController.MacchineWithFlux(dtStart, dtEnd);
|
||||||
// serializzp e salvo...
|
// serializzo e salvo...
|
||||||
rawData = JsonConvert.SerializeObject(result);
|
rawData = JsonConvert.SerializeObject(result);
|
||||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
||||||
}
|
}
|
||||||
@@ -624,40 +669,91 @@ namespace MP.SPEC.Data
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Effettua chiusura dell'ODL indicato, andand
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idxOdl">idx odl da chiudere</param>
|
||||||
|
/// <param name="idxMacchina">idx macchina</param>
|
||||||
|
/// <param name="matrOpr">matricola operatore</param>
|
||||||
|
/// <param name="confPezzi">indica se confermare i pezzi priam di chiudere ODL</param>
|
||||||
|
public async Task<bool> ODLClose(int idxOdl, string idxMacchina, int matrOpr, bool confPezzi)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
await Task.Delay(1);
|
||||||
|
// recupero dati x conf modalità conferma
|
||||||
|
var configData = await ConfigGetAll();
|
||||||
|
if (configData != null)
|
||||||
|
{
|
||||||
|
bool confRett = false;
|
||||||
|
var currRec = configData.FirstOrDefault(x => x.Chiave == "confRett");
|
||||||
|
if (currRec != null)
|
||||||
|
{
|
||||||
|
bool.TryParse(currRec.Valore, out confRett);
|
||||||
|
}
|
||||||
|
int modoConfProd = 0;
|
||||||
|
currRec = configData.FirstOrDefault(x => x.Chiave == "modoConfProd");
|
||||||
|
if (currRec != null)
|
||||||
|
{
|
||||||
|
int.TryParse(currRec.Valore, out modoConfProd);
|
||||||
|
}
|
||||||
|
// chiamo metodo conferma!
|
||||||
|
fatto = await dbController.ODLClose(idxOdl, idxMacchina, matrOpr, confPezzi, confRett, modoConfProd);
|
||||||
|
}
|
||||||
|
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco Codice articolo con dati dossier gestiti
|
/// Record ODL da chaive
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<string>> ArticleWithDossier()
|
public async Task<ODLModel> OdlGetByKey(int IdxOdl)
|
||||||
{
|
{
|
||||||
List<string>? result = new List<string>();
|
await Task.Delay(1);
|
||||||
|
var dbResult = dbController.OdlGetByKey(IdxOdl);
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ODL correnti (tutti)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idxMacchina"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<string> OdlGetCurrent()
|
||||||
|
{
|
||||||
|
List<string> dbResult = new List<string>();
|
||||||
Stopwatch stopWatch = new Stopwatch();
|
Stopwatch stopWatch = new Stopwatch();
|
||||||
stopWatch.Start();
|
stopWatch.Start();
|
||||||
string readType = "DB";
|
string readType = "DB";
|
||||||
string currKey = redisArtByDossier;
|
string currKey = $"{redisOdlCurrByMac}";
|
||||||
// cerco in redis dato valore sel macchina...
|
// cerco in redis dato valore sel macchina...
|
||||||
RedisValue rawData = redisDb.StringGet(currKey);
|
RedisValue rawData = redisDb.StringGet(currKey);
|
||||||
if (rawData.HasValue)
|
if (rawData.HasValue)
|
||||||
{
|
{
|
||||||
result = JsonConvert.DeserializeObject<List<string>>($"{rawData}");
|
try
|
||||||
|
{
|
||||||
|
dbResult = JsonConvert.DeserializeObject<List<string>>($"{rawData}");
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
readType = "REDIS";
|
readType = "REDIS";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = await Task.FromResult(dbController.ArticleWithDossier());
|
dbResult = dbController.OdlGetCurrent().Select(x => x.IdxMacchina).Distinct().ToList();
|
||||||
// serializzp e salvo...
|
rawData = JsonConvert.SerializeObject(dbResult);
|
||||||
rawData = JsonConvert.SerializeObject(result);
|
redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(3));
|
||||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
|
||||||
}
|
}
|
||||||
if (result == null)
|
if (dbResult == null)
|
||||||
{
|
{
|
||||||
result = new List<string>();
|
dbResult = new List<string>();
|
||||||
}
|
}
|
||||||
stopWatch.Stop();
|
stopWatch.Stop();
|
||||||
TimeSpan ts = stopWatch.Elapsed;
|
TimeSpan ts = stopWatch.Elapsed;
|
||||||
Log.Debug($"ArticleWithDossier | Read from {readType}: {ts.TotalMilliseconds}ms");
|
Log.Debug($"OdlGetCurrent | Read from {readType}: {ts.TotalMilliseconds}ms");
|
||||||
return result;
|
|
||||||
|
|
||||||
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -682,7 +778,7 @@ namespace MP.SPEC.Data
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = await Task.FromResult(dbController.ParametriGetFilt(IdxMacchina));
|
result = await Task.FromResult(dbController.ParametriGetFilt(IdxMacchina));
|
||||||
// serializzp e salvo...
|
// serializzo e salvo...
|
||||||
rawData = JsonConvert.SerializeObject(result);
|
rawData = JsonConvert.SerializeObject(result);
|
||||||
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
|
||||||
}
|
}
|
||||||
@@ -696,6 +792,16 @@ namespace MP.SPEC.Data
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recupero PODL da chiave
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idxPODL"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<PODLModel> PODL_getByKey(int idxPODL)
|
||||||
|
{
|
||||||
|
return await dbController.PODL_getByKey(idxPODL);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Eliminazione record selezionato
|
/// Eliminazione record selezionato
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -706,6 +812,16 @@ namespace MP.SPEC.Data
|
|||||||
return await dbController.PODLDeleteRecord(currRec);
|
return await dbController.PODLDeleteRecord(currRec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Avvio fase setup per il record selezionato
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<bool> POdlDoSetup(PODLModel currRec)
|
||||||
|
{
|
||||||
|
return await dbController.PODL_startSetup(currRec, 0, 1, 1, "");
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Aggiornamento record selezionato
|
/// Aggiornamento record selezionato
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -713,7 +829,70 @@ namespace MP.SPEC.Data
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<bool> POdlUpdateRecord(PODLModel currRec)
|
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>
|
||||||
|
/// Statistiche ODL calcolate (da stored stp_STAT_ODL)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task<List<StatODLModel>> StatOdl(int IdxOdl)
|
||||||
|
{
|
||||||
|
return dbController.OdlStart(IdxOdl);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> updateDossierValue(Dossiers currDoss, FluxLogDTO editFL)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
// recupero intero set valori dossier deserializzando...
|
||||||
|
var fluxLogList = getFluxLog(currDoss.Valore);
|
||||||
|
await Task.Delay(1);
|
||||||
|
|
||||||
|
// se tutto ok
|
||||||
|
if (fluxLogList != null)
|
||||||
|
{
|
||||||
|
// da provare...!!!!
|
||||||
|
|
||||||
|
// elimino vecchio record
|
||||||
|
var currRec = fluxLogList.FirstOrDefault(x => x.CodFlux == editFL.CodFlux && x.dtEvento == editFL.dtEvento);
|
||||||
|
if (currRec != null)
|
||||||
|
{
|
||||||
|
fluxLogList.Remove(currRec);
|
||||||
|
// aggiungo nuovo
|
||||||
|
fluxLogList.Add(editFL);
|
||||||
|
}
|
||||||
|
|
||||||
|
// serializzo nuovamente valore
|
||||||
|
DossierFluxLogDTO? result = new DossierFluxLogDTO();
|
||||||
|
var ODLflux = result.ODL.ToList();
|
||||||
|
foreach (var item in fluxLogList)
|
||||||
|
{
|
||||||
|
ODLflux.Add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
DossierFluxLogDTO updatedResult = new DossierFluxLogDTO() { ODL = ODLflux };
|
||||||
|
|
||||||
|
string rawVal = JsonConvert.SerializeObject(updatedResult);
|
||||||
|
currDoss.Valore = rawVal;
|
||||||
|
// aggiorno record sul DB
|
||||||
|
await dbController.DossiersUpdateValore(currDoss);
|
||||||
|
}
|
||||||
|
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<bool> DossiersUpdateValore(Dossiers currDoss)
|
||||||
|
{
|
||||||
|
// aggiorno record sul DB
|
||||||
|
bool answ = await dbController.DossiersUpdateValore(currDoss);
|
||||||
|
|
||||||
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
@@ -741,6 +920,7 @@ namespace MP.SPEC.Data
|
|||||||
|
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
|
private const string redisArtByDossier = redisBaseAddr + "SPEC:Cache:ArtByDossier";
|
||||||
private const string redisBaseAddr = "MP:";
|
private const string redisBaseAddr = "MP:";
|
||||||
|
|
||||||
private const string redisConfKey = redisBaseAddr + "SPEC:Cache:Config";
|
private const string redisConfKey = redisBaseAddr + "SPEC:Cache:Config";
|
||||||
@@ -748,12 +928,12 @@ namespace MP.SPEC.Data
|
|||||||
private const string redisDossByMac = redisBaseAddr + "SPEC:Cache:DossByMac";
|
private const string redisDossByMac = redisBaseAddr + "SPEC:Cache:DossByMac";
|
||||||
|
|
||||||
private const string redisFluxByMac = redisBaseAddr + "SPEC:Cache:FluxByMac";
|
private const string redisFluxByMac = redisBaseAddr + "SPEC:Cache:FluxByMac";
|
||||||
|
private const string redisOdlCurrByMac = redisBaseAddr + "SPEC:Cache:OdlByMac";
|
||||||
|
|
||||||
private const string redisMacByFlux = redisBaseAddr + "SPEC:Cache:MacByFlux";
|
private const string redisMacByFlux = redisBaseAddr + "SPEC:Cache:MacByFlux";
|
||||||
|
|
||||||
private const string redisArtByDossier = redisBaseAddr + "SPEC:Cache:ArtByDossier";
|
|
||||||
|
|
||||||
private const string redisMacList = redisBaseAddr + "SPEC:Cache:MacList";
|
private const string redisMacList = redisBaseAddr + "SPEC:Cache:MacList";
|
||||||
|
private const string redisPOdlList = redisBaseAddr + "SPEC:Cache:POdlList";
|
||||||
|
private const string redisFluxLogFilt = redisBaseAddr + "SPEC:Cache:FluxLogFilt";
|
||||||
|
|
||||||
private const string redisStatoCom = redisBaseAddr + "SPEC:Cache:StatoCom";
|
private const string redisStatoCom = redisBaseAddr + "SPEC:Cache:StatoCom";
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
namespace MP.SPEC.Data
|
using MP.Data;
|
||||||
|
|
||||||
|
namespace MP.SPEC.Data
|
||||||
{
|
{
|
||||||
public class SelectDossierParams
|
public class SelectDossierParams
|
||||||
{
|
{
|
||||||
@@ -13,29 +15,35 @@
|
|||||||
|
|
||||||
public int CurrPage { get; set; } = 1;
|
public int CurrPage { get; set; } = 1;
|
||||||
|
|
||||||
public DateTime DtRef { get; set; } = InitDatetime(5);
|
public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5);
|
||||||
|
|
||||||
|
public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-730);
|
||||||
|
|
||||||
public string IdxMacchina { get; set; } = "*";
|
public string IdxMacchina { get; set; } = "*";
|
||||||
|
|
||||||
public string CodArticolo { 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 int MaxRecord { get; set; } = 100;
|
||||||
|
public bool isEditing { get; set; } = false;
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
public SelectDossierParams clone()
|
||||||
/// <summary>
|
|
||||||
/// Inizializzazione con periodo e arrotondamento
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="minRound"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static DateTime InitDatetime(int minRound)
|
|
||||||
{
|
{
|
||||||
TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today);
|
SelectDossierParams clonedData = new SelectDossierParams()
|
||||||
int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound;
|
{
|
||||||
DateTime endRounded = DateTime.Today.AddMinutes(minDay);
|
DtEnd = this.DtEnd,
|
||||||
return endRounded;
|
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)
|
public override bool Equals(object obj)
|
||||||
@@ -52,14 +60,18 @@
|
|||||||
if (MaxRecord != item.MaxRecord)
|
if (MaxRecord != item.MaxRecord)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (DtRef != item.DtRef)
|
if (TotCount != item.TotCount)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (NumRec != item.NumRec)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (DtEnd != item.DtEnd)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (CurrPage != item.CurrPage)
|
if (CurrPage != item.CurrPage)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//if (lastUpdate != item.lastUpdate)
|
|
||||||
// return false;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,14 +19,33 @@
|
|||||||
public string IdxMacchina { get; set; } = "*";
|
public string IdxMacchina { get; set; } = "*";
|
||||||
public string lastUpdate { get; set; } = "-";
|
public string lastUpdate { get; set; } = "-";
|
||||||
public bool LiveUpdate { get; set; } = true;
|
public bool LiveUpdate { get; set; } = true;
|
||||||
|
public int NumRec { get; set; } = 10;
|
||||||
public int MaxRecord { get; set; } = 100;
|
public int MaxRecord { get; set; } = 100;
|
||||||
public int TempoAgg { get; set; } = 10000;
|
public int TempoAgg { get; set; } = 10000;
|
||||||
|
public int TotCount { get; set; } = 0;
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
|
|
||||||
#region Public Methods
|
#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)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (!(obj is SelectFluxParams item))
|
if (!(obj is SelectFluxParams item))
|
||||||
@@ -46,6 +65,12 @@
|
|||||||
|
|
||||||
if (TempoAgg != item.TempoAgg)
|
if (TempoAgg != item.TempoAgg)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (NumRec!= item.NumRec)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (TotCount!= item.TotCount)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (CurrPage != item.CurrPage)
|
if (CurrPage != item.CurrPage)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -14,8 +14,10 @@ namespace MP.SPEC.Data
|
|||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
public string CodStato { get; set; } = "*";
|
public string CodStato { get; set; } = "*";
|
||||||
|
public string IdxMacchina { get; set; } = "*";
|
||||||
public int CurrPage { get; set; } = 1;
|
public int CurrPage { get; set; } = 1;
|
||||||
public int NumRec { get; set; } = 10;
|
public int NumRec { get; set; } = 10;
|
||||||
|
public int TotCount { get; set; } = 0;
|
||||||
public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5);
|
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(-7);
|
||||||
public int MaxRecord { get; set; } = 100;
|
public int MaxRecord { get; set; } = 100;
|
||||||
@@ -37,6 +39,9 @@ namespace MP.SPEC.Data
|
|||||||
if (CodStato != item.CodStato)
|
if (CodStato != item.CodStato)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (IdxMacchina != item.IdxMacchina)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (MaxRecord != item.MaxRecord)
|
if (MaxRecord != item.MaxRecord)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
namespace MP.SPEC.Data
|
||||||
|
{
|
||||||
|
public class SelectPOdlParams
|
||||||
|
{
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
public SelectPOdlParams()
|
||||||
|
{ }
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public string CodFase { get; set; } = "*";
|
||||||
|
|
||||||
|
public int CurrPage { get; set; } = 1;
|
||||||
|
|
||||||
|
public string IdxMacchina { get; set; } = "*";
|
||||||
|
|
||||||
|
public int MaxRecord { get; set; } = 100;
|
||||||
|
|
||||||
|
public int NumRec { get; set; } = 10;
|
||||||
|
|
||||||
|
public string SearchVal { get; set; } = "*";
|
||||||
|
|
||||||
|
public int TotCount { get; set; } = 0;
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
public SelectPOdlParams clone()
|
||||||
|
{
|
||||||
|
SelectPOdlParams clonedData = new SelectPOdlParams()
|
||||||
|
{
|
||||||
|
CodFase = this.CodFase,
|
||||||
|
CurrPage = this.CurrPage,
|
||||||
|
IdxMacchina = this.IdxMacchina,
|
||||||
|
MaxRecord = this.MaxRecord,
|
||||||
|
NumRec = this.NumRec,
|
||||||
|
SearchVal = this.SearchVal,
|
||||||
|
TotCount = this.TotCount
|
||||||
|
};
|
||||||
|
return clonedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Equals(object obj)
|
||||||
|
{
|
||||||
|
if (!(obj is SelectPOdlParams item))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (CodFase != item.CodFase)
|
||||||
|
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;
|
||||||
|
|
||||||
|
if (SearchVal != item.SearchVal)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return base.GetHashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<RootNamespace>MP.SPEC</RootNamespace>
|
<RootNamespace>MP.SPEC</RootNamespace>
|
||||||
<Version>6.16.2210.1417</Version>
|
<Version>6.16.2210.2014</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -24,9 +24,17 @@ namespace MP.SPEC.Pages
|
|||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private SelectArticoliParams currFilter = new SelectArticoliParams();
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
MessageService.EA_SearchUpdated -= OnSeachUpdated;
|
//MessageService.EA_SearchUpdated -= OnSeachUpdated;
|
||||||
|
currRecord = null;
|
||||||
|
ListTipoArt = null;
|
||||||
|
ListAziende = null;
|
||||||
|
SearchRecords = null;
|
||||||
|
ListRecords = null;
|
||||||
|
GC.Collect();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void OnSeachUpdated()
|
public async void OnSeachUpdated()
|
||||||
@@ -49,9 +57,6 @@ namespace MP.SPEC.Pages
|
|||||||
[Inject]
|
[Inject]
|
||||||
protected MpDataService MDService { get; set; } = null!;
|
protected MpDataService MDService { get; set; } = null!;
|
||||||
|
|
||||||
[Inject]
|
|
||||||
protected MessageService MessageService { get; set; } = null!;
|
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
protected NavigationManager NavManager { get; set; }
|
protected NavigationManager NavManager { get; set; }
|
||||||
|
|
||||||
@@ -125,9 +130,6 @@ namespace MP.SPEC.Pages
|
|||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
numRecord = 10;
|
numRecord = 10;
|
||||||
// mostro ricerca
|
|
||||||
MessageService.ShowSearch = true;
|
|
||||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
|
||||||
configData = await MDService.ConfigGetAll();
|
configData = await MDService.ConfigGetAll();
|
||||||
var currRec = configData.FirstOrDefault(x => x.Chiave == "AZIENDA");
|
var currRec = configData.FirstOrDefault(x => x.Chiave == "AZIENDA");
|
||||||
if (currRec != null)
|
if (currRec != null)
|
||||||
@@ -166,14 +168,14 @@ namespace MP.SPEC.Pages
|
|||||||
{
|
{
|
||||||
Azienda = selRec.Azienda,
|
Azienda = selRec.Azienda,
|
||||||
CodArticolo = selRec.CodArticolo,
|
CodArticolo = selRec.CodArticolo,
|
||||||
DescArticolo = $"CLONE - { selRec.DescArticolo }",
|
DescArticolo = $"CLONE - {selRec.DescArticolo}",
|
||||||
Disegno = selRec.Disegno,
|
Disegno = selRec.Disegno,
|
||||||
Tipo=selRec.Tipo
|
Tipo = selRec.Tipo
|
||||||
};
|
};
|
||||||
currRecord = newRec;
|
currRecord = newRec;
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected async Task update(AnagArticoli selRec)
|
protected async Task update(AnagArticoli selRec)
|
||||||
{
|
{
|
||||||
@@ -288,7 +290,7 @@ namespace MP.SPEC.Pages
|
|||||||
private async Task reloadData()
|
private async Task reloadData()
|
||||||
{
|
{
|
||||||
isLoading = true;
|
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();
|
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,72 +21,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@if (currDetFluxLogRecord != null)
|
@if (isLoading)
|
||||||
{
|
{
|
||||||
<div class="row">
|
<LoadingData></LoadingData>
|
||||||
<div class="col-12">
|
}
|
||||||
<div class="card mb-5">
|
else
|
||||||
<div class="card-header bg-primary text-light">Modifica Parametro</div>
|
{
|
||||||
<div class="card-body">
|
<ListDossiers SelFilter="@currFilter" RecordSel="@selRecordDoss" TotRecordChanged="updateTotal"></ListDossiers>
|
||||||
<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>
|
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@if (isLoading)
|
<div class="card-footer py-1">
|
||||||
{
|
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
||||||
<LoadingData></LoadingData>
|
</div>
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<ListDossiers SelFilter="@currFilter" RecordSel="@selRecordDoss" RecordSelFlux="@selRecordFlux" TotRecordChanged="updateTotal"></ListDossiers>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer py-1">
|
|
||||||
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+32
-37
@@ -23,19 +23,11 @@ namespace MP.SPEC.Pages
|
|||||||
[Inject]
|
[Inject]
|
||||||
protected MpDataService MDService { get; set; } = null!;
|
protected MpDataService MDService { get; set; } = null!;
|
||||||
|
|
||||||
[Inject]
|
|
||||||
protected MessageService MsgService { get; set; } = null!;
|
|
||||||
|
|
||||||
#endregion Protected Properties
|
#endregion Protected Properties
|
||||||
|
|
||||||
#region Protected Methods
|
#region Protected Methods
|
||||||
|
|
||||||
protected async Task cancel()
|
|
||||||
{
|
|
||||||
currDetFluxLogRecord = null;
|
|
||||||
await Task.Delay(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void ForceReload(int newNum)
|
protected void ForceReload(int newNum)
|
||||||
{
|
{
|
||||||
numRecord = newNum;
|
numRecord = newNum;
|
||||||
@@ -51,9 +43,6 @@ namespace MP.SPEC.Pages
|
|||||||
{
|
{
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
isFiltering = true;
|
isFiltering = true;
|
||||||
// disabilito ricerca...
|
|
||||||
MsgService.SearchVal = "";
|
|
||||||
MsgService.ShowSearch = false;
|
|
||||||
// fix pagina
|
// fix pagina
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
var modFilter = currFilter;
|
var modFilter = currFilter;
|
||||||
@@ -69,25 +58,23 @@ namespace MP.SPEC.Pages
|
|||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async Task selRecordFlux(FluxLogDTO selRec)
|
private string css()
|
||||||
{
|
{
|
||||||
currDetFluxLogRecord = selRec;
|
string answ = "";
|
||||||
await Task.Delay(1);
|
if (isEditing == false)
|
||||||
|
{
|
||||||
|
answ = "hidden";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
answ = "visible";
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async Task update(FluxLogDTO selRec)
|
private void enableEditing()
|
||||||
{
|
{
|
||||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler salvare le modifiche? queste saranno parte del dossier inviato all'impianto"))
|
isEditing = true;
|
||||||
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)
|
protected void updateTotal(int newTotCount)
|
||||||
@@ -105,18 +92,14 @@ namespace MP.SPEC.Pages
|
|||||||
|
|
||||||
#region Private Properties
|
#region Private Properties
|
||||||
|
|
||||||
private FluxLogDTO? currDetFluxLogRecord
|
|
||||||
{
|
|
||||||
get => _currDetFluxLogRecord;
|
|
||||||
set { _currDetFluxLogRecord = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private SelectDossierParams currFilter { get; set; } = new SelectDossierParams();
|
private SelectDossierParams currFilter { get; set; } = new SelectDossierParams();
|
||||||
|
|
||||||
private int currPage
|
private int currPage
|
||||||
{
|
{
|
||||||
get => MsgService.currPage;
|
get => currFilter.CurrPage;
|
||||||
set => MsgService.currPage = value;
|
set => currFilter.CurrPage = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Dossiers? currRecordDoss { get; set; } = null;
|
private Dossiers? currRecordDoss { get; set; } = null;
|
||||||
@@ -125,11 +108,19 @@ namespace MP.SPEC.Pages
|
|||||||
|
|
||||||
private int numRecord
|
private int numRecord
|
||||||
{
|
{
|
||||||
get => MsgService.numRecord;
|
get => currFilter.NumRec;
|
||||||
set => MsgService.numRecord = value;
|
set => currFilter.NumRec = value;
|
||||||
|
}
|
||||||
|
private bool isEditing
|
||||||
|
{
|
||||||
|
get => currFilter.isEditing;
|
||||||
|
set => currFilter.isEditing = value;
|
||||||
|
}
|
||||||
|
private int totalCount
|
||||||
|
{
|
||||||
|
get => currFilter.TotCount;
|
||||||
|
set => currFilter.TotCount = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int totalCount { get; set; } = 0;
|
|
||||||
|
|
||||||
#endregion Private Properties
|
#endregion Private Properties
|
||||||
|
|
||||||
@@ -146,6 +137,10 @@ namespace MP.SPEC.Pages
|
|||||||
currFilter = newParams;
|
currFilter = newParams;
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
}
|
}
|
||||||
|
protected void UpdateTotCount(int newTotCount)
|
||||||
|
{
|
||||||
|
totalCount = newTotCount;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Private Methods
|
#endregion Private Methods
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-4
@@ -37,11 +37,11 @@
|
|||||||
<div>
|
<div>
|
||||||
|
|
||||||
<div class="small mt-2">
|
<div class="small mt-2">
|
||||||
<label class="px-2" for="macchina" title="Selezionare inizio periodo">Macchina</label>
|
<label class="px-2" for="fase" title="Selezionare inizio periodo">Fase</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-group px-2">
|
<div class="input-group px-2">
|
||||||
<label class="input-group-text" for="macchina" title="Selezionare la fase da visualizzare"><i class="fa-solid fa-screwdriver-wrench"></i></label>
|
<label class="input-group-text" for="fase" title="Selezionare la fase da visualizzare"><i class="fa-solid fa-screwdriver-wrench"></i></label>
|
||||||
<select @bind="@selStato" id="macchina" class="form-select" title="Selezionare la fase da visualizzare">
|
<select @bind="@selStato" id="fase" class="form-select" title="Selezionare la fase da visualizzare">
|
||||||
<option value="*">--- Tutti ---</option>
|
<option value="*">--- Tutti ---</option>
|
||||||
@if (ListStati != null)
|
@if (ListStati != null)
|
||||||
{
|
{
|
||||||
@@ -53,6 +53,25 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<div class="small mt-2">
|
||||||
|
<label class="px-2" for="macchina" title="Selezionare inizio periodo">Macchina</label>
|
||||||
|
</div>
|
||||||
|
<div class="input-group px-2">
|
||||||
|
<label class="input-group-text" for="macchina" title="Selezionare la macchina da visualizzare"><i class="fa-solid fa-hard-drive"></i></label>
|
||||||
|
<select @bind="@selMacchina" id="macchina" class="form-select" title="Selezionare la macchina da visualizzare">
|
||||||
|
<option value="*">--- Tutti ---</option>
|
||||||
|
@if (ListMacchine != null)
|
||||||
|
{
|
||||||
|
foreach (var item in ListMacchine)
|
||||||
|
{
|
||||||
|
<option value="@item">@item</option>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@if (!isActive)
|
@if (!isActive)
|
||||||
{
|
{
|
||||||
<div class="small mt-2">
|
<div class="small mt-2">
|
||||||
@@ -83,4 +102,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+14
-18
@@ -26,7 +26,7 @@ namespace MP.SPEC.Pages
|
|||||||
|
|
||||||
#region Protected Fields
|
#region Protected Fields
|
||||||
|
|
||||||
protected DataPager pagerODL;
|
protected DataPager pagerODL = null!;
|
||||||
|
|
||||||
#endregion Protected Fields
|
#endregion Protected Fields
|
||||||
|
|
||||||
@@ -44,9 +44,6 @@ namespace MP.SPEC.Pages
|
|||||||
[Inject]
|
[Inject]
|
||||||
protected MpDataService MDService { get; set; } = null!;
|
protected MpDataService MDService { get; set; } = null!;
|
||||||
|
|
||||||
[Inject]
|
|
||||||
protected MessageService MsgService { get; set; } = null!;
|
|
||||||
|
|
||||||
protected DateTime selDtEnd
|
protected DateTime selDtEnd
|
||||||
{
|
{
|
||||||
get => currFilter.DtEnd;
|
get => currFilter.DtEnd;
|
||||||
@@ -87,15 +84,8 @@ namespace MP.SPEC.Pages
|
|||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
// abilito ricerca...
|
|
||||||
MsgService.ShowSearch = true;
|
|
||||||
// resetto search
|
|
||||||
MsgService.SearchVal = "";
|
|
||||||
ListStati = await MDService.AnagStatiComm();
|
ListStati = await MDService.AnagStatiComm();
|
||||||
#if false
|
ListMacchine = await MDService.MacchineWithFlux(currFilter.DtStart, currFilter.DtEnd);
|
||||||
// carico dati
|
|
||||||
await reloadData();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async Task pgResetReq(bool doReset)
|
protected async Task pgResetReq(bool doReset)
|
||||||
@@ -123,6 +113,7 @@ namespace MP.SPEC.Pages
|
|||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
private List<MP.Data.DatabaseModels.ListValues>? ListStati;
|
private List<MP.Data.DatabaseModels.ListValues>? ListStati;
|
||||||
|
private List<string>? ListMacchine;
|
||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
|
|
||||||
@@ -132,8 +123,8 @@ namespace MP.SPEC.Pages
|
|||||||
|
|
||||||
private int currPage
|
private int currPage
|
||||||
{
|
{
|
||||||
get => MsgService.currPage;
|
get => currFilter.CurrPage;
|
||||||
set => MsgService.currPage = value;
|
set => currFilter.CurrPage = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool isLoading { get; set; } = false;
|
private bool isLoading { get; set; } = false;
|
||||||
@@ -145,8 +136,8 @@ namespace MP.SPEC.Pages
|
|||||||
|
|
||||||
private int numRecord
|
private int numRecord
|
||||||
{
|
{
|
||||||
get => MsgService.numRecord;
|
get => currFilter.NumRec;
|
||||||
set => MsgService.numRecord = value;
|
set => currFilter.NumRec = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string rightStringCSS
|
private string rightStringCSS
|
||||||
@@ -159,11 +150,16 @@ namespace MP.SPEC.Pages
|
|||||||
get => currFilter.CodStato;
|
get => currFilter.CodStato;
|
||||||
set => currFilter.CodStato = value;
|
set => currFilter.CodStato = value;
|
||||||
}
|
}
|
||||||
|
private string selMacchina
|
||||||
|
{
|
||||||
|
get => currFilter.IdxMacchina;
|
||||||
|
set => currFilter.IdxMacchina = value;
|
||||||
|
}
|
||||||
|
|
||||||
private int totalCount
|
private int totalCount
|
||||||
{
|
{
|
||||||
get => MsgService.totalCount;
|
get => currFilter.TotCount;
|
||||||
set => MsgService.totalCount = value;
|
set => currFilter.TotCount = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Private Properties
|
#endregion Private Properties
|
||||||
|
|||||||
@@ -25,12 +25,10 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<ListPARAMS SelFilter="@currFilter" TotRecordChanged="@updateTotal" RecordSel="@detailSel"></ListPARAMS>
|
<ListPARAMS SelFilter="@currFilter" TotRecordChanged="@UpdateTotCount" RecordSel="@detailSel"></ListPARAMS>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer py-1">
|
<div class="card-footer py-1">
|
||||||
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ namespace MP.SPEC.Pages
|
|||||||
|
|
||||||
#region Protected Properties
|
#region Protected Properties
|
||||||
|
|
||||||
[Inject]
|
|
||||||
protected MessageService MsgService { get; set; } = null!;
|
|
||||||
|
|
||||||
#endregion Protected Properties
|
#endregion Protected Properties
|
||||||
|
|
||||||
@@ -43,9 +41,6 @@ namespace MP.SPEC.Pages
|
|||||||
{
|
{
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
isFiltering = true;
|
isFiltering = true;
|
||||||
// disabilito ricerca...
|
|
||||||
MsgService.SearchVal = "";
|
|
||||||
MsgService.ShowSearch = false;
|
|
||||||
// fix pagina
|
// fix pagina
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
var modFilter = currFilter;
|
var modFilter = currFilter;
|
||||||
@@ -100,8 +95,8 @@ namespace MP.SPEC.Pages
|
|||||||
|
|
||||||
private int currPage
|
private int currPage
|
||||||
{
|
{
|
||||||
get => MsgService.currPage;
|
get => currFilter.CurrPage;
|
||||||
set => MsgService.currPage = value;
|
set => currFilter.CurrPage = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool isFiltering { get; set; } = false;
|
private bool isFiltering { get; set; } = false;
|
||||||
@@ -109,8 +104,8 @@ namespace MP.SPEC.Pages
|
|||||||
|
|
||||||
private int numRecord
|
private int numRecord
|
||||||
{
|
{
|
||||||
get => MsgService.numRecord;
|
get => currFilter.NumRec;
|
||||||
set => MsgService.numRecord = value;
|
set => currFilter.NumRec = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int totalCount { get; set; } = 0;
|
private int totalCount { get; set; } = 0;
|
||||||
@@ -128,7 +123,7 @@ namespace MP.SPEC.Pages
|
|||||||
if (newParams.CurrPage == 0)
|
if (newParams.CurrPage == 0)
|
||||||
{
|
{
|
||||||
newParams.CurrPage = 1;
|
newParams.CurrPage = 1;
|
||||||
newParams.LiveUpdate = false;
|
//newParams.LiveUpdate = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -139,7 +134,10 @@ namespace MP.SPEC.Pages
|
|||||||
currFilter = newParams;
|
currFilter = newParams;
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
}
|
}
|
||||||
|
protected void UpdateTotCount(int newTotCount)
|
||||||
|
{
|
||||||
|
totalCount = newTotCount;
|
||||||
|
}
|
||||||
#endregion Private Methods
|
#endregion Private Methods
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<div class="card mb-5">
|
<div class="card mb-5">
|
||||||
<div class="card-header table-primary">
|
<div class="card-header table-primary">
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<div class="col-6">
|
<div class="col-6 col-lg-8">
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<div class="px-2">
|
<div class="px-2">
|
||||||
<h3><b>P</b>romesse <b>ODL</b></h3>
|
<h3><b>P</b>romesse <b>ODL</b></h3>
|
||||||
@@ -17,9 +17,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6 col-lg-4">
|
||||||
<div class="input-group input-group-sm">
|
<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>
|
@*<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">
|
<select @bind="@currAzienda" class="form-select" title="Selezionare l'azienda da visualizzare">
|
||||||
@if (ListAziende != null)
|
@if (ListAziende != null)
|
||||||
{
|
{
|
||||||
@@ -28,9 +28,9 @@
|
|||||||
<option value="@item.CodGruppo">@item.DescrGruppo</option>
|
<option value="@item.CodGruppo">@item.DescrGruppo</option>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</select>
|
</select>*@
|
||||||
<label class="input-group-text" for="maxRecord" title="Selezionare la fase da visualizzare"><i class="fa-solid fa-screwdriver-wrench"></i></label>
|
<label class="input-group-text" for="maxRecord" title="Selezionare la fase da visualizzare"><i class="fa-solid fa-screwdriver-wrench"></i></label>
|
||||||
<select @bind="@selStato" class="form-select" title="Selezionare la fase da visualizzare">
|
<select @bind="@currFase" class="form-select" title="Selezionare la fase da visualizzare">
|
||||||
<option value="*">--- Tutti ---</option>
|
<option value="*">--- Tutti ---</option>
|
||||||
@if (ListStati != null)
|
@if (ListStati != null)
|
||||||
{
|
{
|
||||||
@@ -222,13 +222,10 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<ListPODL PagerResetReq="pgResetReq" RecordSel="@selRecord" updateRecordCount="UpdateTotCount"></ListPODL>
|
<ListPODL PagerResetReq="pgResetReq" RecordSel="@selRecord" updateRecordCount="UpdateTotCount" actFilter="@currFilter"></ListPODL>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer py-1">
|
<div class="card-footer py-1">
|
||||||
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="@isLoading" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+41
-34
@@ -4,6 +4,7 @@ using MP.Data.DatabaseModels;
|
|||||||
using MP.SPEC.Components;
|
using MP.SPEC.Components;
|
||||||
using MP.SPEC.Data;
|
using MP.SPEC.Data;
|
||||||
using MP.SPEC.Services;
|
using MP.SPEC.Services;
|
||||||
|
using NLog;
|
||||||
|
|
||||||
namespace MP.SPEC.Pages
|
namespace MP.SPEC.Pages
|
||||||
{
|
{
|
||||||
@@ -11,7 +12,7 @@ namespace MP.SPEC.Pages
|
|||||||
{
|
{
|
||||||
#region Protected Fields
|
#region Protected Fields
|
||||||
|
|
||||||
protected DataPager pagerODL;
|
protected DataPager pagerODL = null!;
|
||||||
|
|
||||||
protected bool reqNew = false;
|
protected bool reqNew = false;
|
||||||
|
|
||||||
@@ -20,19 +21,16 @@ namespace MP.SPEC.Pages
|
|||||||
#region Protected Properties
|
#region Protected Properties
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
protected IJSRuntime JSRuntime { get; set; }
|
protected IJSRuntime JSRuntime { get; set; } = null!;
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
protected MpDataService MDService { get; set; }
|
protected MpDataService MDService { get; set; } = null!;
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
protected IOApiService MpIoApiCall { get; set; }
|
protected IOApiService MpIoApiCall { get; set; } = null!;
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
protected MessageService MsgService { get; set; }
|
protected NavigationManager NavManager { get; set; } = null!;
|
||||||
|
|
||||||
[Inject]
|
|
||||||
protected NavigationManager NavManager { get; set; }
|
|
||||||
|
|
||||||
#endregion Protected Properties
|
#endregion Protected Properties
|
||||||
|
|
||||||
@@ -70,10 +68,6 @@ namespace MP.SPEC.Pages
|
|||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
// abilito ricerca...
|
|
||||||
MsgService.ShowSearch = true;
|
|
||||||
// resetto search
|
|
||||||
MsgService.SearchVal = "";
|
|
||||||
ListAziende = await MDService.ElencoAziende();
|
ListAziende = await MDService.ElencoAziende();
|
||||||
ListGruppiFase = await MDService.ElencoGruppiFase();
|
ListGruppiFase = await MDService.ElencoGruppiFase();
|
||||||
ListMacchine = await MDService.MacchineGetAll();
|
ListMacchine = await MDService.MacchineGetAll();
|
||||||
@@ -110,7 +104,7 @@ namespace MP.SPEC.Pages
|
|||||||
var firstArt = ListArticoli.FirstOrDefault();
|
var firstArt = ListArticoli.FirstOrDefault();
|
||||||
currArticolo = firstArt != null ? firstArt.CodArticolo : "";
|
currArticolo = firstArt != null ? firstArt.CodArticolo : "";
|
||||||
}
|
}
|
||||||
string codExt = $"{selStato}";
|
string codExt = $"{currFase}";
|
||||||
string codGruppo = "";
|
string codGruppo = "";
|
||||||
if (ListGruppiFase != null && ListGruppiFase.Count > 0)
|
if (ListGruppiFase != null && ListGruppiFase.Count > 0)
|
||||||
{
|
{
|
||||||
@@ -157,6 +151,9 @@ namespace MP.SPEC.Pages
|
|||||||
await callSyncDb(selRec);
|
await callSyncDb(selRec);
|
||||||
currRecord = null;
|
currRecord = null;
|
||||||
await reloadData();
|
await reloadData();
|
||||||
|
// forzo update parametri
|
||||||
|
await Task.Delay(1);
|
||||||
|
currFase = "*";
|
||||||
await Task.Delay(1);
|
await Task.Delay(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,16 +166,12 @@ namespace MP.SPEC.Pages
|
|||||||
|
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
|
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
private PODLModel? _currRecord = null;
|
private PODLModel? _currRecord = null;
|
||||||
|
|
||||||
private List<AnagArticoli>? ListArticoli;
|
private List<AnagArticoli>? ListArticoli;
|
||||||
|
|
||||||
private List<AnagGruppi>? ListAziende;
|
private List<AnagGruppi>? ListAziende;
|
||||||
|
|
||||||
private List<AnagGruppi>? ListGruppiFase;
|
private List<AnagGruppi>? ListGruppiFase;
|
||||||
|
|
||||||
private List<Macchine>? ListMacchine;
|
private List<Macchine>? ListMacchine;
|
||||||
|
|
||||||
private List<ListValues>? ListStati;
|
private List<ListValues>? ListStati;
|
||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
@@ -186,12 +179,11 @@ namespace MP.SPEC.Pages
|
|||||||
#region Private Properties
|
#region Private Properties
|
||||||
|
|
||||||
private string _artSearch { get; set; } = "";
|
private string _artSearch { get; set; } = "";
|
||||||
|
|
||||||
private string _currAzienda { get; set; } = "*";
|
private string _currAzienda { get; set; } = "*";
|
||||||
|
|
||||||
private bool addEnabled
|
private bool addEnabled
|
||||||
{
|
{
|
||||||
get => selStato != "*";
|
get => currFase != "*";
|
||||||
}
|
}
|
||||||
|
|
||||||
private string artSearch
|
private string artSearch
|
||||||
@@ -217,7 +209,6 @@ namespace MP.SPEC.Pages
|
|||||||
}
|
}
|
||||||
|
|
||||||
private List<ConfigModel>? configData { get; set; } = null;
|
private List<ConfigModel>? configData { get; set; } = null;
|
||||||
|
|
||||||
private string currArticolo { get; set; } = "";
|
private string currArticolo { get; set; } = "";
|
||||||
|
|
||||||
private string currAzienda
|
private string currAzienda
|
||||||
@@ -237,10 +228,25 @@ 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
|
private int currPage
|
||||||
{
|
{
|
||||||
get => MsgService.currPage;
|
get => currFilter.CurrPage;
|
||||||
set => MsgService.currPage = value;
|
set => currFilter.CurrPage = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private PODLModel? currRecord
|
private PODLModel? currRecord
|
||||||
@@ -257,20 +263,14 @@ namespace MP.SPEC.Pages
|
|||||||
|
|
||||||
private int numRecord
|
private int numRecord
|
||||||
{
|
{
|
||||||
get => MsgService.numRecord;
|
get => currFilter.NumRec;
|
||||||
set => MsgService.numRecord = value;
|
set => currFilter.NumRec = value;
|
||||||
}
|
|
||||||
|
|
||||||
private string selStato
|
|
||||||
{
|
|
||||||
get => MsgService.StateSel;
|
|
||||||
set => MsgService.StateSel = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int totalCount
|
private int totalCount
|
||||||
{
|
{
|
||||||
get => MsgService.totalCount;
|
get => currFilter.TotCount;
|
||||||
set => MsgService.totalCount = value;
|
set => currFilter.TotCount = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Private Properties
|
#endregion Private Properties
|
||||||
@@ -287,7 +287,14 @@ namespace MP.SPEC.Pages
|
|||||||
// chiamo aggiunta task SyncDb...
|
// chiamo aggiunta task SyncDb...
|
||||||
string idxMacc = selRec.IdxMacchina;
|
string idxMacc = selRec.IdxMacchina;
|
||||||
string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName=syncDbData&taskVal=";
|
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()
|
private async Task reloadData()
|
||||||
|
|||||||
@@ -32,8 +32,8 @@
|
|||||||
|
|
||||||
<script src="lib/bootstrap/js/bootstrap.bundle.min.js"></script>
|
<script src="lib/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||||
<script src="_framework/blazor.server.js" autostart="false"></script>
|
<script src="_framework/blazor.server.js" autostart="false"></script>
|
||||||
<script src="lib/chartjs-adapter-luxon/chartjs-adapter-luxon.js"></script>
|
|
||||||
<script src="lib/chartBoot.js"></script>
|
<script src="lib/chartBoot.js"></script>
|
||||||
|
<script src="lib/modalHandler.js"></script>
|
||||||
<script src="lib/Chart.js/chart.js"></script>
|
<script src="lib/Chart.js/chart.js"></script>
|
||||||
|
|
||||||
@*Gestione autoriconnessione: https://github.com/dotnet/aspnetcore/issues/38305 (vedere anche https://docs.microsoft.com/it-it/aspnet/core/blazor/fundamentals/signalr?view=aspnetcore-6.0#modify-the-reconnection-handler-blazor-server)*@
|
@*Gestione autoriconnessione: https://github.com/dotnet/aspnetcore/issues/38305 (vedere anche https://docs.microsoft.com/it-it/aspnet/core/blazor/fundamentals/signalr?view=aspnetcore-6.0#modify-the-reconnection-handler-blazor-server)*@
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<body>
|
<body>
|
||||||
<i>Modulo MAPOSPEC </i>
|
<i>Modulo MAPOSPEC </i>
|
||||||
<h4>Versione: 6.16.2210.1417</h4>
|
<h4>Versione: 6.16.2210.2014</h4>
|
||||||
<br /> Note di rilascio:
|
<br /> Note di rilascio:
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
6.16.2210.1417
|
6.16.2210.2014
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<item>
|
<item>
|
||||||
<version>6.16.2210.1417</version>
|
<version>6.16.2210.2014</version>
|
||||||
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
|
<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>
|
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
|
||||||
<mandatory>false</mandatory>
|
<mandatory>false</mandatory>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using MP.SPEC.Data;
|
using MP.SPEC.Data;
|
||||||
|
using NLog;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace MP.SPEC.Services
|
namespace MP.SPEC.Services
|
||||||
@@ -18,6 +19,9 @@ namespace MP.SPEC.Services
|
|||||||
private static IConfiguration _configuration = null!;
|
private static IConfiguration _configuration = null!;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
private static string MpIoBaseUrl = "";
|
private static string MpIoBaseUrl = "";
|
||||||
|
|
||||||
public IOApiService(IHttpClientFactory clientFactory, IConfiguration configuration, ILogger<MpDataService> logger)
|
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}");
|
var request = new HttpRequestMessage(HttpMethod.Get, $"{MpIoBaseUrl}{relUrl}");
|
||||||
request.Headers.Add("Accept", "application/vnd.github.v3+json");
|
request.Headers.Add("Accept", "application/vnd.github.v3+json");
|
||||||
var client = _clientFactory.CreateClient();
|
var client = _clientFactory.CreateClient();
|
||||||
|
Log.Info($"Richiesta call per {MpIoBaseUrl}{relUrl}");
|
||||||
var response = await client.SendAsync(request);
|
var response = await client.SendAsync(request);
|
||||||
if (response.IsSuccessStatusCode)
|
if (response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
var stringResponse = await response.Content.ReadAsStringAsync();
|
var stringResponse = await response.Content.ReadAsStringAsync();
|
||||||
result = stringResponse;
|
result = stringResponse;
|
||||||
|
Log.Info($"Richiesta call per {MpIoBaseUrl}{relUrl}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = "NO";
|
result = "NO";
|
||||||
|
Log.Error($"Errore in chaimata | code {response.StatusCode} | {response.Content}");
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,5 +5,11 @@
|
|||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
"Microsoft.AspNetCore": "Warning"
|
"Microsoft.AspNetCore": "Warning"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"ServerConf": {
|
||||||
|
"maxAge": "2000",
|
||||||
|
"cacheCheckArtUsato": 2,
|
||||||
|
"redisLongTimeCache": 15,
|
||||||
|
"MpIoBaseUrl": "https://iis01.egalware.com/MP/IO/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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/"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -95,7 +95,6 @@ a,
|
|||||||
}
|
}
|
||||||
.dcOverlay {
|
.dcOverlay {
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
margin: 8.5rem;
|
|
||||||
}
|
}
|
||||||
#blazor-error-ui {
|
#blazor-error-ui {
|
||||||
background: lightyellow;
|
background: lightyellow;
|
||||||
@@ -327,4 +326,23 @@ a,
|
|||||||
min-width: 8rem;
|
min-width: 8rem;
|
||||||
min-height: 4rem;
|
min-height: 4rem;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
/* Colori!*/
|
||||||
|
blue {
|
||||||
|
color: purple;
|
||||||
|
background-color: purple;
|
||||||
|
}
|
||||||
|
.dc_yellow {
|
||||||
|
color: yellow;
|
||||||
|
background-color: yellow;
|
||||||
|
}
|
||||||
|
.dc_gray {
|
||||||
|
color: gray;
|
||||||
|
}
|
||||||
|
.dc_red {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.dc_green {
|
||||||
|
color: green;
|
||||||
|
background-color: green;
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,6 @@ a, .btn-link {
|
|||||||
|
|
||||||
.dcOverlay {
|
.dcOverlay {
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
margin: 8.5rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#blazor-error-ui {
|
#blazor-error-ui {
|
||||||
@@ -376,4 +375,25 @@ a, .btn-link {
|
|||||||
min-width: @blSCut * 8;
|
min-width: @blSCut * 8;
|
||||||
min-height: @blSCut * 4;
|
min-height: @blSCut * 4;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Colori!*/
|
||||||
|
blue {
|
||||||
|
color: purple;
|
||||||
|
background-color: purple;
|
||||||
|
}
|
||||||
|
.dc_yellow {
|
||||||
|
color: yellow;
|
||||||
|
background-color: yellow;
|
||||||
|
}
|
||||||
|
.dc_gray {
|
||||||
|
color: gray;
|
||||||
|
}
|
||||||
|
.dc_red {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.dc_green {
|
||||||
|
color: green;
|
||||||
|
background-color: green;
|
||||||
}
|
}
|
||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,20 +1,12 @@
|
|||||||
///Setup del chart desiderato con id univoco
|
///Setup del chart desiderato con id univoco
|
||||||
window.setup = (id, config) => {
|
window.setup = (id, config) => {
|
||||||
var ctx = document.getElementById(id).getContext('2d');
|
var ctx = document.getElementById(id).getContext('2d');
|
||||||
//let currentDate = new Date();
|
|
||||||
//console.log(currentDate + " - Calling setup...");
|
|
||||||
console.log(id);
|
|
||||||
if (window['myChart'] instanceof Chart) {
|
if (window['myChart'] instanceof Chart) {
|
||||||
//window.myChart.destroy();
|
|
||||||
window['myChart'].destroy();
|
window['myChart'].destroy();
|
||||||
console.log("Chart " + id + " destroyed!");
|
|
||||||
window['myChart'] = new Chart(ctx, config);
|
window['myChart'] = new Chart(ctx, config);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
window['myChart'] = new Chart(ctx, config);
|
window['myChart'] = new Chart(ctx, config);
|
||||||
//console.log("Chart " + id + " created!");
|
|
||||||
console.log(window['myChart']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
////TENTATIVO POPOLAMENTO HELPER PER POTER INVOCARE IL METODO DOPO
|
||||||
|
//let helper;
|
||||||
|
|
||||||
|
//window.setHelper = (dotNetHelper) => {
|
||||||
|
// helper = dotNetHelper.invokeMethodAsync('setHelper');
|
||||||
|
// console.log(helper);
|
||||||
|
// return dotNetHelper.invokeMethodAsync('setHelper');
|
||||||
|
//}
|
||||||
|
|
||||||
|
////BECCA QUANDO LA MODALE VIENE CHIUSA ED ESEGUE
|
||||||
|
//document.addEventListener('click', function (e) {
|
||||||
|
// if (e.target.id === 'myModal') {
|
||||||
|
// console.log('chiuso');
|
||||||
|
|
||||||
|
// //return helper.invokeMethodAsync('svuotaRecord');
|
||||||
|
// console.log("fatto");
|
||||||
|
// } else {
|
||||||
|
// console.log('aperto');
|
||||||
|
// }
|
||||||
|
// e.stopPropagation();
|
||||||
|
//}, false);
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<RootNamespace>MP.Stats</RootNamespace>
|
<RootNamespace>MP.Stats</RootNamespace>
|
||||||
<UserSecretsId>826e877c-ba70-4253-84cb-d0b1cafd4440</UserSecretsId>
|
<UserSecretsId>826e877c-ba70-4253-84cb-d0b1cafd4440</UserSecretsId>
|
||||||
<Version>6.16.2210.0716</Version>
|
<Version>6.16.2210.1708</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<body>
|
<body>
|
||||||
<i>Modulo statistiche MAPO</i>
|
<i>Modulo statistiche MAPO</i>
|
||||||
<h4>Versione: 6.16.2210.0716</h4>
|
<h4>Versione: 6.16.2210.1708</h4>
|
||||||
<br />
|
<br />
|
||||||
Note di rilascio:
|
Note di rilascio:
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
6.16.2210.0716
|
6.16.2210.1708
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<item>
|
<item>
|
||||||
<version>6.16.2210.0716</version>
|
<version>6.16.2210.1708</version>
|
||||||
<url>https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/MP.Stats.zip</url>
|
<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>
|
<changelog>https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/ChangeLog.html</changelog>
|
||||||
<mandatory>false</mandatory>
|
<mandatory>false</mandatory>
|
||||||
|
|||||||
Reference in New Issue
Block a user