Compare commits

...

282 Commits

Author SHA1 Message Date
Samuele Locatelli 67f0f74fbe Merge branch 'Release/UpdateGestSelect' 2022-10-18 10:11:16 +02:00
Samuele Locatelli d00b4bbb8b Refresh 2022-10-18 10:09:01 +02:00
Samuele Locatelli dd63bb292d Merge remote-tracking branch 'origin/develop' into develop 2022-10-18 09:56:05 +02:00
zaccaria.majid 57bc790074 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-18 09:55:37 +02:00
zaccaria.majid 41a00ffa45 fix 2 variabili x statRecord e currRecord 2022-10-18 09:55:29 +02:00
Samuele Locatelli 633b5dda6e Fix cache recupero ODL correnti (3 sec redis) 2022-10-18 09:51:43 +02:00
Samuele Locatelli 5d6bef0fc8 Merge tag 'UpdateGestOdlPodl' into develop
Update gestione ODL/PODL
2022-10-18 09:26:34 +02:00
Samuele Locatelli d24b2ada0c Merge branch 'Release/UpdateGestOdlPodl' 2022-10-18 09:26:27 +02:00
Samuele Locatelli 0a9ccffe28 Fix ODL/PODL x setup ed avvio 2022-10-18 09:26:04 +02:00
Samuele Locatelli 207d305327 Merge tag 'UpdateGestSetupOdl' into develop
Fix x test gesiotne ODL (manca vera gestione SE ODL aperto)
2022-10-18 08:43:44 +02:00
Samuele Locatelli caa4b4f590 Merge branch 'Release/UpdateGestSetupOdl' 2022-10-18 08:43:22 +02:00
Samuele Locatelli e45cb0595e Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-18 08:42:56 +02:00
Samuele Locatelli 77e7e39985 Aggiornamento modifiche x chiudere ODL e creare nuovo 2022-10-18 08:41:12 +02:00
Samuele Locatelli b2e9ae76d4 bozza modifiche (da completare) 2022-10-17 20:10:52 +02:00
zaccaria.majid 460eb769dc inizio gestione currRecord dopo chiusura modal 2022-10-17 17:27:39 +02:00
Samuele Locatelli 5e38749c65 Bozza gestione PODL --> ODL 2022-10-17 12:17:11 +02:00
Samuele Locatelli 91083b6c4a Merge remote-tracking branch 'origin/develop' into develop 2022-10-17 12:01:43 +02:00
Samuele Locatelli de562b1287 Update x gestione chiusura ODL 2022-10-17 12:01:33 +02:00
zaccaria.majid 470c9a2191 aggiunta controllo listaStati null 2022-10-17 11:25:05 +02:00
zaccaria.majid 26e36e7124 fix posizionamento label durata 2022-10-17 10:09:16 +02:00
zaccaria.majid bef0ee6000 fix text dark progress bar gialla 2022-10-17 09:22:38 +02:00
zaccaria.majid 9e4822d529 Aggiunta filtro per macchine ODL 2022-10-17 09:09:43 +02:00
Samuele Locatelli 7f9685a007 Merge tag 'UpdateOdlStatsModal' into develop
fix gestione statistiche ODL
2022-10-14 17:43:06 +02:00
Samuele Locatelli d8978f84f3 Merge branch 'Release/UpdateOdlStatsModal' 2022-10-14 17:42:54 +02:00
Samuele Locatelli 946f157cff Pulizia codice 2022-10-14 17:41:50 +02:00
Samuele Locatelli 47f1ae5cb2 Completo fix plot ODL x chiusura modale 2022-10-14 17:35:56 +02:00
Samuele Locatelli a428ecb4ab Fix overlay donught 2022-10-14 17:27:55 +02:00
zaccaria.majid c4b6f289af modifiche grafiche richieste 2022-10-14 16:54:41 +02:00
zaccaria.majid 1cc90d2459 minor fix 2022-10-14 13:08:32 +02:00
zaccaria.majid e438fa3930 minor fix 2022-10-14 12:47:13 +02:00
zaccaria.majid 6c88e2687a fix plot odl + modifiche grafiche 2022-10-14 12:39:43 +02:00
zaccaria.majid fba6eca9cc Minor fix 2022-10-13 09:30:43 +02:00
zaccaria.majid 330e208866 Minor fix 2022-10-12 15:27:10 +02:00
zaccaria.majid 013b21e055 Fix serializzazione valori edit 2022-10-12 11:48:51 +02:00
Samuele Locatelli 8e763e52a4 update metodo DTO da testare 2022-10-12 06:26:04 +02:00
Samuele Locatelli d5f5cf9b11 FluxLogDTO:
- Update modello dati x gestione nuovo DTO
- bozza udpatre DB e servizio
2022-10-12 06:20:54 +02:00
Samuele Locatelli a4810826f8 Aggiunta metodo x copiare ODL in SEND + trad valori 2022-10-11 20:56:51 +02:00
zaccaria.majid 7f3a73ba0e bozza Metodo Update 2022-10-11 17:34:02 +02:00
zaccaria.majid d108b74f7d test grafico x valori modificati 2022-10-11 16:52:11 +02:00
zaccaria.majid 16278b6ae0 pescaggio e clonazione flusso scelto 2022-10-11 13:03:56 +02:00
zaccaria.majid 1f10e8537d Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-11 09:16:42 +02:00
Samuele E. Locatelli a6408ba2af Merge tag 'UpdateMain221010' into develop
Update di riallineamento
2022-10-11 08:02:06 +02:00
Samuele E. Locatelli 924a5017f5 Merge branch 'release/UpdateMain221010' 2022-10-11 08:01:04 +02:00
zaccaria.majid 5bcc32023a fix plot 2022-10-10 17:55:53 +02:00
zaccaria.majid e87d14bd8a Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-10 17:14:39 +02:00
zaccaria.majid cbaa16a850 Merge branch 'FeatureODLPlot' into develop 2022-10-10 17:12:27 +02:00
zaccaria.majid cc272cac29 Plot ODL 2022-10-10 17:12:09 +02:00
zaccaria.majid b032b6bbb9 Primo ODL PLOT da fixare 2022-10-10 13:15:42 +02:00
Samuele Locatelli 91174a2f67 Merge remote-tracking branch 'origin/develop' into develop 2022-10-10 12:05:20 +02:00
Samuele Locatelli 2a96b63f17 PODL:
- aggiunto chiamate x syncDbData post delete o update
2022-10-10 12:05:11 +02:00
Samuele Locatelli 08634b5656 Aggiunta servizio x chiamate API REST ad MP-IO 2022-10-10 11:54:03 +02:00
zaccaria.majid 5d63c41cf8 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-10 10:11:40 +02:00
zaccaria.majid de3ce0f114 inizio odl Plot 2022-10-10 10:11:02 +02:00
Samuele Locatelli 2ec29bbe68 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-10 09:55:42 +02:00
Samuele Locatelli 7416f6e7b5 Bozza dettaglio stat con modale 2022-10-10 09:55:39 +02:00
zaccaria.majid a604e5741b minor fix 2022-10-10 09:03:32 +02:00
Samuele Locatelli 923094054b fix key model 2022-10-10 08:40:34 +02:00
Samuele Locatelli c28dae0c8d SPEC, statistiche ODL:
-aggiunta model e controllo x recupero stat da stored
2022-10-08 17:47:47 +02:00
Samuele Locatelli 6fb9cbe085 update displayODL 2022-10-07 18:50:08 +02:00
Samuele Locatelli 4f03661182 Update minori pagina ODL 2022-10-07 18:43:32 +02:00
Samuele Locatelli dd26773590 Merge remote-tracking branch 'origin/develop' into develop 2022-10-07 18:33:10 +02:00
Samuele Locatelli 75894fa3c7 update ordinamento fluxlog 2022-10-07 18:32:56 +02:00
zaccaria.majid 9fc73c5c85 modifiche richieste 2022-10-07 18:30:53 +02:00
Samuele Locatelli 0f9c01ae82 Update grafico e calcolo durata ODL 2022-10-07 17:20:35 +02:00
Samuele Locatelli ea60e785f9 Update fix x ODL con filtri nuovi 2022-10-07 16:58:33 +02:00
Samuele Locatelli 1849101028 inizio modifica pagina ODL x SPEC 2022-10-07 16:14:29 +02:00
Samuele Locatelli a1f9a958b3 Fix errore compilaizone stats 2022-10-07 16:14:22 +02:00
zaccaria.majid fd585aee93 modifiche richieste 2022-10-07 15:14:57 +02:00
zaccaria.majid 4ecd647b1b modifiche richieste 2022-10-07 14:43:00 +02:00
zaccaria.majid 8aace3fb82 Minor fix 2022-10-07 12:00:37 +02:00
zaccaria.majid 4acf2a2970 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-07 11:16:41 +02:00
zaccaria.majid 9b6c449354 Fix grafici richiesti 2022-10-07 11:16:02 +02:00
Samuele Locatelli c11e05123d Fix display label x filtro parametri 2022-10-07 08:41:45 +02:00
zaccaria.majid 862960bae4 minor fix 2022-10-06 17:47:40 +02:00
zaccaria.majid 4cdf0033cd fix index 2022-10-06 17:32:32 +02:00
zaccaria.majid 25b75101e9 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-06 17:24:49 +02:00
zaccaria.majid 50dbe7691f minor fix 2022-10-06 17:24:43 +02:00
Samuele Locatelli 9c762969ac Merge remote-tracking branch 'origin/develop' into develop 2022-10-06 16:30:59 +02:00
Samuele Locatelli 09b2008f25 Update classe dossier 2022-10-06 16:30:54 +02:00
zaccaria.majid baa42fbd2f Merge branch 'FeatureParametersFilter' into develop 2022-10-06 16:28:14 +02:00
zaccaria.majid 90d4a46087 Fine fix filtri params e dossier 2022-10-06 16:27:49 +02:00
zaccaria.majid 5b12ac47d3 update Filter 2022-10-06 13:10:12 +02:00
zaccaria.majid 81fd2820df Params filter con dots INIZIO 2022-10-05 17:39:51 +02:00
Samuele Locatelli 624d6d3411 minor refresh x display trad articolo/macchina 2022-10-05 16:46:56 +02:00
zaccaria.majid 21fa81f09c fix grafico filtri Dossier 2022-10-05 16:34:22 +02:00
zaccaria.majid 0795cae1d5 Aggiunta filtro per articolo
+ fix lettura da redis dossiers
2022-10-05 15:46:59 +02:00
Samuele Locatelli 6a0eeba75f Bozza metodo selezione x articolo 2022-10-05 14:45:29 +02:00
Samuele Locatelli b476829a73 Merge branch 'develop' 2022-10-05 11:13:46 +02:00
Samuele Locatelli 78c90a8e93 Update ODL come PODL 2022-10-05 11:12:51 +02:00
Samuele Locatelli 9515906e20 Merge branch 'master' into develop 2022-10-05 11:04:42 +02:00
Samuele Locatelli c929e3cf65 Merge branch 'Release/FixPodlAndSnapshotBaglietto' 2022-10-05 11:04:31 +02:00
Samuele Locatelli 43f0569fe3 Fix flush + reload home 2022-10-05 11:03:18 +02:00
Samuele Locatelli 2807bd9edc Merge remote-tracking branch 'origin/develop' into develop 2022-10-05 10:59:42 +02:00
Samuele Locatelli c4a682cc24 Gestione snapshot
- anticipo parametricod a tab config
2022-10-05 10:58:49 +02:00
zaccaria.majid 5ef3139bd5 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-10-05 10:53:30 +02:00
zaccaria.majid 2a679504eb fix selRecord + fix grafico toggle att 2022-10-05 10:53:17 +02:00
Samuele Locatelli 10f9ed08a8 Fix query anticipo a 24h 2022-10-05 10:47:57 +02:00
Samuele Locatelli 374902d5f0 Merge branch 'Feature/AddPodlClone' into develop 2022-10-05 10:24:30 +02:00
Samuele Locatelli 59b43f6005 Update pagina PODL 2022-10-05 10:24:19 +02:00
zaccaria.majid 1ad6222543 Aggiunta selezione data minima in PARAMETERS 2022-09-28 09:10:52 +02:00
Samuele Locatelli b97394b067 Aggiunta duplicazione articoli 2022-09-27 18:47:47 +02:00
Samuele Locatelli 9d35441b07 Merge branch 'develop' into Feature/AddPodlClone 2022-09-27 18:28:28 +02:00
Samuele Locatelli f71ec80c16 Aggiunta duplicazione riga 2022-09-27 18:27:46 +02:00
Samuele Locatelli d1b6c804be Aggiunta editing note 2022-09-27 18:14:40 +02:00
Samuele Locatelli 391078dd06 Aggiunto edit numpz e TCiclo 2022-09-27 18:08:17 +02:00
zaccaria.majid 55c6790d7b update per takesnapshotList 2022-09-27 18:03:36 +02:00
zaccaria.majid 66642032bf Merge branch 'develop' 2022-09-27 16:40:09 +02:00
Samuele Locatelli da76bc96f8 Update display dati dossier 2022-09-27 16:19:40 +02:00
zaccaria.majid 23fbacba87 Fix lettura da cache 2022-09-27 14:27:24 +02:00
Samuele Locatelli b9d67616cb Merge branch 'develop' 2022-09-27 12:01:32 +02:00
Samuele Locatelli 79da055771 Fix filtraggio record ODL 2022-09-27 12:01:25 +02:00
Samuele Locatelli 7e879fe2f6 Merge tag 'UpdateDossierHistSnapshot' into develop
Fix dossier management:
- delete dossiers
- possibilità snapshot valori apssati
2022-09-27 11:43:58 +02:00
Samuele Locatelli 95e83f7d56 Merge branch 'Release/UpdateDossierHistSnapshot' 2022-09-27 11:43:40 +02:00
Samuele Locatelli 0efe322f7a Pagine con molti record nascoste (footer):
- Update cards x avere margine mb-5
2022-09-27 11:43:04 +02:00
zaccaria.majid 3bc3746a9d Fix scomparsa bottone snapshot fatto 2022-09-27 11:36:51 +02:00
Samuele Locatelli 08901bcebc Riduzione numero chiamate x update parametri 2022-09-27 11:03:55 +02:00
Samuele Locatelli 4d481699a1 Ok selezione e filtraggio parametri 2022-09-27 10:57:45 +02:00
Samuele Locatelli 3efeb994cf Fix selezione data max x filtro parametri 2022-09-27 10:34:24 +02:00
Samuele Locatelli 5014bb1ecb Inizio gestione filtro parametri con data max 2022-09-27 09:47:41 +02:00
Samuele Locatelli 523b1683d9 Metodi cancellazione dossier (2 test) 2022-09-27 08:20:40 +02:00
Samuele Locatelli 35c0f2856d Prima bozza con salvataggio live e storico... 2022-09-26 20:03:05 +02:00
Samuele Locatelli 77457df40a Update numero maxRecord gestiti (fino a 5000) 2022-09-26 19:35:26 +02:00
Samuele Locatelli add4fe13fa Inizio update selezione parametri 2022-09-26 19:31:55 +02:00
zaccaria.majid b748c76cad fix 2022-09-23 08:33:24 +02:00
Samuele Locatelli 279d2799ae Merge tag 'consolidateNuget220921' into develop
Fix/consolidate nuget pack x progetti MON / STATS
2022-09-21 18:36:21 +02:00
Samuele Locatelli 198d18002b Merge branch 'Release/consolidateNuget220921' 2022-09-21 18:36:10 +02:00
Samuele Locatelli 838ebe55da Fix nuget
- progetti CORE MON/STATS aggiornati
- consolidamenti nuget
2022-09-21 18:35:41 +02:00
Samuele Locatelli f58253341f Merge tag '220921_FixAndNugetUpdate' into develop
Fix vari (es paginazione dossier) + nuget update generale
2022-09-21 14:53:20 +02:00
Samuele Locatelli 4644646fa4 Merge branch 'Release/220921_FixAndNugetUpdate' 2022-09-21 14:53:05 +02:00
Samuele Locatelli c3c5300830 Nuget Update:
- nlog
- newtonsoft json
2022-09-21 14:52:25 +02:00
Samuele Locatelli ebeeab69e1 Nuget Update: dotNet framework 2022-09-21 14:50:56 +02:00
Samuele Locatelli 2a41e8070b CodeMaid
- fix componenti UI
- lasciati invariati in area wwwroot
2022-09-21 14:49:45 +02:00
Samuele Locatelli 3a5b77314a CodeMaid:
- DTO e MOdelli NON riorganizzabili
- refresh globale ordinamenti
- test rebuild
2022-09-21 14:45:57 +02:00
zaccaria.majid 16c7b0bc6b modifiche grafiche + fix paginazione 2022-09-21 14:21:22 +02:00
Samuele Locatelli 46f284ae0c Merge tag 'FirstSpecStableRelease' into develop
Prima release master con fix vari grafici + tutte le funzionalità
2022-09-21 10:36:57 +02:00
Samuele Locatelli e945aad224 Merge branch 'Release/FirstSpecStableRelease' 2022-09-21 10:36:40 +02:00
Samuele Locatelli 8510731366 Update home page 2022-09-21 10:36:29 +02:00
Samuele Locatelli 5df4195e6c Completato salvataggio snapshot + refresh 2022-09-21 10:26:09 +02:00
Samuele Locatelli a3dc1e1657 Start ver 6.16 2022-09-21 09:52:54 +02:00
Samuele Locatelli 27149e2131 Fix grafici minori 2022-09-21 09:46:44 +02:00
Samuele Locatelli 91be755781 Fix conf key redis cache:
- era overlapping parametri/dossiers
2022-09-21 09:27:00 +02:00
Samuele Locatelli 84f6730023 Merge remote-tracking branch 'origin/develop' into develop 2022-09-21 09:22:12 +02:00
zaccaria.majid b51c2679e4 aggiunta cache redis 2022-09-21 09:17:28 +02:00
zaccaria.majid 9d7502d1a4 modifiche grafiche e round orario datetime 2022-09-21 09:13:39 +02:00
zaccaria.majid d3b8160634 fix deserializzazione oggetto fluxlog 2022-09-20 17:35:45 +02:00
zaccaria.majid 601c817aa2 Modifiche grafiche 2022-09-20 17:16:42 +02:00
zaccaria.majid d0d30bd1c3 Modifiche per permettere la deserializzazione dei
valori in dossier
2022-09-20 17:16:21 +02:00
zaccaria.majid 0e9e7f3dda Creazione pagina per la visualizzazione Dossier
con relativi filtri
2022-09-20 12:54:46 +02:00
Samuele Locatelli e518c17db2 Aggiunta traccia x pagina dossiers 2022-09-20 09:03:22 +02:00
Samuele Locatelli 0a281827f9 Refresh 2022-09-19 20:01:24 +02:00
Samuele Locatelli 141473ce28 Aggiunta metodi gestione lettura dossiers da DB + refresh 2022-09-19 20:01:13 +02:00
Samuele Locatelli 45af089e3f Aggiunta preliminare modello Dossiers 2022-09-19 20:00:56 +02:00
Samuele Locatelli 4e4387620b Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-09-19 09:58:28 +02:00
Samuele Locatelli 8c2c48a63f Fix procedura di flux dati:
- aggiunta conn tipo admin
- tolta cancellazione intero DB
- ricerca x pattern delle sole chaivi interessate
2022-09-19 09:54:30 +02:00
zaccaria.majid 534a668496 tentativo fix redis Flush 2022-09-19 09:22:29 +02:00
zaccaria.majid eed45695e8 continuo flushCache 2022-09-19 08:43:48 +02:00
zaccaria.majid ff2fbe0c34 modifiche grafiche
inizio pagina utils
2022-09-16 17:37:39 +02:00
Samuele Locatelli 3324c736c6 Minor fix 2022-09-16 16:49:19 +02:00
zaccaria.majid 0a6a0bc5cb modifiche grafiche varie 2022-09-16 16:00:13 +02:00
Samuele Locatelli e18e0ddff3 Fix last update da pagina main 2022-09-16 15:18:56 +02:00
zaccaria.majid 580a498238 tentativo fix lastUpdate 2022-09-16 14:47:31 +02:00
zaccaria.majid c97557722e Modifiche grafiche 2022-09-16 14:22:23 +02:00
zaccaria.majid c17fa17d76 fix filtri aggiunta titles 2022-09-16 12:40:18 +02:00
zaccaria.majid 5b054ee2ec fix last snapshot che non veniva
scritto al primo giro
2022-09-16 11:55:23 +02:00
zaccaria.majid 2771d9957d Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-09-16 11:47:43 +02:00
zaccaria.majid 5893152761 aggiornamento grafico filtri 2022-09-16 11:47:35 +02:00
Samuele Locatelli b7d57e935a COmpletato fix version number 2022-09-16 11:21:03 +02:00
Samuele Locatelli 61b613a8fb Fix proj config x calcolo versione 2022-09-16 11:19:26 +02:00
Samuele Locatelli d2fef81f55 Merge remote-tracking branch 'origin/develop' into develop 2022-09-16 11:17:33 +02:00
Samuele Locatelli cd7a8ccad8 Fix x display numero versione 2022-09-16 11:17:28 +02:00
zaccaria.majid 08079d3e0e Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-09-16 10:51:19 +02:00
zaccaria.majid 8156828ec3 fix bottone filtri avanzati 2022-09-16 10:44:45 +02:00
Samuele Locatelli 9bb95c5a49 Merge tag 'FixMasterDeploy' into develop
Fix deploy IIS x icone, errore cancellazione, log
2022-09-16 10:37:26 +02:00
Samuele Locatelli 7ba3aeb65d Merge branch 'Release/FixMasterDeploy' 2022-09-16 10:37:10 +02:00
Samuele Locatelli 6ea938a91a Aggiunta web.config x windows auth 2022-09-16 10:36:25 +02:00
Samuele Locatelli 92c196023d fix posizione img home page 2022-09-16 10:33:13 +02:00
Samuele Locatelli 10d9625b6d fix articoli:
- tolto refuso cancellazione csv temp appoggio
2022-09-16 10:33:03 +02:00
Samuele Locatelli 5f955499e2 Fix file favicon e logfolder 2022-09-16 10:32:47 +02:00
Samuele Locatelli 716813abe1 Merge tag 'AddSpecInstaller' into develop
Aggiornamento x generazione installer SPEC su nexus
2022-09-16 09:13:19 +02:00
Samuele Locatelli 6f0d0419c5 Merge branch 'Release/AddSpecInstaller' 2022-09-16 09:13:02 +02:00
Samuele Locatelli 300c2dc294 Metodo timeout+ random x cache 2022-09-16 09:03:05 +02:00
Samuele Locatelli fddfbb6dfa More cleanup! 2022-09-16 08:36:52 +02:00
Samuele Locatelli b2858c9c8a Fix catena update pagina 2022-09-16 08:16:00 +02:00
Samuele Locatelli 68404c928a Cleanup page PODL 2022-09-16 08:02:08 +02:00
Samuele Locatelli ca16c3a1b0 Clenaup classe dataAdapter 2022-09-16 08:01:51 +02:00
Samuele Locatelli c11163896c Speedup:
- aggiuta cache redis x elenco macchine con dati flux
2022-09-16 07:43:42 +02:00
Samuele Locatelli 891def5bcd refresh 2022-09-15 19:43:21 +02:00
Samuele Locatelli 65aa95d1e7 Update yaml (da testare) 2022-09-15 19:43:07 +02:00
Samuele Locatelli 1b20cd8ef5 Aggiunta xml pubblicazione 2022-09-15 19:39:31 +02:00
Samuele Locatelli 11934fcae2 Minor Update x reload 2022-09-15 19:25:51 +02:00
Samuele Locatelli 687a254a8d Collegato refresh period da edit conf 2022-09-15 18:53:51 +02:00
Samuele Locatelli 25f274d4d6 cleanup params page 2022-09-15 18:48:04 +02:00
Samuele Locatelli 0ec3a4c31a Correzione Dispose:
- fix sovrapposizione eventi multipli
2022-09-15 18:47:35 +02:00
Samuele Locatelli 1b89501529 Fix cambio pagina da cambio filtro 2022-09-15 18:35:38 +02:00
Samuele Locatelli 191b23ee7d Fix comportamento cambio filtro su pag 1 2022-09-15 18:23:10 +02:00
Samuele Locatelli ae39db267d CurrPage:
- riporto a 1 se cambio filtro
- sbaglia primo cambio da sel DataPager
2022-09-15 18:01:25 +02:00
Samuele Locatelli 7cc25ac9be Fix toggle show/hide edit params 2022-09-15 17:55:14 +02:00
Samuele Locatelli 5c30c8a1ba Levato isLoading inutilizzato da filtro parametri 2022-09-15 17:46:03 +02:00
Samuele Locatelli d5777c0020 REDIS:
- fix cache selezione flussi da macchina
- rimosse modalità async lettura/Scrittura redis
2022-09-15 17:43:52 +02:00
zaccaria.majid f5bbcae0db Aggiunta filtri per max record e
tempo aggiornamento
2022-09-15 17:28:26 +02:00
zaccaria.majid 1efd5f5a4b listParams riga 136 fix pager stop live
PARAMS riga 147 fix filter stop live
2022-09-15 16:08:47 +02:00
Samuele Locatelli 47ddab4e67 Merge branch 'Feature/TestSelFilterObj' into develop 2022-09-15 15:46:48 +02:00
Samuele Locatelli 07c58c5738 Pulizia metodi inutilizzati 2022-09-15 15:46:39 +02:00
Samuele Locatelli fcf1ec5ea9 FIX: ora ok con update in blocco 2022-09-15 15:36:05 +02:00
Samuele Locatelli 673eb62d8c Inizio gestione con unico obj filtro 2022-09-15 15:30:48 +02:00
Samuele Locatelli 6790088950 Ancora update x gestione filtro/stop live... 2022-09-15 13:09:05 +02:00
Samuele Locatelli d46f3fd38d OK con filtraggio in cascata 2022-09-15 12:40:23 +02:00
Samuele Locatelli 0fe40dacc7 Fix errore inc ascata selezione parametri 2022-09-15 12:02:01 +02:00
zaccaria.majid 0c01e93ff3 Fix filtro flussi 2022-09-15 10:51:00 +02:00
Samuele Locatelli 6da702e31f Fix dati x lettura solo macc valide (=con dati flux) 2022-09-15 10:31:39 +02:00
Samuele Locatelli ce92f70eb0 Correzione timer x considerare tempo di esecuzione 2022-09-15 09:51:24 +02:00
Samuele Locatelli 37a62a34ae Parametri:
- FIx selezione live su pagina 1
- passo a pag 1 sul cambio filtro
2022-09-15 08:57:27 +02:00
Samuele Locatelli c138ea3143 Live update:
- disattivato al cambio filtro
- sbaglia num record paginazione
2022-09-14 17:55:27 +02:00
Samuele Locatelli 4e11685415 Fix live + filtri x parameters 2022-09-14 17:49:06 +02:00
Samuele Locatelli 32398cd7fb CLeanup + tolto search da parametri 2022-09-14 17:39:29 +02:00
Samuele Locatelli d5f2ed3950 Fix lettura dati con/senza filtro 2022-09-14 17:38:16 +02:00
Samuele Locatelli f120bb6c28 Merge remote-tracking branch 'origin/Feature/ParameterDataMethods' into develop 2022-09-14 16:56:57 +02:00
zaccaria.majid 7abd135f30 Modifiche page params
aggiunta msgservice per selezione macchina
2022-09-14 16:53:46 +02:00
zaccaria.majid bae58ec4bb modifiche per grafica pagina PARAMS 2022-09-14 14:34:30 +02:00
zaccaria.majid f44838d235 Aggiunta pagina parameters con componente live. 2022-09-14 12:18:36 +02:00
zaccaria.majid 9c11e877aa Merge remote-tracking branch 'origin/develop' into Feature/ParameterDataMethods 2022-09-14 10:15:07 +02:00
zaccaria.majid 5fdd74ae9a Inizio page params 2022-09-14 10:13:51 +02:00
Samuele Locatelli b838e95c28 Merge branch 'Feature/ParameterDataMethods' into develop 2022-09-14 09:26:23 +02:00
Samuele Locatelli 0e2036cb42 Completato aggiunta metodi elenco (da testare) 2022-09-14 09:23:46 +02:00
Samuele Locatelli b29bac08a2 Inizio aggiunta parametri e metodi relativi 2022-09-14 09:07:30 +02:00
Samuele Locatelli 5559e7daa8 Fix spazio titolo x add button 2022-09-13 18:23:09 +02:00
Samuele Locatelli d3fb78810e Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-09-13 18:20:39 +02:00
Samuele Locatelli 30dac79e7c PODL:
- completato editing con delete
2022-09-13 18:19:30 +02:00
zaccaria.majid bf8f7b8fa3 fix bottone new PODL allineato con scritta 2022-09-13 17:44:56 +02:00
zaccaria.majid 5915e5f532 Merge branch 'develop' of https://gitlab.steamware.net/steamware/mapo-core into develop 2022-09-13 17:39:54 +02:00
zaccaria.majid 658488fe0e fix bottone aggiunta PODL 2022-09-13 17:39:48 +02:00
Samuele Locatelli 5f8e60b4ba Code cleanup + fix preselezione gruppo fase + art 2022-09-13 17:35:55 +02:00
Samuele Locatelli fff3659939 Update x inserimento nuovo record (OK) 2022-09-13 17:05:08 +02:00
Samuele Locatelli 385c5cf7ea Update gestione editing fasi/key richeista 2022-09-13 16:51:13 +02:00
Samuele Locatelli 31ed8b2edb Aggiunto estrazione dato fase da PODL 2022-09-13 16:17:34 +02:00
Samuele Locatelli 0ef6d161d5 Bozza edit + new quasi OK 2022-09-13 15:44:15 +02:00
Samuele Locatelli a0b88fd157 UPdate x ricerca art in cascata 2022-09-13 15:16:46 +02:00
Samuele Locatelli ed93a04fd0 Inizio modifica selezione articolo 2022-09-13 15:01:07 +02:00
Samuele Locatelli 00a0fc81ce POSDL:
- FIX Selezione stato comemssa e filtraggio
2022-09-13 14:40:54 +02:00
Samuele Locatelli 681aa44b32 Fix reset ricerca al cambio pagina 2022-09-13 14:14:15 +02:00
zaccaria.majid 9d43a221ed fix label 2022-09-13 12:33:23 +02:00
zaccaria.majid 53a7630d97 Divisione visualizzazione ODL e PODL in due pagine 2022-09-13 12:23:44 +02:00
Samuele Locatelli 7317fa58b4 Inizio inserimento pagina PODL 2022-09-13 10:26:04 +02:00
zaccaria.majid dd56701b5b fix paginazione e ricerca 2022-09-12 16:26:30 +02:00
Samuele Locatelli 014bed96f9 Typo:
-CodeMaid vari
2022-09-12 15:12:56 +02:00
Samuele Locatelli ac196be0b7 MessageService:
- Fix errore loop infinito in update numero record totali
2022-09-12 15:12:10 +02:00
zaccaria.majid a77862b372 fix pagina PODL 2022-09-12 14:53:25 +02:00
zaccaria.majid ed5b55cf77 fix controller spec +
inizio implementazione pagina PODL
2022-09-12 13:00:34 +02:00
Samuele Locatelli aec6271f5a Update x ricerca ODL 2022-09-12 11:54:08 +02:00
Samuele Locatelli 62359ac858 Fix evento mostr/nascondi 2022-09-12 11:39:41 +02:00
Samuele Locatelli 73df595421 Fix paginazione ODL:
- aggiunto StateHasChanged in async
2022-09-12 11:28:48 +02:00
Samuele Locatelli 2cd1d57cd3 UPdate comportamento compress menù laterale sx 2022-09-12 11:14:01 +02:00
Samuele Locatelli 8934c86f7b STATS:
- Refresh conf StatsODL
2022-09-09 17:35:50 +02:00
Samuele Locatelli cee1718208 refresh list ODL 2022-08-23 11:25:58 +02:00
Samuele Locatelli 9407b451c7 bozza ODL 2022-08-01 13:34:16 +02:00
Samuele Locatelli 66469b9df7 Inizio pagina PODL/ODL correnti 2022-08-01 12:43:42 +02:00
Samuele Locatelli 57833b368d Update gestione azienda sel da config 2022-08-01 09:44:14 +02:00
Samuele Locatelli 634f5f7120 Aggiunta gestione oggetti JQM in home/index page 2022-07-25 07:56:32 +02:00
Samuele Locatelli 0e376c070c Aggiunta lettura Link JQL 2022-07-25 07:56:20 +02:00
Samuele Locatelli 387df699b0 Update link in pagina HOME 2022-07-23 17:56:51 +02:00
Samuele Locatelli 2016379205 ART:
- aggiunta ricerca x selVal
- completata ricerca veto cancellazione
2022-07-23 17:19:19 +02:00
Samuele Locatelli 0ad15c90c3 Articoli
- completato fix editing lista valori ammissibili x tipo
- ok editing
2022-07-23 16:05:38 +02:00
Samuele Locatelli 190e572bce Inizio insert listValues model 2022-07-23 12:12:54 +02:00
Samuele Locatelli 02e7b7c4e7 Modifica edit:
- azienda da selettore, tranne "tutte"
2022-07-23 11:53:38 +02:00
Samuele Locatelli e03b590844 Update pagina articoli: CRUD 2022-07-23 11:45:59 +02:00
Samuele Locatelli 4ee291c12d update bootstrap / bootstrap-icons 2022-07-23 11:45:41 +02:00
Samuele Locatelli 81c04ef70b Aggiunta metodi delete/update 2022-07-23 11:45:30 +02:00
Samuele Locatelli 19b89db170 Update display articoli 2022-07-23 10:32:35 +02:00
Samuele Locatelli 623ecd6308 Update DB
- aggiunta anagrafica aziende
- filtro articoli
2022-07-23 10:32:29 +02:00
Samuele Locatelli c5e598a0d6 Ancora update x mostrare articoli 2022-07-21 14:57:51 +02:00
Samuele Locatelli a46dc9cb32 Bozza pagine 2022-07-21 14:21:14 +02:00
Samuele Locatelli 3634f85359 Ancora update bozza SPEC 2022-07-21 11:47:33 +02:00
Samuele Locatelli 54d2cd634c Refresh sln 2022-07-21 10:05:33 +02:00
Samuele Locatelli 4cd61462c0 Aggiunta preliminare sito MP.SPEC 2022-07-21 10:05:03 +02:00
Samuele Locatelli 5444722c25 Merge tag 'AddConfMaxAge' into develop
Update impiegando MaxAge
2022-07-15 17:36:49 +02:00
Samuele Locatelli d5d47076df Merge branch 'release/AddConfMaxAge' 2022-07-15 17:36:41 +02:00
Samuele Locatelli 612c3c95f7 MON:
- fix: parametro MaxAge usato anche x redis
- cambio maxAge a 2000ms
2022-07-15 17:36:21 +02:00
Samuele Locatelli dddac15b52 MON:
- update x conf maxAge da appsetting.json
2022-07-15 17:23:58 +02:00
Samuele Locatelli a315e4f0ef Merge tag 'FixDisplayMonHours' into develop
Update x display ore in MON
2022-07-15 17:16:43 +02:00
Samuele Locatelli d71e9465e5 Merge branch 'release/FixDisplayMonHours' 2022-07-15 17:15:57 +02:00
Samuele Locatelli 876197b0ac Update display MON x vedere HH 2022-07-15 17:14:44 +02:00
Samuele Locatelli cd07a940d0 Merge tag 'UpdateLand4WCS' into develop
update x compatibilità con nuovi metodi WebConfigSetter
2022-07-14 17:55:44 +02:00
2196 changed files with 149923 additions and 198 deletions
+105
View File
@@ -121,6 +121,19 @@ MON:build:
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
SPEC:build:
stage: build
tags:
- win
variables:
APP_NAME: MP.SPEC
SOL_NAME: MP-SPEC
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
# WAMON:build:
# stage: build
# tags:
@@ -216,6 +229,22 @@ MON:test:
# script:
# - dotnet test $env:PROJ_PATH/$env:APP_NAME.csproj
SPEC:test:
stage: test
tags:
- win
variables:
APP_NAME: MP.SPEC
SOL_NAME: MP-SPEC
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
needs: ["SPEC:build"]
script:
- dotnet test $env:APP_NAME/$env:APP_NAME.csproj
LAND:IIS01:deploy:
stage: deploy
tags:
@@ -297,6 +326,22 @@ MON:IIS01:deploy:
# script:
# - dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
SPEC:IIS01:deploy:
stage: deploy
tags:
- win
variables:
APP_NAME: MP.SPEC
SOL_NAME: MP-SPEC
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
needs: ["SPEC:test"]
script:
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
LAND:IIS02:deploy:
stage: deploy
tags:
@@ -383,6 +428,23 @@ MON:IIS02:deploy:
# - dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
# - dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
SPEC:IIS02:deploy:
stage: deploy
tags:
- win
variables:
APP_NAME: MP.SPEC
SOL_NAME: MP-SPEC
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- master
needs: ["SPEC:build"]
script:
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
LAND:installer:
stage: installer
tags:
@@ -489,6 +551,27 @@ MON:installer:
# - *hashBuild
# - *nexusUpload
SPEC:installer:
stage: installer
tags:
- win
variables:
APP_NAME: MP.SPEC
SOL_NAME: MP-SPEC
NEXUS_PATH: MP-SPEC
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- develop
- master
needs: ["SPEC:build"]
script:
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish
# qui il deploy su nexus...
- *hashBuild
- *nexusUpload
LAND:release:
stage: release
tags:
@@ -606,3 +689,25 @@ MON:release:
# script:
# - dotnet publish -c Release -o ./publish $env:PROJ_PATH/$env:APP_NAME.csproj
SPEC:release:
stage: release
tags:
- win
variables:
APP_NAME: MP.SPEC
SOL_NAME: MP-SPEC
NEXUS_PATH: MP-SPEC
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
only:
- tags
except:
- branches
needs: ["SPEC:build"]
artifacts:
paths:
- publish/
script:
- dotnet publish -c Release -o ./publish $env:APP_NAME/$env:APP_NAME.csproj
+31
View File
@@ -0,0 +1,31 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32126.317
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Data", "MP.Data\MP.Data.csproj", "{10BA8450-301D-49C7-8E1E-21B7469C225C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.SPEC", "MP.SPEC\MP.SPEC.csproj", "{C777A098-6F91-45AF-A85E-0AD08CBCAC52}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Release|Any CPU.Build.0 = Release|Any CPU
{C777A098-6F91-45AF-A85E-0AD08CBCAC52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C777A098-6F91-45AF-A85E-0AD08CBCAC52}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C777A098-6F91-45AF-A85E-0AD08CBCAC52}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C777A098-6F91-45AF-A85E-0AD08CBCAC52}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {632D11D1-088B-4795-97E5-048534002558}
EndGlobalSection
EndGlobal
+6 -6
View File
@@ -9,18 +9,18 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.6">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.6">
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NLog" Version="5.0.1" />
<PackageReference Include="NLog" Version="5.0.4" />
</ItemGroup>
<ItemGroup>
+6 -6
View File
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace MP.Data.Conf
{
@@ -11,9 +7,13 @@ namespace MP.Data.Conf
/// </summary>
public class IobTags
{
#region Public Fields
/// <summary>
/// Oggetto dizionario di configurazione x IOB
/// </summary>
public Dictionary<string, List<TagData>> IobSetup = new Dictionary<string, List<TagData>>();
#endregion Public Fields
}
}
}
+18 -12
View File
@@ -1,37 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.Data.Conf
namespace MP.Data.Conf
{
/// <summary>
/// Item da mostrare nei blocchi MON degli impianti come override ai dati MSE
/// </summary>
public class TagData
{
#region Public Properties
/// <summary>
/// Indice della colonna (ordine) del dato
/// </summary>
public int ColNum { get; set; } = 0;
/// <summary>
/// Indice della riga del dato
/// </summary>
public int RowNum { get; set; } = 0;
/// <summary>
/// Override CSS (es fontSmall)
/// </summary>
public string TagCss { get; set; } = "";
/// <summary>
/// Etichetta da mostrare
/// </summary>
public string TagName { get; set; } = "";
/// <summary>
/// Indicazione della chiave REDIS dove recuperare il tag indicato (già in formato string)
/// </summary>
public string TagLocation { get; set; } = "";
/// <summary>
/// Etichetta da mostrare
/// </summary>
public string TagName { get; set; } = "";
#endregion Public Properties
#region Public Methods
/// <summary>
/// Clone dell'oggetto
/// </summary>
@@ -40,5 +44,7 @@ namespace MP.Data.Conf
{
return (TagData)this.MemberwiseClone();
}
#endregion Public Methods
}
}
}
+10 -12
View File
@@ -1,21 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.Data
namespace MP.Data
{
public class Constants
public class Constants
{
#region Public Fields
public static readonly string ACT_BLINK_KEY = $"{BASE_HASH}:Current:Blink";
public static readonly string ACT_MSE_DATA_KEY = $"{BASE_HASH}:Current:MSE";
// dati conf REDIS Cache
public static readonly string BASE_HASH = "MAPO";
// REDIS KEY Dati correnti
public static readonly string CONF_MON_KEY = $"{BASE_HASH}:Conf:MonDispData";
public static readonly string ACT_MSE_DATA_KEY = $"{BASE_HASH}:Current:MSE";
public static readonly string ACT_BLINK_KEY = $"{BASE_HASH}:Current:Blink";
#endregion Public Fields
}
}
}
+29 -29
View File
@@ -10,14 +10,6 @@ namespace MP.Data.Controllers
{
public class MpMonController : IDisposable
{
#region Private Fields
private static IConfiguration _configuration;
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Public Constructors
public MpMonController(IConfiguration configuration)
@@ -36,13 +28,13 @@ namespace MP.Data.Controllers
/// <param name="numRecord"></param>
/// <param name="searchVal"></param>
/// <returns></returns>
public List<DatabaseModels.AnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
public List<DatabaseModels.StatsAnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
{
List<DatabaseModels.AnagArticoli> dbResult = new List<DatabaseModels.AnagArticoli>();
List<DatabaseModels.StatsAnagArticoli> dbResult = new List<DatabaseModels.StatsAnagArticoli>();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
.DbSetArticoli
.DbSetStatArticoli
.AsNoTracking()
.Where(x => x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
.OrderBy(x => x.CodArticolo)
@@ -52,6 +44,24 @@ namespace MP.Data.Controllers
return dbResult;
}
/// <summary>
/// Elenco da tabella Macchine
/// </summary>
/// <returns></returns>
public List<DatabaseModels.ConfigModel> ConfigGetAll()
{
List<DatabaseModels.ConfigModel> dbResult = new List<DatabaseModels.ConfigModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
.DbSetConfig
.AsNoTracking()
.OrderBy(x => x.Chiave)
.ToList();
}
return dbResult;
}
public void Dispose()
{
}
@@ -74,24 +84,6 @@ namespace MP.Data.Controllers
return dbResult;
}
/// <summary>
/// Elenco da tabella Macchine
/// </summary>
/// <returns></returns>
public List<DatabaseModels.ConfigModel> ConfigGetAll()
{
List<DatabaseModels.ConfigModel> dbResult = new List<DatabaseModels.ConfigModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
.DbSetConfig
.AsNoTracking()
.OrderBy(x => x.Chiave)
.ToList();
}
return dbResult;
}
/// <summary>
/// Elenco da tabella MappaStatoExpl
/// </summary>
@@ -138,5 +130,13 @@ namespace MP.Data.Controllers
}
#endregion Public Methods
#region Private Fields
private static IConfiguration _configuration;
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
}
}
File diff suppressed because it is too large Load Diff
+14 -14
View File
@@ -10,14 +10,6 @@ namespace MP.Data.Controllers
{
public class MpStatsController : IDisposable
{
#region Private Fields
private static IConfiguration _configuration;
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Public Constructors
public MpStatsController(IConfiguration configuration)
@@ -52,9 +44,9 @@ namespace MP.Data.Controllers
/// <param name="numRecord"></param>
/// <param name="searchVal"></param>
/// <returns></returns>
public List<DatabaseModels.AnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
public List<DatabaseModels.StatsAnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
{
List<DatabaseModels.AnagArticoli> dbResult = new List<DatabaseModels.AnagArticoli>();
List<DatabaseModels.StatsAnagArticoli> dbResult = new List<DatabaseModels.StatsAnagArticoli>();
using (var dbCtx = new MoonPro_STATSContext(_configuration))
{
dbResult = dbCtx
@@ -73,9 +65,9 @@ namespace MP.Data.Controllers
/// <param name="numRecord"></param>
/// <param name="searchVal"></param>
/// <returns></returns>
public List<DatabaseModels.ODL> CommesseGetSearch(int numRecord, string searchVal = "")
public List<DatabaseModels.StatsODL> CommesseGetSearch(int numRecord, string searchVal = "")
{
List<DatabaseModels.ODL> dbResult = new List<DatabaseModels.ODL>();
List<DatabaseModels.StatsODL> dbResult = new List<DatabaseModels.StatsODL>();
using (var dbCtx = new MoonPro_STATSContext(_configuration))
{
dbResult = dbCtx
@@ -223,9 +215,9 @@ namespace MP.Data.Controllers
/// <param name="numRecord"></param>
/// <param name="searchVal"></param>
/// <returns></returns>
public List<DatabaseModels.ODL> StatOdlGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
public List<DatabaseModels.StatsODL> StatOdlGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
{
List<DatabaseModels.ODL> dbResult = new List<DatabaseModels.ODL>();
List<DatabaseModels.StatsODL> dbResult = new List<DatabaseModels.StatsODL>();
using (var dbCtx = new MoonPro_STATSContext(_configuration))
{
var dataFrom = new SqlParameter("@dataFrom", DataStart);
@@ -326,5 +318,13 @@ namespace MP.Data.Controllers
}
#endregion Public Methods
#region Private Fields
private static IConfiguration _configuration;
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
}
}
+22
View File
@@ -0,0 +1,22 @@
using MP.Data.DatabaseModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DTO
{
public class DossierFluxLogDTO
{
/// <summary>
/// Elenco valori FluxLogDTO serializzato (compreso valori edit)
/// </summary>
public List<FluxLogDTO> ODL { get; set; } = new List<FluxLogDTO>();
}
}
+23
View File
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.Data.DTO
{
public class FluxLogDTO
{
public string IdxMacchina { get; set; }
public DateTime dtEvento { get; set; }
public string CodFlux { get; set; }
public string Valore { get; set; }
public string ValoreEdit { get; set; }
}
}
+6 -1
View File
@@ -1,10 +1,14 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DatabaseModels
{
[Table("AnagArticoli")]
public partial class AnagArticoli
{
#region Public Properties
@@ -13,6 +17,7 @@ namespace MP.Data.DatabaseModels
public string DescArticolo { get; set; }
public string Disegno { get; set; }
public string Tipo { get; set; }
public string Azienda { get; set; }
#endregion Public Properties
}
+30
View File
@@ -0,0 +1,30 @@
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("AnagraficaGruppi")]
public partial class AnagGruppi
{
#region Public Properties
//[Key, DatabaseGenerated(DatabaseGeneratedOption.None), MaxLength(50)]
public string CodGruppo { get; set; }
//[MaxLength(50)]
public string TipoGruppo { get; set; }
//[MaxLength(250)]
public string DescrGruppo { get; set; }
public bool SelEnabled { get; set; }
#endregion Public Properties
}
}
+3 -1
View File
@@ -2,7 +2,9 @@
using System.Collections.Generic;
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DatabaseModels
{
public partial class AzioniUL
+4
View File
@@ -2,6 +2,10 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DatabaseModels
{
[Table("Config")]
+3
View File
@@ -4,6 +4,9 @@ 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
{
+50
View File
@@ -0,0 +1,50 @@
using System;
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("Dossiers")]
public partial class Dossiers
{
#region Public Properties
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int IdxDossier { get; set; }
[MaxLength(50)]
public string DataType { get; set; }
public DateTime DtRif { get; set; }
[MaxLength(50)]
public string IdxMacchina { get; set; } = "";
[MaxLength(50)]
public string CodArticolo { get; set; } = "";
public int IdxODL { get; set; } = 0;
public string Valore { get; set; } = "";
/// <summary>
/// Navigazione oggetto Machine
/// </summary>
[ForeignKey("IdxMacchina")]
public virtual Macchine MachineNav { get; set; } = null!;
/// <summary>
/// Navigazione oggetto ODL
/// </summary>
[ForeignKey("IdxODL")]
public virtual ODLModel OdlNav { get; set; } = null!;
#endregion Public Properties
}
}
+47
View File
@@ -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
}
}
+32
View File
@@ -0,0 +1,32 @@
using System;
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("FluxLog")]
public partial class FluxLog
{
#region Public Properties
[MaxLength(50)]
public string IdxMacchina { get; set; }
public DateTime dtEvento { get; set; }
[MaxLength(50)]
public string CodFlux { get; set; }
[MaxLength(250)]
public string Valore { get; set; }
public int Cnt { get; set; }
#endregion Public Properties
}
}
+38
View File
@@ -0,0 +1,38 @@
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("LinkMenuJQM")]
public partial class LinkMenu
{
#region Public Properties
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int idxLink { get; set; }
[MaxLength(50)]
public string TipoLink { get; set; } = "";
public int ordine { get; set; } = 0;
[MaxLength(50)]
public string Testo { get; set; } = "";
[MaxLength(50)]
public string NavigateUrl { get; set; } = "";
[MaxLength(50)]
public string icona { get; set; } = "";
#endregion Public Properties
}
}
+32
View File
@@ -0,0 +1,32 @@
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("ListValues")]
public partial class ListValues
{
#region Public Properties
[MaxLength(50)]
public string TableName { get; set; }
[MaxLength(50)]
public string FieldName { get; set; }
[MaxLength(50)]
public string value { get; set; }
[MaxLength(50)]
public string label { get; set; }
public int ordinal { get; set; }
#endregion Public Properties
}
}
+4 -1
View File
@@ -1,8 +1,11 @@
using System;
using System.Collections.Generic;
#nullable disable
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DatabaseModels
{
public partial class Macchine
+4
View File
@@ -1,6 +1,10 @@
using System;
using System.Collections.Generic;
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DatabaseModels
{
public partial class MappaStatoExpl
+69
View File
@@ -0,0 +1,69 @@
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("ODL")]
public partial class ODLModel
{
#region Public Properties
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int IdxOdl { get; set; }
[MaxLength(50)]
public string CodArticolo { get; set; } = "";
[MaxLength(50)]
public string IdxMacchina { get; set; }
public int NumPezzi { get; set; }
public decimal Tcassegnato { get; set; }
public DateTime? DataInizio { get; set; }
public DateTime? DataFine { get; set; }
[MaxLength(2500)]
public string Note { get; set; } = "";
[MaxLength(50)]
public string KeyRichiesta { get; set; }
public int PzPallet { get; set; } = 1;
[MaxLength(50)]
public string CodCli { get; set; } = "";
[NotMapped]
public string DurataMinuti
{
get
{
string answ = "";
DateTime end = DataFine != null ? (DateTime)DataFine : DateTime.Now;
var tsDurata = (end).Subtract((DateTime)DataInizio);
if (tsDurata.TotalDays < 1)
{
answ = $"{tsDurata.Hours:00}h {tsDurata.Minutes:00}'";
}
else
{
answ = $"{tsDurata.Days}gg {tsDurata.Hours:00}h";
}
return answ;
}
}
/// <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
}
}
+71
View File
@@ -0,0 +1,71 @@
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("PromesseODL")]
public partial class PODLModel
{
#region Public Properties
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int IdxPromessa { get; set; }
[MaxLength(50)]
public string KeyRichiesta { get; set; }
[MaxLength(50)]
public string KeyBCode { get; set; }
public bool Attivabile { get; set; } = false;
public int IdxOdl { get; set; } = 0;
[MaxLength(50)]
public string CodArticolo { get; set; } = "";
[MaxLength(50)]
public string CodGruppo { get; set; } = "";
[MaxLength(50)]
public string IdxMacchina { get; set; }
public int NumPezzi { get; set; } = 1;
public decimal Tcassegnato { get; set; } = 1;
public DateTime? DueDate { get; set; }
public int Priorita { get; set; } = 1;
public int PzPallet { get; set; } = 1;
[MaxLength(2500)]
public string Note { get; set; } = "";
[MaxLength(50)]
public string CodCli { get; set; } = "";
public DateTime InsertDate { get; set; } = DateTime.Now;
[NotMapped]
public string CodFase
{
get
{
string answ = "*";
var allData = KeyRichiesta.Split('_');
if (allData.Length > 0)
{
answ = allData[0];
}
return answ;
}
}
/// <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
}
}
+4 -1
View File
@@ -1,8 +1,11 @@
using System;
using System.Collections.Generic;
#nullable disable
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DatabaseModels
{
public partial class ResControlli
+4 -1
View File
@@ -1,8 +1,11 @@
using System;
using System.Collections.Generic;
#nullable disable
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DatabaseModels
{
public partial class ResScarti
+26
View File
@@ -0,0 +1,26 @@
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 StatODLModel
{
#region Public Properties
[Key]
public int IdxStato { get; set; }
public string Descrizione { get; set; } = "";
public string Semaforo { get; set; }
public string Css { get; set; }
public double TotDurata { get; set; }
#endregion Public Properties
}
}
+20
View File
@@ -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;
}
}
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DatabaseModels
{
public partial class StatsAnagArticoli
{
#region Public Properties
public string CodArticolo { get; set; }
public string DescArticolo { get; set; }
public string Disegno { get; set; }
public string Tipo { get; set; }
#endregion Public Properties
}
}
@@ -1,11 +1,14 @@
using System;
using System.Collections.Generic;
#nullable disable
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DatabaseModels
{
public partial class ODL
public partial class StatsODL
{
#region Public Properties
+4 -1
View File
@@ -3,8 +3,11 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DatabaseModels
{
public partial class TurniOee
+4 -1
View File
@@ -1,8 +1,11 @@
using System;
using System.Collections.Generic;
#nullable disable
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data.DatabaseModels
{
public partial class UserActionLog
+6 -6
View File
@@ -12,14 +12,14 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.7">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.7" />
<PackageReference Include="NLog" Version="5.0.1" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.9" />
<PackageReference Include="NLog" Version="5.0.4" />
</ItemGroup>
</Project>
+46 -50
View File
@@ -1,29 +1,11 @@
using NLog;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.Data
{
public class MessagePipe
{
#region Private Fields
private bool enableLog = false;
private IConnectionMultiplexer redis;
private IDatabase? redisDb;
#endregion Private Fields
#region Protected Fields
protected static Logger Log = LogManager.GetCurrentClassLogger();
#endregion Protected Fields
#region Public Constructors
public MessagePipe(IConnectionMultiplexer redisConn, string channelName, bool enableLog = false)
@@ -44,37 +26,6 @@ namespace MP.Data
#endregion Public Events
#region Private Properties
/// <summary>
/// Canale associato al gestore pipeline messaggi
/// </summary>
private string _channel { get; set; } = "";
#endregion Private Properties
#region Private Methods
private void setupSubscriber()
{
ISubscriber sub = redis.GetSubscriber();
//Subscribe to the channel named messages
sub.Subscribe(_channel, (channel, message) =>
{
Log.Trace($"ch {channel} | {message}");
// messaggio
PubSubEventArgs mea = new PubSubEventArgs(message);
// se qualcuno ascolta sollevo evento nuovo valore...
if (EA_NewMessage != null)
{
EA_NewMessage(this, mea);
}
});
Log.Info($"Subscribed {_channel}");
}
#endregion Private Methods
#region Public Methods
public bool saveAndSendMessage(string memKey, string message)
@@ -108,6 +59,51 @@ namespace MP.Data
#endregion Public Methods
#region Protected Fields
protected static Logger Log = LogManager.GetCurrentClassLogger();
#endregion Protected Fields
#region Private Fields
private bool enableLog = false;
private IConnectionMultiplexer redis;
private IDatabase? redisDb;
#endregion Private Fields
#region Private Properties
/// <summary>
/// Canale associato al gestore pipeline messaggi
/// </summary>
private string _channel { get; set; } = "";
#endregion Private Properties
#region Private Methods
private void setupSubscriber()
{
ISubscriber sub = redis.GetSubscriber();
//Subscribe to the channel named messages
sub.Subscribe(_channel, (channel, message) =>
{
Log.Trace($"ch {channel} | {message}");
// messaggio
PubSubEventArgs mea = new PubSubEventArgs(message);
// se qualcuno ascolta sollevo evento nuovo valore...
if (EA_NewMessage != null)
{
EA_NewMessage(this, mea);
}
});
Log.Info($"Subscribed {_channel}");
}
#endregion Private Methods
/// <summary>
/// Invio messaggio sul canale + salvataggio in cache REDIS
/// </summary>
@@ -132,4 +128,4 @@ namespace MP.Data
#endregion Public Properties
}
}
}
+88 -5
View File
@@ -6,7 +6,9 @@ using MP.Data.DatabaseModels;
using NLog;
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data
{
public partial class MoonProContext : DbContext
@@ -34,10 +36,21 @@ namespace MP.Data
#region Public Properties
public virtual DbSet<StatsAnagArticoli> DbSetStatArticoli { get; set; }
public virtual DbSet<AnagArticoli> DbSetArticoli { get; set; }
public virtual DbSet<Macchine> DbSetMacchine { get; set; }
public virtual DbSet<MappaStatoExpl> DbSetMSE { get; set; }
public virtual DbSet<ConfigModel> DbSetConfig { get; set; }
public virtual DbSet<AnagGruppi> DbSetAnagGruppi { get; set; }
public virtual DbSet<ListValues> DbSetListValues { get; set; }
public virtual DbSet<LinkMenu> DbSetLinkMenu { get; set; }
public virtual DbSet<ODLModel> DbSetODL { get; set; }
public virtual DbSet<PODLModel> DbSetPODL { get; set; }
public virtual DbSet<FluxLog> DbSetFluxLog { get; set; }
public virtual DbSet<Dossiers> DbSetDossiers { get; set; }
public virtual DbSet<StatODLModel> DbSetStatOdl { get; set; }
public virtual DbSet<StatoProdModel> DbSetStatoProd { get; set; }
public virtual DbSet<EventListModel> DbSetEvList { get; set; }
#endregion Public Properties
@@ -53,7 +66,15 @@ namespace MP.Data
{
if (!optionsBuilder.IsConfigured)
{
string connString = _configuration.GetConnectionString("Mp.Mon");
string connString = _configuration.GetConnectionString("Mp.Data");
if (string.IsNullOrEmpty(connString))
{
connString = _configuration.GetConnectionString("Mp.Mon");
}
if (string.IsNullOrEmpty(connString))
{
connString = _configuration.GetConnectionString("Mp.STATS");
}
optionsBuilder.UseSqlServer(connString);
//optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;");
@@ -64,9 +85,9 @@ namespace MP.Data
{
modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS");
modelBuilder.Entity<AnagArticoli>(entity =>
modelBuilder.Entity<StatsAnagArticoli>(entity =>
{
entity.HasNoKey();
entity.HasKey(e => e.CodArticolo);
entity.ToView("v_UI_AnagArticoli");
@@ -86,10 +107,36 @@ namespace MP.Data
.IsRequired()
.HasMaxLength(50);
});
modelBuilder.Entity<AnagArticoli>(entity =>
{
entity.HasKey(e => e.CodArticolo);
entity.ToView("AnagArticoli");
entity.Property(e => e.CodArticolo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.DescArticolo)
.IsRequired()
.HasMaxLength(250);
entity.Property(e => e.Disegno)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Tipo)
.IsRequired()
.HasMaxLength(50);
entity.Property(e => e.Azienda)
.IsRequired()
.HasMaxLength(50);
});
modelBuilder.Entity<Macchine>(entity =>
{
entity.HasNoKey();
entity.HasKey(e => e.IdxMacchina);
entity.ToView("Macchine");
@@ -223,6 +270,42 @@ namespace MP.Data
.HasColumnName("valoreStd")
.HasComment("Valore di default/riferimento per la variabile");
});
modelBuilder.Entity<AnagGruppi>(entity =>
{
entity.HasKey(e => e.CodGruppo);
entity.Property(e => e.CodGruppo)
.HasMaxLength(50)
.HasColumnName("CodGruppo");
entity.Property(e => e.TipoGruppo)
.HasMaxLength(50)
.HasColumnName("TipoGruppo");
entity.Property(e => e.DescrGruppo)
.HasMaxLength(250)
.HasColumnName("DescrGruppo");
entity.Property(e => e.SelEnabled)
.HasColumnName("SelEnabled");
});
modelBuilder.Entity<ListValues>(entity =>
{
entity.HasKey(e => new { e.TableName, e.FieldName, e.value });
});
modelBuilder.Entity<FluxLog>(entity =>
{
entity.HasKey(e => new { e.IdxMacchina, e.dtEvento, e.CodFlux });
});
modelBuilder.Entity<EventListModel>(entity =>
{
entity.HasKey(e => new { e.IdxMacchina, e.InizioStato, e.IdxTipo});
});
OnModelCreatingPartial(modelBuilder);
}
+7 -5
View File
@@ -6,7 +6,9 @@ using MP.Data.DatabaseModels;
using NLog;
#nullable disable
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace MP.Data
{
public partial class MoonPro_STATSContext : DbContext
@@ -34,12 +36,12 @@ namespace MP.Data
#region Public Properties
public virtual DbSet<AnagArticoli> DbSetArticoli { get; set; }
public virtual DbSet<StatsAnagArticoli> DbSetArticoli { get; set; }
public virtual DbSet<AzioniUL> DbSetAzioniUL { get; set; }
public virtual DbSet<ResControlli> DbSetControlli { get; set; }
public virtual DbSet<DdbTurni> DbSetDdbTurni { get; set; }
public virtual DbSet<Macchine> DbSetMacchine { get; set; }
public virtual DbSet<ODL> DbSetODL { get; set; }
public virtual DbSet<StatsODL> DbSetODL { get; set; }
public virtual DbSet<ResScarti> DbSetScarti { get; set; }
public virtual DbSet<TurniOee> DbSetTurniOee { get; set; }
public virtual DbSet<UserActionLog> DbSetUserLog { get; set; }
@@ -98,7 +100,7 @@ namespace MP.Data
.HasMaxLength(5);
});
modelBuilder.Entity<AnagArticoli>(entity =>
modelBuilder.Entity<StatsAnagArticoli>(entity =>
{
entity.HasNoKey();
@@ -325,7 +327,7 @@ namespace MP.Data
.HasMaxLength(250);
});
modelBuilder.Entity<ODL>(entity =>
modelBuilder.Entity<StatsODL>(entity =>
{
entity.HasKey(e => e.IdxOdl)
.HasName("PK_ODL_1");
+69 -3
View File
@@ -3,13 +3,26 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.Data
{
public class Utils
{
#region Public Properties
public static string redKeyArtUsed
{
get => RedHash($"CACHE:CheckArtUsed");
}
public static string redKeyTabCheckArt
{
get => RedHash($"CACHE:TabCheckArt");
}
#endregion Public Properties
#region Public Methods
public static string ConvMinToTime(double minutes)
@@ -28,17 +41,70 @@ namespace MP.Data
return answ;
}
public static async Task SaveToCsv<T>(List<T> reportData, string path)
/// <summary>
/// Nome della variabile HASH da utilizzare (dato CodModulo / Server / DB impiegato da
/// funzionalita' DbConfig) + keyName richiesto...
/// </summary>
public static string RedHash(string keyName)
{
string answ = keyName;
try
{
answ = $"MP:Data:{keyName}";
}
catch
{ }
return answ;
}
/// <summary>
/// Effettua salvataggio in file di un generico oggetto in formato CSV
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="reportData"></param>
/// <param name="path"></param>
/// <param name="separator">Separatore da impiegare</param>
/// <returns></returns>
public static async Task SaveToCsv<T>(List<T> reportData, string path, char separator)
{
var lines = new List<string>();
IEnumerable<PropertyDescriptor> props = TypeDescriptor.GetProperties(typeof(T)).OfType<PropertyDescriptor>();
var header = string.Join(";", props.ToList().Select(x => x.Name));
lines.Add(header);
var valueLines = reportData.Select(row => string.Join(";", header.Split(';').Select(a => row.GetType().GetProperty(a).GetValue(row, null))));
var valueLines = reportData.Select(row => string.Join(separator, header.Split(separator).Select(a => row.GetType().GetProperty(a).GetValue(row, null))));
//var valueLines = reportData.Select(row => string.Join(";", header.Split(';').Select(a => row.GetType().GetProperty(a).GetValue(row, null))));
lines.AddRange(valueLines);
await Task.Run(() => File.WriteAllLines(path, lines.ToArray()));
}
/// <summary>
/// Inizializzazione con periodo e arrotondamento
/// </summary>
/// <param name="minRound"></param>
/// <returns></returns>
public static DateTime InitDatetime(DateTime dtRif, int minRound)
{
TimeSpan DayElapsed = dtRif.Subtract(dtRif.Date);
int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound;
DateTime endRounded = DateTime.Today.AddMinutes(minDay);
return endRounded;
}
public static string FormDurata(double durataMinuti)
{
string answ = "";
TimeSpan tsDurata = TimeSpan.FromMinutes(durataMinuti);
if (tsDurata.TotalDays < 1)
{
answ = $"{tsDurata.Hours:00}h {tsDurata.Minutes:00}'";
}
else
{
answ = $"{tsDurata.Days}gg {tsDurata.Hours:00}h";
}
return answ;
}
#endregion Public Methods
}
}
+5 -5
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>MP.Land</RootNamespace>
<Version>6.15.2207.1417</Version>
<Version>6.16.2209.2118</Version>
</PropertyGroup>
<ItemGroup>
@@ -45,14 +45,14 @@
<ItemGroup>
<PackageReference Include="DiffMatchPatch" Version="1.0.3" />
<PackageReference Include="Majorsoft.Blazor.Components.Debounce" Version="1.5.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.6">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.6" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.6" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.9" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.9" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.0.0" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.1.4" />
<PackageReference Include="RestSharp" Version="107.1.2" />
</ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo gestione Programmi MAPO</i>
<h4>Versione: 6.15.2207.1417</h4>
<h4>Versione: 6.16.2209.2118</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
6.15.2207.1417
6.16.2209.2118
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.15.2207.1417</version>
<version>6.16.2209.2118</version>
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+8 -1
View File
@@ -259,7 +259,14 @@ namespace MP.Mon.Components
{
double cTimeMin = currTimeMin != null ? (double)currTimeMin : 0;
tSpan = TimeSpan.FromMinutes(cTimeMin);
answ = $"{tSpan:mm}:{tSpan:ss}";
if (tSpan.TotalHours < 1)
{
answ = $"{tSpan:mm}:{tSpan:ss}";
}
else
{
answ = $"{tSpan.TotalHours:N0}h {tSpan:mm}:{tSpan:ss}";
}
}
catch
{ }
+4 -2
View File
@@ -117,6 +117,8 @@ namespace MP.Mon.Data
public async Task<List<MappaStatoExpl>> MseGetAll()
{
int maxAge = 2000;
int.TryParse(_configuration.GetValue<string>("ServerConf:maxAge"), out maxAge);
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
List<MappaStatoExpl>? result = new List<MappaStatoExpl>();
@@ -131,10 +133,10 @@ namespace MP.Mon.Data
}
else
{
result = await Task.FromResult(dbController.MseGetAll());
result = await Task.FromResult(dbController.MseGetAll(maxAge));
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(redisMseKey, rawData, TimeSpan.FromSeconds(2));
await redisDb.StringSetAsync(redisMseKey, rawData, TimeSpan.FromMilliseconds(maxAge));
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"Read from DB: {ts.TotalMilliseconds}ms");
+3 -3
View File
@@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>6.15.2207.1309</Version>
<Version>6.16.2209.2118</Version>
</PropertyGroup>
<ItemGroup>
@@ -30,8 +30,8 @@
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog" Version="5.0.1" />
<PackageReference Include="StackExchange.Redis" Version="2.6.48" />
<PackageReference Include="NLog" Version="5.0.4" />
<PackageReference Include="StackExchange.Redis" Version="2.6.66" />
</ItemGroup>
<ItemGroup>
+1
View File
@@ -7,6 +7,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="google" content="notranslate">
<base href="~/" />
<link rel="stylesheet" href="lib/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="css/site.css" />
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MON MAPO</i>
<h4>Versione: 6.15.2207.1309</h4>
<h4>Versione: 6.16.2209.2118</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.15.2207.1309
6.16.2209.2118
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.15.2207.1309</version>
<version>6.16.2209.2118</version>
<url>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/MP.Mon.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+3
View File
@@ -11,5 +11,8 @@
"MP.Mon": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=Blazor.ServerApp;",
"MP.Stats": "Server=SQL2016DEV;Database=MoonPro_STATS; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=Blazor.ServerApp;",
"Redis": "localhost:6379,DefaultDatabase=1,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false"
},
"ServerConf": {
"maxAge": "2000"
}
}
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>MP.Prog</RootNamespace>
<Version>6.15.2202.2715</Version>
<Version>6.15.2209.1609</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo gestione Programmi MAPO</i>
<h4>Versione: 6.15.2202.2715</h4>
<h4>Versione: 6.15.2209.1609</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
6.15.2202.2715
6.15.2209.1609
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.15.2202.2715</version>
<version>6.15.2209.1609</version>
<url>https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/MP.Prog.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+14
View File
@@ -0,0 +1,14 @@
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
</CascadingAuthenticationState>
+1
View File
@@ -0,0 +1 @@
<canvas id="@Id"></canvas>
@@ -0,0 +1,59 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data;
using static System.Net.Mime.MediaTypeNames;
namespace MP.SPEC.Components.Chart
{
public partial class Doughnut
{
[Inject]
private IJSRuntime JSRuntime { get; set; } = null!;
public enum ChartType
{
Pie,
Bar,
Doughnut
}
//[Parameter]
public string Id { get; set; } = "myChart";
[Parameter]
public ChartType Type { get; set; }
[Parameter]
public double[] Data { get; set; }
[Parameter]
public string[] BackgroundColor { get; set; }
[Parameter]
public string[] Labels { get; set; }
protected override async Task OnAfterRenderAsync(bool firstRender)
{
var config = new
{
Type = Type.ToString().ToLower(),
Options = new
{
Responsive = true,
},
Data = new
{
Datasets = new[]
{
new { Data = Data, BackgroundColor = BackgroundColor
}
},
Labels = Labels
}
};
await JSRuntime.InvokeVoidAsync("setup", Id, config);
}
}
}
+1
View File
@@ -0,0 +1 @@
<canvas id="@Id"></canvas>
+162
View File
@@ -0,0 +1,162 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data;
namespace MP.SPEC.Components.Chart
{
public partial class Line
{
#region Public Properties
[Parameter]
public double AspRatio { get; set; } = 0;
[Parameter]
public List<string> backColor { get; set; } = new List<string>();
[Parameter]
public string ChartId
{
get
{
return Id;
}
set
{
Id = value;
}
}
[Parameter]
public List<chartJsData.chartJsTSerie> DataTS
{
get
{
return _DataTS;
}
set
{
_DataTS = value;
//var pUpd = Task.Run(async () => await renderChart());
//pUpd.Wait();
}
}
[Parameter]
public List<string> Labels { get; set; } = new List<string>();
[Parameter]
public List<string> lineColor { get; set; } = new List<string>();
[Parameter]
public int lTens { get; set; } = 0;
[Parameter]
public string MaxValue { get; set; } = "0";
[Parameter]
public string MinValue { get; set; } = "0";
[Parameter]
public List<string> pointColor { get; set; } = new List<string>();
[Parameter]
public string Title { get; set; } = "Demo Line";
#endregion Public Properties
#region Protected Properties
protected string Id { get; set; } = "CurrId";
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// Inizializzazione rendering componente
///
/// partendo da qui: https://www.williamleme.com/posts/2020/003-chartjs-blazor/
/// https://www.puresourcecode.com/dotnet/blazor/using-chart-js-with-blazor/ https://www.tutorialsteacher.com/csharp/csharp-anonymous-type
/// </summary>
/// <param name="firstRender"></param>
/// <returns></returns>
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await renderChart();
}
/// <summary>
/// Inizializzazione rendering componente
///
/// partendo da qui: https://www.williamleme.com/posts/2020/003-chartjs-blazor/
/// https://www.puresourcecode.com/dotnet/blazor/using-chart-js-with-blazor/ https://www.tutorialsteacher.com/csharp/csharp-anonymous-type
/// </summary>
/// <param name="firstRender"></param>
/// <returns></returns>
protected async Task renderChart()
{
// creazione di un oggetto anonymous type con tutte le opzioni da passare a chart.js
var config = new
{
type = "line",
options = new
{
responsive = true,
scales = new
{
yAxes = new
{
display = true,
position = "right",
ticks = new
{
maxTicksLimit = 10
},
suggestedMin = MinValue != MaxValue ? MinValue : "auto",
suggestedMax = MinValue != MaxValue ? MaxValue : "auto"
},
xAxes = new
{
type = "time",
distribution = "linear",
}
},
plugins = new
{
legend = new
{
display = false
},
},
Animation = false,
AspectRatio = AspRatio == 0 ? "auto" : $"{AspRatio}"
},
data = new
{
labels = Labels,
datasets = new[]{new
{
data = DataTS, pointBorderColor = backColor, borderColor = lineColor, backgroundColor = backColor, fill = true, PointRadius = 2, BorderWidth = 1, lineTension = lTens, stepped = false, label = Title
}
}
}
}
;
await JSRuntime.InvokeVoidAsync("setup", Id, config);
}
#endregion Protected Methods
#region Private Properties
private List<chartJsData.chartJsTSerie> _DataTS { get; set; } = null!;
[Inject]
private IJSRuntime JSRuntime { get; set; } = null!;
#endregion Private Properties
}
}
+9
View File
@@ -0,0 +1,9 @@
<div class="row text-light">
<div class="col-5 pe-0 text-left">
<b>Mapo SPEC @(DateTime.Today.Year)</b> | <span class="small">v.@version</span>
</div>
<div class="col-7 ps-0 text-end">
<span class="small">@($"{DateTime.Now:HH:mm:ss}")</span> | <a class="text-light" href="https://www.egalware.com/" target="_blank"><img class="img-fluid" width="16" src="images/LogoEgw.png" /> Egalware </a>
</div>
</div>
+55
View File
@@ -0,0 +1,55 @@
using NLog;
namespace MP.SPEC.Components
{
public partial class CmpFooter
{
#region Public Methods
public void Dispose()
{
aTimer.Elapsed -= ElapsedTimer;
aTimer.Stop();
aTimer.Dispose();
}
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
{
var pUpd = Task.Run(async () =>
{
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
});
pUpd.Wait();
}
public void StartTimer()
{
int tOutPeriod = 5000;
//int.TryParse(Configuration["ReloadStatusTimer"], out tOutPeriod);
aTimer = new System.Timers.Timer(tOutPeriod);
aTimer.Elapsed += ElapsedTimer;
aTimer.Enabled = true;
aTimer.Start();
}
#endregion Public Methods
#region Protected Methods
protected override void OnInitialized()
{
version = typeof(Program).Assembly.GetName().Version;
}
#endregion Protected Methods
#region Private Fields
private static System.Timers.Timer aTimer = null!;
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private Version version = null!;
#endregion Private Fields
}
}
+65
View File
@@ -0,0 +1,65 @@
@using MP.SPEC.Components
@using MP.SPEC.Data
@using System.Security.Claims
@using Microsoft.AspNetCore.Components.Authorization
@inject AuthenticationStateProvider AuthenticationStateProvider
@inject MessageService MService
<div class="d-flex w-100 justify-content-between">
<div class="px-2">
<i class="fas fa-user-alt"></i> <b>@userName</b>
</div>
<div class="px-2 flex-grow-1 text-end">
<span class="text-secondary">@TipoSearch</span>
</div>
<div class="px-2 text-end">
@if (ShowSearch)
{
<SearchMod></SearchMod>
}
</div>
</div>
@code {
protected bool ShowSearch
{
get => MService.ShowSearch;
set => MService.ShowSearch = value;
}
private string userName = "";
private string TipoSearch
{
get => MService.TipoSearch;
set => MService.TipoSearch = value;
}
protected override async Task OnInitializedAsync()
{
MService.EA_ShowSearch += MService_EA_ShowSearch;
await forceReload();
}
private async void MService_EA_ShowSearch()
{
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
}
private async Task forceReload()
{
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
var user = authState.User;
if (user.Identity != null&& user.Identity.IsAuthenticated)
{
userName = $"{user.Identity.Name}";
}
else
{
userName = "N.A.";
}
}
}
+56
View File
@@ -0,0 +1,56 @@
<div class="row">
<div class="col-12 col-lg-8 text-left">
<div class="row">
<div class="col-12 small">
@if (totalCount > 0)
{
<ul class="pagination pagination-sm mb-1">
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(1)"><i class="fas fa-angle-double-left"></i></button></li>
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(prevBlock)"><i class="fas fa-angle-left"></i></button></li>
@for (int i = @startPage; i <= endPage; ++i)
{
var pageNum = i;
<li class="page-item @cssActive(pageNum)"><button class="page-link" @onclick="() => PaginationItemClick(pageNum)">@pageNum</button></li>
}
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(nextBlock)"><i class="fas fa-angle-right"></i></button></li>
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(LastPage)"><i class="fas fa-angle-double-right"></i></button></li>
</ul>
}
</div>
</div>
<div class="row">
<div class="col-12 small">
@if (showLoading)
{
<div class="progress" style="height: 10px;">
<div class="progress-bar progress-bar-striped progress-bar-animated" style="width:@percLoading%;"></div>
</div>
}
</div>
</div>
</div>
<div class="col-12 col-lg-4">
<div class="d-flex">
<div class="p-1 flex-fill">
@if (!showLoading)
{
<span>@totalCount records</span>
}
</div>
<div class="p-1 small">
@if (totalCount > 0)
{
<div class="input-group input-group-sm">
<select @bind="@PageSize" class="form-select form-select-sm text-end">
<option value="5">5</option>
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</div>
}
</div>
</div>
</div>
</div>
+198
View File
@@ -0,0 +1,198 @@
using Microsoft.AspNetCore.Components;
namespace MP.SPEC.Components
{
public partial class DataPager : ComponentBase
{
#region Public Properties
[Parameter]
public int currPage
{
get
{
return _numPage;
}
set
{
bool doReport = !_numPage.Equals(value);
if (doReport)
{
_numPage = value;
reportChangePage();
}
}
}
[Parameter]
public EventCallback<int> numPageChanged { get; set; }
[Parameter]
public EventCallback<int> numRecordChanged { get; set; }
[Parameter]
public int PageSize
{
get
{
return _numRecord;
}
set
{
bool doReport = !_numRecord.Equals(value);
if (doReport)
{
_numRecord = value;
reportChange();
resetCurrPage();
}
}
}
[Parameter]
public bool showLoading
{
get
{
return _showLoading;
}
set
{
if (value)
{
Random random = new Random();
percLoading = random.Next(30, 90);
}
else
{
percLoading = 5;
}
_showLoading = value;
}
}
[Parameter]
public int totalCount { get; set; } = 0;
#endregion Public Properties
#region Public Methods
public async Task resetCurrPage()
{
await Task.Delay(1);
currPage = 1;
}
#endregion Public Methods
#region Protected Fields
protected bool _showLoading = false;
#endregion Protected Fields
#region Protected Properties
protected int _numPage { get; set; } = 1;
protected int _numRecord { get; set; } = 10;
protected int percLoading { get; set; } = 0;
#endregion Protected Properties
#region Protected Methods
protected string cssActive(int numPage)
{
string answ = "";
if (numPage == currPage)
{
answ = "active";
}
return answ;
}
protected override async Task OnInitializedAsync()
{
await Task.Run(() => showLoading = false);
}
protected void PaginationItemClick(int page)
{
currPage = page;
}
#endregion Protected Methods
#region Private Properties
private int endPage
{
get
{
int answ = (int)(currPage / numPages) * numPages + numPages;
answ = answ < LastPage ? answ : LastPage;
return answ;
}
}
private int LastPage
{
get
{
return Math.Max((int)Math.Ceiling(totalCount / (double)PageSize), 1);
}
}
private int nextBlock
{
get
{
int answ = currPage + numPages;
answ = answ < LastPage ? answ : LastPage;
return answ;
}
}
private int numPages { get; set; } = 10;
private int prevBlock
{
get
{
int answ = currPage - numPages;
answ = answ > 0 ? answ : 1;
return answ;
}
}
// calcola un set 1 .. numPages centrato sulla pagina corrente...
private int startPage
{
get
{
int answ = (int)(currPage / numPages) * numPages;
answ = answ > 0 ? answ : 1;
return answ;
}
}
#endregion Private Properties
#region Private Methods
private void reportChange()
{
numRecordChanged.InvokeAsync(PageSize);
}
private void reportChangePage()
{
numPageChanged.InvokeAsync(currPage);
}
#endregion Private Methods
}
}
+58
View File
@@ -0,0 +1,58 @@
<div class="d-flex justify-content-end">
<a class="pt-2 text-dark" data-bs-toggle="offcanvas" data-bs-target="#paramsFilterExample" aria-controls="paramsFilterExample">
<i class="fa-solid fa-bars"></i>
</a>
<div class="offcanvas offcanvas-end" tabindex="-1" id="paramsFilterExample" aria-labelledby="paramsFilterExampleLabel">
<div class="offcanvas-header">
<h3 class="offcanvas-title" id="paramsFilterExampleLabel"><b>FILTRI</b></h3>
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div>
Seleziona i filtri per:
</div>
<div class="input-group p-2">
<label class="input-group-text" for="macchina" title="Selezionare l'articolo"><i class="fa-solid fa-file"></i></label>
<select @bind="@selArticolo" class="form-select" id="macchina" title="Selezionare la macchina">
<option value="*">--- Tutti ---</option>
@if (ListArticoli != null)
{
foreach (var item in ListArticoli)
{
<option value="@item">@item</option>
}
}
</select>
</div>
<div class="input-group p-2">
<label class="input-group-text" for="macchina" title="Selezionare la macchina"><i class="fa-solid fa-hard-drive"></i></label>
<select @bind="@selMacchina" class="form-select" id="macchina" title="Selezionare la macchina">
<option value="*">--- Tutti ---</option>
@if (ListMacchine != null)
{
foreach (var item in ListMacchine)
{
<option value="@item">@item</option>
}
}
</select>
</div>
<div class="input-group p-2">
<label class="input-group-text" for="DtMin" title="Selezionare la data da visualizzare"><i class="fa-solid fa-calendar-check"></i></label>
<input @bind="@selDtRef" id="DtMin" class="form-control" type="datetime-local" title="Selezionare la data minima da visualizzare" />
</div>
<div class="input-group p-2">
<label class="input-group-text" for="maxRecord" title="Selezionare il numero massimo di record da visualizzare"><i class="fa-solid fa-list-ol"></i></label>
<select @bind="@selMaxRecord" class="form-select" id="maxRecord" title="Selezionare il numero massimo di record da visualizzare">
<option value="50">50</option>
<option value="100">100</option>
<option value="250">250</option>
<option value="500">500</option>
</select>
</div>
</div>
</div>
</div>
+143
View File
@@ -0,0 +1,143 @@
using Microsoft.AspNetCore.Components;
using MP.SPEC.Data;
namespace MP.SPEC.Components
{
public partial class DossiersFilter
{
#region Public Properties
[Parameter]
public EventCallback<SelectDossierParams> FilterChanged { get; set; }
[Parameter]
public SelectDossierParams SelFilterDossier { get; set; } = null!;
#endregion Public Properties
#region Protected Properties
[Inject]
protected MpDataService MDService { get; set; } = null!;
protected string selArticolo
{
get
{
return SelFilterDossier.CodArticolo;
}
set
{
if (!SelFilterDossier.CodArticolo.Equals(value))
{
SelFilterDossier.CurrPage = 1;
SelFilterDossier.CodArticolo = value;
StateHasChanged();
Task.Delay(1);
reportChange();
}
}
}
protected DateTime selDtRef
{
get
{
return SelFilterDossier.DtRef;
}
set
{
if (!SelFilterDossier.DtRef.Equals(value))
{
SelFilterDossier.DtRef = value;
reportChange();
}
}
}
protected string selMacchina
{
get
{
return SelFilterDossier.IdxMacchina;
}
set
{
if (!SelFilterDossier.IdxMacchina.Equals(value))
{
SelFilterDossier.CurrPage = 1;
SelFilterDossier.IdxMacchina = value;
StateHasChanged();
Task.Delay(1);
reportChange();
}
}
}
protected int selMaxRecord
{
get
{
return SelFilterDossier.MaxRecord;
}
set
{
if (!SelFilterDossier.MaxRecord.Equals(value))
{
SelFilterDossier.MaxRecord = value;
reportChange();
}
}
}
protected bool showParam { get; set; } = false;
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
SelFilterDossier = new SelectDossierParams();
ListMacchine = await MDService.MacchineWithFlux();
ListArticoli = await MDService.ArticleWithDossier();
await FilterChanged.InvokeAsync(SelFilterDossier);
}
protected void toggleParams()
{
showEditPar = !showEditPar;
}
#endregion Protected Methods
#region Private Fields
private List<string>? ListArticoli = null;
private List<string>? ListMacchine = null;
#endregion Private Fields
#region Private Properties
private bool showEditPar { get; set; } = false;
#endregion Private Properties
#region Private Methods
private void reportChange()
{
FilterChanged.InvokeAsync(SelFilterDossier);
}
private void toggleShowParams()
{
showParam = !showParam;
}
#endregion Private Methods
}
}
+126
View File
@@ -0,0 +1,126 @@
@using MP.SPEC.Components
@using MP.SPEC.Data
@if (ListRecords == null)
{
<LoadingData></LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
}
else
{
<div class="row">
<div class="d-flex justify justify-content-between">
<table class="table table-sm table-striped small">
<thead>
<tr>
<th>
<button @onclick="() => unToggleTableFlux()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
</th>
<th><i class="fa-solid fa-file"></i> Articolo</th>
<th><i class="fa-solid fa-screwdriver-wrench"></i> Fase</th>
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
<th><i class="fa-regular fa-calendar-days"></i> Data Snap</th>
<th><i class="fa-solid fa-sliders"></i> ODL</th>
@*<th><i class="fa-solid fa-circle-info"></i> DATA TYPE</th>*@
<th></th>
</tr>
</thead>
<tbody>
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(@record)">
<td>
<button class="btn btn-primary btn-sm" @onclick="() => selRecord(record)"><i class="fa-solid fa-magnifying-glass"></i></button>
</td>
<td>
@record.OdlNav.CodArticolo
<div class="small textConsensed text-secondary">@record.OdlNav.ArticoloNav.DescArticolo</div>
</td>
<td>
@tradFase(record.OdlNav.KeyRichiesta)
</td>
<td>
@record.IdxMacchina
<div class="small textConsensed text-secondary">@record.MachineNav.Descrizione</div>
</td>
<td>
@record.DtRif
</td>
<td>
@record.IdxODL
</td>
@*<td>
@record.DataType
</td>*@
<td>
<button @onclick="() => deleteRecord(record)" class="btn btn-danger btn-sm"><i class="bi bi-trash-fill"></i></button>
</td>
</tr>
}
</tbody>
</table>
@if (!visualizzaFlux)
{
if (listaFlux == null)
{
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
}
else
{
<div class="table selBlock p-2">
<table class="table table-light table-sm table-striped small mb-0">
<thead>
<tr>
<th></th>
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
<th><i class="fa-regular fa-calendar-days"></i> Data</th>
<th><i class="fa-solid fa-sliders"></i> Data Type</th>
<th>
<div class="d-flex justify-content-between col-12">
<span class="col-11" style="text-align: right;"> Valore </span>
<button class="btn btn-primary btn-sm py-0" @onclick="() => unToggleTableFlux()"><i class="fa-solid fa-xmark"></i></button>
</div>
</th>
</tr>
</thead>
<tbody>
@foreach (var record in listaFlux)
{
<tr>
<td>
<button @onclick="() => editRecord(record)" class="btn btn-primary btn-sm" title="Modifica Record"><i class="bi bi-pencil-square"></i></button>
</td>
<td>
@record.IdxMacchina
</td>
<td>
@record.dtEvento
</td>
<td>
@record.CodFlux
</td>
<td style="text-align: right;">
<div><span class="small text-dark">Modificato: </span><b>@record.ValoreEdit</b></div>
<div class="small text-secondary"><span class="small text-dark">Originale: </span><i>@record.Valore</i></div>
</td>
</tr>
}
</tbody>
</table>
</div>
}
}
</div>
</div>
}
+248
View File
@@ -0,0 +1,248 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using MP.SPEC.Data;
namespace MP.SPEC.Components
{
public partial class ListDossiers
{
#region Public Properties
[Parameter]
public EventCallback<Dossiers> RecordSel { get; set; }
[Parameter]
public EventCallback<FluxLogDTO> RecordSelFlux { get; set; }
[Parameter]
public SelectDossierParams SelFilter { get; set; } = null!;
[Parameter]
public EventCallback<int> TotRecordChanged { get; set; }
#endregion Public Properties
#region Public Methods
public string checkSelect(Dossiers recordSel)
{
string answ = "";
if (currRecord != null)
{
try
{
answ = (currRecord.IdxMacchina == recordSel.IdxMacchina && currRecord.DtRif == recordSel.DtRif) ? "table-info" : "";
}
catch
{ }
}
return answ;
}
#endregion Public Methods
#region Protected Properties
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
[Inject]
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MessageService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// Eliminazione record selezionato (previa conferma)
/// </summary>
/// <param name="selRec"></param>
/// <returns></returns>
protected async Task deleteRecord(Dossiers selRec)
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Eliminazione Dossier: sei sicuro di voler procedere?"))
return;
await Task.Delay(1);
var done = await MDService.DossiersDeleteRecord(selRec);
currRecord = null;
await reloadData(true);
visualizzaFlux = true;
await Task.Delay(1);
}
protected async Task editRecord(FluxLogDTO selRec)
{
// indico record selezionato
await RecordSelFlux.InvokeAsync(selRec);
}
protected string findRec(FluxLog record)
{
string answ = "";
#if false
if (ListRecordsMod != null)
{
answ = ListRecordsMod.Where(l => l.IdxMacchina == record.IdxMacchina && l.CodFlux == record.CodFlux).Select(x => x.Valore).SingleOrDefault();
}
#endif
return answ;
}
protected override async Task OnInitializedAsync()
{
MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated += OnSeachUpdated;
ListStati = await MDService.AnagStatiComm();
await reloadData(true);
}
protected async void OnSeachUpdated()
{
await InvokeAsync(() =>
{
currPage = 1;
StateHasChanged();
});
}
protected async Task selRecord(Dossiers selRec)
{
currRecord = selRec;
await RecordSel.InvokeAsync(selRec);
listaFlux = MDService.getFluxLog(selRec.Valore);
await toggleTableFlux();
}
protected async Task UpdateData()
{
currRecord = null;
await reloadData(true);
}
#endregion Protected Methods
#region Private Fields
private int _totalCount = 0;
private Dossiers? currRecord = null;
private FluxLogDTO? currRecordFlux;
private List<Dossiers>? ListRecords;
private List<ListValues>? ListStati;
private List<Dossiers>? SearchRecords;
#endregion Private Fields
#region Private Properties
private int currPage
{
get => MessageService.currPage;
set => MessageService.currPage = value;
}
private bool isLoading { get; set; } = false;
private List<FluxLogDTO>? listaFlux { get; set; } = null;
private int MaxRecord
{
get => SelFilter.MaxRecord;
}
private int numRecord
{
get => MessageService.numRecord;
set => MessageService.numRecord = value;
}
private string SelArticolo
{
get => SelFilter.CodArticolo;
}
private DateTime SelDtRef
{
get => SelFilter.DtRef;
}
private string SelMacchina
{
get => SelFilter.IdxMacchina;
}
private int totalCount
{
get => _totalCount;
set
{
if (_totalCount != value)
{
_totalCount = value;
TotRecordChanged.InvokeAsync(value);
}
}
}
private bool visualizzaFlux { get; set; } = true;
#endregion Private Properties
#region Private Methods
private async void MessageService_EA_PageUpdated()
{
await reloadData(true);
}
private async Task reloadData(bool setChanged)
{
isLoading = true;
SearchRecords = await MDService.DossiersGetLastFilt(SelMacchina, SelArticolo, SelDtRef, MaxRecord);
totalCount = SearchRecords.Count;
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
await Task.Delay(1);
if (setChanged)
{
await InvokeAsync(() => StateHasChanged());
}
isLoading = false;
}
private async Task toggleTableFlux()
{
visualizzaFlux = false;
await Task.Delay(1);
}
private string tradFase(string codFase)
{
string answ = codFase;
if (ListStati != null && ListStati.Count > 0)
{
var recSel = ListStati.FirstOrDefault(x => x.value == codFase);
if (recSel != null)
{
answ = recSel.label;
}
}
return answ;
}
private async Task unToggleTableFlux()
{
currRecord = null;
visualizzaFlux = true;
await Task.Delay(1);
}
#endregion Private Methods
}
}
+258
View File
@@ -0,0 +1,258 @@
@using MP.SPEC.Components
@using MP.SPEC.Data
@if (ListRecords == null)
{
<LoadingData></LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
}
else
{
<div class="row">
@if (currRecord != null && !showStats && isCurrOdl)
{
<div class="col-6 col-lg-8">
</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">
<table class="table table-sm table-striped">
<thead>
<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-screwdriver-wrench"></i> Fase</th>
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
<th><i class="fa-solid fa-circle-info"></i> Info ciclo</th>
<th><i class="fa-solid fa-calendar-day"></i> Periodo</th>
<th title="Durata in ore:min"><i class="fa-solid fa-clock"></i> Durata</th>
</tr>
</thead>
<tbody>
@foreach (var record in ListRecords)
{
<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>
@record.CodArticolo
<div class="small textConsensed text-secondary">@record.ArticoloNav.DescArticolo</div>
</td>
<td>
<div>
@tradFase(record.KeyRichiesta)
</div>
@if (record.Note != "")
{
<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"> @record.Note </span>
</div>
}
</td>
<td>
@record.IdxMacchina
<div class="small textConsensed text-secondary">@record.MachineNav.Descrizione</div>
</td>
<td>
<div class="small textConsensed"><b>N° pezzi:</b> @record.NumPezzi</div>
<div class="small textConsensed"><b>T. Ciclo:</b> @record.Tcassegnato.ToString("N3")</div>
</td>
<td>
<div class="small d-flex justify-content-between">
<div>
<div><b>@($"{@record.DataInizio:yyyy/MM/dd}")</b></div>
<div>@($"{@record.DataInizio:ddd HH:mm:ss}")</div>
</div>
<div class="p-0">
<i class="fa-solid fa-angles-right"></i>
</div>
<div>
@if (@record.DataFine != null)
{
<div><b>@($"{@record.DataFine:yyyy/MM/dd}")</b></div>
<div>@($"{@record.DataFine:ddd HH:mm:ss}")</div>
}
else
{
<div class="text-secondary">
<div><b>@($"{DateTime.Now:yyyy/MM/dd}")</b></div>
<div>@($"{DateTime.Now:ddd HH:mm:ss}")</div>
</div>
}
</div>
</div>
</td>
<td>
<div>
<b>@record.DurataMinuti</b>
</div>
<div>
<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>
<!-- Modal -->
</td>
</tr>
}
</tbody>
</table>
<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-content">
<div class="modal-header bg-primary col-12">
@if (statRecord != null)
{
<div class="col-3">
<b class="modal-title fs-1" id="staticBackdropLabel"><b>ODL @statRecord.IdxOdl</b></b>
</div>
<div class="col-6 fs-5">
<b>@statRecord.CodArticolo</b>
<div class="small textConsensed text-light">@statRecord.ArticoloNav.DescArticolo</div>
</div>
<div class="col-2 fs-5">
<b>@statRecord.IdxMacchina</b>
<div class="small textConsensed text-light">@statRecord.MachineNav.Descrizione</div>
</div>
}
<div class="col-1 text-end">
<button type="button" class="btn btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
</div>
<div class="modal-body col-12">
@if (statRecord != null && showStats)
{
<div class="d-flex justify-content-between">
<div class="col-8">
<div>
<table class="table">
<tbody>
<tr>
<td style="width: 270px">
<div class="small textConsensed"><b>N° pezzi:</b> @statRecord.NumPezzi</div>
<div class="small textConsensed"><b>T. Ciclo:</b> @statRecord.Tcassegnato.ToString("N3")</div>
</td>
<td style="width: 300px">
<div class="small d-flex justify-content-between">
<div>
<div><b>@($"{@statRecord.DataInizio:yyyy/MM/dd}")</b></div>
<div>@($"{@statRecord.DataInizio:ddd HH:mm:ss}")</div>
</div>
<div class="p-0">
<i class="fa-solid fa-angles-right"></i>
</div>
<div>
@if (@statRecord.DataFine != null)
{
<div><b>@($"{@statRecord.DataFine:yyyy/MM/dd}")</b></div>
<div>@($"{@statRecord.DataFine:ddd HH:mm:ss}")</div>
}
else
{
<div class="text-secondary">
<div><b>@($"{DateTime.Now:yyyy/MM/dd}")</b></div>
<div>@($"{DateTime.Now:ddd HH:mm:ss}")</div>
</div>
}
</div>
</div>
</td>
<td>
<!-- Modal -->
</td>
</tr>
</tbody>
</table>
</div>
<div>
<table class="table">
<tbody>
<tr>
<td>
<div>
@tradFase(statRecord.KeyRichiesta)
</div>
@if (statRecord.Note != "")
{
<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"> @statRecord.Note </span>
</div>
}
</td>
</tr>
</tbody>
</table>
</div>
<div>
@if (statRecord != null)
{
@if (ListOdlStats != null)
{
@foreach (var stat in ListOdlStats)
{
<div class="p-1">
<div class="d-flex justify-content-between">
<div class="text-uppercase">
@stat.Descrizione
</div>
<div>
<b>@(formDurata(stat.TotDurata))</b>
</div>
</div>
<div class="progress">
<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:@stat.Css;" aria-valuemax="100">@($"{calcolaPerc(stat.TotDurata):N1}%")</div>
</div>
</div>
}
}
}
</div>
</div>
<div class="col-4 dcContainer">
@if (statRecord != null && ListOdlStats != null)
{
<div class="dcBox">
<ODLPlot SelectedOdl="@statRecord.IdxOdl"></ODLPlot>
</div>
<div class="dcBox dcOverlay d-flex">
<div class="align-self-center text-center w-100">
<b class="fs-3">@statRecord.DurataMinuti</b>
</div>
</div>
}
</div>
</div>
}
</div>
</div>
</div>
</div>
</div>
</div>
}
+314
View File
@@ -0,0 +1,314 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data;
using MP.Data.DatabaseModels;
using MP.SPEC.Data;
using MP.SPEC.Pages;
using System.Xml.Linq;
namespace MP.SPEC.Components
{
public partial class ListODL
{
#region Public Properties
[Parameter]
public SelectOdlParams currFilter { get; set; } = null!;
[Parameter]
public EventCallback<bool> PagerResetReq { get; set; }
[Parameter]
public EventCallback<int> updateRecordCount { get; set; }
#endregion Public Properties
#region Public Methods
public string checkSelect(int IdxOdl)
{
string answ = "";
if (currRecord != null)
{
try
{
answ = (currRecord.IdxOdl == IdxOdl) ? "table-info" : "";
}
catch
{ }
}
return answ;
}
public string formDurata(double durataMin)
{
return MP.Data.Utils.FormDurata(durataMin);
}
//oggetto contenente le funzioni del code behind che sono jsInvokable
private DotNetObjectReference<ListODL>? objRef;
#if false //FUNZIONA SE IL METODO TriggerDotNetInstanceMethod() E' IN ONCLICK BOTTONE
[JSInvokable]
public void setHelper()
{
objRef = DotNetObjectReference.Create(this);
}
[JSInvokable]
public void svuotaRecord()
{
currRecord = null;
}
public async Task TriggerDotNetInstanceMethod()
{
await JSRuntime.InvokeVoidAsync("recordDeselect", objRef);
}
#endif
#endregion Public Methods
#region Protected Properties
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
[Inject]
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MessageService { get; set; } = null!;
#endregion Protected Properties
#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);
// ricarica...
await selectRecord(null);
}
await reloadData();
}
protected override async Task OnInitializedAsync()
{
ListStati = await MDService.AnagStatiComm();
objRef = DotNetObjectReference.Create(this);
//await JSRuntime.InvokeVoidAsync("setHelper", objRef);
}
protected override async Task OnParametersSetAsync()
{
await reloadData();
}
protected string colorChanger(string colorCSS)
{
string answ = "";
if (colorCSS == "yellow")
{
answ = "text-dark";
}
return answ;
}
//protected double durataMin(DateTime? DataInizio, DateTime? DataFine)
//{
// DateTime end = DataInizio != null ? (DateTime)DataFine : DateTime.Now;
// var tsDurata = (end).Subtract((DateTime)DataInizio);
// return tsDurata.TotalMinutes;
//}
protected async void OnSeachUpdated()
{
await InvokeAsync(() =>
{
PagerResetReq.InvokeAsync(true);
Task task = UpdateData();
StateHasChanged();
});
}
protected async Task resetSel()
{
await selectRecord(null);
await reloadData();
}
protected async Task selectRecord(ODLModel? currRec)
{
showStats = true;
await Task.Delay(1);
currRecord = currRec;
if (currRec != null)
{
showStats = true;
ListOdlStats = await MDService.StatOdl(currRec.IdxOdl);
}
else
{
showStats = false;
ListOdlStats = null;
}
}
protected async Task selectStatRecord(ODLModel? currRec)
{
showStats = true;
await Task.Delay(1);
statRecord = currRec;
if (currRec != null)
{
showStats = true;
ListOdlStats = await MDService.StatOdl(currRec.IdxOdl);
}
else
{
showStats = false;
ListOdlStats = null;
}
}
protected async Task selRecord(ODLModel? currRec)
{
await Task.Delay(1);
selDtFine = DateTime.Now;
currRecord = currRec;
showStats = false;
ListOdlStats = null;
}
protected async Task UpdateData()
{
await selectRecord(null);
await reloadData();
}
#endregion Protected Methods
#region Private Fields
private ODLModel? currRecord = null;
private ODLModel? statRecord = null;
private List<StatODLModel>? ListOdlStats;
private List<ODLModel>? ListRecords;
private List<ListValues>? ListStati;
private List<ODLModel>? SearchRecords;
#endregion Private Fields
#region Private Properties
private int currPage
{
get => MessageService.currPage;
set => MessageService.currPage = value;
}
/// <summary>
/// Indica se si tratti di ODL correnti
/// </summary>
private bool isCurrOdl
{
get => currFilter.IsActive;
}
private bool isLoading { get; set; } = false;
private int numRecord
{
get => MessageService.numRecord;
set => MessageService.numRecord = value;
}
private DateTime selDtFine { get; set; } = DateTime.Now;
private bool showStats { get; set; } = false;
#if false
private List<double>? ListOdlStatsData = new List<double>();
private List<string>? ListOdlStatsLabels = new List<string>();
#endif
private int totalCount { get; set; } = 0;
#endregion Private Properties
#region Private Methods
private double calcolaPerc(double durata)
{
double answ = 0;
double tot = 0;
if (ListOdlStats != null)
{
foreach (var item in ListOdlStats)
{
tot += item.TotDurata;
}
double perc = (durata / tot) * 100;
if (perc > 1)
{
answ = Math.Round(perc, 2);
}
else
{
answ = Math.Round(perc, 4);
}
}
return answ;
}
private async void MessageService_EA_PageUpdated()
{
await reloadData();
}
private async Task reloadData()
{
isLoading = true;
SearchRecords = await MDService.ListODLFilt(currFilter.IsActive, currFilter.SearchVal, currFilter.CodStato, currFilter.IdxMacchina, currFilter.DtStart, currFilter.DtEnd);
totalCount = SearchRecords.Count;
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
await updateRecordCount.InvokeAsync(totalCount);
isLoading = false;
}
private string tradFase(string codFase)
{
string answ = codFase;
if (ListStati != null && ListStati.Count > 0)
{
var recSel = ListStati.FirstOrDefault(x => x.value == codFase);
if (recSel != null)
{
answ = recSel.label;
}
}
return answ;
}
#endregion Private Methods
}
}
+55
View File
@@ -0,0 +1,55 @@
@using MP.SPEC.Components
@using MP.SPEC.Data
@if (ListRecords == null)
{
<LoadingData></LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
}
else
{
<div class="row">
<div class="col-12">
<table class="table table-sm table-striped small">
<thead>
<tr>
<th>
<button @onclick="() => resetSel()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
</th>
<th><i class="fa-regular fa-calendar-days"></i> Data</th>
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
<th><i class="fa-solid fa-sliders"></i> Parametro</th>
<th style="text-align: right">Valore</th>
</tr>
</thead>
<tbody>
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(@record)">
<td>
<button @onclick="() => selRecord(record)" class="btn btn-primary btn-sm"><i class="bi bi-search"></i></button>
</td>
<td>
@record.dtEvento
</td>
<td>
@record.IdxMacchina
</td>
<td>
@record.CodFlux
</td>
<td style="text-align: right">
<b>@record.Valore</b>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
}
+256
View File
@@ -0,0 +1,256 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.SPEC.Data;
using System.Diagnostics;
namespace MP.SPEC.Components
{
public partial class ListPARAMS : IDisposable
{
#region Public Properties
[Parameter]
public EventCallback<bool> PagerResetReq { get; set; }
[Parameter]
public EventCallback<FluxLog> RecordSel { get; set; }
[Parameter]
public SelectFluxParams SelFilter { get; set; } = null!;
[Parameter]
public EventCallback<int> TotRecordChanged { get; set; }
#endregion Public Properties
#region Public Methods
public string checkSelect(FluxLog selRecord)
{
string answ = "";
if (currRecord != null)
{
try
{
answ = (currRecord.IdxMacchina == selRecord.IdxMacchina && currRecord.dtEvento == selRecord.dtEvento && currRecord.CodFlux == selRecord.CodFlux) ? "table-info" : "";
}
catch
{ }
}
return answ;
}
protected override async Task OnParametersSetAsync()
{
await Task.Delay(1);
// se sono cambiati --> rileggo...
if (LastFilter==null || !SelFilter.Equals(LastFilter))
{
await reloadData(false);
LastFilter = SelFilter;
}
}
public SelectFluxParams? LastFilter = null;
public void Dispose()
{
aTimer.Elapsed -= ElapsedTimer;
MessageService.EA_PageUpdated -= MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated -= OnSeachUpdated;
aTimer.Stop();
aTimer.Dispose();
}
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
{
if (!isLoading && LiveUpdate)
{
aTimer.Stop();
// inizio misura esecuzione
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
var pUpd = Task.Run(async () =>
{
await Task.Delay(1);
await InvokeAsync(() => reloadData(true));
});
pUpd.Wait();
// misuro tempo esecuzione
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
int deltaTime = RefreshPeriod - (int)ts.TotalMilliseconds;
aTimer.Interval = deltaTime > 100 ? deltaTime : 100;
aTimer.Start();
}
}
public async Task reloadData(bool setChanged)
{
isLoading = true;
DateTime limitData = DateTime.Now;
if (SelDtMax != null)
{
limitData = (DateTime)SelDtMax;
}
SearchRecords = await MDService.FluxLogGetLastFilt(limitData, SelMacchina, SelFlux, MaxRecord);
totalCount = SearchRecords.Count;
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
await Task.Delay(1);
if (setChanged)
{
await InvokeAsync(() => StateHasChanged());
}
isLoading = false;
}
public void StartTimer()
{
aTimer = new System.Timers.Timer(RefreshPeriod);
aTimer.Elapsed += ElapsedTimer;
aTimer.Enabled = true;
aTimer.Start();
}
#endregion Public Methods
#region Protected Properties
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
[Inject]
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MessageService { get; set; } = null!;
protected int RefreshPeriod
{
get => SelFilter.TempoAgg;
}
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated += OnSeachUpdated;
StartTimer();
}
//protected int RefreshPeriod { get; set; } = 5000;
protected async void OnSeachUpdated()
{
await InvokeAsync(() =>
{
PagerResetReq.InvokeAsync(false);
//currPage = 1;
Task task = UpdateData();
StateHasChanged();
});
}
protected async Task resetSel()
{
currRecord = null;
await RecordSel.InvokeAsync(null);
}
protected async Task selRecord(FluxLog selRec)
{
currRecord = selRec;
SelFilter.IdxMacchina = selRec.IdxMacchina;
await reloadData(false);
await RecordSel.InvokeAsync(selRec);
}
protected async Task UpdateData()
{
currRecord = null;
await reloadData(true);
}
#endregion Protected Methods
#region Private Fields
private static System.Timers.Timer aTimer = null!;
private int _totalCount = 0;
private FluxLog? currRecord = null;
private List<FluxLog>? ListRecords;
private List<FluxLog>? SearchRecords;
#endregion Private Fields
#region Private Properties
private int currPage
{
get => MessageService.currPage;
set => MessageService.currPage = value;
}
private bool isLoading { get; set; } = false;
private bool LiveUpdate
{
get => SelFilter.LiveUpdate;
}
private int MaxRecord
{
get => SelFilter.MaxRecord;
}
private int numRecord
{
get => MessageService.numRecord;
set => MessageService.numRecord = value;
}
private string SelFlux
{
get => SelFilter.CodFlux;
}
private string SelMacchina
{
get => SelFilter.IdxMacchina;
}
private DateTime? SelDtMax
{
get => SelFilter.dtMax;
}
private int totalCount
{
get => _totalCount;
set
{
if (_totalCount != value)
{
_totalCount = value;
TotRecordChanged.InvokeAsync(value);
}
}
}
#endregion Private Properties
#region Private Methods
private async void MessageService_EA_PageUpdated()
{
await reloadData(true);
}
#endregion Private Methods
}
}
+97
View File
@@ -0,0 +1,97 @@
@using MP.SPEC.Components
@using MP.SPEC.Data
@if (ListRecords == null)
{
<LoadingData></LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
}
else
{
<div class="row">
<div class="col-12">
<table class="table table-sm table-striped">
<thead>
<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-screwdriver-wrench"></i> Fase</th>
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
<th><i class="fa-solid fa-circle-info"></i> Info ciclo</th>
@*<th><i class="fa-solid fa-pen-to-square"></i> Note</th>*@
<th title="Attivabile"><i class="fa-regular fa-square-check"></i> Att</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(@record)">
<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="() => 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>
@record.CodArticolo
<div class="small textConsensed text-secondary">@record.ArticoloNav.DescArticolo</div>
</td>
<td>
<div>
@tradFase(record.KeyRichiesta)
</div>
@if (record.Note != "")
{
<div class="small textConsensed text-secondary badge text-bg-light border border-primary rounded">
<b class="text-dark">Note:</b> @record.Note
</div>
}
</td>
<td>
@record.IdxMacchina
<div class="small textConsensed text-secondary">@record.MachineNav.Descrizione</div>
</td>
<td>
<div class="small textConsensed"><b>N° pezzi:</b> @record.NumPezzi</div>
<div class="small textConsensed"><b>T. Ciclo:</b> @record.Tcassegnato.ToString("N3")</div>
</td>
@*<td>@record.Note</td>*@
<td>
@if (@record.Attivabile)
{
<i class="fa-regular fa-square-check text-success"></i>
}
else
{
<i class="fa-regular fa-square text-secondary"></i>
}
</td>
<td>
@if (POdlDelEnabled(record.IdxOdl))
{
<button @onclick="() => deleteRecord(record)" class="btn btn-danger btn-sm"><i class="bi bi-trash-fill"></i></button>
}
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
}
+390
View File
@@ -0,0 +1,390 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.SPEC.Data;
using MP.SPEC.Services;
namespace MP.SPEC.Components
{
public partial class ListPODL
{
#region Public Properties
[Parameter]
public EventCallback<bool> PagerResetReq { get; set; }
[Parameter]
public EventCallback<PODLModel> RecordSel { get; set; }
[Parameter]
public EventCallback<int> updateRecordCount { get; set; }
#endregion Public Properties
#region Public Methods
public string checkSelect(PODLModel record)
{
string answ = "";
if (currRecord != null)
{
try
{
answ = ((currRecord.IdxMacchina == record.IdxMacchina) && (currRecord.CodArticolo == record.CodArticolo) && (currRecord.CodFase == record.CodFase)) ? "table-info" : "";
}
catch
{ }
}
return answ;
}
#endregion Public Methods
#region Protected Properties
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
[Inject]
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected IOApiService MpIoApiCall { get; set; } = null!;
[Inject]
protected MessageService MsgService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected async Task cloneRecord(PODLModel selRec)
{
// creo record duplicato...
PODLModel newRec = new PODLModel()
{
Attivabile = selRec.Attivabile,
CodArticolo = selRec.CodArticolo,
CodCli = selRec.CodCli,
CodGruppo = selRec.CodGruppo,
DueDate = selRec.DueDate,
IdxMacchina = selRec.IdxMacchina,
IdxOdl = selRec.IdxOdl,
IdxPromessa = 0,
InsertDate = selRec.InsertDate,
KeyBCode = selRec.KeyBCode,
KeyRichiesta = selRec.KeyRichiesta,
Note = $"DUPLICATED - {selRec.Note}",
NumPezzi = selRec.NumPezzi,
Priorita = selRec.Priorita,
PzPallet = selRec.PzPallet,
Tcassegnato = selRec.Tcassegnato
};
currRecord = selRec;
await RecordSel.InvokeAsync(newRec);
}
/// <summary>
/// Eliminazione record selezionato (previa conferma)
/// </summary>
/// <param name="selRec"></param>
/// <returns></returns>
protected async Task deleteRecord(PODLModel selRec)
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Eliminazione Record: sei sicuro di voler procedere?"))
return;
await Task.Delay(1);
var done = await MDService.PODLDeleteRecord(selRec);
await callSyncDb(selRec.IdxMacchina);
currRecord = null;
await reloadData();
await Task.Delay(1);
}
protected override async Task OnInitializedAsync()
{
MsgService.EA_PageUpdated += MessageService_EA_PageUpdated;
MsgService.EA_SearchUpdated += OnSeachUpdated;
MsgService.EA_StatoSearch += MsgService_EA_StatoSearch;
ListStati = await MDService.AnagStatiComm();
}
protected override async Task OnParametersSetAsync()
{
await reloadData();
}
protected async void OnSeachUpdated()
{
await InvokeAsync(() =>
{
PagerResetReq.InvokeAsync(true);
//currPage = 1;
Task task = UpdateData();
StateHasChanged();
});
}
protected bool POdlDelEnabled(int idxOdl)
{
return idxOdl == 0;
}
protected async Task resetSel()
{
currRecord = null;
await RecordSel.InvokeAsync(null);
}
protected async Task selRecord(PODLModel selRec)
{
currRecord = 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()
{
currRecord = null;
await reloadData();
}
#endregion Protected Methods
#region Private Fields
private PODLModel? currRecord = null;
private List<PODLModel>? ListRecords;
private List<ListValues>? ListStati;
private List<PODLModel>? SearchRecords;
#endregion Private Fields
#region Private Properties
private int currPage
{
get => MsgService.currPage;
set => MsgService.currPage = value;
}
private bool isLoading { get; set; } = false;
private int numRecord
{
get => MsgService.numRecord;
set => MsgService.numRecord = value;
}
private string SearchVal
{
get => string.IsNullOrEmpty(MsgService.SearchVal) ? "*" : MsgService.SearchVal;
}
private string StatoSel
{
get => MsgService.StateSel;
set => MsgService.StateSel = value;
}
private int totalCount { get; set; } = 0;
#endregion Private Properties
#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)
{
}
}
/// <summary>
/// Chiama metodo x chiedere force Update
/// </summary>
/// <param name="selRec"></param>
/// <returns></returns>
private async Task callForceUpdate(string IdxMacc)
{
// chiamo aggiunta task SyncDb...
await addTask2Exe(IdxMacc, "ForceUpdate", $"SPEC|TS:{DateTime.Now:yyMMddHHmmss}");
}
/// <summary>
/// Chiama metodo x indicare inizio setup
/// </summary>
/// <param name="selRec"></param>
/// <returns></returns>
private async Task callStartSetup(string IdxMacc)
{
// chiamo evento inizio setup
await addTask2Exe(IdxMacc, "startSetup", $"SPEC|TS:{DateTime.Now:yyMMddHHmmss}");
}
/// <summary>
/// Chiama metodo x chiedere sync DB
/// </summary>
/// <param name="IdxMacc"></param>
/// <returns></returns>
private async Task callSyncDb(string IdxMacc)
{
// chiamo aggiunta task SyncDb...
await addTask2Exe(IdxMacc, "syncDbData", "");
#if false
string idxMacc = selRec.IdxMacchina;
string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName=syncDbData&taskVal=";
var response = await MpIoApiCall.callMpIoUrlGet(restUrl);
#endif
}
/// <summary>
/// verifica se sia avviabile ODL x macchina
/// </summary>
/// <param name="idxMacchina"></param>
/// <returns></returns>
private bool canStartOdl(string idxMacchina)
{
var currOdl = MDService.OdlGetCurrentByMacc(idxMacchina);
bool answ = currOdl == null;
return answ;
}
private async void MessageService_EA_PageUpdated()
{
await reloadData();
}
private async void MsgService_EA_StatoSearch()
{
await InvokeAsync(() =>
{
PagerResetReq.InvokeAsync(true);
//currPage = 1;
Task task = UpdateData();
StateHasChanged();
});
}
/// <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()
{
isLoading = true;
SearchRecords = await MDService.ListPODLFilt(SearchVal, StatoSel);
totalCount = SearchRecords.Count;
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
await updateRecordCount.InvokeAsync(totalCount);
isLoading = false;
}
private string tradFase(string codFase)
{
string answ = codFase;
if (ListStati != null && ListStati.Count > 0)
{
var recSel = ListStati.FirstOrDefault(x => x.value == codFase);
if (recSel != null)
{
answ = recSel.label;
}
}
return answ;
}
#endregion Private Methods
}
}
+10
View File
@@ -0,0 +1,10 @@
<div class="row p-5 m-5 alert alert-primary">
<div class="col-6 text-center mt-4 py-3 bg-light">
<h1>MAPO SPEC</h1>
EgalWare MES suite <img class="logoImg img-fluid" src="images/logoCliente.png" width="64" />
</div>
<div class="col-6 text-center mt-4 py-3 bg-light">
<h3>loading data</h3>
<i class="fas fa-spinner fa-spin fa-4x"></i>
</div>
</div>
@@ -0,0 +1,6 @@
<div class="row p-0 m-0">
<div class="col-12 text-center py-2 mb-0 alert alert-primary">
<b>loading data</b>
<i class="fas fa-spinner fa-spin"></i>
</div>
</div>
+13
View File
@@ -0,0 +1,13 @@
@if (@SelectedOdl != -1)
{
<div class="px-1 flex-fill">
@if (isLoading)
{
<LoadingDataSmall></LoadingDataSmall>
}
else
{
<MP.SPEC.Components.Chart.Doughnut Type="@Chart.Doughnut.ChartType.Doughnut" Data="@Data.ToArray()" BackgroundColor="@colors.ToArray()"></MP.SPEC.Components.Chart.Doughnut>
}
</div>
}
+77
View File
@@ -0,0 +1,77 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.SPEC.Components;
using MP.SPEC.Data;
namespace MP.SPEC.Components
{
public partial class ODLPlot
{
#region Public Properties
public int OdlId
{
get => _selParam;
}
[Parameter]
public int SelectedOdl
{
get => _selParam;
set => _selParam = value;
}
#endregion Public Properties
#region Protected Properties
//protected DataLogFilter _SelFilter { get; set; } = new DataLogFilter();
protected int _selParam { get; set; } = -1;
#endregion Protected Properties
#region Protected Methods
private bool isLoading { get; set; } = false;
protected override async Task OnInitializedAsync()
{
isLoading = true;
await Task.Delay(1);
}
private List<StatODLModel>? ListRecords = null;
protected override async Task OnParametersSetAsync()
{
await ReloadData();
await Task.Delay(1);
}
public List<double> Data = new List<double>();
public List<string> Labels = new List<string>();
public List<string> colors = new List<string>();
protected async Task ReloadData()
{
Data.Clear();
Labels.Clear();
colors.Clear();
ListRecords = await MDService.StatOdl(SelectedOdl);
foreach (var record in ListRecords)
{
Data.Add(record.TotDurata);
Labels.Add($"{record.Descrizione} - {record.TotDurata:N1}min");
colors.Add($"{record.Css}");
}
await Task.Delay(1);
isLoading = false;
}
[Inject]
protected MpDataService MDService { get; set; } = null!;
#endregion Protected Methods
}
}
+128
View File
@@ -0,0 +1,128 @@
<div class="d-flex justify-content-between">
<div class="d-flex justify-content-between pt-1 mb-1">
<div class="px-2">
@if (!liveUpdate)
{
<button class="btn btn-secondary" type="button" @onclick="() => toggleUpdate()" title="Click per tornare a Valori Live">
<small>@lastUpdate</small>
</button>
}
else
{
<button class="btn btn-primary" type="button" @onclick="() => toggleUpdate()">
<span class="spinner-grow spinner-grow-sm" role="status" aria-hidden="true"></span>
Valori live
</button>
}
</div>
<div class="px-2">
@if (selMacchina != "*")
{
<button class="btn btn-warning" type="button" @onclick="() => takeSnapshot()">
<i class="fa-solid fa-camera"></i>
@snapMode
</button>
}
</div>
<div class="px-2">
@if (snapshotDone)
{
<button class="btn btn-success" type="button" @onclick="() => navDossier()">
<div class="spinner-border spinner-border-sm" role="status">
<span class="visually-hidden">Loading...</span>
</div>
<i class="fa-solid fa-camera"></i>
Fatto! Mostra Dossier
</button>
}
</div>
</div>
<a class="pt-2" data-bs-toggle="offcanvas" data-bs-target="#paramsFilterExample" aria-controls="paramsFilterExample" @onclick="setDtMax">
<i class="fa-solid fa-bars text-dark"></i>
</a>
<div class="offcanvas offcanvas-end" tabindex="-1" id="paramsFilterExample" aria-labelledby="paramsFilterExampleLabel">
<div class="offcanvas-header">
<h3 class="offcanvas-title" id="paramsFilterExampleLabel"><b>FILTRI</b></h3>
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div class="small">
<label class="px-2" for="macchina" title="Selezionare impianto">Impianto</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="macchina" title="Selezionare impianto"><i class="fa-solid fa-hard-drive"></i></label>
<select @bind="@selMacchina" class="form-select" id="macchina" title="Selezionare impianto">
<option value="*">--- Tutti ---</option>
@if (ListMacchine != null)
{
foreach (var item in ListMacchine)
{
<option value="@item">@item</option>
}
}
</select>
</div>
<div class="small mt-2">
<label class="px-2" for="flusso" title="Selezionare il parametro">Parametro</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="flusso" title="Selezionare il parametro"><i class="fa-solid fa-sliders"></i></label>
<select @bind="@selFlux" class="form-select" id="flusso" title="Selezionare il parametro">
<option value="*">--- Tutti ---</option>
@if (ListFlux != null)
{
foreach (var item in ListFlux)
{
<option value="@item">@item</option>
}
}
</select>
</div>
<div class="small mt-2">
<label class="px-2" for="dtMin" title="Selezionare inizio periodo">Inizio Periodo</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="dtMin" title="Selezionare inizio periodo"><i class="fa-regular fa-calendar-minus"></i></label>
<input class="form-control" @bind="@selDtMin" id="dtMin" type="datetime-local" title="Data minima eventi da visualizzare">
</div>
<div class="small mt-2">
<label class="px-2" for="dtMax" title="Selezionare fine periodo">Fine Periodo</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="dtMax" title="Selezionare fine periodo"><i class="fa-regular fa-calendar-plus"></i></label>
<input class="form-control" @bind="@selDtMax" id="dtMax" type="datetime-local" title="Selezionare fine periodo">
</div>
<div class="small mt-2">
<label class="px-2" for="tempoAgg" title="Selezionare refresh rate (sec) periodo">Refresh rate (sec)</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="tempoAgg" title="Selezionare refresh rate (sec)"><i class="fa-solid fa-clock"></i></label>
<select @bind="@selTempoAgg" class="form-select" id="tempoAgg" title="Selezionare refresh rate (sec)" style="width: 3em;">
<option value="2">2</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="30">30</option>
<option value="60">60</option>
</select>
</div>
<div class="small mt-2">
<label class="px-2" for="maxRecord" title="Numero massimo record da mostrare">Max Record</label>
</div>
<div class="px-2 input-group">
<label class="input-group-text" for="maxRecord" title="Numero massimo record da mostrare"><i class="fa-solid fa-list-ol"></i></label>
<select @bind="@selMaxRecord" class="form-select" id="maxRecord" title="Numero massimo record da mostrare">
<option value="50">50</option>
<option value="100">100</option>
<option value="250">250</option>
<option value="500">500</option>
<option value="1000">1000</option>
<option value="2500">2500</option>
<option value="5000">5000</option>
</select>
</div>
</div>
</div>
</div>
+318
View File
@@ -0,0 +1,318 @@
using Microsoft.AspNetCore.Components;
using MP.SPEC.Data;
namespace MP.SPEC.Components
{
public partial class ParamsFilter : IDisposable
{
#region Public Properties
[Parameter]
public EventCallback<SelectFluxParams> FilterChanged { get; set; }
[Parameter]
public SelectFluxParams SelFilter { get; set; } = null!;
#endregion Public Properties
#region Public Methods
/// <summary>
/// Inizializzazione con periodo e arrotondamento
/// </summary>
/// <param name="minRound"></param>
/// <returns></returns>
public static DateTime RoundDatetime(int minRound)
{
TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today);
int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound;
DateTime endRounded = DateTime.Today.AddMinutes(minDay);
return endRounded;
}
public void Dispose()
{
aTimer.Elapsed -= ElapsedTimer;
aTimer.Stop();
aTimer.Dispose();
}
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
{
snapshotDone = false;
aTimer.Stop();
aTimer.Enabled = false;
//reportChange();
var pUpd = Task.Run(async () =>
{
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
});
pUpd.Wait();
}
#endregion Public Methods
#region Protected Properties
protected string lastUpdate
{
get => SelFilter.lastUpdate;
set => SelFilter.lastUpdate = value;
}
protected bool liveUpdate
{
get => SelFilter.LiveUpdate;
set
{
if (!SelFilter.LiveUpdate.Equals(value))
{
SelFilter.LiveUpdate = value;
if (!value)
{
SelFilter.CurrPage = 0;
}
reportChange();
}
}
}
[Inject]
protected MpDataService MDService { get; set; } = null!;
protected string selFlux
{
get
{
return SelFilter.CodFlux;
}
set
{
if (!SelFilter.CodFlux.Equals(value))
{
SelFilter.CurrPage = 1;
SelFilter.CodFlux = value;
StateHasChanged();
Task.Delay(1);
reportChange();
}
}
}
protected bool showParam { get; set; } = false;
protected bool selDt { get; set; } = false;
protected string selMacchina
{
get => SelFilter.IdxMacchina;
set
{
if (!SelFilter.IdxMacchina.Equals(value))
{
SelFilter.CurrPage = 1;
SelFilter.IdxMacchina = value;
SelFilter.CodFlux = "*";
ListFlux = MDService.ParametriGetFilt(selMacchina).Result;
StateHasChanged();
Task.Delay(1);
reportChange();
}
}
}
protected int selMaxRecord
{
get
{
return SelFilter.MaxRecord;
}
set
{
if (!SelFilter.MaxRecord.Equals(value))
{
SelFilter.MaxRecord = value;
reportChange();
}
}
}
protected int selTempoAgg
{
get
{
return SelFilter.TempoAgg / 1000;
}
set
{
int tempoMS = value * 1000;
if (!SelFilter.TempoAgg.Equals(tempoMS))
{
SelFilter.TempoAgg = tempoMS;
reportChange();
}
}
}
#endregion Protected Properties
#region Protected Methods
protected async Task navDossier()
{
await Task.Delay(1);
// rimando alla home
NavManager.NavigateTo("DOSS", true);
}
protected override async Task OnInitializedAsync()
{
SelFilter = new SelectFluxParams();
ListMacchine = await MDService.MacchineWithFlux();
ListFlux = await MDService.ParametriGetFilt(selMacchina);
var configData = await MDService.ConfigGetAll();
var currRec = configData.FirstOrDefault(x => x.Chiave == "numOreAnticipoSnapshot");
if (currRec != null)
{
int.TryParse(currRec.Valore, out numOreAnticipoSnapshot);
}
await FilterChanged.InvokeAsync(SelFilter);
}
protected void setDtMax()
{
// copio il filtro
var currFilt = SelFilter;
// fermo update
//currFilt.LiveUpdate = false;
currFilt.CurrPage = 0;
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
currFilt.dtMax = RoundDatetime(5);
currFilt.dtMin = RoundDatetime(5).AddHours(-numOreAnticipoSnapshot);
SelFilter = currFilt;
}
protected void startTimer()
{
aTimer = new System.Timers.Timer(5000);
aTimer.Elapsed += ElapsedTimer;
aTimer.Enabled = true;
aTimer.Start();
}
protected async Task takeSnapshot()
{
// fermo udpate
liveUpdate = false;
// se non ho data rif uso adesso...
DateTime dtMax = selDtMax == null ? RoundDatetime(5) : (DateTime)selDtMax;
DateTime dtMin = selDtMin == null ? RoundDatetime(5).AddHours(-numOreAnticipoSnapshot) : (DateTime)selDtMin;
// aggiungo 2 sec
dtMax = dtMax.AddSeconds(15);
//dtMin = dtMin.AddMinutes(-30);
await MDService.DossiersTakeParamsSnapshotLast(selMacchina, dtMin, dtMax);
lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
// indico snapshot fatto
snapshotDone = true;
startTimer();
}
protected void toggleParams()
{
showEditPar = !showEditPar;
selDtMax = null;
}
protected async Task toggleUpdate()
{
liveUpdate = !liveUpdate;
await Task.Delay(1);
if (!liveUpdate)
{
lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
}
else
{
selDtMax = null;
}
}
#endregion Protected Methods
#region Private Fields
private static System.Timers.Timer aTimer = new System.Timers.Timer();
private List<string>? ListFlux = null;
private List<string>? ListMacchine = null;
private int numOreAnticipoSnapshot = 5;
private bool snapshotDone = false;
#endregion Private Fields
#region Private Properties
[Inject]
private NavigationManager NavManager { get; set; } = null!;
private DateTime? selDtMax
{
get => SelFilter.dtMax;
set
{
if (SelFilter.dtMax != value)
{
// copio il filtro
var currFilt = SelFilter;
// fermo update
currFilt.LiveUpdate = false;
currFilt.CurrPage = 0;
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
currFilt.dtMax = value;
SelFilter = currFilt;
reportChange();
}
}
}
private DateTime? selDtMin
{
get => SelFilter.dtMin;
set
{
if (SelFilter.dtMin != value)
{
// copio il filtro
var currFilt = SelFilter;
// fermo update
currFilt.LiveUpdate = false;
currFilt.CurrPage = 0;
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
currFilt.dtMin = value;
SelFilter = currFilt;
reportChange();
}
}
}
private bool showEditPar { get; set; } = false;
private string snapMode
{
get => SelFilter.dtRif == null ? "Realtime Rec" : $"Rec {SelFilter.dtRif:yyyy/MM/dd HH:mm:ss}";
}
#endregion Private Properties
#region Private Methods
private void reportChange()
{
FilterChanged.InvokeAsync(SelFilter);
}
#endregion Private Methods
}
}
+55
View File
@@ -0,0 +1,55 @@
@using MP.SPEC.Components
@using MP.SPEC.Data
@inject MessageService AppMService
<div class="input-group input-group-sm" hidden>
<input @bind-value="@searchVal" @bind-value:event="oninput" type="text" class="form-control" title="Campo Ricerca" placeholder="Ricerca [ALT-R]" accesskey="R" />
<button @onclick="reset" class="btn btn-success input-group-text"><i class="fa-solid fa-rotate"></i></button>
</div>
@code {
[Parameter]
public EventCallback<string> searchUpdated { get; set; }
[Parameter]
public string searchVal
{
get
{
return AppMService.SearchVal;
}
set
{
AppMService.SearchVal = value;
reportChange();
}
}
protected override Task OnInitializedAsync()
{
AppMService.EA_SearchUpdated += OnSeachUpdated;
return base.OnInitializedAsync();
}
public async void OnSeachUpdated()
{
await InvokeAsync(() =>
{
StateHasChanged();
});
}
private void reportChange()
{
searchUpdated.InvokeAsync(searchVal);
}
private void reset()
{
searchVal = "";
}
}
+12
View File
@@ -0,0 +1,12 @@
<div class="input-group input-group-sm">
<div class="input-group-text">
<span class="me-1 @leftStringCSS">@leftString</span>
<div class="form-check form-check-sm form-switch py-1" title="Parameter View Mode (RealTime / LogData)">
<input class="form-check-input" type="checkbox" id="mySwitch" name="setupAlarms" checked @onclick="() => toggle()">
</div>
<span class="@rightStringCSS">@rightString</span>
</div>
</div>
+127
View File
@@ -0,0 +1,127 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using System.Net.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Web.Virtualization;
using Microsoft.JSInterop;
using MP.SPEC;
using MP.SPEC.Shared;
using MP.SPEC.Components;
using MP.SPEC.Data;
namespace MP.SPEC.Components
{
public partial class ToggleMode
{
[Parameter]
public EventCallback<SelectGlobalToggle> FilterChanged { get; set; }
[Parameter]
public SelectGlobalToggle SelFilter { get; set; } = new SelectGlobalToggle();
protected bool isActive
{
get => SelFilter.isActive;
set
{
if (SelFilter.isActive != value)
{
SelFilter.isActive = value;
reportChange();
}
}
}
protected string leftString
{
get => SelFilter.leftString;
set
{
if (SelFilter.leftString != value)
{
SelFilter.leftString = value;
reportChange();
}
}
}
protected string leftStringCSS
{
get => SelFilter.leftStringCSS;
set
{
if (SelFilter.leftStringCSS != value)
{
SelFilter.leftStringCSS = value;
reportChange();
}
}
}
protected string rightString
{
get => SelFilter.rightString;
set
{
if (SelFilter.rightString != value)
{
SelFilter.rightString = value;
reportChange();
}
}
}
protected string rightStringCSS
{
get => SelFilter.rightStringCSS;
set
{
if (SelFilter.rightStringCSS != value)
{
SelFilter.rightStringCSS = value;
reportChange();
}
}
}
protected void toggle()
{
var currFilt = SelFilter;
currFilt.isActive = !currFilt.isActive;
SelFilter = currFilt;
if (isActive)
{
rightStringCSS = "fw-bold";
leftStringCSS = "text-secondary";
}
else
{
leftStringCSS = "fw-bold";
rightStringCSS = "text-secondary";
}
}
protected override async Task OnInitializedAsync()
{
if (isActive)
{
rightStringCSS = "fw-bold";
leftStringCSS = "text-secondary";
}
else
{
leftStringCSS = "fw-bold";
rightStringCSS = "text-secondary";
}
await FilterChanged.InvokeAsync(SelFilter);
}
private void reportChange()
{
FilterChanged.InvokeAsync(SelFilter);
}
}
}
+166
View File
@@ -0,0 +1,166 @@
namespace MP.SPEC.Data
{
public class MessageService
{
#region Public Events
public event Action EA_PageUpdated;
public event Action EA_SearchUpdated;
public event Action EA_ShowSearch;
public event Action EA_StatoSearch;
#endregion Public Events
#region Public Properties
public int currPage
{
get => _currPage;
set
{
if (_currPage != value)
{
_currPage = value;
if (EA_PageUpdated != null)
{
EA_PageUpdated?.Invoke();
}
}
}
}
public int numRecord
{
get => _numRecord;
set
{
if (_numRecord != value)
{
_numRecord = value;
if (EA_PageUpdated != null)
{
EA_PageUpdated?.Invoke();
}
}
}
}
public string SearchVal
{
get => searchVal;
set
{
//if (searchVal != value)
//{
searchVal = value;
if (EA_SearchUpdated != null)
{
EA_SearchUpdated?.Invoke();
}
//}
}
}
public bool ShowSearch
{
get => showSearch;
set
{
if (showSearch != value)
{
showSearch = value;
if (EA_ShowSearch != null)
{
EA_ShowSearch?.Invoke();
}
}
}
}
public string StateSel
{
get => stateSel;
set
{
stateSel = value;
if (EA_StatoSearch != null)
{
EA_StatoSearch?.Invoke();
}
}
}
public string TipoSearch
{
get => tipoSearch;
set
{
if (tipoSearch != value)
{
tipoSearch = value;
if (EA_ShowSearch != null)
{
EA_ShowSearch?.Invoke();
}
}
}
}
public int totalCount
{
get => _totalCount;
set
{
if (_totalCount != value)
{
_totalCount = value;
}
}
}
#endregion Public Properties
#region Protected Methods
protected void reportPaging()
{
if (EA_PageUpdated != null)
{
EA_PageUpdated?.Invoke();
}
}
protected void reportSearch()
{
if (EA_SearchUpdated != null)
{
EA_SearchUpdated?.Invoke();
}
}
#endregion Protected Methods
#region Private Fields
private string searchVal = "";
private bool showSearch;
private string stateSel = "*";
private string tipoSearch = "";
#endregion Private Fields
#region Private Properties
private int _currPage { get; set; } = 1;
private int _numRecord { get; set; } = 10;
private int _totalCount { get; set; } = 0;
#endregion Private Properties
}
}
+930
View File
@@ -0,0 +1,930 @@
using MP.Data;
using MP.Data.Conf;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using Newtonsoft.Json;
using NLog;
using StackExchange.Redis;
using System.Diagnostics;
namespace MP.SPEC.Data
{
public class MpDataService : IDisposable
{
#region Public Constructors
public MpDataService(IConfiguration configuration, ILogger<MpDataService> logger)
{
_logger = logger;
_logger.LogInformation("Starting MpDataService INIT");
_configuration = configuration;
// setup compoenti REDIS
redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis"));
redisConnAdmin = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("RedisAdmin"));
redisDb = redisConn.GetDatabase();
// leggo cache lungo periodo
int.TryParse(_configuration.GetValue<string>("ServerConf:redisLongTimeCache"), out redisLongTimeCache);
_logger.LogInformation("Redis INIT");
// setup canali pub/sub
dataPipe = new MessagePipe(redisConn, Constants.ACT_MSE_DATA_KEY);
blinkPipe = new MessagePipe(redisConn, Constants.ACT_BLINK_KEY);
// conf DB
string connStr = _configuration.GetConnectionString("Mp.Data");
if (string.IsNullOrEmpty(connStr))
{
_logger.LogError("DbController: ConnString empty!");
}
else
{
dbController = new MP.Data.Controllers.MpSpecController(configuration);
_logger.LogInformation("DbController OK");
}
}
#endregion Public Constructors
#region Public Properties
public static MP.Data.Controllers.MpSpecController dbController { get; set; } = null!;
public MessagePipe blinkPipe { get; set; } = null!;
/// <summary>
/// Dizionario dei tag configurati per IOB
/// </summary>
public Dictionary<string, List<TagData>> currTagConf { get; set; } = new Dictionary<string, List<TagData>>();
public MessagePipe dataPipe { get; set; } = null!;
#endregion Public Properties
#region Public Methods
public async Task<List<ListValues>> AnagStatiComm()
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
List<ListValues>? result = new List<ListValues>();
// cerco in redis...
RedisValue rawData = await redisDb.StringGetAsync(redisStatoCom);
if (!string.IsNullOrEmpty($"{rawData}"))
{
result = JsonConvert.DeserializeObject<List<ListValues>>($"{rawData}");
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"AnagStatiComm Read from REDIS: {ts.TotalMilliseconds}ms");
}
else
{
result = await Task.FromResult(dbController.AnagStatiComm());
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(redisStatoCom, rawData, getRandTOut(redisLongTimeCache));
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"AnagStatiComm Read from DB: {ts.TotalMilliseconds}ms");
}
if (result == null)
{
result = new List<ListValues>();
}
return result;
}
public async Task<List<ListValues>> AnagTipoArtLV()
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
List<ListValues>? result = new List<ListValues>();
// cerco in redis...
RedisValue rawData = await redisDb.StringGetAsync(redisTipoArt);
if (!string.IsNullOrEmpty($"{rawData}"))
{
result = JsonConvert.DeserializeObject<List<ListValues>>($"{rawData}");
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"AnagTipoArtLV Read from REDIS: {ts.TotalMilliseconds}ms");
}
else
{
result = await Task.FromResult(dbController.AnagTipoArtLV());
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(redisTipoArt, rawData, getRandTOut(redisLongTimeCache));
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"AnagTipoArtLV Read from DB: {ts.TotalMilliseconds}ms");
}
if (result == null)
{
result = new List<ListValues>();
}
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());
// serializzp 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>
/// Eliminazione record selezionato
/// </summary>
/// <param name="currRec"></param>
/// <returns></returns>
public async Task<bool> ArticoliDeleteRecord(AnagArticoli currRec)
{
return await dbController.ArticoliDeleteRecord(currRec);
}
/// <summary>
/// Restitusice elenco articoli cercati
/// </summary>
/// <param name="numRecord"></param>
/// <param name="searchVal"></param>
/// <returns></returns>
public async Task<List<AnagArticoli>> ArticoliGetSearch(int numRecord, string azienda, string searchVal)
{
return await Task.FromResult(dbController.ArticoliGetSearch(numRecord, azienda, searchVal));
}
/// <summary>
/// Aggiornamento record selezionato
/// </summary>
/// <param name="currRec"></param>
/// <returns></returns>
public async Task<bool> ArticoliUpdateRecord(AnagArticoli currRec)
{
return await dbController.ArticoliUpdateRecord(currRec);
}
/// <summary>
/// Verifica se sia possiubile cancellare articolo dato suo CodArt cercando su redis o su
/// tab veto da DB
/// </summary>
/// <param name="CodArt"></param>
/// <returns></returns>
public bool ArticoloDelEnabled(object CodArt)
{
bool answ = false;
string codArticolo = $"{CodArt}";
int cacheCheckArtUsato = 1;
int.TryParse(_configuration.GetValue<string>("ServerConf:cacheCheckArtUsato"), out cacheCheckArtUsato);
TimeSpan TTLCache = getRandTOut(cacheCheckArtUsato);
// cerco in cache redis...
string redKeyArtUsed = $"{Utils.redKeyArtUsed}:{codArticolo}";
string redKeyTabCheckArt = Utils.redKeyTabCheckArt;
string rawData = redisDb.StringGet(redKeyArtUsed);
if (!string.IsNullOrEmpty(rawData))
{
bool.TryParse(rawData, out answ);
}
else
{
// controllo non sia stato mai prodotto sennò non posso cancellare...
try
{
// cerco in cache se ci sia la tabella con gli articoli impiegati...
string rawTable = redisDb.StringGet(redKeyTabCheckArt);
List<string> artList = new List<string>();
if (!string.IsNullOrEmpty(rawTable))
{
artList = JsonConvert.DeserializeObject<List<string>>(rawTable);
}
// rileggo...
if (artList == null || artList.Count == 0)
{
artList = new List<string>();
var tabArticoli = dbController.ArticoliGetUsed();
var codList = tabArticoli.Select(x => x.CodArticolo);
foreach (string cod in codList)
{
artList.Add(cod);
}
// SE fosse vuoto aggiungo comunque il cado "ND"...
if (artList.Count == 0)
{
artList.Add("ND");
}
// salvo
rawTable = JsonConvert.SerializeObject(artList);
redisDb.StringSet(redKeyTabCheckArt, rawTable, TTLCache);
}
// cerco nella tabella: se ci fosse --> disabilitato delete
bool usato = false;
if (artList != null && artList.Count > 0)
{
usato = artList.Contains(codArticolo);
}
answ = !usato;
redisDb.StringSet(redKeyArtUsed, $"{answ}", TTLCache);
}
catch
{ }
}
return answ;
}
public async Task<List<ConfigModel>> ConfigGetAll()
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
List<ConfigModel>? result = new List<ConfigModel>();
// cerco in redis...
RedisValue rawData = await redisDb.StringGetAsync(redisConfKey);
if (!string.IsNullOrEmpty($"{rawData}"))
{
result = JsonConvert.DeserializeObject<List<ConfigModel>>($"{rawData}");
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"ConfigGetAll Read from REDIS: {ts.TotalMilliseconds}ms");
}
else
{
result = await Task.FromResult(dbController.ConfigGetAll());
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(redisConfKey, rawData, getRandTOut(redisLongTimeCache));
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"ConfigGetAll Read from DB: {ts.TotalMilliseconds}ms");
}
if (result == null)
{
result = new List<ConfigModel>();
}
return result;
}
/// <summary>
/// Reset dati cache config
/// </summary>
/// <returns></returns>
public async Task ConfigResetCache()
{
await redisDb.StringSetAsync(redisConfKey, "");
}
/// <summary>
/// Update chiave config
/// </summary>
/// <returns></returns>
public async Task<bool> ConfigUpdate(ConfigModel updRec)
{
return await Task.FromResult(dbController.ConfigUpdate(updRec));
}
public void Dispose()
{
// Clear database controller
dbController.Dispose();
redisConn.Dispose();
}
/// <summary>
/// Eliminazione di un dossier
/// </summary>
/// <param name="selRecord">record dossier da eliminare</param>
/// <returns></returns>
public async Task<bool> DossiersDeleteRecord(Dossiers selRecord)
{
bool result = false;
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
result = await dbController.DossiersDeleteRecord(selRecord);
// elimino cache redis...
RedisValue pattern = new RedisValue($"{redisDossByMac}:*");
bool answ = await ExecFlushRedisPattern(pattern);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"DossiersDeleteRecord | IdxMacchina {selRecord.IdxMacchina} | DtRif {selRecord.DtRif} | IdxODL {selRecord.IdxODL} | {ts.TotalMilliseconds}ms");
return result;
}
/// <summary>
/// Elenco ultimi n record DOssiers (che contengono ad esempio "salvataggi" di FLuxLog) dato
/// macchina (ordinato x data registrazione)
/// </summary>
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
/// <param name="DtRef">Data di riferimento (Massima) per estrazione records</param>
/// <param name="MaxRec">numero massimo record da restituire</param>
/// <returns></returns>
public async Task<List<Dossiers>> DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtRef, int MaxRec)
{
List<Dossiers>? result = new List<Dossiers>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
string currKey = $"{redisDossByMac}:{IdxMacchina}:{CodArticolo}:{DtRef}:{MaxRec}";
// cerco in redis dato valore sel macchina...
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<Dossiers>>($"{rawData}");
readType = "REDIS";
}
else
{
result = await Task.FromResult(dbController.DossiersGetLastFilt(IdxMacchina, CodArticolo, DtRef, MaxRec));
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache / 5));
}
if (result == null)
{
result = new List<Dossiers>();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"DossiersGetLastFilt | Read from {readType}: {ts.TotalMilliseconds}ms");
return result;
}
/// <summary>
/// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis
/// </summary>
/// <param name="IdxMacchina">macchina</param>
/// <param name="MaxSec">NUm massimo secondi per recuperare dati correnti</param>
/// <param name="DtRif">DataOra riferimento x cui prendere valori antecedenti</param>
/// <returns></returns>
public async Task<bool> DossiersTakeParamsSnapshot(string IdxMacchina, int MaxSec, DateTime DtRif)
{
bool answ = false;
await Task.Delay(1);
// chiamo stored x salvare parametri
dbController.DossiersTakeParamsSnapshot(IdxMacchina, MaxSec, DtRif);
// svuoto cache redis x macchina
string currKey = $"{redisDossByMac}:{IdxMacchina}";
redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1));
currKey = $"{redisDossByMac}:*";
redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1));
return answ;
}
/// <summary>
/// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis
/// </summary>
/// <param name="IdxMacchina">macchina</param>
/// <param name="MaxSec">NUm massimo secondi per recuperare dati correnti</param>
/// <param name="DtRif">DataOra riferimento x cui prendere valori antecedenti</param>
/// <returns></returns>
public async Task<bool> DossiersTakeParamsSnapshotLast(string IdxMacchina, DateTime dtMin, DateTime dtMax)
{
bool answ = false;
await Task.Delay(1);
// chiamo stored x salvare parametri
dbController.DossiersTakeParamsSnapshotLast(IdxMacchina, dtMin, dtMax);
// svuoto cache redis x macchina
string currKey = $"{redisDossByMac}:{IdxMacchina}";
redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1));
currKey = $"{redisDossByMac}:*";
redisDb.StringSet(currKey, "", TimeSpan.FromSeconds(1));
return answ;
}
/// <summary>
/// Restitusice elenco aziende
/// </summary>
/// <returns></returns>
public Task<List<AnagGruppi>> ElencoAziende()
{
return Task.FromResult(dbController.AnagGruppiAziende());
}
/// <summary>
/// Restitusice elenco fasi
/// </summary>
/// <returns></returns>
public Task<List<AnagGruppi>> ElencoGruppiFase()
{
return Task.FromResult(dbController.AnagGruppiFase());
}
public Task<List<LinkMenu>> 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()
{
await Task.Delay(1);
RedisValue pattern = new RedisValue($"{redisBaseAddr}*");
bool answ = await ExecFlushRedisPattern(pattern);
return answ;
}
/// <summary>
/// Elenco ultimi n record flux log dato macchina e flusso (ordinato x data registrazione)
/// </summary>
/// <param name="DtMax">Data massima (recupera eventi antecedenti)</param>
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
/// <param name="CodFlux">*=tutti, altrimenti solo selezionato</param>
/// <param name="MaxRec">numero massimo record da restituire</param>
/// <returns></returns>
public async Task<List<FluxLog>> FluxLogGetLastFilt(DateTime DtMax, string IdxMacchina, string CodFlux, int MaxRec)
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
var results = await Task.FromResult(dbController.FluxLogGetLastFilt(DtMax, IdxMacchina, CodFlux, MaxRec));
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"FluxLogGetLastFilt | Read from DB: {ts.TotalMilliseconds}ms");
return results;
}
/// <summary>
/// Elenco setup dei tag conf correnti
/// </summary>
/// <returns></returns>
public Task<Dictionary<string, List<TagData>>> getAllTags()
{
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>
/// restituisce il valore da REDIS associato al tag richeisto
/// </summary>
/// <param name="redKey">Chiave in cui cercare il valore</param>
/// <returns></returns>
public string getTagConf(string redKey)
{
string outVal = "";
// cerco in REDIS la conf x l'IOB
var rawData = redisDb.StringGet(redKey);
if (!string.IsNullOrEmpty(rawData))
{
outVal = $"{rawData}";
}
return outVal;
}
/// <summary>
/// Elenco ODL filtrati x stato, articolo, KeyRich (che contiene stato)
/// </summary>
/// <param name="inCorso">Stato ODL: true=in corso/completato</param>
/// <param name="codArt">Cod articolo</param>
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
/// <param name="IdxMacchina">id macchina da cercare</param>
/// <returns></returns>
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, IdxMacchina, startDate, endDate));
}
/// <summary>
/// Elenco PODL non avviati filtrati x articolo, KeyRich (che contiene stato)
/// </summary>
/// <param name="codArt">Cod articolo</param>
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
/// <returns></returns>
public async Task<List<PODLModel>> ListPODLFilt(string codArt, string keyRichPart)
{
return await Task.FromResult(dbController.ListPODLFilt(codArt, keyRichPart));
}
/// <summary>
/// Elenco di tutte le macchine gestite
/// </summary>
/// <returns></returns>
public async Task<List<Macchine>> MacchineGetAll()
{
List<Macchine>? result = new List<Macchine>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
string currKey = redisMacList;
// cerco in redis dato valore sel macchina...
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue)
{
result = JsonConvert.DeserializeObject<List<Macchine>>($"{rawData}");
readType = "REDIS";
}
else
{
result = await Task.FromResult(dbController.MacchineGetAll());
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
redisDb.StringSet(currKey, rawData, getRandTOut(redisLongTimeCache));
}
if (result == null)
{
result = new List<Macchine>();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"MacchineGetAll | Read from {readType}: {ts.TotalMilliseconds}ms");
return result;
}
/// <summary>
/// Elenco ID macchine con dati FluxLog gestite
/// </summary>
/// <returns></returns>
public async Task<List<string>> MacchineWithFlux()
{
List<string>? result = new List<string>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
string currKey = redisMacByFlux;
// 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 dbController.MacchineWithFlux();
// serializzp 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($"MacchineWithFlux | Read from {readType}: {ts.TotalMilliseconds}ms");
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>
/// Record ODL da chaive
/// </summary>
/// <returns></returns>
public async Task<ODLModel> OdlGetByKey(int IdxOdl)
{
await Task.Delay(1);
var dbResult = dbController.OdlGetByKey(IdxOdl);
return dbResult;
}
/// <summary>
/// ODL corrente x macchina
/// </summary>
/// <param name="idxMacchina"></param>
/// <returns></returns>
public ODLModel OdlGetCurrentByMacc(string idxMacchina)
{
ODLModel dbResult = new ODLModel();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
string currKey = $"{redisOdlCurrByMac}:{idxMacchina}";
// cerco in redis dato valore sel macchina...
RedisValue rawData = redisDb.StringGet(currKey);
if (rawData.HasValue)
{
dbResult = JsonConvert.DeserializeObject<ODLModel>($"{rawData}");
readType = "REDIS";
}
else
{
dbResult = dbController.OdlGetCurrentByMacc(idxMacchina);
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(dbResult);
redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(3));
}
if (dbResult == null)
{
dbResult = new ODLModel();
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"OdlGetCurrentByMacc | Read from {readType}: {ts.TotalMilliseconds}ms");
return dbResult;
}
/// <summary>
/// Elenco di tutti i parametri filtrati x macchina
/// </summary>
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
/// <returns></returns>
public async Task<List<string>> ParametriGetFilt(string IdxMacchina)
{
List<string>? result = new List<string>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
string currKey = $"{redisFluxByMac}:{IdxMacchina}";
// 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.ParametriGetFilt(IdxMacchina));
// serializzp 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($"ParametriGetFilt | Read from {readType}: {ts.TotalMilliseconds}ms");
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>
/// Eliminazione record selezionato
/// </summary>
/// <param name="currRec"></param>
/// <returns></returns>
public async Task<bool> PODLDeleteRecord(PODLModel 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>
/// Aggiornamento record selezionato
/// </summary>
/// <param name="currRec"></param>
/// <returns></returns>
public async Task<bool> POdlUpdateRecord(PODLModel currRec)
{
return await dbController.PODLUpdateRecord(currRec);
}
/// <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;
}
#endregion Public Methods
#region Protected Fields
protected Random rand = new Random();
#endregion Protected Fields
#region Protected Methods
/// <summary>
/// Restituisce un timeout dai minuti richiesti + tempo random 1..60 sec
/// </summary>
/// <param name="stdMinutes"></param>
/// <returns></returns>
protected TimeSpan getRandTOut(int stdMinutes)
{
double rndValue = (double)stdMinutes + (double)rand.Next(1, 60) / 60;
return TimeSpan.FromMinutes(rndValue);
}
#endregion Protected Methods
#region Private Fields
private const string redisArtByDossier = redisBaseAddr + "SPEC:Cache:ArtByDossier";
private const string redisBaseAddr = "MP:";
private const string redisConfKey = redisBaseAddr + "SPEC:Cache:Config";
private const string redisDossByMac = redisBaseAddr + "SPEC:Cache:DossByMac";
private const string redisFluxByMac = redisBaseAddr + "SPEC:Cache:FluxByMac";
private const string redisOdlCurrByMac = redisBaseAddr + "SPEC:Cache:OdlByMac";
private const string redisMacByFlux = redisBaseAddr + "SPEC:Cache:MacByFlux";
private const string redisMacList = redisBaseAddr + "SPEC:Cache:MacList";
private const string redisStatoCom = redisBaseAddr + "SPEC:Cache:StatoCom";
private const string redisTipoArt = redisBaseAddr + "SPEC:Cache:TipoArt";
private static IConfiguration _configuration = null!;
private static ILogger<MpDataService> _logger = null!;
private static Logger Log = LogManager.GetCurrentClassLogger();
/// <summary>
/// Oggetto per connessione a REDIS
/// </summary>
private ConnectionMultiplexer redisConn = null!;
/// <summary>
/// Oggetto per connessione a REDIS modalità admin (ex flux dati)
/// </summary>
private ConnectionMultiplexer redisConnAdmin = null!;
/// <summary>
/// Oggetto DB redis da impiegare x chiamate R/W
/// </summary>
private IDatabase redisDb = null!;
private int redisLongTimeCache = 5;
#endregion Private Fields
#region Private Methods
/// <summary>
/// Esegue flush memoria redis dato pattern
/// </summary>
/// <param name="pattern"></param>
/// <returns></returns>
private async Task<bool> ExecFlushRedisPattern(RedisValue pattern)
{
bool answ = false;
var listEndpoints = redisConnAdmin.GetEndPoints();
foreach (var endPoint in listEndpoints)
{
//var server = redisConnAdmin.GetServer(listEndpoints[0]);
var server = redisConnAdmin.GetServer(endPoint);
if (server != null)
{
var keyList = server.Keys(redisDb.Database, pattern);
foreach (var item in keyList)
{
await redisDb.KeyDeleteAsync(item);
}
// brutalmente rimuovo intero contenuto DB... DANGER
//await server.FlushDatabaseAsync();
answ = true;
}
}
return answ;
}
#endregion Private Methods
}
}
+74
View File
@@ -0,0 +1,74 @@
namespace MP.SPEC.Data
{
public class SelectDossierParams
{
#region Public Constructors
public SelectDossierParams()
{ }
#endregion Public Constructors
#region Public Properties
public int CurrPage { get; set; } = 1;
public DateTime DtRef { get; set; } = InitDatetime(5);
public string IdxMacchina { get; set; } = "*";
public string CodArticolo { get; set; } = "*";
public int MaxRecord { get; set; } = 100;
#endregion Public Properties
#region Public Methods
/// <summary>
/// Inizializzazione con periodo e arrotondamento
/// </summary>
/// <param name="minRound"></param>
/// <returns></returns>
public static DateTime InitDatetime(int minRound)
{
TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today);
int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound;
DateTime endRounded = DateTime.Today.AddMinutes(minDay);
return endRounded;
}
public override bool Equals(object obj)
{
if (!(obj is SelectDossierParams item))
return false;
if (IdxMacchina != item.IdxMacchina)
return false;
if (CodArticolo != item.CodArticolo)
return false;
if (MaxRecord != item.MaxRecord)
return false;
if (DtRef != item.DtRef)
return false;
if (CurrPage != item.CurrPage)
return false;
//if (lastUpdate != item.lastUpdate)
// return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
#endregion Public Methods
}
}
+66
View File
@@ -0,0 +1,66 @@
namespace MP.SPEC.Data
{
public class SelectFluxParams
{
#region Public Constructors
public SelectFluxParams()
{ }
#endregion Public Constructors
#region Public Properties
public string CodFlux { get; set; } = "*";
public int CurrPage { get; set; } = 1;
public DateTime? dtRif { get; set; } = null;
public DateTime? dtMax { get; set; } = null;
public DateTime? dtMin { get; set; } = null;
public string IdxMacchina { get; set; } = "*";
public string lastUpdate { get; set; } = "-";
public bool LiveUpdate { get; set; } = true;
public int MaxRecord { get; set; } = 100;
public int TempoAgg { get; set; } = 10000;
#endregion Public Properties
#region Public Methods
public override bool Equals(object obj)
{
if (!(obj is SelectFluxParams item))
return false;
if (IdxMacchina != item.IdxMacchina)
return false;
if (CodFlux != item.CodFlux)
return false;
if (LiveUpdate != item.LiveUpdate)
return false;
if (MaxRecord != item.MaxRecord)
return false;
if (TempoAgg != item.TempoAgg)
return false;
if (CurrPage != item.CurrPage)
return false;
if (lastUpdate != item.lastUpdate)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
#endregion Public Methods
}
}
+74
View File
@@ -0,0 +1,74 @@
namespace MP.SPEC.Data
{
public class SelectGlobalToggle
{
#region Public Constructors
public SelectGlobalToggle()
{ }
#endregion Public Constructors
#region Public Properties
/// <summary>
/// Bool: indica se il toggle è attivo
/// </summary>
public bool isActive { get; set; } = true;
/// <summary>
/// string: stringa da mostrare a sinistra (disattivo onInitialize)
/// </summary>
public string leftString { get; set; } = "";
/// <summary>
/// string: stringa da mostrare a destra (attivo onInitialize)
/// </summary>
public string rightString { get; set; } = "";
/// <summary>
/// string: stile stringa da mostrare a sinistra (disattivo onInitialize)
/// </summary>
public string leftStringCSS { get; set; } = "";
/// <summary>
/// string: stile stringa da mostrare a destra (attivo onInitialize)
/// </summary>
public string rightStringCSS { get; set; } = "";
#endregion Public Properties
#region Public Methods
public override bool Equals(object obj)
{
if (!(obj is SelectGlobalToggle item))
return false;
if (isActive != item.isActive)
return false;
if (leftString != item.leftString)
return false;
if (rightString != item.rightString)
return false;
if (leftStringCSS != item.leftStringCSS)
return false;
if (rightStringCSS != item.rightStringCSS)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
#endregion Public Methods
}
}
+72
View File
@@ -0,0 +1,72 @@
using MP.Data;
namespace MP.SPEC.Data
{
public class SelectOdlParams
{
#region Public Constructors
public SelectOdlParams()
{ }
#endregion Public Constructors
#region Public Properties
public string CodStato { get; set; } = "*";
public string IdxMacchina { get; set; } = "*";
public int CurrPage { get; set; } = 1;
public int NumRec { get; set; } = 10;
public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5);
public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-7);
public int MaxRecord { get; set; } = 100;
public bool IsActive { get; set; } = true;
public string SearchVal { get; set; } = "*";
#endregion Public Properties
#region Public Methods
public override bool Equals(object obj)
{
if (!(obj is SelectOdlParams item))
return false;
if (IsActive != item.IsActive)
return false;
if (CodStato != item.CodStato)
return false;
if (IdxMacchina != item.IdxMacchina)
return false;
if (MaxRecord != item.MaxRecord)
return false;
if (NumRec != item.NumRec)
return false;
if (DtStart != item.DtStart)
return false;
if (DtEnd != item.DtEnd)
return false;
if (CurrPage != item.CurrPage)
return false;
if (SearchVal != item.SearchVal)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
#endregion Public Methods
}
}
+56
View File
@@ -0,0 +1,56 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2210.1810</Version>
</PropertyGroup>
<ItemGroup>
<Content Remove="compilerconfig.json" />
</ItemGroup>
<ItemGroup>
<None Include="compilerconfig.json" />
<None Include="wwwroot\lib\Chart.js\chart.esm.js" />
<None Include="wwwroot\lib\Chart.js\chart.esm.min.js" />
<None Include="wwwroot\lib\Chart.js\chart.js" />
<None Include="wwwroot\lib\Chart.js\chart.min.js" />
<None Include="wwwroot\lib\Chart.js\helpers.esm.js" />
<None Include="wwwroot\lib\Chart.js\helpers.esm.min.js" />
<None Include="wwwroot\lib\chartjs-adapter-luxon\chartjs-adapter-luxon.esm.js" />
<None Include="wwwroot\lib\chartjs-adapter-luxon\chartjs-adapter-luxon.esm.min.js" />
<None Include="wwwroot\lib\chartjs-adapter-luxon\chartjs-adapter-luxon.js" />
<None Include="wwwroot\lib\chartjs-adapter-luxon\chartjs-adapter-luxon.min.js" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="6.0.9" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MP.Data\MP.Data.csproj" />
</ItemGroup>
<ItemGroup>
<Content Update="wwwroot\favicon.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Update="logs\.placeholder">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="post-build.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
</Target>
</Project>
+46
View File
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="false"
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
<!-- optional, add some variables
https://github.com/nlog/NLog/wiki/Configuration-file#variables
-->
<variable name="myvar" value="myvalue" />
<!--
See https://github.com/nlog/nlog/wiki/Configuration-file
for information on customizing logging rules and outputs.
-->
<targets>
<!--
add your targets here
See https://github.com/nlog/NLog/wiki/Targets for possible targets.
See https://github.com/nlog/NLog/wiki/Layout-Renderers for the possible layout renderers.
-->
<!--
Write events to a file with the date in the filename.
<target xsi:type="File" name="f" fileName="${basedir}/logs/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message}" />
-->
<target xsi:type="File" name="fileTarget" fileName="${basedir}/logs/${shortdate}.log" layout="${longdate} | ${uppercase:${level}} | ${logger:shortName=false} | ${message}" />
<target xsi:type="ColoredConsole" name="consoleTarget" layout="${longdate} | ${uppercase:${level}} | ${logger:shortName=true} | ${message}" />
</targets>
<rules>
<!-- add your logging rules here -->
<!--
Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f"
<logger name="*" minlevel="Debug" writeTo="f" />
-->
<logger name="*" minlevel="Debug" writeTo="consoleTarget" />
<!--<logger name="Microsoft.*" maxlevel="Info" final="true" />-->
<logger name="*" minlevel="Info" writeTo="fileTarget" />
</rules>
</nlog>
+171
View File
@@ -0,0 +1,171 @@
@page "/ART"
@using MP.SPEC.Components
@using MP.SPEC.Data
<div class="card mb-5">
<div class="card-header table-primary">
<div class="d-flex justify-content-between">
<div class="px-0">
<div class="d-flex justify-content-between">
<div class="px-2">
<h3>Articoli </h3>
</div>
<div class="px-2">
<button class="btn btn-success" @onclick="() => addNew()">Nuovo <i class="bi bi-plus-square"></i></button>
</div>
</div>
</div>
<div class="px-0 align-content-center">
<div class="input-group input-group">
<label class="input-group-text" for="maxRecord" title="Selezionare l'azienda da visualizzare"><i class="fa-solid fa-industry"></i></label>
<select @bind="@selAzienda" class="form-select" title="Selezionare l'azienda da visualizzare">
@if (ListAziende != null)
{
foreach (var item in ListAziende)
{
<option value="@item.CodGruppo">@item.DescrGruppo</option>
}
}
</select>
</div>
</div>
</div>
@if (currRecord != null)
{
<div class="row">
<div class="col-12">
<div class="card mb-5">
<div class="card-header bg-primary text-light">Modifica</div>
<div class="card-body">
<div class="row">
<div class="col-4">
<div class="input-group">
<span class="input-group-text">Codice</span>
<input type="text" class="form-control" placeholder="Articolo" @bind-value="@currRecord.CodArticolo">
</div>
</div>
<div class="col-4">
<div class="input-group">
<span class="input-group-text">Disegno</span>
<input type="text" class="form-control" placeholder="Disegno" @bind-value="@currRecord.Disegno">
</div>
</div>
<div class="col-1">
<div class="input-group" title="Tipo">
<select @bind="@currRecord.Tipo" class="form-select text-end">
@if (ListTipoArt != null)
{
foreach (var item in ListTipoArt)
{
<option value="@item.value">@item.label</option>
}
}
</select>
</div>
</div>
<div class="col-3">
<div class="input-group" title="Azienda">
<select @bind="@currRecord.Azienda" class="form-select text-end">
@if (ListAziende != null)
{
foreach (var item in ListAziende.Where(x => x.CodGruppo != "*").ToList())
{
<option value="@item.CodGruppo">@item.DescrGruppo</option>
}
}
</select>
</div>
</div>
</div>
<div class="row mt-2">
<div class="col-8">
<input type="text" class="form-control" placeholder="Descrizione Articolo" @bind-value="@currRecord.DescArticolo">
</div>
<div class="col-2">
<div class="d-grid gap-2">
<button class="btn btn-warning" @onclick="() => cancel()">Annulla <i class="bi bi-x-circle"></i></button>
</div>
</div>
<div class="col-2">
<div class="d-grid gap-2">
<button class="btn btn-success" @onclick="() => update(currRecord)">Salva <i class="bi bi-save"></i></button>
</div>
</div>
</div>
</div>
@*<div class="card-footer">Footer</div>*@
</div>
</div>
</div>
}
</div>
<div class="card-body">
@if (ListRecords == null)
{
<LoadingData></LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
}
else
{
<div class="row">
<div class="col-12">
<table class="table table-sm table-striped">
<thead>
<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-compass-drafting"></i> Disegno</th>
<th><i class="fa-solid fa-file-word"></i> Descrizione</th>
<th><i class="fa-solid fa-rectangle-list"></i> Tipo</th>
<th><i class="fa-solid fa-industry"></i> Azienda</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(@record.CodArticolo)">
<td>
<button @onclick="() => selRecord(record)" class="btn btn-primary btn-sm" title="Modifica Record"><i class="bi bi-pencil-square"></i></button>
<button @onclick="() => cloneRecord(record)" class="btn btn-info btn-sm" title="Duplica Record"><i class="bi bi-clipboard-check"></i></button>
</td>
<td>
<div>@record.CodArticolo</div>
</td>
<td>
<div class="small">@record.Disegno</div>
</td>
<td>
<div class="small">@record.DescArticolo</div>
</td>
<td>
<div>@record.Tipo</div>
</td>
<td>@record.Azienda</td>
<td>
@if (ArticoloDelEnabled(record.CodArticolo))
{
<button @onclick="() => deleteRecord(record)" class="btn btn-danger btn-sm"><i class="bi bi-trash-fill"></i></button>
}
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
}
</div>
<div class="card-footer py-1">
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
</div>
</div>
+298
View File
@@ -0,0 +1,298 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.SPEC.Data;
namespace MP.SPEC.Pages
{
public partial class Articoli : ComponentBase, IDisposable
{
#region Public Methods
public string checkSelect(string CodArticolo)
{
string answ = "";
if (currRecord != null)
{
try
{
answ = (currRecord.CodArticolo == CodArticolo) ? "table-info" : "";
}
catch
{ }
}
return answ;
}
public void Dispose()
{
MessageService.EA_SearchUpdated -= OnSeachUpdated;
}
public async void OnSeachUpdated()
{
await InvokeAsync(() =>
{
currPage = 1;
Task task = UpdateData();
StateHasChanged();
});
}
#endregion Public Methods
#region Protected Properties
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
[Inject]
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MessageService { get; set; } = null!;
[Inject]
protected NavigationManager NavManager { get; set; }
protected int totalCount
{
get
{
int answ = 0;
if (SearchRecords != null)
{
answ = SearchRecords.Count;
}
return answ;
}
}
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// Crea nuovo record e va in editing...
/// </summary>
/// <returns></returns>
protected async Task addNew()
{
currRecord = new AnagArticoli()
{
CodArticolo = $"_NEW_{DateTime.Now:yyyyMMdd.HHmmss}",
DescArticolo = "Nuovo articolo",
Azienda = selAzienda != "*" ? selAzienda : "MAPO",
Disegno = "",
Tipo = "ART"
};
await Task.Delay(1);
}
protected async Task cancel()
{
currRecord = null;
await reloadData();
await Task.Delay(1);
}
/// <summary>
/// Eliminazione record selezionato (previa conferma)
/// </summary>
/// <param name="selRec"></param>
/// <returns></returns>
protected async Task deleteRecord(AnagArticoli selRec)
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Eliminazione Articolo: sei sicuro di voler procedere?"))
return;
await Task.Delay(1);
var done = await MDService.ArticoliDeleteRecord(selRec);
currRecord = null;
await reloadData();
await Task.Delay(1);
}
protected void ForceReload(int newNum)
{
numRecord = newNum;
}
protected void ForceReloadPage(int newNum)
{
currPage = newNum;
}
protected override async Task OnInitializedAsync()
{
numRecord = 10;
// mostro ricerca
MessageService.ShowSearch = true;
MessageService.EA_SearchUpdated += OnSeachUpdated;
configData = await MDService.ConfigGetAll();
var currRec = configData.FirstOrDefault(x => x.Chiave == "AZIENDA");
if (currRec != null)
{
selAzienda = currRec.Valore;
}
ListAziende = await MDService.ElencoAziende();
ListTipoArt = await MDService.AnagTipoArtLV();
}
protected override async Task OnParametersSetAsync()
{
await reloadData();
}
protected void ResetData()
{
currRecord = null;
}
protected async Task resetSel()
{
currRecord = null;
await Task.Delay(1);
}
protected async Task selRecord(AnagArticoli selRec)
{
currRecord = selRec;
await Task.Delay(1);
}
protected async Task cloneRecord(AnagArticoli selRec)
{
// creo record duplicato...
AnagArticoli newRec = new AnagArticoli()
{
Azienda = selRec.Azienda,
CodArticolo = selRec.CodArticolo,
DescArticolo = $"CLONE - { selRec.DescArticolo }",
Disegno = selRec.Disegno,
Tipo=selRec.Tipo
};
currRecord = newRec;
await Task.Delay(1);
}
protected async Task update(AnagArticoli selRec)
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler salvare le modifiche?"))
return;
await Task.Delay(1);
var done = await MDService.ArticoliUpdateRecord(selRec);
currRecord = null;
await reloadData();
await Task.Delay(1);
}
protected async Task UpdateData()
{
currRecord = null;
await reloadData();
}
#endregion Protected Methods
#region Private Fields
private string _selAzienda = "*";
private AnagArticoli? currRecord = null;
private List<AnagGruppi>? ListAziende;
private List<AnagArticoli>? ListRecords;
private List<ListValues>? ListTipoArt;
private List<AnagArticoli>? SearchRecords;
#endregion Private Fields
#region Private Properties
private int _currPage { get; set; } = 1;
private int _numRecord { get; set; } = 10;
private List<ConfigModel>? configData { get; set; } = null;
private int currPage
{
get => _currPage;
set
{
if (_currPage != value)
{
_currPage = value;
var pUpd = Task.Run(async () => await reloadData());
pUpd.Wait();
}
}
}
private bool isLoading { get; set; } = false;
private int numRecord
{
get => _numRecord;
set
{
if (_numRecord != value)
{
_numRecord = value;
var pUpd = Task.Run(async () => await reloadData());
pUpd.Wait();
}
}
}
private string selAzienda
{
get => _selAzienda;
set
{
if (value != _selAzienda)
{
_selAzienda = value;
var pUpd = Task.Run(async () =>
{
// svuoto cache redis...
ConfigModel updRec = new ConfigModel()
{
Chiave = "AZIENDA",
Valore = value
};
await MDService.ConfigUpdate(updRec);
await MDService.ConfigResetCache();
// ricarico
await Task.Delay(1);
await reloadData();
});
pUpd.Wait();
}
}
}
private bool ShowCharts { get; set; } = false;
#endregion Private Properties
#region Private Methods
/// <summary>
/// Seleziona record x editing
/// </summary>
/// <param name="selRec"></param>
/// <returns></returns>
private bool ArticoloDelEnabled(string codArt)
{
bool answ = MDService.ArticoloDelEnabled(codArt);
return answ;
}
private async Task reloadData()
{
isLoading = true;
SearchRecords = await MDService.ArticoliGetSearch(100000, selAzienda, MessageService.SearchVal);
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
isLoading = false;
}
#endregion Private Methods
}
}
+92
View File
@@ -0,0 +1,92 @@
@page "/DOSS"
<div class="card mb-5">
<div class="card-header table-primary">
<div class="d-flex">
<div class="px-0 py-1">
<h3><b>DOSSIERS</b></h3>
</div>
<div class="px-2 flex-fill">
@if (isFiltering)
{
<LoadingDataSmall></LoadingDataSmall>
<i>filtro x macchina / periodo</i>
}
else
{
<DossiersFilter FilterChanged="updateFilter"></DossiersFilter>
}
</div>
</div>
</div>
<div class="card-body">
@if (currDetFluxLogRecord != null)
{
<div class="row">
<div class="col-12">
<div class="card mb-5">
<div class="card-header bg-primary text-light">Modifica Parametro</div>
<div class="card-body">
<div class="row">
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">MACCHINA</span>
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currDetFluxLogRecord.IdxMacchina">
</div>
</div>
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">DATA</span>
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currDetFluxLogRecord.dtEvento">
</div>
</div>
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">DATA TYPE</span>
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currDetFluxLogRecord.CodFlux">
</div>
</div>
<div class="col-3 pe-0">
<div class="input-group input-group-sm">
<span class="input-group-text" id="inputGroup-sizing-sm">VALORE</span>
<input type="text" class="form-control" aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currDetFluxLogRecord.ValoreEdit">
</div>
</div>
</div>
<div class="row pt-4">
<div class="col-3 pe-0">
</div>
<div class="col-3 pe-0">
</div>
<div class="col-3 pe-0">
<div class="d-grid gap-2">
<button @onclick="() => cancel()" class="btn btn-warning">Annulla <i class="bi bi-x-circle"></i></button>
</div>
</div>
<div class="col-3 pe-0">
<div class="d-grid gap-2">
<button @onclick="() => update(currDetFluxLogRecord)" class="btn btn-success">Save <i class="bi bi-save"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
}
</div>
@if (isLoading)
{
<LoadingData></LoadingData>
}
else
{
<ListDossiers SelFilter="@currFilter" RecordSel="@selRecordDoss" RecordSelFlux="@selRecordFlux" TotRecordChanged="updateTotal"></ListDossiers>
}
</div>
<div class="card-footer py-1">
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
</div>
+152
View File
@@ -0,0 +1,152 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using MP.SPEC.Components;
using MP.SPEC.Data;
namespace MP.SPEC.Pages
{
public partial class DOSS
{
#region Protected Fields
protected DataPager pagerODL = null!;
#endregion Protected Fields
#region Protected Properties
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
[Inject]
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MsgService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected async Task cancel()
{
currDetFluxLogRecord = null;
await Task.Delay(1);
}
protected void ForceReload(int newNum)
{
numRecord = newNum;
}
protected void ForceReloadPage(int newNum)
{
currPage = newNum;
StateHasChanged();
}
protected override async Task OnInitializedAsync()
{
isLoading = true;
isFiltering = true;
// disabilito ricerca...
MsgService.SearchVal = "";
MsgService.ShowSearch = false;
// fix pagina
await Task.Delay(1);
var modFilter = currFilter;
modFilter.CurrPage = 1;
currFilter = modFilter;
await Task.Delay(1);
isFiltering = false;
}
protected async Task selRecordDoss(Dossiers selDoss)
{
currRecordDoss = selDoss;
await Task.Delay(1);
}
protected async Task selRecordFlux(FluxLogDTO selRec)
{
currDetFluxLogRecord = selRec;
await Task.Delay(1);
}
protected async Task update(FluxLogDTO selRec)
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler salvare le modifiche? queste saranno parte del dossier inviato all'impianto"))
return;
await Task.Delay(1);
if (currRecordDoss != null)
{
// METODO PER UPDATE FLUX
await MDService.updateDossierValue(currRecordDoss, selRec);
}
currDetFluxLogRecord = null;
await Task.Delay(1);
}
protected void updateTotal(int newTotCount)
{
totalCount = newTotCount;
}
#endregion Protected Methods
#region Private Fields
private FluxLogDTO? _currDetFluxLogRecord = null;
#endregion Private Fields
#region Private Properties
private FluxLogDTO? currDetFluxLogRecord
{
get => _currDetFluxLogRecord;
set { _currDetFluxLogRecord = value; }
}
private SelectDossierParams currFilter { get; set; } = new SelectDossierParams();
private int currPage
{
get => MsgService.currPage;
set => MsgService.currPage = value;
}
private Dossiers? currRecordDoss { get; set; } = null;
private bool isFiltering { get; set; } = false;
private bool isLoading { get; set; } = true;
private int numRecord
{
get => MsgService.numRecord;
set => MsgService.numRecord = value;
}
private int totalCount { get; set; } = 0;
#endregion Private Properties
#region Private Methods
private async Task updateFilter(SelectDossierParams newParams)
{
isFiltering = false;
isLoading = true;
await Task.Delay(1);
currPage = 1;
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
currFilter = newParams;
isLoading = false;
}
#endregion Private Methods
}
}
+42
View File
@@ -0,0 +1,42 @@
@page
@model MP.SPEC.Pages.ErrorModel
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Error</title>
<link href="~/css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="~/css/site.css" rel="stylesheet" asp-append-version="true" />
</head>
<body>
<div class="main">
<div class="content px-4">
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
</div>
</div>
</body>
</html>
+43
View File
@@ -0,0 +1,43 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Diagnostics;
namespace MP.SPEC.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[IgnoreAntiforgeryToken]
public class ErrorModel : PageModel
{
#region Public Constructors
public ErrorModel(ILogger<ErrorModel> logger)
{
_logger = logger;
}
#endregion Public Constructors
#region Public Properties
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
#endregion Public Properties
#region Public Methods
public void OnGet()
{
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
#endregion Public Methods
#region Private Fields
private readonly ILogger<ErrorModel> _logger;
#endregion Private Fields
}
}
+60
View File
@@ -0,0 +1,60 @@
@page "/"
<PageTitle>Index</PageTitle>
<div class="card mb-5">
<div class="card-header bg-dark text-light">
<div class="d-flex justify-content-between">
<div class="p-2">
<img src="images/LogoMapo.png" class="image-fluid" height="64" />
</div>
<div class="p-2 align-content-center fs-1">
<b>MAPO SPEC</b>
</div>
<div class="p-2 bg-light">
<img src="images/LogoEgw.png" class="image-fluid" height="64" />
</div>
</div>
</div>
<div class="card-body text-center">
<div class="shortcuts my-3 py-3">
<div class="row">
<div class="col-12">
@if (ElencoLink == null)
{
<LoadingData></LoadingData>
}
else if (ElencoLink.Count == 0)
{
<div class="alert alert-danger" role="alert">
Nessun record trovato!
</div>
}
else
{
foreach (var item in ElencoLink)
{
<a href="@item.NavigateUrl" class="shortcut">
<i class="@item.icona shortcut-icon"></i>
<span class="shortcut-label">@item.Testo</span>
</a>
}
}
</div>
</div>
</div>
</div>
<dic class="card-footer bg-primary">
<div class="d-flex text-white justify-content-between">
<div class="px-2">
<h1>@currAzienda</h1>
</div>
<div class="px-2">
<h3 class="my-2">MAPO MES Custom Pages</h3>
</div>
</div>
</dic>
</div>
+59
View File
@@ -0,0 +1,59 @@
using Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.SPEC.Data;
namespace MP.SPEC.Pages
{
public partial class Index
{
#region Public Properties
public List<LinkMenu>? ElencoLink { get; set; }
#endregion Public Properties
#region Protected Properties
[Inject]
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MessageService { get; set; }
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
// nascondo ricerca
MessageService.ShowSearch = false;
// recupero elenco JQM
ElencoLink = await MDService.ElencoLink();
configData = await MDService.ConfigGetAll();
if (configData != null)
{
var currRec = configData.FirstOrDefault(x => x.Chiave == "AZIENDA");
if (currRec != null)
{
currAzienda = currRec.Valore;
}
}
await Task.Delay(1);
}
#endregion Protected Methods
#region Private Fields
private string currAzienda = "";
#endregion Private Fields
#region Private Properties
private List<ConfigModel>? configData { get; set; } = null;
#endregion Private Properties
}
}
+104
View File
@@ -0,0 +1,104 @@
@page "/ODL"
<div class="card mb-5">
<div class="card-header table-primary ">
<div class="d-flex justify-content-between col-12">
<div class="px-1 col-4">
<div>
<h3><b>ODL</b></h3>
</div>
</div>
<div class="col-4">
<div class="input-group input-group-sm">
<div class="input-group-text">
<span class="me-1 @leftStringCSS">Completati</span>
<span class="form-check form-check-sm form-switch py-1" title="ODL Chiusi / Correnti">
<input class="form-check-input" type="checkbox" id="switchActive" @bind="@isActive">
</span>
<span class="@rightStringCSS">In Corso</span>
</div>
</div>
</div>
<div class="d-flex justify-content-end">
<a class="pt-2 text-dark" data-bs-toggle="offcanvas" data-bs-target="#paramsFilterExample" aria-controls="paramsFilterExample" @onclick="setDtMax">
<i class="fa-solid fa-bars"></i>
</a>
<div class="offcanvas offcanvas-end" tabindex="-1" id="paramsFilterExample" aria-labelledby="paramsFilterExampleLabel">
<div class="offcanvas-header">
<h3 class="offcanvas-title" id="paramsFilterExampleLabel"><b>FILTRI</b></h3>
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div>
<div>
Seleziona i filtri per:
</div>
</div>
<div>
<div class="small mt-2">
<label class="px-2" for="fase" title="Selezionare inizio periodo">Fase</label>
</div>
<div class="input-group px-2">
<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="fase" class="form-select" title="Selezionare la fase da visualizzare">
<option value="*">--- Tutti ---</option>
@if (ListStati != null)
{
foreach (var item in ListStati)
{
<option value="@item.value">@item.label</option>
}
}
</select>
</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)
{
<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="@selDtStart" 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="@selDtEnd" id="dtMax" type="datetime-local" title="Selezionare fine periodo">
</div>
}
</div>
</div>
</div>
</div>
</div>
<div class="card-body">
<ListODL PagerResetReq="pgResetReq" updateRecordCount="UpdateTotCount" currFilter="@currFilter"></ListODL>
</div>
<div class="card-footer py-1">
<DataPager @ref="pagerODL" PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
</div>
</div>

Some files were not shown because too many files have changed in this diff Show More