Compare commits

..

457 Commits

Author SHA1 Message Date
Samuele Locatelli 52dffc36d7 Merge tag 'FixIobObj_02' into develop
Update metodi API x versione e salvataggio senza errori + fix
salvataggio aprametri
2026-03-13 10:14:52 +01:00
Samuele Locatelli 58c90034af Merge branch 'release/FixIobObj_02' 2026-03-13 10:14:38 +01:00
Samuele Locatelli c96b2eba1d Aggiunta REST call x versione
Fix salvataggio conf
2026-03-13 10:14:19 +01:00
Samuele Locatelli 2a4e46240c Fix errori params update 2026-03-13 10:10:54 +01:00
Samuele Locatelli 3739f888f9 Merge tag 'FixIobObj_01' into develop
Ancora fix valori double min/max
2026-03-13 09:14:06 +01:00
Samuele Locatelli e406fce2eb Merge branch 'release/FixIobObj_01' 2026-03-13 09:13:57 +01:00
Samuele Locatelli aa19832649 Forzato fix iobObject che non aveva preso val double 2026-03-13 09:13:28 +01:00
Samuele Locatelli 25d5ba81d2 Fix round fact in edit param 2026-03-13 09:11:43 +01:00
Samuele Locatelli 822a0fdfb8 Merge tag 'AddDebugParams_04' into develop
Ancora fix objItem ricevibili x evitare erroi invio
2026-03-13 09:02:37 +01:00
Samuele Locatelli b4a4db08d1 Merge branch 'release/AddDebugParams_04' 2026-03-13 09:02:25 +01:00
Samuele Locatelli 9d9dcecb1c fix IobObject: da int a double min/max val da conf 2026-03-13 09:02:03 +01:00
Samuele Locatelli fd5433f3c9 Forzo writable all'atto dell'editing... 2026-03-12 19:37:33 +01:00
Samuele Locatelli 4b365e1760 Merge tag 'AddDebugParams_03' into develop
Review localizzazione IT x evitare problema decimali verso IOB
2026-03-12 19:00:15 +01:00
Samuele Locatelli 693687a1ee Merge branch 'release/AddDebugParams_03' 2026-03-12 19:00:03 +01:00
Samuele Locatelli a45b70af9b Ripristinata culture ITA x evitare problemi con decimali inviati... 2026-03-12 18:59:44 +01:00
Samuele Locatelli 153438e4d6 Merge tag 'AddDebugParams_02' into develop
Update decimali con . tramite tulture EN-US
2026-03-12 18:50:37 +01:00
Samuele Locatelli f63d153d5b Merge branch 'release/AddDebugParams_02' 2026-03-12 18:50:27 +01:00
Samuele Locatelli 85298a16d7 Forzato culture a EN-US x problema decimali parametri 2026-03-12 18:50:07 +01:00
Samuele Locatelli 16ccb1c57e Merge tag 'AddDebugParams_01' into develop
update gestione parametri forzabili in debug + update round valori
2026-03-12 17:06:56 +01:00
Samuele Locatelli ecfa85ff38 Merge branch 'release/AddDebugParams_01' 2026-03-12 17:04:49 +01:00
Samuele Locatelli b45b728eb1 Fix round val 2 decimali + conf da json roundFactor 2026-03-12 17:04:11 +01:00
Samuele Locatelli 1dfd0c60d1 Aggiunta gestione currMode x plantParameters x forzare parametri 2026-03-12 16:55:18 +01:00
Samuele Locatelli 76f6151f75 Merge tag 'Telemetry_09' into develop
Aggiunta log duplicati
2026-03-04 09:44:41 +01:00
Samuele Locatelli 39559e3151 Merge branch 'release/Telemetry_09' 2026-03-04 09:44:33 +01:00
Samuele Locatelli 9625911cf1 Aggiunto log esteso rimozione allarmi duplicati 2026-03-04 09:44:06 +01:00
Samuele Locatelli 3e0b496764 Merge tag 'Rel_1.2' into develop
Update minor version
2026-03-04 09:23:13 +01:00
Samuele Locatelli cd902129a5 Merge branch 'release/Rel_1.2' 2026-03-04 09:23:07 +01:00
Samuele Locatelli 4f14df94bb Update vers 1.2 2026-03-04 09:22:39 +01:00
Samuele Locatelli 879e54d194 Merge tag 'Telemetry_08' into develop
Update x fix errori HEALT su ipv6 + fix varie aree commentate
2026-03-04 09:22:24 +01:00
Samuele Locatelli a4a9bb55b6 Merge branch 'release/Telemetry_08' 2026-03-04 09:21:55 +01:00
Samuele Locatelli 1eab3ad672 Cleanup finale e update mino vers x fiix trasmissione telemetria (FINALLY!) in prod 2026-03-04 09:21:39 +01:00
Samuele Locatelli bd505ab5ef Merge tag 'Telemetry_07' into develop
update versione
2026-03-04 08:57:56 +01:00
Samuele Locatelli a68471ec6f Merge branch 'release/Telemetry_07' 2026-03-04 08:57:51 +01:00
Samuele Locatelli 8f3239b6d6 update vers 2026-03-04 08:57:34 +01:00
Samuele Locatelli d6e5b07e2d Merge tag 'Telemetry_06' into develop
Update init x http vs grpc
2026-03-04 08:53:22 +01:00
Samuele Locatelli 89492349b6 Merge branch 'release/Telemetry_06' 2026-03-04 08:53:11 +01:00
Samuele Locatelli 971f2c51e9 Update conf x usare http vs grpc 2026-03-04 08:52:55 +01:00
Samuele Locatelli dbfc13e968 Merge tag 'Telemetry_05' into develop
Update telemetria con unico program.cs e nuova vers 1.1
2026-03-04 07:42:08 +01:00
Samuele Locatelli cb42c0a7ca Merge branch 'release/Telemetry_05' 2026-03-04 07:41:43 +01:00
Samuele Locatelli 06bae1d955 Update con startup in unico program.cs, vers 1.1 2026-03-04 07:41:06 +01:00
Samuele Locatelli 9459492599 Merge tag 'Telemetry_04' into develop
Merge nuova versione x test telemetria
2026-03-04 07:12:48 +01:00
Samuele Locatelli c208513988 Merge branch 'release/Telemetry_04' 2026-03-04 07:12:38 +01:00
Samuele Locatelli f0dc98a4f8 vers refres 2026-03-04 07:12:07 +01:00
Samuele Locatelli 7742d49b08 update vers con cleanup 2026-03-04 07:11:50 +01:00
Samuele Locatelli d6ed7c56a4 Merge tag 'Telemetry_03' into develop
Aggiunta parametro linux x grpc in http vs http2
2026-03-04 07:07:19 +01:00
Samuele Locatelli d17175b405 Merge branch 'release/Telemetry_03' 2026-03-04 07:07:03 +01:00
Samuele Locatelli 38b89c9a81 Update codice startup (da testare!) 2026-03-03 19:17:19 +01:00
Samuele Locatelli e31f773b34 Merge tag 'Telemetry_02' into develop
Update altri metodi export e async
2026-03-03 18:58:33 +01:00
Samuele Locatelli 74b4c50b00 Merge branch 'release/Telemetry_02' 2026-03-03 18:58:11 +01:00
Samuele Locatelli 4fda312aac Avanzamento telemetria:
- altri metodi tracciati
- modifica json x prod
- aggiunta Async vari
2026-03-03 18:57:46 +01:00
Samuele Locatelli 165c7ebb5f Merge tag 'OrderDedup_Telemetry_01' into develop
Inserito controllo ordini duplicati + telemetrica (non ancora completa)
+ fix naming Async metodi DAL
2026-03-03 15:05:43 +01:00
Samuele Locatelli b0274e0f33 Merge branch 'release/OrderDedup_Telemetry_01' 2026-03-03 15:05:22 +01:00
Samuele Locatelli c52a35082f Update
- naming metodi async
- inserimento funzione controllo ordini duplicati
- telemetria (continuo)
2026-03-03 15:03:29 +01:00
Samuele Locatelli c572a9556e Modifiche x inizio gestione telemetria 2026-03-03 12:51:37 +01:00
Samuele Locatelli fb74462ecd Aggiunta preliminare intercept errore (sostituzione NLog? approfondire...) 2026-02-26 18:42:40 +01:00
Samuele Locatelli 003f8792c4 Code reorg-cleanup 2026-02-26 18:35:53 +01:00
Samuele Locatelli 8757528de3 iniziato aggiunta telemetria in DEBUG x verifica azioni operatori 2026-02-26 18:35:09 +01:00
Samuele Locatelli 5e3bbc23da Merge tag 'ReduceCacheSizeTSData_01' into develop
Fix gestione dati TSData più compatti + review log vari
2026-02-20 12:04:40 +01:00
Samuele Locatelli 2cbe549751 Merge branch 'release/ReduceCacheSizeTSData_01' 2026-02-20 12:04:24 +01:00
Samuele Locatelli a28d7cbc4a Merge remote-tracking branch 'origin/develop' into develop 2026-02-20 12:03:49 +01:00
Samuele Locatelli 9670e170f2 Modifiche in prod
- cambio livello logging x tracciare meglio funzionamento eventi
- modifica modalità serializzazione TSData (nuovo costruttore) x ridurre dimensione cache redis (circa -40%)
2026-02-20 12:01:42 +01:00
Samuele E. Locatelli b6c514ebe9 Merge tag 'AddOrderCreateNote_01' into develop
Update gestione ordini con commenti
2025-12-02 11:07:06 +01:00
Samuele E. Locatelli 50ac4a9e30 Merge branch 'release/AddOrderCreateNote_01' 2025-12-02 11:06:56 +01:00
Samuele E. Locatelli 4122e27d17 Update gestione creazione ordini:
- quelli automatici sono messi all'1:00 non a mezzanotte
- creazione da plant analisys e orders differenziata come log sul DB
2025-12-02 11:06:21 +01:00
Samuele Locatelli 2d8a4db24a Merge tag 'FixLogout_01' into develop
Fix logout con corretta chiamata da pagina logout
2025-10-17 14:34:15 +02:00
Samuele Locatelli ac7b284397 Merge branch 'release/FixLogout_01' 2025-10-17 14:34:05 +02:00
Samuele Locatelli 70469bc51d Fix logout da pagina Auth MVC 2025-10-17 14:33:24 +02:00
Samuele Locatelli e84e352795 Merge tag 'FixAlarmAndSel_01' into develop
Fix deduplica allarmi + fix gestione buttons e sel varie
2025-10-15 16:03:12 +02:00
Samuele Locatelli 603e8df10f Merge branch 'release/FixAlarmAndSel_01' 2025-10-15 16:02:57 +02:00
Samuele Locatelli 11751c2adb Update gestione allarmi: deduplica prima dir ecuperare
Update visualizzazione ordini (/mostra richiesta sel)
Update gestione buttons vari
2025-10-15 16:02:20 +02:00
Samuele Locatelli 45ecc0f796 Update conf x uso MDB cluster in ufficio, test ok 2025-09-22 11:15:50 +02:00
Samuele Locatelli b7193732a5 Email via services in produzione 2025-09-22 08:49:31 +02:00
Samuele Locatelli e139e98309 Typo refresh (no real changes) + nuova stored salvata x delete allarmi duplicati 2025-02-11 16:22:34 +01:00
Samuele Locatelli cc71178b7f Merge tag 'FixFactorDecimal01' into develop
Fix factor come decimal e non come intero
2024-10-21 10:54:35 +02:00
Samuele Locatelli 43589701fd Merge branch 'release/FixFactorDecimal01' 2024-10-21 10:54:26 +02:00
Samuele Locatelli 24e8999f95 Fix ricezione factor a decimale 2024-10-21 10:53:59 +02:00
Samuele Locatelli 5050878708 Merge tag 'FixFlushMasterKeys02' into develop
Typo riorg codice (ASC ord)
2024-07-30 13:09:44 +02:00
Samuele Locatelli 528f368a99 Merge branch 'release/FixFlushMasterKeys02' 2024-07-30 13:09:34 +02:00
Samuele Locatelli 7c0c172231 Riorg codice 2024-07-30 13:09:14 +02:00
Samuele Locatelli 2c7c06058b Merge tag 'FixFlushMasterKeys01' into develop
Riscritto procedura cancellazione su redis:
- solo master server
- anche in parallelo da conf
2024-07-30 13:07:18 +02:00
Samuele Locatelli eaa75482e0 Merge branch 'release/FixFlushMasterKeys01' 2024-07-30 13:06:37 +02:00
Samuele Locatelli df6fa1ad77 Fix gestione cancellazione key solo da redis master 2024-07-30 13:06:10 +02:00
Samuele Locatelli d96c9205fa Merge tag 'ChangeRedisCache02' into develop
Fix ulteriore x redis con sentinel e cache, ripulite dipendenze
2024-07-29 17:31:59 +02:00
Samuele Locatelli c9a845fc81 Merge branch 'release/ChangeRedisCache02' 2024-07-29 17:31:11 +02:00
Samuele Locatelli e5325be058 Fix stringa redis x sentinel
Rimozione cache da program cs
rimozione nuget packages
2024-07-29 17:30:11 +02:00
Samuele Locatelli 911e8cbd05 Riorganizzazione (alfabetica) codice GWMSDataService 2024-07-29 17:03:39 +02:00
Samuele Locatelli 01330d3bb2 Redis cache:
- pulizia aree commentate in GWMSDataService
- razionalizzazione namespace
2024-07-29 16:53:53 +02:00
Samuele Locatelli 1effa123fb Merge tag 'ChangeRedisCache01' into develop
Modifica metodi gestione redis cluster con nuova libreria
2024-07-29 15:57:17 +02:00
Samuele Locatelli 921582e436 Merge branch 'release/ChangeRedisCache01' 2024-07-29 15:56:34 +02:00
Samuele Locatelli d2c549d471 Update applicazione x nuova gestione redis 2024-07-29 15:56:04 +02:00
Samuele Locatelli 82d8737157 Merge tag 'FixRedisConfigDecode01' into develop
Fix decodifica stringa redis: effettua trim sulle variabili splittate
2024-07-24 17:57:27 +02:00
Samuele Locatelli 9bd4b07db7 Fix decodifica confString di REDIS 2024-07-24 17:56:55 +02:00
Samuele Locatelli cc559063b3 Merge tag 'ChangeRedisConfig01' into develop
Modifica gestione servizio cache redis (primo tipo, non diretto): non +
cablato su localhost ma da conf, resta cmq da modificare al metodo
generale e + recente
2024-07-24 17:28:24 +02:00
Samuele Locatelli 95e9a8ee8a Merge branch 'release/ChangeRedisConfig01' 2024-07-24 17:27:54 +02:00
Samuele Locatelli 19986dc38d Update x gestione redis non locale, da testare in prod 2024-07-24 17:27:25 +02:00
Samuele Locatelli 5f8611bf63 Merge tag 'FixHealthCheck01' into develop
Fix healthcheck x ip non validi linux da pingare
2024-07-24 15:25:12 +02:00
Samuele Locatelli 9d6e624a77 Merge branch 'release/FixHealthCheck01' 2024-07-24 15:25:01 +02:00
Samuele Locatelli ed54dafcdb Fix heathcheck ping:
- esclusi indirizzi non validi linux
- review startup
2024-07-24 15:24:35 +02:00
Samuele Locatelli 64e574bfba Merge tag 'FixNugetRestore01' into develop
Fix nuget restore da v2 a v3 x build linux
2024-07-24 15:14:46 +02:00
Samuele Locatelli 4b3d4a4639 Merge branch 'release/FixNugetRestore01' 2024-07-24 15:14:23 +02:00
Samuele Locatelli 5d6535b85b Update comando x nuget fix 2024-07-24 15:12:00 +02:00
Samuele Locatelli 3d7730aaa9 Merge tag 'ReconfProdMdbOvh01' into develop
Riconfigurazione x impiego mdb.ovh
2024-07-24 14:47:55 +02:00
Samuele Locatelli cf787b3c71 Merge branch 'release/ReconfProdMdbOvh01' 2024-07-24 14:47:46 +02:00
Samuele Locatelli 76c3fa1ecf refresh + save conf x prod su cluster MDB 2024-07-24 14:47:09 +02:00
Samuele Locatelli 99256c0bed Fix inix context GWMS che era cablato su localhost... 2024-07-24 14:46:52 +02:00
Samuele Locatelli 9d3e781f0e Merge tag 'UpdateDisplayStatus03' into develop
Update modalità calcolo css display RT
2024-06-06 09:08:44 +02:00
Samuele Locatelli 4f1b6f7861 Merge branch 'release/UpdateDisplayStatus03' 2024-06-06 09:08:32 +02:00
Samuele Locatelli 0ab48fdd99 Typo: cleanup commenti 2024-06-06 09:08:15 +02:00
Samuele Locatelli cda14a810b Modifica blocco calcolo css display 2024-06-06 09:07:26 +02:00
Samuele Locatelli 30e4cd863b Update dafault config x refresh 2024-06-06 08:54:01 +02:00
Samuele Locatelli a231f9ac8c Merge tag 'UpdateDisplayStatus02' into develop
Ancora update display conditions
2024-06-06 08:28:54 +02:00
Samuele Locatelli 4ba86de5c0 Merge branch 'release/UpdateDisplayStatus02' 2024-06-06 08:28:46 +02:00
Samuele Locatelli 768c435943 Update x cambio icona realtime (play) 2024-06-06 08:28:00 +02:00
Samuele Locatelli dacbc8a6a6 Merge tag 'UpdateDisplayStatus01' into develop
Aggiornamento calcolo visualizzazione status css
2024-06-06 08:20:04 +02:00
Samuele Locatelli fe4c3e2f93 Merge branch 'release/UpdateDisplayStatus01' 2024-06-06 08:19:48 +02:00
Samuele Locatelli 2a93efc1e3 Update calcolo condizioni css 2024-06-06 08:19:29 +02:00
Samuele Locatelli e4bfb2eaa3 Merge tag 'FixLog03' into develop
Fix refresh e rilettura DTO livelli
2024-06-05 19:13:37 +02:00
Samuele Locatelli f59d9b49f5 Merge branch 'release/FixLog03' 2024-06-05 19:13:29 +02:00
Samuele Locatelli c3afb4140e Fix reload dettagli livelli 2024-06-05 19:13:13 +02:00
Samuele Locatelli c731932339 Modifica gestione login/logout da identity 2024-06-05 16:59:04 +02:00
Samuele Locatelli afb4d5d2cc Refresh pagina aggiornato
Inizio gestione base URL rivisitato
riconf visualizzazione x usare dati PlantLevelDTO
2024-06-05 16:23:49 +02:00
Samuele Locatelli 82d167bfef Merge tag 'FixLog02' into develop
Update conf nlog
2024-06-05 09:51:45 +02:00
Samuele Locatelli 6755380008 Merge branch 'release/FixLog02' 2024-06-05 09:51:37 +02:00
Samuele Locatelli 7e5ad0279f Fix gestione NLog 2024-06-05 09:51:20 +02:00
Samuele Locatelli 4741f98c66 Merge tag 'FixLog01' into develop
update conf NLog in prod + update indice da migration
2024-06-05 09:44:57 +02:00
Samuele Locatelli 6eb8e8c55d Merge branch 'release/FixLog01' 2024-06-05 09:43:17 +02:00
Samuele Locatelli ea2d912e05 Fix loglevel: ready x install 2024-06-05 09:37:02 +02:00
Samuele Locatelli 6bbc8b6fa0 Update livello minimo log a debug 2024-06-04 17:53:00 +02:00
Samuele Locatelli 14fb396c00 Aggiunta migrazione con indice doppio x PlantLog 2024-06-04 17:52:54 +02:00
Samuele Locatelli f9068995a8 Completata review gestione file conf x log 2024-06-04 12:21:57 +02:00
Samuele Locatelli c64efc5aca Modifica gestione NLog:
- test senza file esterno ma da codice (così da distinguere Debug/Release...)
- test deploy ps1
2024-06-04 12:18:48 +02:00
Samuele Locatelli eee32daf4b Bozza indice x dt + plantlog 2024-06-03 20:15:50 +02:00
Samuele Locatelli 1d1112cc46 Merge tag 'StartFixRecalcDto04' into develop
Ancora spostamento metodi a + semplici x check plant
2024-06-03 19:49:58 +02:00
Samuele Locatelli 11570f93f8 Merge branch 'release/StartFixRecalcDto04' 2024-06-03 19:49:46 +02:00
Samuele Locatelli 17f24c9209 Ancora update x diminuire num chiamate necessarie 2024-06-03 19:49:29 +02:00
Samuele Locatelli 3eb27c942a Merge tag 'StartFixRecalcDto03' into develop
Modifica modello migrazione con veto a tempo esplicito
2024-06-03 19:31:06 +02:00
Samuele Locatelli e6dcfc2ca2 Merge branch 'release/StartFixRecalcDto03' 2024-06-03 19:30:53 +02:00
Samuele Locatelli 6c3ea45bea Altra modifica veto ricalcolo 2024-06-03 19:30:39 +02:00
Samuele Locatelli 9c729c678f Merge tag 'StartFixRecalcDto02' into develop
Aggiunta cache ultrafast di tipo semaforico x ricalcolo
2024-06-03 19:08:06 +02:00
Samuele Locatelli 6e0f4b1fed Merge branch 'release/StartFixRecalcDto02' 2024-06-03 19:07:55 +02:00
Samuele Locatelli 26bf86bcab Modifica logica cache attesa rilettura x DTO 2024-06-03 19:07:38 +02:00
Samuele Locatelli d58e41ba06 Merge tag 'StartFixRecalcDto01' into develop
Inizio modifica condizioni ricalcolo DTO x minimizzare carico DB al
cambio ora
2024-06-03 17:49:51 +02:00
Samuele Locatelli 227e17aa35 Merge branch 'release/StartFixRecalcDto01' 2024-06-03 17:49:37 +02:00
Samuele Locatelli 65c7ec3863 Update x lettura ottimizzata dati DTO (no index su migration x ora...) 2024-06-03 17:49:08 +02:00
Samuele Locatelli a086b3cdcd Merge tag 'AddDbMigrationTabCount01' into develop
Aggiunta migrazione ok in test x GWMS
2024-04-18 16:46:54 +02:00
Samuele Locatelli 1ca0a4737c Merge branch 'release/AddDbMigrationTabCount01' 2024-04-18 16:46:45 +02:00
Samuele Locatelli 46854b969f Update log x gestione update DB 2024-04-18 16:41:25 +02:00
Samuele Locatelli 341029019f Rimsso anche migrazione identity 2024-04-18 16:30:17 +02:00
Samuele Locatelli 82eea1eb0b Inizio re-adding DbSetCount 2024-04-18 13:04:53 +02:00
Samuele Locatelli ce5fc70204 Merge tag 'RemDbSEtCountTable' into develop
Rimozione tab DbSetCount creata x errore in UserIdentityContext
2024-04-11 18:00:22 +02:00
Samuele Locatelli ead61e3e16 Merge branch 'release/RemDbSEtCountTable' 2024-04-11 18:00:00 +02:00
Samuele Locatelli bd80c01404 Refresh per test in ufficio 2024-04-11 17:59:18 +02:00
Samuele Locatelli fd0356bae4 GWMS:
- aggiunta migrazione x rimuovere tab DbSetCount creata x errore
- fix dim nvarchar(255) vari
2024-04-11 17:59:06 +02:00
Samuele Locatelli 2655dfcb41 Merge tag 'FixLayoutReload01' into develop
Fix layout relaod blazor js
2024-02-19 19:53:17 +01:00
Samuele Locatelli 0690754a58 Merge branch 'release/FixLayoutReload01' 2024-02-19 19:53:04 +01:00
Samuele Locatelli 32ab150dda Fox layout home reload 2024-02-19 19:52:41 +01:00
Samuele Locatelli 4e3d8f79ef Merge tag 'FixMainCiCd01' into develop
Fix ci/cd x main con restore soluzione esplicito
2024-02-19 15:24:27 +01:00
Samuele Locatelli 4976afeb8e Merge branch 'release/FixMainCiCd01' 2024-02-19 15:24:16 +01:00
Samuele Locatelli 5e954f6cf6 fix CI/CD di MAIN 2024-02-19 15:23:53 +01:00
Samuele Locatelli f7b8f394a5 Merge tag 'UpdateLayoutReload01' into develop
Update base layout x reload page
2024-02-19 14:33:23 +01:00
Samuele Locatelli 4c1577fa8e Merge branch 'release/UpdateLayoutReload01' 2024-02-19 14:32:55 +01:00
Samuele Locatelli 3c88852245 Update base page x reload 2024-02-19 14:32:07 +01:00
Samuele Locatelli 7de72d3bf8 Merge tag 'AddParamLimitCheck01' into develop
Fix controllo parametri inviato in range ammissibile
2023-09-05 14:01:27 +02:00
Samuele Locatelli 21139721b8 Merge branch 'release/AddParamLimitCheck01' 2023-09-05 14:01:11 +02:00
Samuele Locatelli b76c7de6f9 Fix paginatore (hoard coded) 2023-09-05 13:23:47 +02:00
Samuele Locatelli 45f17da3d7 codemaid su classe GWMSDataService 2023-09-05 13:12:19 +02:00
Samuele Locatelli 430ac3373c refresh vari 2023-09-05 13:11:53 +02:00
Samuele Locatelli b6bb9a93d6 SendParam:
- aggiunto controlo parametro calcolato (ammissibile SOLO tra min/max)
2023-09-05 13:11:18 +02:00
Samuele Locatelli 0c014e5bcf YAML:
- rimozione stage test inutilizzato che da errori
2023-05-16 18:33:05 +02:00
Samuele Locatelli 5d24a718ca Merge tag 'AddVendutoOnStorico01' into develop
Aggiunto qta venduto in storico + fix typo vari
2023-05-16 18:28:50 +02:00
Samuele Locatelli dc4b4e016e Merge branch 'release/AddVendutoOnStorico01' 2023-05-16 18:28:32 +02:00
Samuele Locatelli b8edda48d3 - vari typo
- updsate display venduto in storico
2023-05-16 18:28:04 +02:00
Samuele Locatelli d1f0264e7d Aggiunta calcolo qta venduta in DTO LevelSummary 2023-05-16 18:27:10 +02:00
Samuele Locatelli 246ba5c3f4 refresh vers number 2023-01-26 15:06:24 +01:00
Samuele Locatelli 62856f93cc Merge tag 'FixGenOrdini' into develop
Update condizione generazione ordini
2023-01-26 11:47:08 +01:00
Samuele Locatelli bf35260327 Merge branch 'release/FixGenOrdini' 2023-01-26 11:46:58 +01:00
Samuele Locatelli 9bad2a2f27 Cambio condizione generaizone ordini:
- ignora ordini eventualmente mal creati (ordine > inizio fill)
2023-01-26 11:46:38 +01:00
Samuele Locatelli f19ff17228 Merge tag 'AddPiz10Img' into develop
Agfgiunta img temporanea x PIZ10 + alcuni aggiustamenti in home
2022-12-12 18:34:15 +01:00
Samuele Locatelli 84d933e17c Merge branch 'release/AddPiz10Img' 2022-12-12 18:33:54 +01:00
Samuele Locatelli d66d328468 Minor fix grafici 2022-12-12 18:32:34 +01:00
Samuele Locatelli 8c5f032194 Merge branch 'develop' 2022-12-12 18:15:16 +01:00
Samuele Locatelli d204b0d211 Aggiunta copia impianto PIZ09 --> PIZ10 2022-12-12 18:15:08 +01:00
Samuele Locatelli 3f01132a72 Merge tag 'UpdatePlantStatusLayout' into develop
Update x nuovo display a 6 blocchi x PlantStatus
2022-12-12 18:14:48 +01:00
Samuele Locatelli 88f05d72e7 Merge branch 'release/UpdatePlantStatusLayout' 2022-12-12 18:13:54 +01:00
Samuele Locatelli ec0fc6c697 Riorganizzazione scheda plant x 6 impianti 2022-12-12 18:11:44 +01:00
Samuele Locatelli d672979655 Merge tag 'UpdateSmtpAddress' into develop
Update account invio email
2022-06-21 09:06:44 +02:00
Samuele Locatelli 1a4387f2ad Merge branch 'release/UpdateSmtpAddress' 2022-06-21 09:06:35 +02:00
marco.locatelli@steamware.net b7495e4f13 Cambio da gmail ad outlook per invio notifiche 2022-06-20 17:57:19 +02:00
Samuele Locatelli 1f9dcbd773 Merge tag 'UpdateIconsAndGraph' into develop
Fix icona e buttons vari
2022-03-11 08:58:28 +01:00
Samuele Locatelli ba0a82b7ee Merge branch 'release/UpdateIconsAndGraph' 2022-03-11 08:58:16 +01:00
Samuele Locatelli c2c088e33b Merge remote-tracking branch 'origin/develop' into develop 2022-03-11 08:57:52 +01:00
marco.locatelli@steamware.net 34a144e688 Update nuova icona SVG bianca 2022-03-08 18:10:35 +01:00
marco.locatelli@steamware.net d6668f467e Update nuove icone Egalware 2022-03-08 17:28:34 +01:00
marco.locatelli@steamware.net 5bf2c194ca Correzione - Href to Button in Index 2022-03-08 11:37:02 +01:00
Samuele Locatelli bcaca9e7cf Merge tag 'UpdateDotNet6' into develop
Aggiornamento globale a dotNet6
2022-03-02 15:46:19 +01:00
Samuele Locatelli 40662a80a2 Merge branch 'release/UpdateDotNet6' 2022-03-02 15:46:04 +01:00
marco.salvi 1b3c581357 Modifica target framework per passaggio net6.0 2022-03-02 11:53:52 +01:00
marco.salvi 36c33aa5c9 Modifica campo data scheda trasportatore 2022-03-02 10:50:48 +01:00
Samuele Locatelli f1965d4253 Fix altre componenti base 2022-03-01 18:47:59 +01:00
Samuele Locatelli 45f7f1d4e4 Fix display grafico + date storico impianto 2022-03-01 18:40:49 +01:00
Samuele Locatelli 0728b898eb Fix prima apgina stato impianti con net6 2022-03-01 17:20:53 +01:00
Samuele Locatelli 5bdd97b722 Fixed display x chart vari 2022-03-01 16:04:23 +01:00
Samuele Locatelli 66ea0e4f82 Primo update globale componenti x net6 2022-03-01 15:15:35 +01:00
Samuele Locatelli c6cb60b1d1 Inizio porting net6 2022-03-01 14:36:30 +01:00
Samuele Locatelli 541a1a22e3 Merge tag 'updateColorStatus' into develop
Fix colore verde --> blu
2022-02-18 09:14:31 +01:00
Samuele Locatelli 7579dcc7ec Merge branch 'release/updateColorStatus' 2022-02-18 09:14:09 +01:00
marco.locatelli@steamware.net 6ad8c5b4bd nuovo minor fix colori (tolto verde acceso) 2022-02-17 12:51:52 +01:00
Samuele Locatelli dd96869f7c Merge tag 'Fix_setObjItems' into develop
Update procedura setObjItems
2022-02-17 11:17:38 +01:00
Samuele Locatelli f91d2086a4 Merge branch 'release/Fix_setObjItems' 2022-02-17 11:17:13 +01:00
Samuele Locatelli ce577e3427 Merge remote-tracking branch 'origin/develop' into develop 2022-02-17 11:16:10 +01:00
Samuele Locatelli 3dd1128c5f refresh 2022-02-17 11:16:01 +01:00
Samuele Locatelli 774215368c fix set taskType x errore avvio IOB GWMS 2022-02-17 11:15:57 +01:00
marco.locatelli@steamware.net cfdd308c84 minifix UX - colors 2022-02-16 16:45:34 +01:00
Samuele Locatelli 1eac43bf65 Merge tag 'FixDisplayBarraLivello' into develop
Fix display barra livello + fix menu top
2022-02-15 11:50:18 +01:00
Samuele Locatelli 4fae5108d8 Merge branch 'release/FixDisplayBarraLivello' 2022-02-15 11:50:07 +01:00
Samuele Locatelli a1e0552cfd Merge remote-tracking branch 'origin/develop' into develop 2022-02-15 11:49:37 +01:00
Samuele Locatelli f1b1b2de74 refresh 2022-02-15 11:48:41 +01:00
Samuele Locatelli 599ff6aaba Semplificaizone menù top 2022-02-15 11:48:25 +01:00
marco.locatelli@steamware.net 7b833a6383 fix list-group + ordinamento corretto navigazione 2022-02-14 14:53:07 +01:00
Samuele Locatelli b457ed905f refresh vers 2022-02-09 19:06:11 +01:00
Samuele Locatelli ace3f1062f cleanup & refactor codice 2022-02-09 19:06:05 +01:00
Samuele Locatelli 073ebcaf41 Merge tag 'FixCalcoloVenduto' into develop
Fix calcolo venduto
2022-02-03 10:03:37 +01:00
Samuele Locatelli 29ead2e26c Merge branch 'release/FixCalcoloVenduto' 2022-02-03 10:03:28 +01:00
Samuele Locatelli d88f2a5d12 Merge branch 'testProd' into develop 2022-02-03 10:03:09 +01:00
Samuele Locatelli 9243321336 refresh 2022-02-03 10:03:05 +01:00
Samuele Locatelli 45a2d1aa81 Fix calcolo venduto x dati mancanti gg 2022-02-03 10:02:23 +01:00
Samuele Locatelli cd108c1327 Merge branch 'develop' 2022-02-03 09:46:48 +01:00
Samuele Locatelli c445941aa2 wip x calcolo 2022-02-03 09:46:41 +01:00
Samuele Locatelli d5858dc440 altro fix && --> || x condizioni null 2022-02-03 09:25:40 +01:00
Samuele Locatelli 61a2c5547d Fix controllo valori nulli x livello rilevato 2022-02-03 09:22:17 +01:00
Samuele Locatelli db290137a1 Merge branch 'develop' 2022-02-02 11:04:09 +01:00
marco.locatelli@steamware.net 49a38e1d92 Gestione N-ordini per calcolo venduto 2022-02-02 11:03:27 +01:00
Samuele Locatelli 6eab14cd1d Merge tag 'InclusioneDatiVenduto' into develop
Inclusione dati venduto
2022-02-02 09:22:13 +01:00
Samuele Locatelli a2a0ea66c9 Merge branch 'release/InclusioneDatiVenduto' 2022-02-02 09:22:07 +01:00
Samuele Locatelli 9b8e6be1fa Refresh versione 2022-02-02 09:21:55 +01:00
marco.locatelli@steamware.net a8b04afc04 gestione venduto ieri+oggi 2022-02-01 17:36:45 +01:00
Samuele Locatelli b68464a23e Merge tag 'TraduzioneClaimsRuoli' into develop
Update metodo traduzione claims/valore opzione
2022-01-31 16:21:03 +01:00
Samuele Locatelli 88465c26b9 Merge branch 'release/TraduzioneClaimsRuoli' 2022-01-31 16:20:43 +01:00
Samuele Locatelli 75782c27c0 Update traduzione claims/ruoli 2022-01-31 16:20:14 +01:00
Samuele Locatelli cc2b7cc093 Merge tag 'AddResetCache' into develop
Aggiunta pagina reset cache
2022-01-31 15:17:36 +01:00
Samuele Locatelli d775c44c10 Merge branch 'release/AddResetCache' 2022-01-31 15:17:18 +01:00
Samuele Locatelli 3be9d4ab38 Invalidazione cache su richiesta 2022-01-31 15:16:52 +01:00
Samuele Locatelli 153a5343c2 Merge tag 'FixDefaultOrderSearch' into develop
Sistemazione calcolo trasp/suppl di default
2022-01-31 15:02:03 +01:00
Samuele Locatelli 9d69e407ea Merge branch 'release/FixDefaultOrderSearch' 2022-01-31 15:01:52 +01:00
Samuele Locatelli bcd0e8f0d5 Fix calcolo consegna settimanale 1 = ND 2022-01-31 15:00:58 +01:00
Samuele Locatelli 05f945196e Merge tag 'FixQrCode' into develop
Fix QRCode utenti in .*json
2022-01-26 16:21:06 +01:00
Samuele Locatelli 5f4bb45293 Merge branch 'release/FixQrCode' 2022-01-26 16:20:48 +01:00
marco.locatelli@steamware.net 880f3ecb95 Merge branch 'develop' of https://gitlab.steamware.net/steamware/gwms into develop 2022-01-26 16:17:30 +01:00
marco.locatelli@steamware.net d86464e89d QRcode corretto 2022-01-26 16:16:29 +01:00
Samuele Locatelli d95fca4d47 Merge tag 'FixHomeButtons' into develop
Aggiunta home buttons
2022-01-26 15:48:20 +01:00
Samuele Locatelli 8a5e79597e Merge branch 'release/FixHomeButtons' 2022-01-26 15:48:06 +01:00
marco.locatelli@steamware.net da77586543 Navigazione home page 2022-01-26 15:41:28 +01:00
Samuele Locatelli 8c0b3cea80 Merge tag 'FixQrAndHomeBtn' into develop
Fix gestione url rimando QR + buttons in home
2022-01-26 11:53:52 +01:00
Samuele Locatelli 812a88f781 Merge branch 'release/FixQrAndHomeBtn' 2022-01-26 11:53:38 +01:00
Samuele Locatelli f1508ecb97 Update x link corretto QRCode + button in home 2022-01-26 11:53:04 +01:00
Samuele Locatelli 8d51af5b01 Merge branch 'master' into develop 2022-01-21 12:52:30 +01:00
Samuele Locatelli 4b28b5924e Merge tag 'AddClaimIdTranslation' into develop
Merge gestione pure per ruoli utenti filtrabili
2022-01-21 12:52:21 +01:00
Samuele Locatelli 6d55ecef79 Aggiunta gestione ruolo 2022-01-21 12:51:54 +01:00
Samuele Locatelli 68beb7f6b7 Merge branch 'release/AddClaimIdTranslation' 2022-01-21 12:45:27 +01:00
Samuele Locatelli 74208e7a4b Update: edit utente da selettore supplier/plant/transp a tendina 2022-01-21 12:45:05 +01:00
Samuele Locatelli 8e5a366315 Merge tag 'AddClipboardCopyQRCode' into develop
Aggiunta copia clipboard
2022-01-21 10:20:37 +01:00
Samuele Locatelli c9d2e4528f Merge branch 'release/AddClipboardCopyQRCode' 2022-01-21 10:20:30 +01:00
Samuele Locatelli bb9b89b3e0 Aggiunta copia clipboard + link modificato x prod 2022-01-21 10:18:28 +01:00
Samuele Locatelli c2087179d0 Merge branch 'master' into develop 2022-01-21 10:02:47 +01:00
Samuele Locatelli da4db76f15 Ancora update url con baseAppPath 2022-01-21 10:02:38 +01:00
Samuele Locatelli e0da86f71b Merge branch 'develop' 2022-01-21 09:44:14 +01:00
Samuele Locatelli 637da2dbd7 Update base url da config 2022-01-21 09:44:08 +01:00
Samuele Locatelli de40678633 Merge tag 'AddUserQrcode' into develop
Aggiunta componente display qrcode utente
2022-01-21 09:29:19 +01:00
Samuele Locatelli 03befe8559 Merge branch 'release/AddUserQrcode' 2022-01-21 09:29:08 +01:00
Samuele Locatelli 97c96c6a0c Fix QrcodeDisplay 2022-01-21 09:28:28 +01:00
Samuele Locatelli 718d99d35f test Qrcode Display(KO) 2022-01-21 09:11:45 +01:00
Samuele Locatelli e812d2b076 typo 2022-01-21 09:11:31 +01:00
Samuele Locatelli 925376388b Spostamento classe qr js in file incluso 2022-01-21 09:11:01 +01:00
Samuele Locatelli a320902dbc Completata modifica x login jumper da URL + params 2022-01-21 08:35:23 +01:00
Samuele Locatelli 1de09ad0d6 Migliorata gestione jumper in login 2022-01-20 18:59:04 +01:00
Samuele Locatelli cec1de29e0 Inizio modifica x avere login via URL con id + email... 2022-01-20 18:06:05 +01:00
Samuele Locatelli 82e90f7f63 Merge tag 'UpdateVersatoOrdinato' into develop
Update visualizzazione plant analisys
2022-01-20 16:35:33 +01:00
Samuele Locatelli 91a65a0b62 Merge branch 'release/UpdateVersatoOrdinato' 2022-01-20 16:34:17 +01:00
Samuele Locatelli f63d7ba3ba Update visualizzazione plant analisys x ordini e versato e editing 2022-01-20 16:22:45 +01:00
Samuele Locatelli 74e438aa99 Aggiunta TS Ordinato / Versato nel DTO dei summary livello 2022-01-20 16:22:01 +01:00
Samuele Locatelli 1b9321cef7 Merge tag 'FixConfermaFLog' into develop
Fix conferma esecuzione FLog
2021-12-20 13:09:27 +01:00
Samuele Locatelli 90c446696f Merge branch 'release/FixConfermaFLog' 2021-12-20 13:09:20 +01:00
Samuele Locatelli 0a66fb6895 Update x notifica esecuzione task salvataggio FLOG 2021-12-20 13:08:51 +01:00
Samuele Locatelli ecae528287 Merge tag 'FixCloseScanner' into develop
Fix close scanner
2021-11-25 17:17:25 +01:00
Samuele Locatelli e2276798ed Merge branch 'release/FixCloseScanner' 2021-11-25 17:17:19 +01:00
Samuele Locatelli fce3d154fc Fix close button x scanner QR 2021-11-25 17:17:01 +01:00
Samuele Locatelli a0cd17dd07 Merge tag 'TestCambioXZing' into develop
Update versione stabile con nuova lib XZing
2021-11-25 17:11:35 +01:00
Samuele Locatelli e6d5a4bfe1 Merge branch 'release/TestCambioXZing' 2021-11-25 17:11:23 +01:00
Samuele Locatelli c3d0c9d2d8 COmpleto cambio libreria XZing 2021-11-25 17:10:41 +01:00
Samuele Locatelli cab87ecf63 Test modifica componente XZing 2021-11-25 17:02:39 +01:00
Samuele Locatelli bc1cab41da refresh develop 2021-11-25 15:45:42 +01:00
Samuele Locatelli 9849f28f3f Merge branch 'master' into develop 2021-11-25 15:29:54 +01:00
Samuele Locatelli 33777d7d3e Merge branch 'develop' 2021-11-25 15:29:46 +01:00
Samuele Locatelli d76ab0e115 refresh vers 2021-11-25 15:29:42 +01:00
Samuele Locatelli 18ab7e08ea Refresh versione 2021-11-25 15:29:28 +01:00
Samuele Locatelli ac0c14817c Merge branch 'master' into develop 2021-11-25 14:52:20 +01:00
Samuele Locatelli 8b7908b14a Rimozione completa HEALTHCHECK 2021-11-25 14:52:11 +01:00
Samuele Locatelli fd1453507f Merge branch 'develop' 2021-11-25 14:49:23 +01:00
Samuele Locatelli d2ddab281f uPDATE CLASSE db X TRANSIENT SERVICE 2021-11-25 14:49:17 +01:00
Samuele Locatelli a22d3c1e9d Merge branch 'develop' 2021-11-25 14:34:19 +01:00
Samuele Locatelli 9d8600ee7b Aggiunta semaforo processing in decodifica barcode (x evitare tante chiamate insieme) 2021-11-25 14:34:10 +01:00
Samuele Locatelli c36e7db974 Merge branch 'master' into develop 2021-11-25 13:08:08 +01:00
Samuele Locatelli 9df0aa79d1 Merge branch 'develop' 2021-11-25 13:07:54 +01:00
Samuele Locatelli 6dc3212bc5 update vers 2021-11-25 13:07:49 +01:00
Samuele Locatelli 117dd188d3 Merge branch 'master' into develop 2021-11-25 13:07:30 +01:00
Samuele Locatelli 66992a4d7a Aggiunto ritorno pagine corretto 2021-11-25 13:07:21 +01:00
Samuele Locatelli 0cae56932f Merge branch 'develop' 2021-11-25 12:33:05 +01:00
Samuele Locatelli 75325e7479 Update versione con 2 pagine gas station + load 2021-11-25 12:32:54 +01:00
Samuele Locatelli 538ac1e7fd Merge tag 'FixUserDisplayPagination' into develop
Fix user pagination
2021-11-24 11:04:54 +01:00
Samuele Locatelli 24d395001d Merge branch 'release/FixUserDisplayPagination' 2021-11-24 11:04:46 +01:00
Samuele Locatelli 391d55b7f9 Fix display tutti utenti GWMS 2021-11-24 10:37:12 +01:00
Samuele Locatelli 6df93c020d Merge tag 'FixFavicon' into develop
Fix gestioen favicon con rendering classe parziale + fix
safari/android/iOS
2021-11-12 09:48:44 +01:00
Samuele Locatelli bcbc9ea92c Merge branch 'release/FixFavicon' 2021-11-12 09:48:13 +01:00
Samuele Locatelli 50e29dc0b9 refresh 2021-11-12 09:47:48 +01:00
Samuele Locatelli 0416e5eb1e fix nav menu x home 2021-11-12 09:47:45 +01:00
Samuele Locatelli ac8ff44e16 Fix partial x favicons 2021-11-12 09:47:37 +01:00
Samuele Locatelli 7105323fde componente favicon 2021-11-12 09:36:13 +01:00
Samuele Locatelli d613ac56cf fix gestione favicon 2021-11-12 09:36:06 +01:00
Samuele Locatelli 400d26a989 modifica anche di host 2021-11-11 16:27:03 +01:00
Samuele Locatelli 2b17e0b79f update conf x base path + refresh 2021-11-11 16:18:59 +01:00
Samuele Locatelli a8b1552fe1 update barcode scanner 2021-11-11 15:19:52 +01:00
Samuele Locatelli b354ff3c59 update pacchetto barcodescanner 2021-11-11 15:18:54 +01:00
Samuele Locatelli 61dd35311d fix html come iniziale x sito 2021-11-11 13:01:23 +01:00
Samuele Locatelli 8c15c33533 test modifica host 2021-11-11 12:39:50 +01:00
Samuele Locatelli 1c27e4b550 Merge tag 'fixStr2doubleValConvLog' into develop
fix conversione string --> double x valore PlantLog
2021-11-11 09:24:19 +01:00
Samuele Locatelli eb1e301d5f Merge branch 'release/fixStr2doubleValConvLog' 2021-11-11 09:24:05 +01:00
Samuele Locatelli c0c26c8d7a refresh vers 2021-11-11 09:23:37 +01:00
Samuele Locatelli 3c94b7453a Aggiunto immagine plant Guardamiglio 2021-11-11 09:23:34 +01:00
Samuele Locatelli 36f495a1dc Fix ed unificazione conversione string2double 2021-11-11 09:23:20 +01:00
Samuele Locatelli 5fdf7e4253 Aggiunta img x 5° impianto + setup seed con guardamiglio 2021-11-04 17:44:23 +01:00
Samuele Locatelli 0fa063d803 Merge tag 'FixStatusPAge' into develop
Fix status page display + refresh + lento
2021-11-04 10:32:20 +01:00
Samuele Locatelli fab87251b7 Merge branch 'release/FixStatusPAge' 2021-11-04 10:32:01 +01:00
Samuele Locatelli e6e68951e9 refresh parametri 2021-11-04 10:31:45 +01:00
Samuele Locatelli 35ffe90e75 Update pagina overview refresh e display piccoli 2021-11-04 10:31:40 +01:00
Samuele Locatelli a69ee64671 Merge tag 'ReloadStatusPage' into develop
Aggiunta reload in main status page
2021-11-03 19:29:05 +01:00
Samuele Locatelli 720a171600 Merge branch 'release/ReloadStatusPage' 2021-11-03 19:28:56 +01:00
Samuele Locatelli e136c48dd2 Reload pagina anche su PlantStatus 2021-11-03 19:28:35 +01:00
Samuele Locatelli 67b6a5e6c2 Merge tag 'FixGetMemConf' into develop
Fix metodo salvataggio conf memoria con MEDIANA
2021-11-03 19:11:59 +01:00
Samuele Locatelli 15d393584e Refresh 2021-11-03 19:11:14 +01:00
Samuele Locatelli ab8ff5dea1 FIX enum x func mediana in calcolo VC 2021-11-03 19:11:05 +01:00
Samuele Locatelli 469de5dde1 Merge branch 'develop' 2021-11-03 17:38:53 +01:00
Samuele Locatelli 811af16935 Merge tag 'FixDisplayOrdini' into develop
Update display ordini + allarmi
2021-11-03 17:07:51 +01:00
Samuele Locatelli 758c2382e4 Merge branch 'release/FixDisplayOrdini' 2021-11-03 17:07:43 +01:00
Samuele Locatelli 96ce5f8b60 Update x fix invio email allarmi 2021-11-03 17:07:03 +01:00
Samuele Locatelli fa8203bd44 Merge branch 'master' into develop 2021-11-02 16:05:57 +01:00
Samuele Locatelli b190113d13 refresh 2021-11-02 16:05:40 +01:00
Samuele Locatelli 810c0790bd refresh 2021-11-02 16:04:18 +01:00
Samuele Locatelli c17eec87d1 Merge remote-tracking branch 'origin/develop' into develop 2021-11-02 16:03:53 +01:00
Samuele Locatelli f507574bb0 refresh 2021-11-02 16:02:44 +01:00
Samuele Locatelli a06d87ee90 Display qta caricata effettiva in lista storico 2021-11-02 16:02:41 +01:00
Samuele E. Locatelli 55162f3788 Merge tag 'SendAlarmVariations' into develop
Aggiunta invio email post registrazione log allarmi
2021-10-30 17:10:40 +02:00
Samuele E. Locatelli 97e25c7b74 Merge branch 'release/SendAlarmVariations' 2021-10-30 17:10:21 +02:00
Samuele E. Locatelli e22b35eae8 refresh 2021-10-30 17:09:50 +02:00
Samuele E. Locatelli 04123158d4 Aggiunta invio email post log allarmi (2 test!) 2021-10-30 17:09:47 +02:00
Samuele Locatelli cde398efdb Merge tag 'FixOrderStationLoad' into develop
Fix pagina caricamento ordini con QRCode scanner
2021-10-30 10:04:38 +02:00
Samuele Locatelli f3980a9aa8 Merge branch 'release/FixOrderStationLoad' 2021-10-30 10:04:22 +02:00
Samuele Locatelli a63ab90026 Completata review e fix pagina stazione 2021-10-30 10:03:59 +02:00
Samuele Locatelli 2eb97a8300 ancora code cleanup 2021-10-30 10:00:15 +02:00
Samuele Locatelli 5c73f921b5 Modifiche pagina stazione x evitare problema load 2021-10-30 09:55:53 +02:00
Samuele Locatelli dc1232f6ba RImozione pagina load (inutile x nuovo flusso) 2021-10-30 09:55:41 +02:00
Samuele Locatelli 8fc515b94e Merge tag 'FixDisplayChartBackward' into develop
fix calcolo decimazione grafico
2021-10-29 17:18:21 +02:00
Samuele Locatelli 97b4f9b12e Merge branch 'release/FixDisplayChartBackward' 2021-10-29 17:18:15 +02:00
Samuele Locatelli 6f743950c2 fix decimazione record grafici backward 2021-10-29 17:17:50 +02:00
Samuele Locatelli 218e7eab5e Merge tag 'FixDisplayCarico' into develop
Fix display smat + pagina elenco ordini
2021-10-29 17:01:33 +02:00
Samuele Locatelli 47fe7dbe3d Merge branch 'release/FixDisplayCarico' 2021-10-29 17:01:22 +02:00
Samuele Locatelli c8f817a2dc Fix resyle x grafica SMART device 2021-10-29 16:58:09 +02:00
Samuele Locatelli 74a3551b5e Aggiunta colonna distinta variazione/confermato 2021-10-29 16:17:58 +02:00
Samuele Locatelli 2eeb00a751 Merge tag 'AlarmDecoded01' into develop
Update ordinamento (refresh x forzare)
2021-10-28 17:51:25 +02:00
Samuele Locatelli 1b29546a89 Merge branch 'release/AlarmDecoded01' 2021-10-28 17:51:02 +02:00
Samuele Locatelli 40deea8938 Cambio button reset --> refresh 2021-10-28 17:50:45 +02:00
Samuele Locatelli 42c3d9b4e4 Merge tag 'AlarmDecoded' into develop
Fix ricezione allarmi decodificati
2021-10-28 17:28:19 +02:00
Samuele Locatelli 34a19d89c2 Merge branch 'release/AlarmDecoded' 2021-10-28 17:28:11 +02:00
Samuele Locatelli 46b611b930 COmpletata review x caricamento allarmi con traduzione 2021-10-28 17:27:49 +02:00
Samuele Locatelli f2e0d4084f Merge tag 'AlarmLogPage' into develop
Fix pagina display allarmi
2021-10-28 15:57:36 +02:00
Samuele Locatelli 75aec43ec0 Merge branch 'release/AlarmLogPage' 2021-10-28 15:57:21 +02:00
Samuele Locatelli 8819993161 Completata review pagina display allarmi 2021-10-28 15:56:45 +02:00
Samuele Locatelli 2de0c7e215 Init display allarmi 2021-10-28 15:33:21 +02:00
Samuele Locatelli ef3260224f Fix ridenominazione colonna allarmi 2021-10-28 15:33:13 +02:00
Samuele Locatelli 13e447d3d9 Merge tag 'AlarmLogInsertDraft' into develop
Draft registrazione allarmi
2021-10-28 12:59:46 +02:00
Samuele Locatelli 477e67f6f3 Merge branch 'release/AlarmLogInsertDraft' 2021-10-28 12:59:38 +02:00
Samuele Locatelli 6a7cb4aaa8 Update registrazione allarmi GWMS 2021-10-28 12:59:06 +02:00
Samuele Locatelli 2ac3f3a0a6 aggiunta migration x log allarmi 2021-10-28 12:29:06 +02:00
Samuele Locatelli 07062f6c60 Aggiunta classe DB x log allarmi 2021-10-28 12:28:58 +02:00
Samuele Locatelli e18c30e50c Merge tag 'SetParametersSend' into develop
Fix setup invio parametri programmato + check
2021-10-28 12:11:06 +02:00
Samuele Locatelli af443c3796 Merge branch 'release/SetParametersSend' 2021-10-28 12:10:53 +02:00
Samuele Locatelli f9fc315451 refresh procedura set send parametri 2021-10-28 12:10:15 +02:00
Samuele Locatelli 5e195207ff COmpletata gestione abilitazione send parametri 2021-10-28 11:43:11 +02:00
Samuele Locatelli 7564fda672 Update metodi x refresh typo 2021-10-27 19:29:59 +02:00
Samuele Locatelli a52ee34f4f migrazioni update x gestione parameteres send 2021-10-27 19:29:40 +02:00
Samuele Locatelli f1e44513ba Aggiunta classi x gestione tab ParamSend 2021-10-27 19:29:30 +02:00
Samuele Locatelli ba42ebdf49 Merge tag 'SetParametersCurve' into develop
Fix procedura setup parametri
2021-10-27 17:48:27 +02:00
Samuele Locatelli eff6394308 Merge branch 'release/SetParametersCurve' 2021-10-27 17:48:20 +02:00
Samuele Locatelli c3da657b26 Update gestione setup parametri a scadenza 2021-10-27 17:47:56 +02:00
Samuele Locatelli 26bf1c3017 Abbozzo gestione schedulazione parametri 2021-10-27 11:49:15 +02:00
Samuele Locatelli 9a659b15f5 Aggiunta a controlli metodi CRUD x ParamSet 2021-10-27 11:31:25 +02:00
Samuele Locatelli 1fef63cad5 refresh paramset 2021-10-27 11:15:21 +02:00
Samuele Locatelli bf1650a9a4 Modifica migrationx gestione ParamSet (mancavano dati PLANT e UID parametro) 2021-10-27 11:15:10 +02:00
Samuele Locatelli f16e08852b Aggiunta migrazione ParamSet 2021-10-27 11:11:31 +02:00
Samuele Locatelli 32d87212da Modifica modelli: aggiunto ParamSet 2021-10-27 11:11:21 +02:00
Samuele Locatelli fc61a411e7 Modifica comportamento update parametro singolo 2021-10-27 11:01:27 +02:00
Samuele Locatelli bba7f2f149 Merge tag 'ParamDisplay' into develop
Fix display parametri
2021-10-27 09:53:15 +02:00
Samuele Locatelli 627317bb8e Merge branch 'release/ParamDisplay' 2021-10-27 09:53:05 +02:00
Samuele Locatelli 7b353b1817 refresh controller 2021-10-27 09:52:46 +02:00
Samuele Locatelli c8619473c2 fix ricezione parametri 2021-10-27 09:52:41 +02:00
Samuele Locatelli 36c29fd79f update display UM 2021-10-27 09:52:18 +02:00
Samuele Locatelli 250ca6c169 Merge tag 'PlantOrderMan01' into develop
Fix procedura inizio/fine carico GNL
2021-10-26 15:06:53 +02:00
Samuele Locatelli 9e393cdff1 Fix order update da EFCore x inizio/fine carico impianto 2021-10-26 15:06:16 +02:00
Samuele Locatelli 8a255be19f Merge branch 'develop' 2021-10-26 14:18:35 +02:00
Samuele Locatelli 93c1624430 ulteriore fix x livello 2021-10-26 14:17:47 +02:00
Samuele Locatelli 79390e544e Merge tag 'FixLevelComeca' into develop
Fix gestione livello x comeca
2021-10-26 14:05:46 +02:00
Samuele Locatelli d0f2e21061 Merge branch 'hotfix/FixLevelComeca' 2021-10-26 14:05:39 +02:00
Samuele Locatelli 51a037cd74 refresh 2021-10-26 14:05:31 +02:00
Samuele Locatelli 05fff8d7ca Aggiunta conf x UM opzionale + refresh 2021-10-26 14:04:40 +02:00
Samuele Locatelli 9e54f037f5 fix conversione stringa con "," x siemensComeca 2021-10-26 14:04:26 +02:00
Samuele Locatelli 4647663cc0 Merge tag 'ParamEditTest03' into develop
Add reload timer su pagina parametri
2021-10-25 17:22:42 +02:00
Samuele Locatelli fee0faf8da Merge branch 'release/ParamEditTest03' 2021-10-25 17:22:28 +02:00
Samuele Locatelli 6ce1c6a227 Aggiunta timer reload parametri 2021-10-25 17:22:11 +02:00
Samuele Locatelli 881972d469 Merge tag 'ParamEditTest02' into develop
Aggiunta eliminazione parametri "orfani"
2021-10-25 16:44:00 +02:00
Samuele Locatelli c857126fa3 Merge branch 'release/ParamEditTest02' 2021-10-25 16:43:45 +02:00
Samuele Locatelli 78c8e78caa Update eliminazione parametri (da testare) 2021-10-25 16:43:32 +02:00
Samuele Locatelli 7f4a678b94 Merge tag 'ParamEditTest' into develop
Beta gestione edit parametri
2021-10-25 10:29:52 +02:00
Samuele Locatelli da1aa7c008 Merge branch 'release/ParamEditTest' 2021-10-25 10:29:41 +02:00
Samuele Locatelli 3b3756603c completo pagina prameterEdit 2021-10-25 10:29:11 +02:00
Samuele Locatelli 63e60a82a7 aggiunta componente editing parametri 2021-10-25 10:29:03 +02:00
Samuele Locatelli ea056ea089 Fix livello gestioen dati cache redis 2021-10-25 10:28:54 +02:00
Samuele E. Locatelli 7bef5e6154 Merge branch 'feature/AddParametersPage' into develop 2021-10-23 19:15:41 +02:00
Samuele E. Locatelli 02f072dc6c Completata prima release visualizzazione parametri 2021-10-23 19:15:16 +02:00
Samuele E. Locatelli dcfd321b37 Continuo setup preliminare pagina parametri 2021-10-23 19:03:55 +02:00
Samuele E. Locatelli 6fb3ed9664 refresh 2021-10-23 18:38:59 +02:00
Samuele E. Locatelli f4472a9ead Aggiunta preliminare pagina parametri impianto 2021-10-23 18:38:51 +02:00
Samuele Locatelli a25c38ed19 Merge tag 'TaskParFunc' into develop
COmpletata scrittura metodi IOB in GWMS x gestioen aprametri (quali
legge/scrive e infrastruttura x invio)
2021-10-22 19:38:30 +02:00
Samuele Locatelli ae583786dc Merge branch 'release/TaskParFunc' 2021-10-22 19:37:24 +02:00
Samuele Locatelli 7cc76b5fa6 code refactor 2021-10-22 19:35:16 +02:00
Samuele Locatelli 541cbb8dd2 Ottimizzazioni varie e fix codice async/await 2021-10-22 19:33:59 +02:00
Samuele Locatelli 42b2ca1159 Completata review metodo DB/Redis/Controller IOB x gestione parametri/Task 2021-10-22 19:20:09 +02:00
Samuele Locatelli c72864563c Completata review controller IOB x metodi necessari a invio parametri 2021-10-22 18:58:11 +02:00
Samuele Locatelli c6735a7dfc Aggiunti metodi add/get/rem Task2Exe x macchina 2021-10-22 16:02:46 +02:00
Samuele Locatelli 069f231bc8 Merge tag 'RemoveLocalUserTable' into develop
Fix rimozione tab users locale
2021-10-22 08:45:18 +02:00
Samuele Locatelli eefaf16541 Merge branch 'release/RemoveLocalUserTable' 2021-10-22 08:45:08 +02:00
Samuele Locatelli 70be2891f0 Update strategia migrazione e check health x rimozione users locali 2021-10-22 08:44:36 +02:00
Samuele Locatelli 8f05d9dd23 Modifica struttura x eliminazione tab utenti non + impiegata + migrazione 2021-10-22 08:44:21 +02:00
Samuele Locatelli 2d3f0c9894 Merge tag 'FixOldUserManFunc' into develop
FIx recupero utenti da IdentityFramework
2021-10-21 19:42:32 +02:00
Samuele Locatelli de9260eb98 Merge branch 'release/FixOldUserManFunc' 2021-10-21 19:42:19 +02:00
Samuele Locatelli 42d83239ef COmpletata review recupero dati utente da IDentityFramework 2021-10-21 19:42:10 +02:00
Samuele Locatelli 7b08668f74 Cambio metodi x recuperare utente da UserIdentity con claims + ruoli 2021-10-21 19:03:51 +02:00
Samuele Locatelli f7dcfc6838 Eliminazione anche di UserEditor 2021-10-21 18:33:16 +02:00
Samuele Locatelli be92e549a2 RImozione pagina UserManager obsoleta 2021-10-21 18:32:27 +02:00
Samuele Locatelli aa342df617 Merge tag 'ChangeRefillLevel' into develop
Livello refill minimo > 399kg
2021-10-21 16:36:19 +02:00
Samuele Locatelli 2344b2a12d Merge branch 'release/ChangeRefillLevel' 2021-10-21 16:36:10 +02:00
Samuele Locatelli 7353d22571 limite x rilievo carico: 399 kg 2021-10-21 16:35:50 +02:00
Samuele Locatelli a320c3b957 Merge tag 'addEmailSend' into develop
Aggiunta gestione invio email 8da testare in prod)
2021-10-21 16:24:33 +02:00
Samuele Locatelli bae8f72946 Merge branch 'release/addEmailSend' 2021-10-21 16:24:17 +02:00
Samuele Locatelli 38e0a5cfe5 Merge remote-tracking branch 'origin/develop' into develop 2021-10-21 16:19:05 +02:00
Samuele Locatelli 108bba2fba MOdifica gestioen check livelli con invio email alla bisogna 2021-10-21 16:16:38 +02:00
Samuele Locatelli 98ea55c07d inserito metodi test invio email 2021-10-21 16:16:27 +02:00
Samuele Locatelli 411442dc14 PAgina test x invio email 2021-10-21 16:16:18 +02:00
Samuele E. Locatelli f9b9bdfbb8 Merge tag 'FixDataInsertOverflow' into develop
Fix Errore dataflow insert orario con loop infinito: errore calcolo nuovi record x arrotondamento al minuto che dava esito FLOOR invece di ceiling e infinite-loop
2021-10-01 19:56:51 +02:00
374 changed files with 58800 additions and 41142 deletions
+17 -19
View File
@@ -6,13 +6,22 @@ variables:
# helper x fix pacchetti nuget da repo locale nexus.steamware.net # helper x fix pacchetti nuget da repo locale nexus.steamware.net
.nuget-fix: &nuget-fix .nuget-fix: &nuget-fix
- | - |
$hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C echo "esecuzione Nuget FIX steps"
if ($hasSource -eq 0) { dotnet nuget list source
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`"" $hasSource = dotnet nuget list source | Select-String -Pattern "Steamware Nexus Proxy"
} else { if (! [String]::IsNullOrWhiteSpace($hasSource)) {
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`"" dotnet nuget remove source "`"Steamware Nexus Proxy`""
} }
echo $hasSource $hasSource = dotnet nuget list source | Select-String -Pattern "Steamware Nexus"
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
dotnet nuget remove source "`"Steamware Nexus`""
}
$hasSource = dotnet nuget list source | Select-String -Pattern "nexus-proxy-v3"
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
dotnet nuget remove source nexus-proxy-v3
}
dotnet nuget add source https://nexus.steamware.net/repository/nuget-group-3/index.json -n "Steamware Nexus" -u nugetUser -p $NEXUS_PASSWD --store-password-in-clear-text
echo "Steamware Nexus Source added"
# helper creazione hash files # helper creazione hash files
.hashBuild: &hashBuild .hashBuild: &hashBuild
@@ -58,7 +67,6 @@ variables:
stages: stages:
- build - build
- test
- installer - installer
- release - release
@@ -72,16 +80,6 @@ build:
script: script:
- dotnet build -p:Configuration=Release GWMS.UI/GWMS.UI.csproj - dotnet build -p:Configuration=Release GWMS.UI/GWMS.UI.csproj
test:
stage: test
tags:
- win
only:
- develop
needs: ["build"]
script:
- dotnet test -p:Configuration=Release GWMS.UI/GWMS.UI.csproj
installer: installer:
stage: installer stage: installer
tags: tags:
@@ -91,8 +89,8 @@ installer:
- master - master
needs: ["build"] needs: ["build"]
before_script: before_script:
# - *nuget-fix - *nuget-fix
# - dotnet restore - dotnet restore GWMS.sln
script: script:
# - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release GWMS.UI/GWMS.UI.csproj -o:publish # - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release GWMS.UI/GWMS.UI.csproj -o:publish
# pubblico solo installer Linux x64: https://docs.microsoft.com/en-us/dotnet/core/deploying/ # pubblico solo installer Linux x64: https://docs.microsoft.com/en-us/dotnet/core/deploying/
+1 -1
View File
@@ -10,7 +10,7 @@
"request": "launch", "request": "launch",
"preLaunchTask": "build", "preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path. // If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/GWMS.UI/bin/Debug/net5.0/GWMS.UI.dll", "program": "${workspaceFolder}/GWMS.UI/bin/Debug/net6.0/GWMS.UI.dll",
"args": [], "args": [],
"cwd": "${workspaceFolder}/GWMS.UI", "cwd": "${workspaceFolder}/GWMS.UI",
"stopAtEntry": false, "stopAtEntry": false,
+1 -1
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
+1 -3
View File
@@ -28,7 +28,7 @@ namespace GWMS.Data
_configuration = configuration; _configuration = configuration;
} }
public AdminContext(DbContextOptions<GWMSContext> options) : base(options) public AdminContext(DbContextOptions<AdminContext> options) : base(options)
{ {
} }
@@ -56,8 +56,6 @@ namespace GWMS.Data
string connString = DbConfig.ADMIN_CONNECTION_STRING; string connString = DbConfig.ADMIN_CONNECTION_STRING;
if (!optionsBuilder.IsConfigured) if (!optionsBuilder.IsConfigured)
{ {
//connString = _configuration.GetConnectionString("GWMS.Data");
//connString = "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;";
var serverVersion = ServerVersion.AutoDetect(connString); var serverVersion = ServerVersion.AutoDetect(connString);
optionsBuilder.UseMySql(connString, serverVersion); optionsBuilder.UseMySql(connString, serverVersion);
} }
@@ -6,7 +6,10 @@ using System.Threading.Tasks;
namespace GWMS.Data namespace GWMS.Data
{ {
public class Constants public class Const
{ {
// classi utilità x cache REDIS dati DB
public const string rKeyConfig = "GWMS";
} }
} }
File diff suppressed because it is too large Load Diff
+45 -1
View File
@@ -27,7 +27,10 @@ namespace GWMS.Data.DTO
public DateTime FillStart { get; set; } = DateTime.Today; public DateTime FillStart { get; set; } = DateTime.Today;
public DateTime FillEnd { get; set; } = DateTime.Today; public DateTime FillEnd { get; set; } = DateTime.Today;
public double DeltaMin { get; set; } = 100; /// <summary>
/// Valore minimo x determinare un carico (399kg)
/// </summary>
public double DeltaMin { get; set; } = 399;
public bool HasRefill public bool HasRefill
{ {
@@ -36,6 +39,13 @@ namespace GWMS.Data.DTO
return (LevelMax > LevelStart + DeltaMin) && ((LevelStart + LevelEnd) > 0); return (LevelMax > LevelStart + DeltaMin) && ((LevelStart + LevelEnd) > 0);
} }
} }
public bool HasExecution
{
get
{
return ExecutionTS.Count > 0;
}
}
public bool HasOrder public bool HasOrder
{ {
get get
@@ -44,7 +54,41 @@ namespace GWMS.Data.DTO
} }
} }
public double QtaOrdinata
{
get
{
double answ = 0;
if (OrderTS.Count > 0)
{
answ = OrderTS.Sum(x => x.ValDouble);
}
return answ;
}
}
public double QtaVersata
{
get
{
double answ = 0;
if (ExecutionTS.Count > 0)
{
answ = ExecutionTS.Sum(x => x.ValDouble);
}
return answ;
}
}
public double QtaVenduta
{
get
{
double answ = LevelStart-LevelEnd + QtaVersata;
return answ;
}
}
public List<TSData> LevelTS { get; set; } = new List<TSData>(); public List<TSData> LevelTS { get; set; } = new List<TSData>();
public List<TSData> ExecutionTS { get; set; } = new List<TSData>();
public List<TSData> OrderTS { get; set; } = new List<TSData>(); public List<TSData> OrderTS { get; set; } = new List<TSData>();
public List<int> OrdersIds { get; set; } = new List<int>(); public List<int> OrdersIds { get; set; } = new List<int>();
+12 -1
View File
@@ -24,7 +24,7 @@ namespace GWMS.Data.DTO
public double LevelAct { get; set; } = 0; public double LevelAct { get; set; } = 0;
public double LevelReorder { get; set; } = 0; public double LevelReorder { get; set; } = 0;
public double OrderQtyStd { get; set; } = 0; public double OrderQtyStd { get; set; } = 0;
public double MidnightQty { get; set; } = 0;
public int LevelRatio public int LevelRatio
{ {
@@ -52,9 +52,20 @@ namespace GWMS.Data.DTO
} }
} }
/// <summary>
/// Storico Livelli
/// </summary>
public List<TSData> LevelTS { get; set; } = new List<TSData>(); public List<TSData> LevelTS { get; set; } = new List<TSData>();
/// <summary>
/// Storico Ordini
/// </summary>
public List<TSData> OrderTS { get; set; } = new List<TSData>(); public List<TSData> OrderTS { get; set; } = new List<TSData>();
/// <summary>
/// Storico Vendite
/// </summary>
public List<TSData> SoldTS { get; set; } = new List<TSData>();
public double TempMax { get; set; } = 40; public double TempMax { get; set; } = 40;
+57
View File
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace GWMS.Data.DatabaseModels
{
/// <summary>
/// Tabella dati Plant (log storico)
/// </summary>
[Table("AlarmLog")]
public class AlarmLogModel
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int AlarmLogId { get; set; }
/// <summary>
/// Data registazione
/// </summary>
public DateTime DtEvent { get; set; } = DateTime.Now;
/// <summary>
/// Impianto di riferimento
/// </summary>
public int PlantId { get; set; }
/// <summary>
/// Indirizzo area memoria allarme
/// </summary>
[MaxLength(50)]
public string MemAddress { get; set; } = "";
/// <summary>
/// Indice nel banco allarmi
/// </summary>
public int Index { get; set; } = 0;
/// <summary>
/// Valore banco allarmi
/// </summary>
public uint Status { get; set; } = 0;
/// <summary>
/// Valore decodificato (opzionale)
/// </summary>
public string ValDecoded { get; set; } = "";
[ForeignKey("PlantId")]
public virtual PlantDetailModel Plant { get; set; }
}
}
@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace GWMS.Data.DatabaseModels
{
/// <summary>
/// Tabella Setup aprametri
/// </summary>
[Table("ParamSend")]
public class ParamSendModel
{
#region Public Properties
/// <summary>
/// Plant di riferimento
/// </summary>
public int PlantId { get; set; } = 0;
/// <summary>
/// Uid parametro
/// </summary>
public string ParamUid { get; set; } = "";
/// <summary>
/// Ultimo invio registrato
/// </summary>
public DateTime LastSend { get; set; } = DateTime.Today.AddDays(-7);
/// <summary>
/// Veto invio programmato
/// </summary>
public DateTime VetoSend { get; set; } = DateTime.Today.AddDays(-7);
/// <summary>
/// Invio automatico abilitato
/// </summary>
public bool enabled { get; set; } = false;
/// <summary>
/// Inizio finestra oraria in cui inviare parametri
/// </summary>
public int windStart { get; set; } = 1;
/// <summary>
/// Fine finestra oraria in cui inviare parametri
/// </summary>
public int windEnd { get; set; } = 2;
#endregion Public Properties
}
}
+40
View File
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace GWMS.Data.DatabaseModels
{
/// <summary>
/// Tabella Setup aprametri
/// </summary>
[Table("ParamSet")]
public class ParamSetModel
{
#region Public Properties
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int ParamSetId { get; set; }
public int PlantId { get; set; } = 0;
public string ParamUid { get; set; } = "";
public DateTime Scadenza { get; set; } = DateTime.Today;
public decimal TargetVal { get; set; } = 0;
[MaxLength(250)]
public string Note { get; set; } = "";
#endregion Public Properties
}
}
@@ -32,18 +32,6 @@ namespace GWMS.Data.DatabaseModels
public double OrderQtyStd { get; set; } = 1000; public double OrderQtyStd { get; set; } = 1000;
//public double LastLevelMax { get; set; } = 0;
//public double PressAct { get; set; } = 0;
//public double PressBHMax { get; set; } = 9999;
//public double PressBHAct { get; set; } = 0;
//public double PressBLMax { get; set; } = 9999;
//public double PressBLAct { get; set; } = 0;
#endregion Public Properties #endregion Public Properties
} }
} }
+1 -1
View File
@@ -20,7 +20,7 @@ namespace GWMS.Data.DatabaseModels
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int PlantDataId { get; set; } public int PlantDataId { get; set; }
public DateTime DtEvent { get; set; } = DateTime.Now; public DateTime DtEvent { get; set; } = DateTime.Now;
/// <summary> /// <summary>
+6 -3
View File
@@ -1,6 +1,8 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -10,13 +12,14 @@ namespace GWMS.Data.DatabaseModels
/// <summary> /// <summary>
/// Classe fake x il conteggio tabelle e check preliminari /// Classe fake x il conteggio tabelle e check preliminari
/// </summary> /// </summary>
[Keyless] [Table("DbSetCounts")]
public class TableCount public class TableCount
{ {
#region Public Properties #region Public Properties
public int Count { get; set; } [Key]
public string TableName { get; set; } public string TableName { get; set; } = "ND";
public int Count { get; set; } = 0;
#endregion Public Properties #endregion Public Properties
} }
+1 -1
View File
@@ -30,7 +30,7 @@ namespace GWMS.Data.DatabaseModels
public double PositionLongitude { get; set; } public double PositionLongitude { get; set; }
public DateTime PositionUpdated { get; set; } = DateTime.Now; public DateTime PositionUpdated { get; set; }
#endregion Public Properties #endregion Public Properties
} }
-64
View File
@@ -1,64 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
namespace GWMS.Data.DatabaseModels
{
/// <summary>
/// Tabella Users
/// </summary>
[Table("Users")]
public class UserModel
{
#region Public Properties
[Key, Column(Order = 0), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int UserId { get; set; }
[Column(Order = 1), MaxLength(50)]
public string UserName { get; set; } = "";
[Column(Order = 1), MaxLength(250)]
public string SaltPasswd { get; set; } = "";
[Column(Order = 3), MaxLength(50)]
public string Lastname { get; set; } = "";
[Column(Order = 4), MaxLength(50)]
public string Firstname { get; set; } = "";
[Column(Order = 5), MaxLength(250)]
public string Email { get; set; } = "";
[Column(Order = 6), MaxLength(10)]
public string Lang { get; set; } = "IT";
[Column(Order = 7), MaxLength(100)]
public string AuthKey { get; set; } = "";
[Column(Order = 8)]
public bool IsActive { get; set; } = true;
[Column(Order = 9)]
public UserLevel Livello { get; set; } = UserLevel.ND;
[Column(Order = 10)]
public int MaskPlantId { get; set; } = 9999;
[Column(Order = 11)]
public int MaskSupplierId { get; set; } = 9999;
[Column(Order = 12)]
public int MaskTranspId { get; set; } = 9999;
#endregion Public Properties
}
}
+4 -6
View File
@@ -1,10 +1,8 @@
using System; using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using NLog; using NLog;
using System;
using System.Linq;
using System.Threading.Tasks;
namespace GWMS.Data namespace GWMS.Data
{ {
+8 -6
View File
@@ -1,9 +1,5 @@
using GWMS.Data.DatabaseModels; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore; using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace GWMS.Data namespace GWMS.Data
@@ -48,17 +44,21 @@ namespace GWMS.Data
public static bool ExecMigrationIdentity() public static bool ExecMigrationIdentity()
{ {
Log.Info($"ExecMigrationIdentity: Start");
// esecuzione migrazione // esecuzione migrazione
var migrateTask = Task.Run(async () => await DbAdmin.migrateDbIdentity()); var migrateTask = Task.Run(async () => await DbAdmin.migrateDbIdentity());
migrateTask.Wait(); migrateTask.Wait();
Log.Info($"ExecMigrationIdentity: Completed");
return migrateTask.Result; return migrateTask.Result;
} }
public static bool ExecMigrationMain() public static bool ExecMigrationMain()
{ {
Log.Info($"ExecMigrationMain: Start");
// esecuzione migrazione // esecuzione migrazione
var migrateTask = Task.Run(async () => await DbAdmin.migrateDbMain()); var migrateTask = Task.Run(async () => await DbAdmin.migrateDbMain());
migrateTask.Wait(); migrateTask.Wait();
Log.Info($"ExecMigrationMain: Completed");
return migrateTask.Result; return migrateTask.Result;
} }
@@ -79,6 +79,8 @@ namespace GWMS.Data
return serverVersion; return serverVersion;
} }
private static Logger Log = LogManager.GetCurrentClassLogger();
#endregion Public Methods #endregion Public Methods
} }
} }
+77 -1
View File
@@ -43,6 +43,77 @@ namespace GWMS.Data
String String
} }
/// <summary>
/// Elenco task ammessi (x IOB-WIN da eseguire...)
/// </summary>
public enum taskType
{
/// <summary>
/// Task nullo / fake
/// </summary>
nihil,
/// <summary>
/// Rimanda a PLC eventuale segnale NON in setup (MA NON RESETTA)
/// </summary>
fixStopSetup,
/// <summary>
/// Indica al PLC di forzare il reset del contapezzi
/// </summary>
forceResetPzCount,
/// <summary>
/// Indica al PLC di forzare il NUOVO valore di contapezzi (impostato come value)
/// </summary>
forceSetPzCount,
/// <summary>
/// Imposta Articolo su PLC
/// </summary>
setArt,
/// <summary>
/// Imposta Commessa su PLC
/// </summary>
setComm,
/// <summary>
/// Set di un PARAMETRO su PLC (in value avremo un JSON object)
/// </summary>
setParameter,
/// <summary>
/// Set Programma CNC su PLC
/// </summary>
setProg,
/// <summary>
/// Indica al PLC di impostare il numero di pezzi da produrre per la commessa (impostato come value)
/// </summary>
setPzComm,
/// <summary>
/// Indica al PLC iniziato setup (e secondo casi ferma contapezzi /resetta)
/// </summary>
startSetup,
/// <summary>
/// Indica al PLC finito setup (e secondo casi ferma contapezzi /resetta)
/// </summary>
stopSetup,
/// <summary>
/// Richiesta invio watchdog a PLC
/// </summary>
sendWatchDogMes2Plc,
/// <summary>
/// Indica che è FINITA la produzione (e quindi cancello dati backup)
/// </summary>
endProd,
}
public enum UserLevel public enum UserLevel
{ {
ND = 0, ND = 0,
@@ -75,6 +146,11 @@ namespace GWMS.Data
/// <summary> /// <summary>
/// Valore minimo del periodo /// Valore minimo del periodo
/// </summary> /// </summary>
MIN MIN,
/// <summary>
/// Calcolo MEDIANA
/// </summary>
MEDIAN
} }
} }
+13 -12
View File
@@ -1,30 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Remove="Controllers\GWMS.Data.DbController.cs" /> <Compile Remove="Controllers\GWMS.Data.DbController.cs" />
<Compile Remove="DatabaseModels\UserModel.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="MailKit" Version="2.15.0" /> <PackageReference Include="MailKit" Version="3.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.10" /> <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.10" /> <PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.10" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.10"> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.2">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.10" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.10" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.10"> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.2">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog" Version="4.7.11" /> <PackageReference Include="NLog" Version="5.3.2" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.1" /> <PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.1" />
</ItemGroup> </ItemGroup>
</Project> </Project>
+16 -22
View File
@@ -1,11 +1,9 @@
using System; using System;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using GWMS.Data.DatabaseModels; using GWMS.Data.DatabaseModels;
using NLog; using NLog;
using System.Linq; using System.Linq;
using GWMS.Data.Controllers;
namespace GWMS.Data namespace GWMS.Data
{ {
@@ -49,6 +47,8 @@ namespace GWMS.Data
public virtual DbSet<RebootLogModel> DbRebootLog { get; set; } public virtual DbSet<RebootLogModel> DbRebootLog { get; set; }
public virtual DbSet<AlarmLogModel> DbSetAlarmLog { get; set; }
public virtual DbSet<ConfigModel> DbSetConfig { get; set; } public virtual DbSet<ConfigModel> DbSetConfig { get; set; }
public virtual DbSet<ItemModel> DbSetItems { get; set; } public virtual DbSet<ItemModel> DbSetItems { get; set; }
@@ -59,6 +59,10 @@ namespace GWMS.Data
public virtual DbSet<OrderModel> DbSetOrders { get; set; } public virtual DbSet<OrderModel> DbSetOrders { get; set; }
public virtual DbSet<ParamSendModel> DbSetParamSend { get; set; }
public virtual DbSet<ParamSetModel> DbSetParamSet { get; set; }
public virtual DbSet<PlantDetailModel> DbSetPlant { get; set; } public virtual DbSet<PlantDetailModel> DbSetPlant { get; set; }
public virtual DbSet<PlantLogModel> DbSetPlantLog { get; set; } public virtual DbSet<PlantLogModel> DbSetPlantLog { get; set; }
@@ -71,8 +75,6 @@ namespace GWMS.Data
public virtual DbSet<TransporterModel> DbSetTransporter { get; set; } public virtual DbSet<TransporterModel> DbSetTransporter { get; set; }
public virtual DbSet<UserModel> DbSetUser { get; set; }
#endregion Public Properties #endregion Public Properties
#region Private Methods #region Private Methods
@@ -86,26 +88,13 @@ namespace GWMS.Data
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{ {
// default // default
string connString = "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;"; string connString = DbConfig.CONNECTION_STRING;
//if (string.IsNullOrEmpty(connString))
// tento setup da config //{
try // connString = "Server=localhost;port=3306;database=GWMS_PZZFRR;user=user_PZZFRR;pwd=pwd_M3T@n0;sslmode=None;";
{ //}
//string server = _configuration["DbConfig:Server"];
//string nKey = _configuration["DbConfig:nKey"];
//string sKey = _configuration["DbConfig:sKey"];
//DbConfig.InitDb(server, nKey, sKey);
//DbConfig.CheckUser(nKey, sKey);
// uso conn string calcolata
connString = DbConfig.CONNECTION_STRING;
}
catch
{ }
if (!optionsBuilder.IsConfigured) if (!optionsBuilder.IsConfigured)
{ {
//connString = "Server=localhost;port=3306;database=GWMS;user=GWMS;pwd=GWMS_secret_pwd;sslmode=None;";
var serverVersion = ServerVersion.AutoDetect(connString); var serverVersion = ServerVersion.AutoDetect(connString);
optionsBuilder.UseMySql(connString, serverVersion); optionsBuilder.UseMySql(connString, serverVersion);
} }
@@ -128,6 +117,11 @@ namespace GWMS.Data
modelBuilder.Entity<PlantStatusModel>().HasKey(c => new { c.PlantId, c.FluxType }); modelBuilder.Entity<PlantStatusModel>().HasKey(c => new { c.PlantId, c.FluxType });
modelBuilder.Entity<ParamSendModel>().HasKey(c => new { c.PlantId, c.ParamUid });
modelBuilder.Entity<PlantLogModel>().HasIndex(c => new { c.PlantId }, "IX_PlantLog_PlantId");
modelBuilder.Entity<PlantLogModel>().HasIndex(c => new { c.PlantId, c.DtEvent }, "IX_PlantLog_PlantDtEv");
modelBuilder.Seed(); modelBuilder.Seed();
OnModelCreatingPartial(modelBuilder); OnModelCreatingPartial(modelBuilder);
+65 -4
View File
@@ -2,9 +2,6 @@
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GWMS.Data namespace GWMS.Data
{ {
@@ -27,7 +24,7 @@ namespace GWMS.Data
/// <summary> /// <summary>
/// Fattore per eventuale divisione (es leggo 1234 --> 12,34 con factor=100) /// Fattore per eventuale divisione (es leggo 1234 --> 12,34 con factor=100)
/// </summary> /// </summary>
public int factor { get; set; } = 1; public decimal factor { get; set; } = 1;
/// <summary> /// <summary>
/// Indice nell'area di memoria (da valore iniziale = 0) /// Indice nell'area di memoria (da valore iniziale = 0)
@@ -65,6 +62,11 @@ namespace GWMS.Data
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(StringEnumConverter))]
public plcDataType tipoMem { get; set; } = plcDataType.Int; public plcDataType tipoMem { get; set; } = plcDataType.Int;
/// <summary>
/// Unità di misura del parametro
/// </summary>
public string unit { get; set; } = "";
/// <summary> /// <summary>
/// Valore parametro (come stringa, decimali con ",", default VUOTO), poi LETTO da PLC (o appena scritto) /// Valore parametro (come stringa, decimali con ",", default VUOTO), poi LETTO da PLC (o appena scritto)
/// </summary> /// </summary>
@@ -191,6 +193,40 @@ namespace GWMS.Data
/// </summary> /// </summary>
public string name { get; set; } = ""; public string name { get; set; } = "";
/// <summary>
/// Wrapper valore richiesto come decimal
/// </summary>
public decimal reqValDec
{
get
{
decimal answ = 0;
decimal.TryParse(reqValue, out answ);
return answ;
}
set
{
reqValue = $"{value}";
}
}
/// <summary>
/// Wrapper valore richiesto come INT
/// </summary>
public int reqValInt
{
get
{
int answ = 0;
int.TryParse(reqValue, out answ);
return answ;
}
set
{
reqValue = $"{value}";
}
}
/// <summary> /// <summary>
/// Indica il NUOVO valore richiesto x l'item /// Indica il NUOVO valore richiesto x l'item
/// </summary> /// </summary>
@@ -201,11 +237,36 @@ namespace GWMS.Data
/// </summary> /// </summary>
public string uid { get; set; } = ""; public string uid { get; set; } = "";
/// <summary>
/// Unità Misura parametro
/// </summary>
public string UM { get; set; }
/// <summary>
/// Valore MASSIMO (SE impostato)
/// </summary>
public double valMax { get; set; }
/// <summary>
/// Valore minimo (SE impostato)
/// </summary>
public double valMin { get; set; }
/// <summary>
/// Ordinamento
/// </summary>
public int displOrdinal { get; set; } = 0;
/// <summary> /// <summary>
/// Valore parametro (come stringa, decimali con ",", default VUOTO), sul CNC/PLC /// Valore parametro (come stringa, decimali con ",", default VUOTO), sul CNC/PLC
/// </summary> /// </summary>
public string value { get; set; } = ""; public string value { get; set; } = "";
/// <summary>
/// Descrizione valore
/// </summary>
public string description { get; set; } = "";
/// <summary> /// <summary>
/// Indica se sia abilitato in scrittura (WRITE) /// Indica se sia abilitato in scrittura (WRITE)
/// </summary> /// </summary>
@@ -0,0 +1,617 @@
// <auto-generated />
using System;
using GWMS.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GWMS.Data.Migrations
{
[DbContext(typeof(GWMSContext))]
[Migration("20211022064058_RemoveLocalUser")]
partial class RemoveLocalUser
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasComment("Descrizione dell'item");
b.Property<int>("ValFloat")
.HasColumnType("int");
b.Property<int>("ValInt")
.HasColumnType("int");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("KeyName");
b.ToTable("AnKeyVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("ValStd")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("Valore di default/riferimento per la variabile");
b.HasKey("KeyName");
b.ToTable("Config");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
{
b.Property<int>("ItemId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ItemCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("ItemDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ItemType")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("UM")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.HasKey("ItemId");
b.ToTable("Items");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
{
b.Property<string>("TabName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("TabName");
b.Property<string>("FieldName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("FieldName");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("Val");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasColumnName("Descript");
b.Property<int>("Ordinal")
.HasColumnType("int")
.HasColumnName("Ordinal");
b.HasKey("TabName", "FieldName", "Val");
b.ToTable("ListVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtETA")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecEnd")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecStart")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtOrder")
.HasColumnType("datetime(6)");
b.Property<double>("ExecutionQty")
.HasColumnType("double");
b.Property<double>("LevelEnd")
.HasColumnType("double");
b.Property<double>("LevelStart")
.HasColumnType("double");
b.Property<string>("OrderCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("OrderDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<double>("OrderQty")
.HasColumnType("double");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("OrderId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("Order");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
{
b.Property<int>("PlantId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("LevelMax")
.HasColumnType("double");
b.Property<double>("LevelReorder")
.HasColumnType("double");
b.Property<double>("OrderQtyStd")
.HasColumnType("double");
b.Property<string>("PlantCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("PlantDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId");
b.ToTable("PlantDetail");
b.HasData(
new
{
PlantId = 1,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ03",
PlantDesc = "Collecchio"
},
new
{
PlantId = 2,
LevelMax = 28000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ04",
PlantDesc = "Noceto"
},
new
{
PlantId = 3,
LevelMax = 24000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ05",
PlantDesc = "Baganzola"
},
new
{
PlantId = 4,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ08",
PlantDesc = "Pilastrello"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.Property<int>("PlantDataId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantDataId");
b.HasIndex("PlantId");
b.ToTable("PlantLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId", "FluxType");
b.ToTable("PlantStatus");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
{
b.Property<int>("RecordId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("Item")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Payload")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("RecordId");
b.ToTable("RebootLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
{
b.Property<int>("SupplierId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("SupplierCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("SupplierDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("SupplierId");
b.ToTable("Supplier");
b.HasData(
new
{
SupplierId = 1,
SupplierCode = "LIQUIGAS",
SupplierDesc = "Liquigas"
},
new
{
SupplierId = 2,
SupplierCode = "VULKANGAS",
SupplierDesc = "Vulkangas"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
{
b.Property<int>("TransporterId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("PositionLatitude")
.HasColumnType("double");
b.Property<double>("PositionLongitude")
.HasColumnType("double");
b.Property<DateTime>("PositionUpdated")
.HasColumnType("datetime(6)");
b.Property<string>("TransporterCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("TransporterDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("TransporterId");
b.ToTable("Transporter");
b.HasData(
new
{
TransporterId = 1,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "LEVO",
TransporterDesc = "Levorato"
},
new
{
TransporterId = 2,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "TRAF",
TransporterDesc = "Traffik"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.Property<int>("WeekPlanId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("DayNum")
.HasColumnType("int");
b.Property<int>("DeliveryHour")
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("WeekPlanId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("WeekPlan");
b.HasData(
new
{
WeekPlanId = 1,
DayNum = 1,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 2,
DayNum = 2,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 3,
DayNum = 3,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 2
},
new
{
WeekPlanId = 4,
DayNum = 4,
DeliveryHour = 15,
Note = "9K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 5,
DayNum = 4,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 6,
DayNum = 6,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 7,
DayNum = 2,
DeliveryHour = 14,
Note = "3K",
PlantId = 3,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 8,
DayNum = 2,
DeliveryHour = 15,
Note = "15K",
PlantId = 4,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 9,
DayNum = 2,
DeliveryHour = 17,
Note = "18K",
PlantId = 1,
SupplierId = 2,
TransporterId = 2
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,98 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace GWMS.Data.Migrations
{
public partial class RemoveLocalUser : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Users");
migrationBuilder.UpdateData(
table: "Transporter",
keyColumn: "TransporterId",
keyValue: 1,
column: "PositionUpdated",
value: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.UpdateData(
table: "Transporter",
keyColumn: "TransporterId",
keyValue: 2,
column: "PositionUpdated",
value: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Users",
columns: table => new
{
UserId = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
AuthKey = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Email = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Firstname = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
Lang = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Lastname = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Livello = table.Column<int>(type: "int", nullable: false),
MaskPlantId = table.Column<int>(type: "int", nullable: false),
MaskSupplierId = table.Column<int>(type: "int", nullable: false),
MaskTranspId = table.Column<int>(type: "int", nullable: false),
SaltPasswd = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UserName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.UserId);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Transporter",
keyColumn: "TransporterId",
keyValue: 1,
column: "PositionUpdated",
value: new DateTime(2021, 8, 9, 16, 36, 52, 691, DateTimeKind.Local).AddTicks(9092));
migrationBuilder.UpdateData(
table: "Transporter",
keyColumn: "TransporterId",
keyValue: 2,
column: "PositionUpdated",
value: new DateTime(2021, 8, 9, 16, 36, 52, 691, DateTimeKind.Local).AddTicks(9470));
migrationBuilder.InsertData(
table: "Users",
columns: new[] { "UserId", "AuthKey", "Email", "Firstname", "IsActive", "Lang", "Lastname", "Livello", "MaskPlantId", "MaskSupplierId", "MaskTranspId", "SaltPasswd", "UserName" },
values: new object[,]
{
{ 1, "th1sIsTh3R1vrOfThNgt98", "samuele@steamware.net", "Samuele", true, "IT", "Locatelli", 1, 0, 0, 0, "", "samuele.locatelli" },
{ 2, "th1sIsTh3R1vrOfThNgt91", "giancarlo@steamware.net", "Giancarlo", true, "IT", "Rottoli", 1, 0, 0, 0, "", "giancarlo.rottoli" },
{ 3, "th1sIsTh3R1vrOfThNgt93", "info@steamware.net", "Steamware", true, "IT", "Admin", 1, 0, 0, 0, "", "steamw.admin" },
{ 4, "th1sIsTh3R1vrOfThNgt97", "a.pizzaferri@pizzaferripetroli.it", "Angelo", true, "IT", "Pizzaferri", 2, 0, 0, 0, "", "angelo.pizzaferri" },
{ 5, "th1sIsTh3R1vrOfThNgt99", "andrei.valeanu@winnlab.it", "Andrei", true, "IT", "Valeanu", 2, 0, 0, 0, "", "andrei.valeanu" },
{ 6, "th1sIsTh3R1vrOfThNgt92", "info@steamware.net", "User", true, "IT", "LIQUIGAS", 4, 0, 1, 0, "", "liquigas.user01" },
{ 7, "th1sIsTh3R1vrOfThNgt94", "info@steamware.net", "User", true, "IT", "VULKANGAS", 4, 0, 2, 0, "", "vulkangas.user01" },
{ 8, "th1sIsTh3R1vrOfThNgt95", "info@steamware.net", "User", true, "IT", "LEVORATO", 4, 0, 0, 1, "", "levorato.user01" },
{ 9, "th1sIsTh3R1vrOfThNgt96", "info@steamware.net", "User", true, "IT", "TRAFFIK", 4, 0, 0, 2, "", "traffik.user01" },
{ 10, "th1sIsTh3R1vrOfThNgt96", "info@steamware.net", "Stazione", true, "IT", "Collecchio", 3, 1, 0, 0, "", "piz03.user01" },
{ 11, "th1sIsTh3R1vrOfThNgt96", "info@steamware.net", "Stazione", true, "IT", "Noceto", 3, 2, 0, 0, "", "piz04.user01" },
{ 12, "th1sIsTh3R1vrOfThNgt96", "info@steamware.net", "Stazione", true, "IT", "Baganzola", 3, 3, 0, 0, "", "piz05.user01" },
{ 13, "th1sIsTh3R1vrOfThNgt96", "info@steamware.net", "Stazione", true, "IT", "Pilastrello", 3, 4, 0, 0, "", "piz08.user01" }
});
}
}
}
@@ -0,0 +1,644 @@
// <auto-generated />
using System;
using GWMS.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GWMS.Data.Migrations
{
[DbContext(typeof(GWMSContext))]
[Migration("20211027091446_ParamSetAdded")]
partial class ParamSetAdded
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasComment("Descrizione dell'item");
b.Property<int>("ValFloat")
.HasColumnType("int");
b.Property<int>("ValInt")
.HasColumnType("int");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("KeyName");
b.ToTable("AnKeyVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("ValStd")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("Valore di default/riferimento per la variabile");
b.HasKey("KeyName");
b.ToTable("Config");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
{
b.Property<int>("ItemId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ItemCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("ItemDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ItemType")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("UM")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.HasKey("ItemId");
b.ToTable("Items");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
{
b.Property<string>("TabName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("TabName");
b.Property<string>("FieldName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("FieldName");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("Val");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasColumnName("Descript");
b.Property<int>("Ordinal")
.HasColumnType("int")
.HasColumnName("Ordinal");
b.HasKey("TabName", "FieldName", "Val");
b.ToTable("ListVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtETA")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecEnd")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecStart")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtOrder")
.HasColumnType("datetime(6)");
b.Property<double>("ExecutionQty")
.HasColumnType("double");
b.Property<double>("LevelEnd")
.HasColumnType("double");
b.Property<double>("LevelStart")
.HasColumnType("double");
b.Property<string>("OrderCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("OrderDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<double>("OrderQty")
.HasColumnType("double");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("OrderId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("Order");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSetModel", b =>
{
b.Property<int>("ParamSetId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ParamUid")
.HasColumnType("longtext");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<DateTime>("Scadenza")
.HasColumnType("datetime(6)");
b.Property<decimal>("TargetVal")
.HasColumnType("decimal(65,30)");
b.HasKey("ParamSetId");
b.ToTable("ParamSet");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
{
b.Property<int>("PlantId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("LevelMax")
.HasColumnType("double");
b.Property<double>("LevelReorder")
.HasColumnType("double");
b.Property<double>("OrderQtyStd")
.HasColumnType("double");
b.Property<string>("PlantCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("PlantDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId");
b.ToTable("PlantDetail");
b.HasData(
new
{
PlantId = 1,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ03",
PlantDesc = "Collecchio"
},
new
{
PlantId = 2,
LevelMax = 28000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ04",
PlantDesc = "Noceto"
},
new
{
PlantId = 3,
LevelMax = 24000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ05",
PlantDesc = "Baganzola"
},
new
{
PlantId = 4,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ08",
PlantDesc = "Pilastrello"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.Property<int>("PlantDataId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantDataId");
b.HasIndex("PlantId");
b.ToTable("PlantLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId", "FluxType");
b.ToTable("PlantStatus");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
{
b.Property<int>("RecordId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("Item")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Payload")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("RecordId");
b.ToTable("RebootLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
{
b.Property<int>("SupplierId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("SupplierCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("SupplierDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("SupplierId");
b.ToTable("Supplier");
b.HasData(
new
{
SupplierId = 1,
SupplierCode = "LIQUIGAS",
SupplierDesc = "Liquigas"
},
new
{
SupplierId = 2,
SupplierCode = "VULKANGAS",
SupplierDesc = "Vulkangas"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
{
b.Property<int>("TransporterId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("PositionLatitude")
.HasColumnType("double");
b.Property<double>("PositionLongitude")
.HasColumnType("double");
b.Property<DateTime>("PositionUpdated")
.HasColumnType("datetime(6)");
b.Property<string>("TransporterCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("TransporterDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("TransporterId");
b.ToTable("Transporter");
b.HasData(
new
{
TransporterId = 1,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "LEVO",
TransporterDesc = "Levorato"
},
new
{
TransporterId = 2,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "TRAF",
TransporterDesc = "Traffik"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.Property<int>("WeekPlanId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("DayNum")
.HasColumnType("int");
b.Property<int>("DeliveryHour")
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("WeekPlanId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("WeekPlan");
b.HasData(
new
{
WeekPlanId = 1,
DayNum = 1,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 2,
DayNum = 2,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 3,
DayNum = 3,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 2
},
new
{
WeekPlanId = 4,
DayNum = 4,
DeliveryHour = 15,
Note = "9K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 5,
DayNum = 4,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 6,
DayNum = 6,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 7,
DayNum = 2,
DeliveryHour = 14,
Note = "3K",
PlantId = 3,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 8,
DayNum = 2,
DeliveryHour = 15,
Note = "15K",
PlantId = 4,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 9,
DayNum = 2,
DeliveryHour = 17,
Note = "18K",
PlantId = 1,
SupplierId = 2,
TransporterId = 2
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,38 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace GWMS.Data.Migrations
{
public partial class ParamSetAdded : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ParamSet",
columns: table => new
{
ParamSetId = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
PlantId = table.Column<int>(type: "int", nullable: false),
ParamUid = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Scadenza = table.Column<DateTime>(type: "datetime(6)", nullable: false),
TargetVal = table.Column<decimal>(type: "decimal(65,30)", nullable: false),
Note = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_ParamSet", x => x.ParamSetId);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ParamSet");
}
}
}
@@ -0,0 +1,672 @@
// <auto-generated />
using System;
using GWMS.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GWMS.Data.Migrations
{
[DbContext(typeof(GWMSContext))]
[Migration("20211027172923_ParamSendTable")]
partial class ParamSendTable
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasComment("Descrizione dell'item");
b.Property<int>("ValFloat")
.HasColumnType("int");
b.Property<int>("ValInt")
.HasColumnType("int");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("KeyName");
b.ToTable("AnKeyVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("ValStd")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("Valore di default/riferimento per la variabile");
b.HasKey("KeyName");
b.ToTable("Config");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
{
b.Property<int>("ItemId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ItemCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("ItemDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ItemType")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("UM")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.HasKey("ItemId");
b.ToTable("Items");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
{
b.Property<string>("TabName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("TabName");
b.Property<string>("FieldName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("FieldName");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("Val");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasColumnName("Descript");
b.Property<int>("Ordinal")
.HasColumnType("int")
.HasColumnName("Ordinal");
b.HasKey("TabName", "FieldName", "Val");
b.ToTable("ListVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtETA")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecEnd")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecStart")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtOrder")
.HasColumnType("datetime(6)");
b.Property<double>("ExecutionQty")
.HasColumnType("double");
b.Property<double>("LevelEnd")
.HasColumnType("double");
b.Property<double>("LevelStart")
.HasColumnType("double");
b.Property<string>("OrderCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("OrderDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<double>("OrderQty")
.HasColumnType("double");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("OrderId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("Order");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSendModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("ParamUid")
.HasColumnType("varchar(255)");
b.Property<DateTime>("LastSend")
.HasColumnType("datetime(6)");
b.Property<DateTime>("VetoSend")
.HasColumnType("datetime(6)");
b.Property<bool>("enabled")
.HasColumnType("tinyint(1)");
b.Property<int>("windEnd")
.HasColumnType("int");
b.Property<int>("windStart")
.HasColumnType("int");
b.HasKey("PlantId", "ParamUid");
b.ToTable("ParamSend");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSetModel", b =>
{
b.Property<int>("ParamSetId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ParamUid")
.HasColumnType("longtext");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<DateTime>("Scadenza")
.HasColumnType("datetime(6)");
b.Property<decimal>("TargetVal")
.HasColumnType("decimal(65,30)");
b.HasKey("ParamSetId");
b.ToTable("ParamSet");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
{
b.Property<int>("PlantId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("LevelMax")
.HasColumnType("double");
b.Property<double>("LevelReorder")
.HasColumnType("double");
b.Property<double>("OrderQtyStd")
.HasColumnType("double");
b.Property<string>("PlantCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("PlantDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId");
b.ToTable("PlantDetail");
b.HasData(
new
{
PlantId = 1,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ03",
PlantDesc = "Collecchio"
},
new
{
PlantId = 2,
LevelMax = 28000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ04",
PlantDesc = "Noceto"
},
new
{
PlantId = 3,
LevelMax = 24000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ05",
PlantDesc = "Baganzola"
},
new
{
PlantId = 4,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ08",
PlantDesc = "Pilastrello"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.Property<int>("PlantDataId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantDataId");
b.HasIndex("PlantId");
b.ToTable("PlantLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId", "FluxType");
b.ToTable("PlantStatus");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
{
b.Property<int>("RecordId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("Item")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Payload")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("RecordId");
b.ToTable("RebootLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
{
b.Property<int>("SupplierId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("SupplierCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("SupplierDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("SupplierId");
b.ToTable("Supplier");
b.HasData(
new
{
SupplierId = 1,
SupplierCode = "LIQUIGAS",
SupplierDesc = "Liquigas"
},
new
{
SupplierId = 2,
SupplierCode = "VULKANGAS",
SupplierDesc = "Vulkangas"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
{
b.Property<int>("TransporterId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("PositionLatitude")
.HasColumnType("double");
b.Property<double>("PositionLongitude")
.HasColumnType("double");
b.Property<DateTime>("PositionUpdated")
.HasColumnType("datetime(6)");
b.Property<string>("TransporterCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("TransporterDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("TransporterId");
b.ToTable("Transporter");
b.HasData(
new
{
TransporterId = 1,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "LEVO",
TransporterDesc = "Levorato"
},
new
{
TransporterId = 2,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "TRAF",
TransporterDesc = "Traffik"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.Property<int>("WeekPlanId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("DayNum")
.HasColumnType("int");
b.Property<int>("DeliveryHour")
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("WeekPlanId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("WeekPlan");
b.HasData(
new
{
WeekPlanId = 1,
DayNum = 1,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 2,
DayNum = 2,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 3,
DayNum = 3,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 2
},
new
{
WeekPlanId = 4,
DayNum = 4,
DeliveryHour = 15,
Note = "9K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 5,
DayNum = 4,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 6,
DayNum = 6,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 7,
DayNum = 2,
DeliveryHour = 14,
Note = "3K",
PlantId = 3,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 8,
DayNum = 2,
DeliveryHour = 15,
Note = "15K",
PlantId = 4,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 9,
DayNum = 2,
DeliveryHour = 17,
Note = "18K",
PlantId = 1,
SupplierId = 2,
TransporterId = 2
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,36 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace GWMS.Data.Migrations
{
public partial class ParamSendTable : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ParamSend",
columns: table => new
{
PlantId = table.Column<int>(type: "int", nullable: false),
ParamUid = table.Column<string>(type: "varchar(255)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
LastSend = table.Column<DateTime>(type: "datetime(6)", nullable: false),
VetoSend = table.Column<DateTime>(type: "datetime(6)", nullable: false),
enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
windStart = table.Column<int>(type: "int", nullable: false),
windEnd = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ParamSend", x => new { x.PlantId, x.ParamUid });
})
.Annotation("MySql:CharSet", "utf8mb4");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ParamSend");
}
}
}
+715
View File
@@ -0,0 +1,715 @@
// <auto-generated />
using System;
using GWMS.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GWMS.Data.Migrations
{
[DbContext(typeof(GWMSContext))]
[Migration("20211028102841_AlarmLog")]
partial class AlarmLog
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
{
b.Property<int>("AlarmLogIdId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<int>("Index")
.HasColumnType("int");
b.Property<string>("MemAddress")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<uint>("Status")
.HasColumnType("int unsigned");
b.Property<string>("ValDecoded")
.HasColumnType("longtext");
b.HasKey("AlarmLogIdId");
b.HasIndex("PlantId");
b.ToTable("AlarmLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasComment("Descrizione dell'item");
b.Property<int>("ValFloat")
.HasColumnType("int");
b.Property<int>("ValInt")
.HasColumnType("int");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("KeyName");
b.ToTable("AnKeyVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("ValStd")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("Valore di default/riferimento per la variabile");
b.HasKey("KeyName");
b.ToTable("Config");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
{
b.Property<int>("ItemId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ItemCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("ItemDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ItemType")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("UM")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.HasKey("ItemId");
b.ToTable("Items");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
{
b.Property<string>("TabName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("TabName");
b.Property<string>("FieldName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("FieldName");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("Val");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasColumnName("Descript");
b.Property<int>("Ordinal")
.HasColumnType("int")
.HasColumnName("Ordinal");
b.HasKey("TabName", "FieldName", "Val");
b.ToTable("ListVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtETA")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecEnd")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecStart")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtOrder")
.HasColumnType("datetime(6)");
b.Property<double>("ExecutionQty")
.HasColumnType("double");
b.Property<double>("LevelEnd")
.HasColumnType("double");
b.Property<double>("LevelStart")
.HasColumnType("double");
b.Property<string>("OrderCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("OrderDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<double>("OrderQty")
.HasColumnType("double");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("OrderId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("Order");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSendModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("ParamUid")
.HasColumnType("varchar(255)");
b.Property<DateTime>("LastSend")
.HasColumnType("datetime(6)");
b.Property<DateTime>("VetoSend")
.HasColumnType("datetime(6)");
b.Property<bool>("enabled")
.HasColumnType("tinyint(1)");
b.Property<int>("windEnd")
.HasColumnType("int");
b.Property<int>("windStart")
.HasColumnType("int");
b.HasKey("PlantId", "ParamUid");
b.ToTable("ParamSend");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSetModel", b =>
{
b.Property<int>("ParamSetId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ParamUid")
.HasColumnType("longtext");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<DateTime>("Scadenza")
.HasColumnType("datetime(6)");
b.Property<decimal>("TargetVal")
.HasColumnType("decimal(65,30)");
b.HasKey("ParamSetId");
b.ToTable("ParamSet");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
{
b.Property<int>("PlantId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("LevelMax")
.HasColumnType("double");
b.Property<double>("LevelReorder")
.HasColumnType("double");
b.Property<double>("OrderQtyStd")
.HasColumnType("double");
b.Property<string>("PlantCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("PlantDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId");
b.ToTable("PlantDetail");
b.HasData(
new
{
PlantId = 1,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ03",
PlantDesc = "Collecchio"
},
new
{
PlantId = 2,
LevelMax = 28000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ04",
PlantDesc = "Noceto"
},
new
{
PlantId = 3,
LevelMax = 24000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ05",
PlantDesc = "Baganzola"
},
new
{
PlantId = 4,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ08",
PlantDesc = "Pilastrello"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.Property<int>("PlantDataId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantDataId");
b.HasIndex("PlantId");
b.ToTable("PlantLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId", "FluxType");
b.ToTable("PlantStatus");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
{
b.Property<int>("RecordId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("Item")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Payload")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("RecordId");
b.ToTable("RebootLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
{
b.Property<int>("SupplierId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("SupplierCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("SupplierDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("SupplierId");
b.ToTable("Supplier");
b.HasData(
new
{
SupplierId = 1,
SupplierCode = "LIQUIGAS",
SupplierDesc = "Liquigas"
},
new
{
SupplierId = 2,
SupplierCode = "VULKANGAS",
SupplierDesc = "Vulkangas"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
{
b.Property<int>("TransporterId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("PositionLatitude")
.HasColumnType("double");
b.Property<double>("PositionLongitude")
.HasColumnType("double");
b.Property<DateTime>("PositionUpdated")
.HasColumnType("datetime(6)");
b.Property<string>("TransporterCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("TransporterDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("TransporterId");
b.ToTable("Transporter");
b.HasData(
new
{
TransporterId = 1,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "LEVO",
TransporterDesc = "Levorato"
},
new
{
TransporterId = 2,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "TRAF",
TransporterDesc = "Traffik"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.Property<int>("WeekPlanId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("DayNum")
.HasColumnType("int");
b.Property<int>("DeliveryHour")
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("WeekPlanId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("WeekPlan");
b.HasData(
new
{
WeekPlanId = 1,
DayNum = 1,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 2,
DayNum = 2,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 3,
DayNum = 3,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 2
},
new
{
WeekPlanId = 4,
DayNum = 4,
DeliveryHour = 15,
Note = "9K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 5,
DayNum = 4,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 6,
DayNum = 6,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 7,
DayNum = 2,
DeliveryHour = 14,
Note = "3K",
PlantId = 3,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 8,
DayNum = 2,
DeliveryHour = 15,
Note = "15K",
PlantId = 4,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 9,
DayNum = 2,
DeliveryHour = 17,
Note = "18K",
PlantId = 1,
SupplierId = 2,
TransporterId = 2
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,50 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace GWMS.Data.Migrations
{
public partial class AlarmLog : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AlarmLog",
columns: table => new
{
AlarmLogIdId = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
DtEvent = table.Column<DateTime>(type: "datetime(6)", nullable: false),
PlantId = table.Column<int>(type: "int", nullable: false),
MemAddress = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Index = table.Column<int>(type: "int", nullable: false),
Status = table.Column<uint>(type: "int unsigned", nullable: false),
ValDecoded = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_AlarmLog", x => x.AlarmLogIdId);
table.ForeignKey(
name: "FK_AlarmLog_PlantDetail_PlantId",
column: x => x.PlantId,
principalTable: "PlantDetail",
principalColumn: "PlantId",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_AlarmLog_PlantId",
table: "AlarmLog",
column: "PlantId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AlarmLog");
}
}
}
@@ -0,0 +1,715 @@
// <auto-generated />
using System;
using GWMS.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GWMS.Data.Migrations
{
[DbContext(typeof(GWMSContext))]
[Migration("20211028133250_AlarmLogFix")]
partial class AlarmLogFix
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
{
b.Property<int>("AlarmLogId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<int>("Index")
.HasColumnType("int");
b.Property<string>("MemAddress")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<uint>("Status")
.HasColumnType("int unsigned");
b.Property<string>("ValDecoded")
.HasColumnType("longtext");
b.HasKey("AlarmLogId");
b.HasIndex("PlantId");
b.ToTable("AlarmLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasComment("Descrizione dell'item");
b.Property<int>("ValFloat")
.HasColumnType("int");
b.Property<int>("ValInt")
.HasColumnType("int");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("KeyName");
b.ToTable("AnKeyVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("ValStd")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasComment("Valore di default/riferimento per la variabile");
b.HasKey("KeyName");
b.ToTable("Config");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
{
b.Property<int>("ItemId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ItemCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("ItemDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ItemType")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("UM")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.HasKey("ItemId");
b.ToTable("Items");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
{
b.Property<string>("TabName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("TabName");
b.Property<string>("FieldName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("FieldName");
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("Val");
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasColumnName("Descript");
b.Property<int>("Ordinal")
.HasColumnType("int")
.HasColumnName("Ordinal");
b.HasKey("TabName", "FieldName", "Val");
b.ToTable("ListVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtETA")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecEnd")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecStart")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtOrder")
.HasColumnType("datetime(6)");
b.Property<double>("ExecutionQty")
.HasColumnType("double");
b.Property<double>("LevelEnd")
.HasColumnType("double");
b.Property<double>("LevelStart")
.HasColumnType("double");
b.Property<string>("OrderCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("OrderDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<double>("OrderQty")
.HasColumnType("double");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("OrderId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("Order");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSendModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("ParamUid")
.HasColumnType("varchar(255)");
b.Property<DateTime>("LastSend")
.HasColumnType("datetime(6)");
b.Property<DateTime>("VetoSend")
.HasColumnType("datetime(6)");
b.Property<bool>("enabled")
.HasColumnType("tinyint(1)");
b.Property<int>("windEnd")
.HasColumnType("int");
b.Property<int>("windStart")
.HasColumnType("int");
b.HasKey("PlantId", "ParamUid");
b.ToTable("ParamSend");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSetModel", b =>
{
b.Property<int>("ParamSetId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ParamUid")
.HasColumnType("longtext");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<DateTime>("Scadenza")
.HasColumnType("datetime(6)");
b.Property<decimal>("TargetVal")
.HasColumnType("decimal(65,30)");
b.HasKey("ParamSetId");
b.ToTable("ParamSet");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
{
b.Property<int>("PlantId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("LevelMax")
.HasColumnType("double");
b.Property<double>("LevelReorder")
.HasColumnType("double");
b.Property<double>("OrderQtyStd")
.HasColumnType("double");
b.Property<string>("PlantCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("PlantDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId");
b.ToTable("PlantDetail");
b.HasData(
new
{
PlantId = 1,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ03",
PlantDesc = "Collecchio"
},
new
{
PlantId = 2,
LevelMax = 28000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ04",
PlantDesc = "Noceto"
},
new
{
PlantId = 3,
LevelMax = 24000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ05",
PlantDesc = "Baganzola"
},
new
{
PlantId = 4,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ08",
PlantDesc = "Pilastrello"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.Property<int>("PlantDataId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantDataId");
b.HasIndex("PlantId");
b.ToTable("PlantLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId", "FluxType");
b.ToTable("PlantStatus");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
{
b.Property<int>("RecordId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("Item")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Payload")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("RecordId");
b.ToTable("RebootLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
{
b.Property<int>("SupplierId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("SupplierCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("SupplierDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("SupplierId");
b.ToTable("Supplier");
b.HasData(
new
{
SupplierId = 1,
SupplierCode = "LIQUIGAS",
SupplierDesc = "Liquigas"
},
new
{
SupplierId = 2,
SupplierCode = "VULKANGAS",
SupplierDesc = "Vulkangas"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
{
b.Property<int>("TransporterId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("PositionLatitude")
.HasColumnType("double");
b.Property<double>("PositionLongitude")
.HasColumnType("double");
b.Property<DateTime>("PositionUpdated")
.HasColumnType("datetime(6)");
b.Property<string>("TransporterCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("TransporterDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("TransporterId");
b.ToTable("Transporter");
b.HasData(
new
{
TransporterId = 1,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "LEVO",
TransporterDesc = "Levorato"
},
new
{
TransporterId = 2,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "TRAF",
TransporterDesc = "Traffik"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.Property<int>("WeekPlanId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<int>("DayNum")
.HasColumnType("int");
b.Property<int>("DeliveryHour")
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("WeekPlanId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("WeekPlan");
b.HasData(
new
{
WeekPlanId = 1,
DayNum = 1,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 2,
DayNum = 2,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 3,
DayNum = 3,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 2
},
new
{
WeekPlanId = 4,
DayNum = 4,
DeliveryHour = 15,
Note = "9K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 5,
DayNum = 4,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 6,
DayNum = 6,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 7,
DayNum = 2,
DeliveryHour = 14,
Note = "3K",
PlantId = 3,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 8,
DayNum = 2,
DeliveryHour = 15,
Note = "15K",
PlantId = 4,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 9,
DayNum = 2,
DeliveryHour = 17,
Note = "18K",
PlantId = 1,
SupplierId = 2,
TransporterId = 2
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace GWMS.Data.Migrations
{
public partial class AlarmLogFix : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "AlarmLogIdId",
table: "AlarmLog",
newName: "AlarmLogId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "AlarmLogId",
table: "AlarmLog",
newName: "AlarmLogIdId");
}
}
}
@@ -0,0 +1,313 @@
// <auto-generated />
using System;
using GWMS.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace GWMS.User.Migrations
{
[DbContext(typeof(UserIdentityDbContext))]
[Migration("20240411155438_RemoveTableCount")]
partial class RemoveTableCount
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("longtext");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles", (string)null);
b.HasData(
new
{
Id = "315208c3-0fb0-421d-b373-8f4730106dd5",
ConcurrencyStamp = "9bd570a3-2012-42a8-bb38-0030e0d45de2",
Name = "Undef",
NormalizedName = "UNDEF"
},
new
{
Id = "757673aa-ea00-4b6a-8c98-f75b3dcd65b7",
ConcurrencyStamp = "55cbb043-dbd6-4018-a834-050c2a15c30f",
Name = "ExtUser",
NormalizedName = "EXTUSER"
},
new
{
Id = "b5083225-0c73-40cb-a7be-db0747b20dca",
ConcurrencyStamp = "496441df-9b5b-4df2-bdc2-54a073a4a912",
Name = "ExtTransp",
NormalizedName = "EXTTRANSP"
},
new
{
Id = "b5136e2c-f9e9-43ae-8cfd-d4b2883b963a",
ConcurrencyStamp = "2009b165-9681-4891-934e-020a35e6fc80",
Name = "User",
NormalizedName = "USER"
},
new
{
Id = "0bbf8f56-fcc8-4afd-9865-805881ca4067",
ConcurrencyStamp = "759f05b6-3995-4763-b76a-aef212eb17f1",
Name = "Admin",
NormalizedName = "ADMIN"
},
new
{
Id = "55fd587f-bfea-40b2-8e44-3ad95a9a9ee1",
ConcurrencyStamp = "8b2b2fbf-ba91-420a-b490-13e02916d8a1",
Name = "SuperAdmin",
NormalizedName = "SUPERADMIN"
});
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ClaimType")
.HasColumnType("longtext");
b.Property<string>("ClaimValue")
.HasColumnType("longtext");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("longtext");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("tinyint(1)");
b.Property<bool>("LockoutEnabled")
.HasColumnType("tinyint(1)");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetime(6)");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.Property<string>("PasswordHash")
.HasColumnType("longtext");
b.Property<string>("PhoneNumber")
.HasColumnType("longtext");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("tinyint(1)");
b.Property<string>("SecurityStamp")
.HasColumnType("longtext");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("tinyint(1)");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("ClaimType")
.HasColumnType("longtext");
b.Property<string>("ClaimValue")
.HasColumnType("longtext");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("varchar(255)");
b.Property<string>("ProviderKey")
.HasColumnType("varchar(255)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("longtext");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("varchar(255)");
b.Property<string>("RoleId")
.HasColumnType("varchar(255)");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("varchar(255)");
b.Property<string>("LoginProvider")
.HasColumnType("varchar(255)");
b.Property<string>("Name")
.HasColumnType("varchar(255)");
b.Property<string>("Value")
.HasColumnType("longtext");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,122 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace GWMS.User.Migrations
{
public partial class RemoveTableCount : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DbSetCounts");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "AspNetUserTokens",
type: "varchar(255)",
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(128)",
oldMaxLength: 128)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "LoginProvider",
table: "AspNetUserTokens",
type: "varchar(255)",
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(128)",
oldMaxLength: 128)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ProviderKey",
table: "AspNetUserLogins",
type: "varchar(255)",
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(128)",
oldMaxLength: 128)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "LoginProvider",
table: "AspNetUserLogins",
type: "varchar(255)",
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(128)",
oldMaxLength: 128)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "AspNetUserTokens",
type: "varchar(128)",
maxLength: 128,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(255)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "LoginProvider",
table: "AspNetUserTokens",
type: "varchar(128)",
maxLength: 128,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(255)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ProviderKey",
table: "AspNetUserLogins",
type: "varchar(128)",
maxLength: 128,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(255)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "LoginProvider",
table: "AspNetUserLogins",
type: "varchar(128)",
maxLength: 128,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(255)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "DbSetCounts",
columns: table => new
{
Count = table.Column<int>(type: "int", nullable: false),
TableName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
})
.Annotation("MySql:CharSet", "utf8mb4");
}
}
}
@@ -0,0 +1,39 @@
// <auto-generated />
using System;
using GWMS.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace GWMS.User.Migrations
{
[DbContext(typeof(UserIdentityDbContext))]
[Migration("20240418104749_ReAddTableCounter4Identity")]
partial class ReAddTableCounter4Identity
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("GWMS.Data.DatabaseModels.TableCount", b =>
{
b.Property<string>("TableName")
.HasColumnType("varchar(255)");
b.Property<int>("Count")
.HasColumnType("int");
b.HasKey("TableName");
b.ToTable("DbSetCounts");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,33 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace GWMS.User.Migrations
{
public partial class ReAddTableCounter4Identity : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DbSetCounts",
columns: table => new
{
TableName = table.Column<string>(type: "varchar(255)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Count = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DbSetCounts", x => x.TableName);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DbSetCounts");
}
}
}
@@ -0,0 +1,748 @@
// <auto-generated />
using System;
using GWMS.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace GWMS.Data.Migrations
{
[DbContext(typeof(GWMSContext))]
[Migration("20240604150033_AddPlantLogDtEvIdx")]
partial class AddPlantLogDtEvIdx
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
{
b.Property<int>("AlarmLogId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<int>("Index")
.HasColumnType("int");
b.Property<string>("MemAddress")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<uint>("Status")
.HasColumnType("int unsigned");
b.Property<string>("ValDecoded")
.HasColumnType("longtext");
b.HasKey("AlarmLogId");
b.HasIndex("PlantId");
b.ToTable("AlarmLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnOrder(0);
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasColumnOrder(4)
.HasComment("Descrizione dell'item");
b.Property<int>("ValFloat")
.HasColumnType("int")
.HasColumnOrder(2);
b.Property<int>("ValInt")
.HasColumnType("int")
.HasColumnOrder(1);
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasColumnOrder(3);
b.HasKey("KeyName");
b.ToTable("AnKeyVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ConfigModel", b =>
{
b.Property<string>("KeyName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnOrder(0);
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasColumnOrder(3);
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnOrder(1);
b.Property<string>("ValStd")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnOrder(2)
.HasComment("Valore di default/riferimento per la variabile");
b.HasKey("KeyName");
b.ToTable("Config");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ItemModel", b =>
{
b.Property<int>("ItemId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnOrder(0);
b.Property<string>("ItemCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)")
.HasColumnOrder(1);
b.Property<string>("ItemDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasColumnOrder(2);
b.Property<string>("ItemType")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnOrder(3);
b.Property<string>("UM")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnOrder(4);
b.HasKey("ItemId");
b.ToTable("Items");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ListValModel", b =>
{
b.Property<string>("TabName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("TabName")
.HasColumnOrder(0);
b.Property<string>("FieldName")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("FieldName")
.HasColumnOrder(1);
b.Property<string>("Val")
.HasMaxLength(50)
.HasColumnType("varchar(50)")
.HasColumnName("Val")
.HasColumnOrder(2);
b.Property<string>("Descript")
.HasMaxLength(250)
.HasColumnType("varchar(250)")
.HasColumnName("Descript")
.HasColumnOrder(3);
b.Property<int>("Ordinal")
.HasColumnType("int")
.HasColumnName("Ordinal")
.HasColumnOrder(4);
b.HasKey("TabName", "FieldName", "Val");
b.ToTable("ListVal");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtETA")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecEnd")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtExecStart")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DtOrder")
.HasColumnType("datetime(6)");
b.Property<double>("ExecutionQty")
.HasColumnType("double");
b.Property<double>("LevelEnd")
.HasColumnType("double");
b.Property<double>("LevelStart")
.HasColumnType("double");
b.Property<string>("OrderCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("OrderDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<double>("OrderQty")
.HasColumnType("double");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("OrderId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("Order");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSendModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("ParamUid")
.HasColumnType("varchar(255)");
b.Property<DateTime>("LastSend")
.HasColumnType("datetime(6)");
b.Property<DateTime>("VetoSend")
.HasColumnType("datetime(6)");
b.Property<bool>("enabled")
.HasColumnType("tinyint(1)");
b.Property<int>("windEnd")
.HasColumnType("int");
b.Property<int>("windStart")
.HasColumnType("int");
b.HasKey("PlantId", "ParamUid");
b.ToTable("ParamSend");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSetModel", b =>
{
b.Property<int>("ParamSetId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ParamUid")
.HasColumnType("longtext");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<DateTime>("Scadenza")
.HasColumnType("datetime(6)");
b.Property<decimal>("TargetVal")
.HasColumnType("decimal(65,30)");
b.HasKey("ParamSetId");
b.ToTable("ParamSet");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
{
b.Property<int>("PlantId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("LevelMax")
.HasColumnType("double");
b.Property<double>("LevelReorder")
.HasColumnType("double");
b.Property<double>("OrderQtyStd")
.HasColumnType("double");
b.Property<string>("PlantCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("PlantDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId");
b.ToTable("PlantDetail");
b.HasData(
new
{
PlantId = 1,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ03",
PlantDesc = "Collecchio"
},
new
{
PlantId = 2,
LevelMax = 28000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ04",
PlantDesc = "Noceto"
},
new
{
PlantId = 3,
LevelMax = 24000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ05",
PlantDesc = "Baganzola"
},
new
{
PlantId = 4,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ08",
PlantDesc = "Pilastrello"
},
new
{
PlantId = 5,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ09",
PlantDesc = "Guardamiglio"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.Property<int>("PlantDataId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantDataId");
b.HasIndex(new[] { "PlantId", "DtEvent" }, "IX_PlantLog_PlantDtEv");
b.HasIndex(new[] { "PlantId" }, "IX_PlantLog_PlantId");
b.ToTable("PlantLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("FluxType")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<double>("ValNumber")
.HasColumnType("double");
b.Property<string>("ValString")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("PlantId", "FluxType");
b.ToTable("PlantStatus");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.RebootLogModel", b =>
{
b.Property<int>("RecordId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<string>("Item")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Payload")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("RecordId");
b.ToTable("RebootLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.SupplierModel", b =>
{
b.Property<int>("SupplierId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("SupplierCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("SupplierDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("SupplierId");
b.ToTable("Supplier");
b.HasData(
new
{
SupplierId = 1,
SupplierCode = "LIQUIGAS",
SupplierDesc = "Liquigas"
},
new
{
SupplierId = 2,
SupplierCode = "VULKANGAS",
SupplierDesc = "Vulkangas"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.TransporterModel", b =>
{
b.Property<int>("TransporterId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<double>("PositionLatitude")
.HasColumnType("double");
b.Property<double>("PositionLongitude")
.HasColumnType("double");
b.Property<DateTime>("PositionUpdated")
.HasColumnType("datetime(6)");
b.Property<string>("TransporterCode")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("TransporterDesc")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.HasKey("TransporterId");
b.ToTable("Transporter");
b.HasData(
new
{
TransporterId = 1,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "LEVO",
TransporterDesc = "Levorato"
},
new
{
TransporterId = 2,
PositionLatitude = 0.0,
PositionLongitude = 0.0,
PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "TRAF",
TransporterDesc = "Traffik"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.Property<int>("WeekPlanId")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnOrder(0);
b.Property<int>("DayNum")
.HasColumnType("int");
b.Property<int>("DeliveryHour")
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.Property<int>("TransporterId")
.HasColumnType("int");
b.HasKey("WeekPlanId");
b.HasIndex("PlantId");
b.HasIndex("SupplierId");
b.HasIndex("TransporterId");
b.ToTable("WeekPlan");
b.HasData(
new
{
WeekPlanId = 1,
DayNum = 1,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 2,
DayNum = 2,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 3,
DayNum = 3,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 2
},
new
{
WeekPlanId = 4,
DayNum = 4,
DeliveryHour = 15,
Note = "9K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 5,
DayNum = 4,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 6,
DayNum = 6,
DeliveryHour = 20,
Note = "18K",
PlantId = 2,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 7,
DayNum = 2,
DeliveryHour = 14,
Note = "3K",
PlantId = 3,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 8,
DayNum = 2,
DeliveryHour = 15,
Note = "15K",
PlantId = 4,
SupplierId = 1,
TransporterId = 1
},
new
{
WeekPlanId = 9,
DayNum = 2,
DeliveryHour = 17,
Note = "18K",
PlantId = 1,
SupplierId = 2,
TransporterId = 2
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantStatusModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.SupplierModel", "Supplier")
.WithMany()
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("GWMS.Data.DatabaseModels.TransporterModel", "Transporter")
.WithMany()
.HasForeignKey("TransporterId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
b.Navigation("Supplier");
b.Navigation("Transporter");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,541 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace GWMS.Data.Migrations
{
public partial class AddPlantLogDtEvIdx : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "WeekPlanId",
table: "WeekPlan",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.Annotation("Relational:ColumnOrder", 0)
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<int>(
name: "Ordinal",
table: "ListVal",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("Relational:ColumnOrder", 4);
migrationBuilder.AlterColumn<string>(
name: "Descript",
table: "ListVal",
type: "varchar(250)",
maxLength: 250,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(250)",
oldMaxLength: 250,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 3)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Val",
table: "ListVal",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 2)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "FieldName",
table: "ListVal",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 1)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "TabName",
table: "ListVal",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 0)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "UM",
table: "Items",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 4)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ItemType",
table: "Items",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 3)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ItemDesc",
table: "Items",
type: "varchar(250)",
maxLength: 250,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(250)",
oldMaxLength: 250,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 2)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ItemCode",
table: "Items",
type: "varchar(100)",
maxLength: 100,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(100)",
oldMaxLength: 100,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 1)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<int>(
name: "ItemId",
table: "Items",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.Annotation("Relational:ColumnOrder", 0)
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<string>(
name: "ValStd",
table: "Config",
type: "varchar(50)",
maxLength: 50,
nullable: true,
comment: "Valore di default/riferimento per la variabile",
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true,
oldComment: "Valore di default/riferimento per la variabile")
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 2)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Val",
table: "Config",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 1)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Note",
table: "Config",
type: "varchar(250)",
maxLength: 250,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(250)",
oldMaxLength: 250,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 3)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "KeyName",
table: "Config",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 0)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ValString",
table: "AnKeyVal",
type: "varchar(250)",
maxLength: 250,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(250)",
oldMaxLength: 250,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 3)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<int>(
name: "ValInt",
table: "AnKeyVal",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("Relational:ColumnOrder", 1);
migrationBuilder.AlterColumn<int>(
name: "ValFloat",
table: "AnKeyVal",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("Relational:ColumnOrder", 2);
migrationBuilder.AlterColumn<string>(
name: "Descript",
table: "AnKeyVal",
type: "varchar(250)",
maxLength: 250,
nullable: true,
comment: "Descrizione dell'item",
oldClrType: typeof(string),
oldType: "varchar(250)",
oldMaxLength: 250,
oldNullable: true,
oldComment: "Descrizione dell'item")
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 4)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "KeyName",
table: "AnKeyVal",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 0)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_PlantLog_PlantDtEv",
table: "PlantLog",
columns: new[] { "PlantId", "DtEvent" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_PlantLog_PlantDtEv",
table: "PlantLog");
migrationBuilder.AlterColumn<int>(
name: "WeekPlanId",
table: "WeekPlan",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.OldAnnotation("Relational:ColumnOrder", 0);
migrationBuilder.AlterColumn<int>(
name: "Ordinal",
table: "ListVal",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("Relational:ColumnOrder", 4);
migrationBuilder.AlterColumn<string>(
name: "Descript",
table: "ListVal",
type: "varchar(250)",
maxLength: 250,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(250)",
oldMaxLength: 250,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 3);
migrationBuilder.AlterColumn<string>(
name: "Val",
table: "ListVal",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 2);
migrationBuilder.AlterColumn<string>(
name: "FieldName",
table: "ListVal",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 1);
migrationBuilder.AlterColumn<string>(
name: "TabName",
table: "ListVal",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 0);
migrationBuilder.AlterColumn<string>(
name: "UM",
table: "Items",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 4);
migrationBuilder.AlterColumn<string>(
name: "ItemType",
table: "Items",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 3);
migrationBuilder.AlterColumn<string>(
name: "ItemDesc",
table: "Items",
type: "varchar(250)",
maxLength: 250,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(250)",
oldMaxLength: 250,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 2);
migrationBuilder.AlterColumn<string>(
name: "ItemCode",
table: "Items",
type: "varchar(100)",
maxLength: 100,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(100)",
oldMaxLength: 100,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 1);
migrationBuilder.AlterColumn<int>(
name: "ItemId",
table: "Items",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.OldAnnotation("Relational:ColumnOrder", 0);
migrationBuilder.AlterColumn<string>(
name: "ValStd",
table: "Config",
type: "varchar(50)",
maxLength: 50,
nullable: true,
comment: "Valore di default/riferimento per la variabile",
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true,
oldComment: "Valore di default/riferimento per la variabile")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 2);
migrationBuilder.AlterColumn<string>(
name: "Val",
table: "Config",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 1);
migrationBuilder.AlterColumn<string>(
name: "Note",
table: "Config",
type: "varchar(250)",
maxLength: 250,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(250)",
oldMaxLength: 250,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 3);
migrationBuilder.AlterColumn<string>(
name: "KeyName",
table: "Config",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 0);
migrationBuilder.AlterColumn<string>(
name: "ValString",
table: "AnKeyVal",
type: "varchar(250)",
maxLength: 250,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(250)",
oldMaxLength: 250,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 3);
migrationBuilder.AlterColumn<int>(
name: "ValInt",
table: "AnKeyVal",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("Relational:ColumnOrder", 1);
migrationBuilder.AlterColumn<int>(
name: "ValFloat",
table: "AnKeyVal",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("Relational:ColumnOrder", 2);
migrationBuilder.AlterColumn<string>(
name: "Descript",
table: "AnKeyVal",
type: "varchar(250)",
maxLength: 250,
nullable: true,
comment: "Descrizione dell'item",
oldClrType: typeof(string),
oldType: "varchar(250)",
oldMaxLength: 250,
oldNullable: true,
oldComment: "Descrizione dell'item")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 4);
migrationBuilder.AlterColumn<string>(
name: "KeyName",
table: "AnKeyVal",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 0);
}
}
}
+154 -287
View File
@@ -5,6 +5,8 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace GWMS.Data.Migrations namespace GWMS.Data.Migrations
{ {
[DbContext(typeof(GWMSContext))] [DbContext(typeof(GWMSContext))]
@@ -14,29 +16,66 @@ namespace GWMS.Data.Migrations
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64) .HasAnnotation("ProductVersion", "6.0.2")
.HasAnnotation("ProductVersion", "5.0.7"); .HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
{
b.Property<int>("AlarmLogId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime(6)");
b.Property<int>("Index")
.HasColumnType("int");
b.Property<string>("MemAddress")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<uint>("Status")
.HasColumnType("int unsigned");
b.Property<string>("ValDecoded")
.HasColumnType("longtext");
b.HasKey("AlarmLogId");
b.HasIndex("PlantId");
b.ToTable("AlarmLog");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b => modelBuilder.Entity("GWMS.Data.DatabaseModels.AnKeyValModel", b =>
{ {
b.Property<string>("KeyName") b.Property<string>("KeyName")
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("varchar(50)"); .HasColumnType("varchar(50)")
.HasColumnOrder(0);
b.Property<string>("Descript") b.Property<string>("Descript")
.HasMaxLength(250) .HasMaxLength(250)
.HasColumnType("varchar(250)") .HasColumnType("varchar(250)")
.HasColumnOrder(4)
.HasComment("Descrizione dell'item"); .HasComment("Descrizione dell'item");
b.Property<int>("ValFloat") b.Property<int>("ValFloat")
.HasColumnType("int"); .HasColumnType("int")
.HasColumnOrder(2);
b.Property<int>("ValInt") b.Property<int>("ValInt")
.HasColumnType("int"); .HasColumnType("int")
.HasColumnOrder(1);
b.Property<string>("ValString") b.Property<string>("ValString")
.HasMaxLength(250) .HasMaxLength(250)
.HasColumnType("varchar(250)"); .HasColumnType("varchar(250)")
.HasColumnOrder(3);
b.HasKey("KeyName"); b.HasKey("KeyName");
@@ -47,19 +86,23 @@ namespace GWMS.Data.Migrations
{ {
b.Property<string>("KeyName") b.Property<string>("KeyName")
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("varchar(50)"); .HasColumnType("varchar(50)")
.HasColumnOrder(0);
b.Property<string>("Note") b.Property<string>("Note")
.HasMaxLength(250) .HasMaxLength(250)
.HasColumnType("varchar(250)"); .HasColumnType("varchar(250)")
.HasColumnOrder(3);
b.Property<string>("Val") b.Property<string>("Val")
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("varchar(50)"); .HasColumnType("varchar(50)")
.HasColumnOrder(1);
b.Property<string>("ValStd") b.Property<string>("ValStd")
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("varchar(50)") .HasColumnType("varchar(50)")
.HasColumnOrder(2)
.HasComment("Valore di default/riferimento per la variabile"); .HasComment("Valore di default/riferimento per la variabile");
b.HasKey("KeyName"); b.HasKey("KeyName");
@@ -71,23 +114,28 @@ namespace GWMS.Data.Migrations
{ {
b.Property<int>("ItemId") b.Property<int>("ItemId")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("int")
.HasColumnOrder(0);
b.Property<string>("ItemCode") b.Property<string>("ItemCode")
.HasMaxLength(100) .HasMaxLength(100)
.HasColumnType("varchar(100)"); .HasColumnType("varchar(100)")
.HasColumnOrder(1);
b.Property<string>("ItemDesc") b.Property<string>("ItemDesc")
.HasMaxLength(250) .HasMaxLength(250)
.HasColumnType("varchar(250)"); .HasColumnType("varchar(250)")
.HasColumnOrder(2);
b.Property<string>("ItemType") b.Property<string>("ItemType")
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("varchar(50)"); .HasColumnType("varchar(50)")
.HasColumnOrder(3);
b.Property<string>("UM") b.Property<string>("UM")
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("varchar(50)"); .HasColumnType("varchar(50)")
.HasColumnOrder(4);
b.HasKey("ItemId"); b.HasKey("ItemId");
@@ -99,26 +147,31 @@ namespace GWMS.Data.Migrations
b.Property<string>("TabName") b.Property<string>("TabName")
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("varchar(50)") .HasColumnType("varchar(50)")
.HasColumnName("TabName"); .HasColumnName("TabName")
.HasColumnOrder(0);
b.Property<string>("FieldName") b.Property<string>("FieldName")
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("varchar(50)") .HasColumnType("varchar(50)")
.HasColumnName("FieldName"); .HasColumnName("FieldName")
.HasColumnOrder(1);
b.Property<string>("Val") b.Property<string>("Val")
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("varchar(50)") .HasColumnType("varchar(50)")
.HasColumnName("Val"); .HasColumnName("Val")
.HasColumnOrder(2);
b.Property<string>("Descript") b.Property<string>("Descript")
.HasMaxLength(250) .HasMaxLength(250)
.HasColumnType("varchar(250)") .HasColumnType("varchar(250)")
.HasColumnName("Descript"); .HasColumnName("Descript")
.HasColumnOrder(3);
b.Property<int>("Ordinal") b.Property<int>("Ordinal")
.HasColumnType("int") .HasColumnType("int")
.HasColumnName("Ordinal"); .HasColumnName("Ordinal")
.HasColumnOrder(4);
b.HasKey("TabName", "FieldName", "Val"); b.HasKey("TabName", "FieldName", "Val");
@@ -183,6 +236,61 @@ namespace GWMS.Data.Migrations
b.ToTable("Order"); b.ToTable("Order");
}); });
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSendModel", b =>
{
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<string>("ParamUid")
.HasColumnType("varchar(255)");
b.Property<DateTime>("LastSend")
.HasColumnType("datetime(6)");
b.Property<DateTime>("VetoSend")
.HasColumnType("datetime(6)");
b.Property<bool>("enabled")
.HasColumnType("tinyint(1)");
b.Property<int>("windEnd")
.HasColumnType("int");
b.Property<int>("windStart")
.HasColumnType("int");
b.HasKey("PlantId", "ParamUid");
b.ToTable("ParamSend");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.ParamSetModel", b =>
{
b.Property<int>("ParamSetId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("Note")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("ParamUid")
.HasColumnType("longtext");
b.Property<int>("PlantId")
.HasColumnType("int");
b.Property<DateTime>("Scadenza")
.HasColumnType("datetime(6)");
b.Property<decimal>("TargetVal")
.HasColumnType("decimal(65,30)");
b.HasKey("ParamSetId");
b.ToTable("ParamSet");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b => modelBuilder.Entity("GWMS.Data.DatabaseModels.PlantDetailModel", b =>
{ {
b.Property<int>("PlantId") b.Property<int>("PlantId")
@@ -246,6 +354,15 @@ namespace GWMS.Data.Migrations
OrderQtyStd = 18000.0, OrderQtyStd = 18000.0,
PlantCode = "PIZ08", PlantCode = "PIZ08",
PlantDesc = "Pilastrello" PlantDesc = "Pilastrello"
},
new
{
PlantId = 5,
LevelMax = 26000.0,
LevelReorder = 15000.0,
OrderQtyStd = 18000.0,
PlantCode = "PIZ09",
PlantDesc = "Guardamiglio"
}); });
}); });
@@ -274,7 +391,9 @@ namespace GWMS.Data.Migrations
b.HasKey("PlantDataId"); b.HasKey("PlantDataId");
b.HasIndex("PlantId"); b.HasIndex(new[] { "PlantId", "DtEvent" }, "IX_PlantLog_PlantDtEv");
b.HasIndex(new[] { "PlantId" }, "IX_PlantLog_PlantId");
b.ToTable("PlantLog"); b.ToTable("PlantLog");
}); });
@@ -391,7 +510,7 @@ namespace GWMS.Data.Migrations
TransporterId = 1, TransporterId = 1,
PositionLatitude = 0.0, PositionLatitude = 0.0,
PositionLongitude = 0.0, PositionLongitude = 0.0,
PositionUpdated = new DateTime(2021, 8, 9, 16, 36, 52, 691, DateTimeKind.Local).AddTicks(9092), PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "LEVO", TransporterCode = "LEVO",
TransporterDesc = "Levorato" TransporterDesc = "Levorato"
}, },
@@ -400,281 +519,18 @@ namespace GWMS.Data.Migrations
TransporterId = 2, TransporterId = 2,
PositionLatitude = 0.0, PositionLatitude = 0.0,
PositionLongitude = 0.0, PositionLongitude = 0.0,
PositionUpdated = new DateTime(2021, 8, 9, 16, 36, 52, 691, DateTimeKind.Local).AddTicks(9470), PositionUpdated = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
TransporterCode = "TRAF", TransporterCode = "TRAF",
TransporterDesc = "Traffik" TransporterDesc = "Traffik"
}); });
}); });
modelBuilder.Entity("GWMS.Data.DatabaseModels.UserModel", b =>
{
b.Property<int>("UserId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("AuthKey")
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property<string>("Email")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("Firstname")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<string>("Lang")
.HasMaxLength(10)
.HasColumnType("varchar(10)");
b.Property<string>("Lastname")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<int>("Livello")
.HasColumnType("int");
b.Property<int>("MaskPlantId")
.HasColumnType("int");
b.Property<int>("MaskSupplierId")
.HasColumnType("int");
b.Property<int>("MaskTranspId")
.HasColumnType("int");
b.Property<string>("SaltPasswd")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property<string>("UserName")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.HasKey("UserId");
b.ToTable("Users");
b.HasData(
new
{
UserId = 1,
AuthKey = "th1sIsTh3R1vrOfThNgt98",
Email = "samuele@steamware.net",
Firstname = "Samuele",
IsActive = true,
Lang = "IT",
Lastname = "Locatelli",
Livello = 1,
MaskPlantId = 0,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "samuele.locatelli"
},
new
{
UserId = 2,
AuthKey = "th1sIsTh3R1vrOfThNgt91",
Email = "giancarlo@steamware.net",
Firstname = "Giancarlo",
IsActive = true,
Lang = "IT",
Lastname = "Rottoli",
Livello = 1,
MaskPlantId = 0,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "giancarlo.rottoli"
},
new
{
UserId = 3,
AuthKey = "th1sIsTh3R1vrOfThNgt93",
Email = "info@steamware.net",
Firstname = "Steamware",
IsActive = true,
Lang = "IT",
Lastname = "Admin",
Livello = 1,
MaskPlantId = 0,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "steamw.admin"
},
new
{
UserId = 4,
AuthKey = "th1sIsTh3R1vrOfThNgt97",
Email = "a.pizzaferri@pizzaferripetroli.it",
Firstname = "Angelo",
IsActive = true,
Lang = "IT",
Lastname = "Pizzaferri",
Livello = 2,
MaskPlantId = 0,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "angelo.pizzaferri"
},
new
{
UserId = 5,
AuthKey = "th1sIsTh3R1vrOfThNgt99",
Email = "andrei.valeanu@winnlab.it",
Firstname = "Andrei",
IsActive = true,
Lang = "IT",
Lastname = "Valeanu",
Livello = 2,
MaskPlantId = 0,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "andrei.valeanu"
},
new
{
UserId = 6,
AuthKey = "th1sIsTh3R1vrOfThNgt92",
Email = "info@steamware.net",
Firstname = "User",
IsActive = true,
Lang = "IT",
Lastname = "LIQUIGAS",
Livello = 4,
MaskPlantId = 0,
MaskSupplierId = 1,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "liquigas.user01"
},
new
{
UserId = 7,
AuthKey = "th1sIsTh3R1vrOfThNgt94",
Email = "info@steamware.net",
Firstname = "User",
IsActive = true,
Lang = "IT",
Lastname = "VULKANGAS",
Livello = 4,
MaskPlantId = 0,
MaskSupplierId = 2,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "vulkangas.user01"
},
new
{
UserId = 8,
AuthKey = "th1sIsTh3R1vrOfThNgt95",
Email = "info@steamware.net",
Firstname = "User",
IsActive = true,
Lang = "IT",
Lastname = "LEVORATO",
Livello = 4,
MaskPlantId = 0,
MaskSupplierId = 0,
MaskTranspId = 1,
SaltPasswd = "",
UserName = "levorato.user01"
},
new
{
UserId = 9,
AuthKey = "th1sIsTh3R1vrOfThNgt96",
Email = "info@steamware.net",
Firstname = "User",
IsActive = true,
Lang = "IT",
Lastname = "TRAFFIK",
Livello = 4,
MaskPlantId = 0,
MaskSupplierId = 0,
MaskTranspId = 2,
SaltPasswd = "",
UserName = "traffik.user01"
},
new
{
UserId = 10,
AuthKey = "th1sIsTh3R1vrOfThNgt96",
Email = "info@steamware.net",
Firstname = "Stazione",
IsActive = true,
Lang = "IT",
Lastname = "Collecchio",
Livello = 3,
MaskPlantId = 1,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "piz03.user01"
},
new
{
UserId = 11,
AuthKey = "th1sIsTh3R1vrOfThNgt96",
Email = "info@steamware.net",
Firstname = "Stazione",
IsActive = true,
Lang = "IT",
Lastname = "Noceto",
Livello = 3,
MaskPlantId = 2,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "piz04.user01"
},
new
{
UserId = 12,
AuthKey = "th1sIsTh3R1vrOfThNgt96",
Email = "info@steamware.net",
Firstname = "Stazione",
IsActive = true,
Lang = "IT",
Lastname = "Baganzola",
Livello = 3,
MaskPlantId = 3,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "piz05.user01"
},
new
{
UserId = 13,
AuthKey = "th1sIsTh3R1vrOfThNgt96",
Email = "info@steamware.net",
Firstname = "Stazione",
IsActive = true,
Lang = "IT",
Lastname = "Pilastrello",
Livello = 3,
MaskPlantId = 4,
MaskSupplierId = 0,
MaskTranspId = 0,
SaltPasswd = "",
UserName = "piz08.user01"
});
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b => modelBuilder.Entity("GWMS.Data.DatabaseModels.WeekPlanModel", b =>
{ {
b.Property<int>("WeekPlanId") b.Property<int>("WeekPlanId")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("int")
.HasColumnOrder(0);
b.Property<int>("DayNum") b.Property<int>("DayNum")
.HasColumnType("int"); .HasColumnType("int");
@@ -798,6 +654,17 @@ namespace GWMS.Data.Migrations
}); });
}); });
modelBuilder.Entity("GWMS.Data.DatabaseModels.AlarmLogModel", b =>
{
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
.WithMany()
.HasForeignKey("PlantId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Plant");
});
modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b => modelBuilder.Entity("GWMS.Data.DatabaseModels.OrderModel", b =>
{ {
b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant") b.HasOne("GWMS.Data.DatabaseModels.PlantDetailModel", "Plant")
@@ -5,6 +5,8 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace GWMS.User.Migrations namespace GWMS.User.Migrations
{ {
[DbContext(typeof(UserIdentityDbContext))] [DbContext(typeof(UserIdentityDbContext))]
@@ -14,16 +16,18 @@ namespace GWMS.User.Migrations
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64) .HasAnnotation("ProductVersion", "6.0.2")
.HasAnnotation("ProductVersion", "5.0.7"); .HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("GWMS.Data.DatabaseModels.TableCount", b => modelBuilder.Entity("GWMS.Data.DatabaseModels.TableCount", b =>
{ {
b.Property<string>("TableName")
.HasColumnType("varchar(255)");
b.Property<int>("Count") b.Property<int>("Count")
.HasColumnType("int"); .HasColumnType("int");
b.Property<string>("TableName") b.HasKey("TableName");
.HasColumnType("longtext");
b.ToTable("DbSetCounts"); b.ToTable("DbSetCounts");
}); });
@@ -51,48 +55,48 @@ namespace GWMS.User.Migrations
.IsUnique() .IsUnique()
.HasDatabaseName("RoleNameIndex"); .HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles"); b.ToTable("AspNetRoles", (string)null);
b.HasData( b.HasData(
new new
{ {
Id = "339a7ac3-4fcd-4baa-bd19-a6a09d1b7c5d", Id = "315208c3-0fb0-421d-b373-8f4730106dd5",
ConcurrencyStamp = "3caf0732-df97-4b81-ba2c-9fb51e34532a", ConcurrencyStamp = "9bd570a3-2012-42a8-bb38-0030e0d45de2",
Name = "Undef", Name = "Undef",
NormalizedName = "UNDEF" NormalizedName = "UNDEF"
}, },
new new
{ {
Id = "47c8d4fb-6925-4ef0-a830-5df33e705d7a", Id = "757673aa-ea00-4b6a-8c98-f75b3dcd65b7",
ConcurrencyStamp = "9671ece6-f70a-4ca6-88db-64562e007c72", ConcurrencyStamp = "55cbb043-dbd6-4018-a834-050c2a15c30f",
Name = "ExtUser", Name = "ExtUser",
NormalizedName = "EXTUSER" NormalizedName = "EXTUSER"
}, },
new new
{ {
Id = "2d87821f-5c6d-4d9e-98d7-7ae801030100", Id = "b5083225-0c73-40cb-a7be-db0747b20dca",
ConcurrencyStamp = "9ee56f2f-558f-4579-9ad7-4a6150e3d822", ConcurrencyStamp = "496441df-9b5b-4df2-bdc2-54a073a4a912",
Name = "ExtTransp", Name = "ExtTransp",
NormalizedName = "EXTTRANSP" NormalizedName = "EXTTRANSP"
}, },
new new
{ {
Id = "db1d1ac5-905d-46a5-bcf4-ef8a5f3f715c", Id = "b5136e2c-f9e9-43ae-8cfd-d4b2883b963a",
ConcurrencyStamp = "3244e9d3-ab0e-45ae-97b6-c8c74f57cf64", ConcurrencyStamp = "2009b165-9681-4891-934e-020a35e6fc80",
Name = "User", Name = "User",
NormalizedName = "USER" NormalizedName = "USER"
}, },
new new
{ {
Id = "7e3dc53b-c152-440f-a49d-6c3a2f6bf6eb", Id = "0bbf8f56-fcc8-4afd-9865-805881ca4067",
ConcurrencyStamp = "a0a109e5-ab8e-4e20-9aa8-eba3c429fd12", ConcurrencyStamp = "759f05b6-3995-4763-b76a-aef212eb17f1",
Name = "Admin", Name = "Admin",
NormalizedName = "ADMIN" NormalizedName = "ADMIN"
}, },
new new
{ {
Id = "2fcd8455-143a-4ebc-b41c-e9bdf6a0315b", Id = "55fd587f-bfea-40b2-8e44-3ad95a9a9ee1",
ConcurrencyStamp = "549b8a8d-ba83-4b79-be88-fde0bd4cc60f", ConcurrencyStamp = "8b2b2fbf-ba91-420a-b490-13e02916d8a1",
Name = "SuperAdmin", Name = "SuperAdmin",
NormalizedName = "SUPERADMIN" NormalizedName = "SUPERADMIN"
}); });
@@ -118,7 +122,7 @@ namespace GWMS.User.Migrations
b.HasIndex("RoleId"); b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims"); b.ToTable("AspNetRoleClaims", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
@@ -182,7 +186,7 @@ namespace GWMS.User.Migrations
.IsUnique() .IsUnique()
.HasDatabaseName("UserNameIndex"); .HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers"); b.ToTable("AspNetUsers", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
@@ -205,18 +209,16 @@ namespace GWMS.User.Migrations
b.HasIndex("UserId"); b.HasIndex("UserId");
b.ToTable("AspNetUserClaims"); b.ToTable("AspNetUserClaims", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{ {
b.Property<string>("LoginProvider") b.Property<string>("LoginProvider")
.HasMaxLength(128) .HasColumnType("varchar(255)");
.HasColumnType("varchar(128)");
b.Property<string>("ProviderKey") b.Property<string>("ProviderKey")
.HasMaxLength(128) .HasColumnType("varchar(255)");
.HasColumnType("varchar(128)");
b.Property<string>("ProviderDisplayName") b.Property<string>("ProviderDisplayName")
.HasColumnType("longtext"); .HasColumnType("longtext");
@@ -229,7 +231,7 @@ namespace GWMS.User.Migrations
b.HasIndex("UserId"); b.HasIndex("UserId");
b.ToTable("AspNetUserLogins"); b.ToTable("AspNetUserLogins", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
@@ -244,7 +246,7 @@ namespace GWMS.User.Migrations
b.HasIndex("RoleId"); b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles"); b.ToTable("AspNetUserRoles", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
@@ -253,19 +255,17 @@ namespace GWMS.User.Migrations
.HasColumnType("varchar(255)"); .HasColumnType("varchar(255)");
b.Property<string>("LoginProvider") b.Property<string>("LoginProvider")
.HasMaxLength(128) .HasColumnType("varchar(255)");
.HasColumnType("varchar(128)");
b.Property<string>("Name") b.Property<string>("Name")
.HasMaxLength(128) .HasColumnType("varchar(255)");
.HasColumnType("varchar(128)");
b.Property<string>("Value") b.Property<string>("Value")
.HasColumnType("longtext"); .HasColumnType("longtext");
b.HasKey("UserId", "LoginProvider", "Name"); b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens"); b.ToTable("AspNetUserTokens", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
+6 -7
View File
@@ -1,10 +1,6 @@
using GWMS.Data.DatabaseModels; using GWMS.Data.DatabaseModels;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GWMS.Data namespace GWMS.Data
{ {
@@ -18,6 +14,7 @@ namespace GWMS.Data
/// <param name="modelBuilder"></param> /// <param name="modelBuilder"></param>
public static void Seed(this ModelBuilder modelBuilder) public static void Seed(this ModelBuilder modelBuilder)
{ {
#if false
// inizializzazione dei valori di default x USER // inizializzazione dei valori di default x USER
modelBuilder.Entity<UserModel>().HasData( modelBuilder.Entity<UserModel>().HasData(
new UserModel { UserId = 1, AuthKey = "th1sIsTh3R1vrOfThNgt98", Livello = UserLevel.SuperAdmin, MaskPlantId = 0, MaskSupplierId = 0, MaskTranspId = 0, UserName = "samuele.locatelli", Email = "samuele@steamware.net", Firstname = "Samuele", Lastname = "Locatelli" }, new UserModel { UserId = 1, AuthKey = "th1sIsTh3R1vrOfThNgt98", Livello = UserLevel.SuperAdmin, MaskPlantId = 0, MaskSupplierId = 0, MaskTranspId = 0, UserName = "samuele.locatelli", Email = "samuele@steamware.net", Firstname = "Samuele", Lastname = "Locatelli" },
@@ -34,13 +31,15 @@ namespace GWMS.Data
new UserModel { UserId = 12, AuthKey = "th1sIsTh3R1vrOfThNgt96", Livello = UserLevel.User, MaskPlantId = 3, MaskSupplierId = 0, MaskTranspId = 0, UserName = "piz05.user01", Email = "info@steamware.net", Firstname = "Stazione", Lastname = "Baganzola" }, new UserModel { UserId = 12, AuthKey = "th1sIsTh3R1vrOfThNgt96", Livello = UserLevel.User, MaskPlantId = 3, MaskSupplierId = 0, MaskTranspId = 0, UserName = "piz05.user01", Email = "info@steamware.net", Firstname = "Stazione", Lastname = "Baganzola" },
new UserModel { UserId = 13, AuthKey = "th1sIsTh3R1vrOfThNgt96", Livello = UserLevel.User, MaskPlantId = 4, MaskSupplierId = 0, MaskTranspId = 0, UserName = "piz08.user01", Email = "info@steamware.net", Firstname = "Stazione", Lastname = "Pilastrello" } new UserModel { UserId = 13, AuthKey = "th1sIsTh3R1vrOfThNgt96", Livello = UserLevel.User, MaskPlantId = 4, MaskSupplierId = 0, MaskTranspId = 0, UserName = "piz08.user01", Email = "info@steamware.net", Firstname = "Stazione", Lastname = "Pilastrello" }
); );
#endif
// inizializzazione dei valori di default x Plant // inizializzazione dei valori di default x Plant
modelBuilder.Entity<PlantDetailModel>().HasData( modelBuilder.Entity<PlantDetailModel>().HasData(
new PlantDetailModel { PlantId = 1, PlantCode = "PIZ03", PlantDesc = "Collecchio", LevelMax = 26000, LevelReorder = 15000, OrderQtyStd = 9000 }, new PlantDetailModel { PlantId = 1, PlantCode = "PIZ03", PlantDesc = "Collecchio", LevelMax = 26000, LevelReorder = 15000, OrderQtyStd = 18000 },
new PlantDetailModel { PlantId = 2, PlantCode = "PIZ04", PlantDesc = "Noceto", LevelMax = 28000, LevelReorder = 15000, OrderQtyStd = 18000 }, new PlantDetailModel { PlantId = 2, PlantCode = "PIZ04", PlantDesc = "Noceto", LevelMax = 28000, LevelReorder = 15000, OrderQtyStd = 18000 },
new PlantDetailModel { PlantId = 3, PlantCode = "PIZ05", PlantDesc = "Baganzola", LevelMax = 24000, LevelReorder = 15000, OrderQtyStd = 9000 }, new PlantDetailModel { PlantId = 3, PlantCode = "PIZ05", PlantDesc = "Baganzola", LevelMax = 24000, LevelReorder = 15000, OrderQtyStd = 18000 },
new PlantDetailModel { PlantId = 4, PlantCode = "PIZ08", PlantDesc = "Pilastrello", LevelMax = 26000, LevelReorder = 15000, OrderQtyStd = 9000 } new PlantDetailModel { PlantId = 4, PlantCode = "PIZ08", PlantDesc = "Pilastrello", LevelMax = 26000, LevelReorder = 15000, OrderQtyStd = 18000 },
new PlantDetailModel { PlantId = 5, PlantCode = "PIZ09", PlantDesc = "Guardamiglio", LevelMax = 26000, LevelReorder = 15000, OrderQtyStd = 18000 }
// new PlantDetailModel { PlantId = 1, PlantCode = "PIZ03", PlantDesc = "Collecchio", LevelMax = 26000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 }, // new PlantDetailModel { PlantId = 1, PlantCode = "PIZ03", PlantDesc = "Collecchio", LevelMax = 26000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 },
//new PlantDetailModel { PlantId = 2, PlantCode = "PIZ04", PlantDesc = "Noceto", LevelMax = 28000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 }, //new PlantDetailModel { PlantId = 2, PlantCode = "PIZ04", PlantDesc = "Noceto", LevelMax = 28000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 },
//new PlantDetailModel { PlantId = 3, PlantCode = "PIZ05", PlantDesc = "Baganzola", LevelMax = 24000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 }, //new PlantDetailModel { PlantId = 3, PlantCode = "PIZ05", PlantDesc = "Baganzola", LevelMax = 24000, PressMax = 19, PressBHMax = 270, PressBLMax = 270 },
@@ -6,10 +6,10 @@ DROP PROCEDURE IF EXISTS DeletePlantLogrecords;
DELIMITER $$ DELIMITER $$
CREATE PROCEDURE DeletePlantLogrecords( CREATE PROCEDURE DeletePlantLogrecords(
IN pStartDate DATETIME, IN pStartDate DATETIME,
IN pPlantId INT, IN pPlantId INT,
IN pMinInt INT, IN pMinInt INT,
IN pFluxType VARCHAR(250) IN pFluxType VARCHAR(250)
) )
BEGIN BEGIN
@@ -0,0 +1,74 @@
USE GWMS_PZZFRR;
DROP PROCEDURE IF EXISTS stp_deleteDuplicatedAlarms;
DELIMITER $$
CREATE PROCEDURE `stp_deleteDuplicatedAlarms`(
IN `PlantIdReq` INT
)
BEGIN
-- Eliminazione allarmi duplicati + indicazione AllOk al secondo (ultimo) della serie per chiusura'
-- Step 1: Eliminazione record 'interni' duplicati (in una sequenza lascia solo primo ed ultimo)
DELETE
FROM AlarmLog
WHERE AlarmLogId IN (
SELECT AlarmLogId
FROM (
SELECT
AlarmLogId,
PlantId,
`Status` AS CurState,
LAG(`Status`) OVER (ORDER BY AlarmLogId) AS prev_State,
LEAD(`Status`) OVER (ORDER BY AlarmLogId) AS next_State
FROM AlarmLog
WHERE PlantId = PlantIdReq
) AS cte
WHERE
(CurState = prev_State) AND (CurState = next_State)
);
-- Step 2: Cambio secondo record in "ALL OK"
UPDATE AlarmLog
SET `Status` = 0,
ValDecoded = 'ALL OK'
WHERE AlarmLogId IN (
SELECT AlarmLogId
FROM (
SELECT
AlarmLogId,
PlantId,
`Status` AS CurState,
LAG(`Status`) OVER (ORDER BY AlarmLogId) AS prev_State,
LEAD(`Status`) OVER (ORDER BY AlarmLogId) AS next_State
FROM AlarmLog
WHERE PlantId = PlantIdReq
) AS cte
WHERE
(CurState = prev_State) AND (CurState != next_State)
);
-- Step 3: Eliminazione eventuali record duplicati 'ALL OK'
DELETE
FROM AlarmLog
WHERE AlarmLogId IN (
SELECT AlarmLogId
FROM (
SELECT
AlarmLogId,
PlantId,
`Status` AS CurState,
LAG(`Status`) OVER (ORDER BY AlarmLogId) AS prev_State,
LEAD(`Status`) OVER (ORDER BY AlarmLogId) AS next_State
FROM AlarmLog
WHERE PlantId = PlantIdReq
) AS cte
WHERE
(CurState = prev_State) AND (CurState = 0)
);
END$$
DELIMITER ;
-5
View File
@@ -1,11 +1,6 @@
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GWMS.Data namespace GWMS.Data
{ {
+36 -1
View File
@@ -1,5 +1,7 @@
using System; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -8,10 +10,43 @@ namespace GWMS.Data
{ {
public class TSData public class TSData
{ {
#region Public Constructors
///// <summary>
///// Init generico per retrocompatibilità e deserializzazione
///// </summary>
public TSData() { }
/// <summary>
/// Costruttore "Smart" per la creazione rapida e ottimizzata
/// </summary>
/// <param name="dt"></param>
/// <param name="val"></param>
/// <param name="doRound"></param>
public TSData(DateTime dt, double val, bool doRound = true)
{
if (doRound)
{
// Arrotonda al secondo: crea una nuova data ignorando i Tick (millisecondi)
DtEvent = new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second);
// Arrotonda a 2 decimali
ValDouble = Math.Round(val, 2);
}
else
{
DtEvent = dt;
ValDouble = val;
}
}
#endregion Public Constructors
#region Public Properties #region Public Properties
[JsonProperty("d")]
public DateTime DtEvent { get; set; } = DateTime.Now; public DateTime DtEvent { get; set; } = DateTime.Now;
[JsonProperty("v")]
public double ValDouble { get; set; } = 0; public double ValDouble { get; set; } = 0;
#endregion Public Properties #endregion Public Properties
+10 -4
View File
@@ -1,10 +1,8 @@
using GWMS.Data.DatabaseModels; using GWMS.Data.DatabaseModels;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NLog;
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GWMS.Data namespace GWMS.Data
{ {
@@ -36,7 +34,9 @@ namespace GWMS.Data
Database.Migrate(); Database.Migrate();
} }
catch (Exception exc) catch (Exception exc)
{ } {
Log.Error($"Eccezione in UserIdentityDbContext{Environment.NewLine}{exc}");
}
} }
#endregion Public Constructors #endregion Public Constructors
@@ -67,5 +67,11 @@ namespace GWMS.Data
} }
#endregion Protected Methods #endregion Protected Methods
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
} }
} }
+31
View File
@@ -0,0 +1,31 @@
using System;
namespace GWMS.Data
{
public class chartJsData
{
#region Public Classes
public class chartJsTSerie
{
#region Public Properties
public DateTime x { get; set; }
public double y { get; set; }
#endregion Public Properties
}
public class chartJsXY
{
#region Public Properties
public double x { get; set; }
public double y { get; set; }
#endregion Public Properties
}
#endregion Public Classes
}
}
+5
View File
@@ -0,0 +1,5 @@
{
"version": "1.0",
"defaultProvider": "cdnjs",
"libraries": []
}
+8 -1
View File
@@ -1,5 +1,12 @@
{ {
"version": 1, "version": 1,
"isRoot": true, "isRoot": true,
"tools": {} "tools": {
"dotnet-ef": {
"version": "6.0.2",
"commands": [
"dotnet-ef"
]
}
}
} }
@@ -147,8 +147,7 @@ namespace GWMS.UI.Areas.Identity.Pages.Account
values: new { area = "Identity", userId = userId, code = code }, values: new { area = "Identity", userId = userId, code = code },
protocol: Request.Scheme); protocol: Request.Scheme);
await _emailSender.SendEmailAsync(Input.Email, "Confirm your email", await _emailSender.SendEmailAsync(Input.Email, "Confirm your email", $"Please confirm your account by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>.");
$"Please confirm your account by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>.");
// If account confirmation is required, we need to show the link if we don't have a real email sender // If account confirmation is required, we need to show the link if we don't have a real email sender
if (_userManager.Options.SignIn.RequireConfirmedAccount) if (_userManager.Options.SignIn.RequireConfirmedAccount)
@@ -10,7 +10,7 @@
@{ @{
if (User.Identity.IsAuthenticated) if (User.Identity.IsAuthenticated)
{ {
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Page("/", new { area = "" })" method="post"> <form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" method="post">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<p>Premendo sul pulsante effettuerai il logout dal sistema.</p> <p>Premendo sul pulsante effettuerai il logout dal sistema.</p>
@@ -51,40 +51,46 @@
</div> </div>
</form> </form>
</section> </section>
<div class="col-md-6">
@if (User.Identity.IsAuthenticated)
{
<h2>USER OK!</h2>
}
</div>
</div> </div>
@*<div class="col-md-6 col-md-offset-2"> @*<div class="col-md-6 col-md-offset-2">
<section> <section>
<h4>Use another service to log in.</h4> <h4>Use another service to log in.</h4>
<hr /> <hr />
@{ @{
if ((Model.ExternalLogins?.Count ?? 0) == 0) if ((Model.ExternalLogins?.Count ?? 0) == 0)
{ {
<div> <div>
<p> <p>
There are no external authentication services configured. See <a href="https://go.microsoft.com/fwlink/?LinkID=532715">this article</a> There are no external authentication services configured. See <a href="https://go.microsoft.com/fwlink/?LinkID=532715">this article</a>
for details on setting up this ASP.NET application to support logging in via external services. for details on setting up this ASP.NET application to support logging in via external services.
</p> </p>
</div> </div>
} }
else else
{ {
<form id="external-account" asp-page="./ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" method="post" class="form-horizontal"> <form id="external-account" asp-page="./ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" method="post" class="form-horizontal">
<div> <div>
<p> <p>
@foreach (var provider in Model.ExternalLogins) @foreach (var provider in Model.ExternalLogins)
{ {
<button type="submit" class="btn btn-primary" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">@provider.DisplayName</button> <button type="submit" class="btn btn-primary" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">@provider.DisplayName</button>
} }
</p> </p>
</div> </div>
</form> </form>
} }
} }
</section> </section>
</div>*@ </div>*@
</div> </div>
</div> </div>
</div> </div>
@section Scripts { @section Scripts {
<partial name="_ValidationScriptsPartial" /> <partial name="_ValidationScriptsPartial" />
} }
@@ -1,39 +1,28 @@
using System; using Microsoft.AspNetCore.Authentication;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text.Encodings.Web;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using Microsoft.Extensions.Configuration;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace GWMS.UI.Areas.Identity.Pages.Account namespace GWMS.UI.Areas.Identity.Pages.Account
{ {
[AllowAnonymous] [AllowAnonymous]
public class LoginModel : PageModel public class LoginModel : PageModel
{ {
#region Private Fields
private readonly ILogger<LoginModel> _logger;
private readonly SignInManager<IdentityUser> _signInManager;
private readonly UserManager<IdentityUser> _userManager;
#endregion Private Fields
#region Public Constructors #region Public Constructors
public LoginModel(SignInManager<IdentityUser> signInManager, public LoginModel(SignInManager<IdentityUser> signInManager, ILogger<LoginModel> logger, UserManager<IdentityUser> userManager, IConfiguration configuration)
ILogger<LoginModel> logger,
UserManager<IdentityUser> userManager)
{ {
_userManager = userManager; _userManager = userManager;
_signInManager = signInManager; _signInManager = signInManager;
_logger = logger; _logger = logger;
_configuration = configuration;
} }
#endregion Public Constructors #endregion Public Constructors
@@ -52,56 +41,9 @@ namespace GWMS.UI.Areas.Identity.Pages.Account
#endregion Public Properties #endregion Public Properties
#region Private Methods
private async Task CheckSuperAdmin()
{
// se non ci fosse --> creo samuele come superadmin
string superUser = "samuele@steamware.net";
string superPwd = "viaDante16!";
string ADMIN_ROLE = "SuperAdmin";
var user = await _userManager.FindByEmailAsync(superUser);
if (user == null)
{
// Insert new user
var NewUser =
new IdentityUser
{
UserName = superUser,
Email = superUser,
EmailConfirmed = true
};
var CreateResult = await _userManager.CreateAsync(NewUser, superPwd);
if (CreateResult.Succeeded)
{
user = await _userManager.FindByEmailAsync(superUser);
}
}
// verifico ruoli...
if (user != null)
{
bool needCreate = true;
// Gestione salvataggio ruoli... SE VARIATO...
var UserRoles = await _userManager.GetRolesAsync(user);
if (UserRoles != null && UserRoles.Count > 0)
{
var oldRole = UserRoles.Where(x => x == ADMIN_ROLE).FirstOrDefault();
needCreate = (oldRole == null);
}
if (needCreate)
{
// aggiungo a ruolo admin
await _userManager.AddToRoleAsync(user, ADMIN_ROLE);
}
}
}
#endregion Private Methods
#region Public Methods #region Public Methods
public async Task OnGetAsync(string returnUrl = null) public async Task<IActionResult> OnGetAsync(string returnUrl = null)
{ {
await CheckSuperAdmin(); await CheckSuperAdmin();
if (!string.IsNullOrEmpty(ErrorMessage)) if (!string.IsNullOrEmpty(ErrorMessage))
@@ -117,6 +59,14 @@ namespace GWMS.UI.Areas.Identity.Pages.Account
ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList(); ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
ReturnUrl = returnUrl; ReturnUrl = returnUrl;
var nextPage = await checkJumpLogin();
if (!string.IsNullOrEmpty(nextPage))
{
return LocalRedirect(nextPage);
}
return Page();
} }
public async Task<IActionResult> OnPostAsync(string returnUrl = null) public async Task<IActionResult> OnPostAsync(string returnUrl = null)
@@ -127,8 +77,8 @@ namespace GWMS.UI.Areas.Identity.Pages.Account
if (ModelState.IsValid) if (ModelState.IsValid)
{ {
// This doesn't count login failures towards account lockout // This doesn't count login failures towards account lockout To enable password
// To enable password failures to trigger account lockout, set lockoutOnFailure: true // failures to trigger account lockout, set lockoutOnFailure: true
var result = await _signInManager.PasswordSignInAsync(Input.Email, Input.Password, Input.RememberMe, lockoutOnFailure: false); var result = await _signInManager.PasswordSignInAsync(Input.Email, Input.Password, Input.RememberMe, lockoutOnFailure: false);
if (result.Succeeded) if (result.Succeeded)
{ {
@@ -178,5 +128,109 @@ namespace GWMS.UI.Areas.Identity.Pages.Account
} }
#endregion Public Classes #endregion Public Classes
#region Private Fields
private readonly ILogger<LoginModel> _logger;
private readonly SignInManager<IdentityUser> _signInManager;
private readonly UserManager<IdentityUser> _userManager;
private IConfiguration _configuration;
#endregion Private Fields
#region Private Methods
private async Task<string> checkJumpLogin()
{
string nextPage = "";
string uid = getReqPar("uid", "");
string uem = getReqPar("uem", "");
string pag = getReqPar("pag", "Transporters");
string baseAppPath = $"{_configuration["RuntimeOpt:BaseAppPath"]}";
await Task.Delay(1);
if (!string.IsNullOrEmpty(uid) && !string.IsNullOrEmpty(uem))
{
var user = await _userManager.FindByEmailAsync(uem);
if (user != null)
{
if (user.Id == uid)
{
// se corrispondono --> signini!
await _signInManager.SignInAsync(user, false);
_logger.LogInformation($"Forced User log in via URL token for {uem}");
// salto a pagina target da conf + req
nextPage = string.IsNullOrEmpty(pag) ? baseAppPath : $"{baseAppPath}{pag}";
}
}
}
return nextPage;
}
private async Task CheckSuperAdmin()
{
// se non ci fosse --> creo samuele come superadmin
string superUser = "samuele@steamware.net";
string superPwd = "viaDante16!";
string ADMIN_ROLE = "SuperAdmin";
var user = await _userManager.FindByEmailAsync(superUser);
if (user == null)
{
// Insert new user
var NewUser =
new IdentityUser
{
UserName = superUser,
Email = superUser,
EmailConfirmed = true
};
var CreateResult = await _userManager.CreateAsync(NewUser, superPwd);
if (CreateResult.Succeeded)
{
user = await _userManager.FindByEmailAsync(superUser);
}
}
// verifico ruoli...
if (user != null)
{
bool needCreate = true;
// Gestione salvataggio ruoli... SE VARIATO...
var UserRoles = await _userManager.GetRolesAsync(user);
if (UserRoles != null && UserRoles.Count > 0)
{
var oldRole = UserRoles.Where(x => x == ADMIN_ROLE).FirstOrDefault();
needCreate = (oldRole == null);
}
if (needCreate)
{
// aggiungo a ruolo admin
await _userManager.AddToRoleAsync(user, ADMIN_ROLE);
}
}
}
/// <summary>
/// Restituisce valore da Request (se presente) oppure defaultVal
/// </summary>
/// <param name="key"></param>
/// <param name="defaultVal"></param>
/// <returns></returns>
private string getReqPar(string key, string defaultVal = "")
{
string answ = defaultVal;
var rawQuery = Request.Query;
if (rawQuery != null)
{
if (rawQuery.ContainsKey(key))
{
answ = rawQuery[key];
}
}
return answ;
}
#endregion Private Methods
} }
} }
@@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace GWMS.UI.Areas.Identity.Pages.Account namespace GWMS.UI.Areas.Identity.Pages.Account
@@ -17,15 +18,17 @@ namespace GWMS.UI.Areas.Identity.Pages.Account
private readonly ILogger<LogoutModel> _logger; private readonly ILogger<LogoutModel> _logger;
private readonly SignInManager<IdentityUser> _signInManager; private readonly SignInManager<IdentityUser> _signInManager;
private IConfiguration _configuration;
#endregion Private Fields #endregion Private Fields
#region Public Constructors #region Public Constructors
public LogoutModel(SignInManager<IdentityUser> signInManager, ILogger<LogoutModel> logger) public LogoutModel(SignInManager<IdentityUser> signInManager, ILogger<LogoutModel> logger, IConfiguration configuration)
{ {
_signInManager = signInManager; _signInManager = signInManager;
_logger = logger; _logger = logger;
_configuration = configuration;
} }
#endregion Public Constructors #endregion Public Constructors
@@ -36,6 +39,8 @@ namespace GWMS.UI.Areas.Identity.Pages.Account
{ {
} }
public async Task<IActionResult> OnPost(string returnUrl = null) public async Task<IActionResult> OnPost(string returnUrl = null)
{ {
await _signInManager.SignOutAsync(); await _signInManager.SignOutAsync();
@@ -46,7 +51,8 @@ namespace GWMS.UI.Areas.Identity.Pages.Account
} }
else else
{ {
return RedirectToPage(); string appDir = $"{_configuration["RuntimeOpt:BaseUrl"]}{_configuration["RuntimeOpt:BaseAppPath"]}";
return Redirect(appDir);
} }
} }
@@ -12,7 +12,7 @@
<p>Ora è necessario effettuare la verifica dell'email registrata</p> <p>Ora è necessario effettuare la verifica dell'email registrata</p>
</div> </div>
<b>Prego verifica la posta ricevuta all'account registrato per effettuare la conferma.</b> <b>Prego verifica la posta ricevuta all'account registrato per effettuare la conferma.</b>
<p>Riceverai un email da steamwarebot at gmail.com con un link da cliccare per completare la registrazione. Dopo la conferma potrai effettuare il login all'applicazione.</p> <p>Riceverai un email da gwms.notify@outlook.com con un link da cliccare per completare la registrazione. Dopo la conferma potrai effettuare il login all'applicazione.</p>
</div> </div>
<div class="card-footer"> <div class="card-footer">
<div class="row"> <div class="row">
+57
View File
@@ -0,0 +1,57 @@
using Microsoft.AspNetCore.Components;
using System;
using System.Diagnostics;
namespace GWMS.UI.Components
{
public abstract class BaseComp : ComponentBase, IDisposable
{
#region Public Methods
public virtual void Dispose()
{
// Opzionale: logga quando l'utente lascia la pagina/componente
}
#endregion Public Methods
#region Protected Fields
/// <summary>
/// Sorgente statica condivisa per tutto il layer UI
/// </summary>
protected static readonly ActivitySource UIActivitySource = new ActivitySource("GWMS.UI");
#endregion Protected Fields
#region Protected Properties
[Inject]
protected NavigationManager Navigation { get; set; } = default!;
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// Avvia un'attività tracciata con metadati standard del componente
/// </summary>
protected Activity? StartTracing(string operationName)
{
// Verifica se qualcuno sta ascoltando questa sorgente
if (!UIActivitySource.HasListeners()) return null;
// init activity con nome gestito
var activity = UIActivitySource.StartActivity($"{GetType().Name}:{operationName}");
// Aggiungiamo tag standard utili per il debug su Uptrace
activity?.SetTag("ui.component_type", GetType().Name);
activity?.SetTag("ui.url", Navigation.Uri);
activity?.SetTag("data.source", "UI");
return activity;
}
#endregion Protected Methods
}
}
+142
View File
@@ -0,0 +1,142 @@
@using GWMS.Data
@inject IJSRuntime JSRuntime
<canvas id="@Id"></canvas>
@code {
private List<chartJsData.chartJsTSerie> _DataTS { get; set; } = null!;
[Parameter]
public string Id { get; set; } = "MyTs";
[Parameter]
public string Title { get; set; } = "Demo Line";
[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> pointColor { get; set; } = new List<string>();
[Parameter]
public List<string> lineColor { get; set; } = new List<string>();
[Parameter]
public List<string> backColor { get; set; } = new List<string>();
[Parameter]
public double AspRatio { get; set; } = 0;
[Parameter]
public string MinValue { get; set; } = "0";
[Parameter]
public string MaxValue { get; set; } = "0";
[Parameter]
public int lTens { get; set; } = 0;
/// <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);
}
}
+2 -8
View File
@@ -1,16 +1,10 @@
<div class="form-row text-light"> <div class="form-row text-light">
<div class="col-5 pr-0 text-left"> <div class="col-5 pr-0 text-left">
GWMS <span class="small">v.@version</span> <string>GWMS</string> <span class="small">v.@version</span><small> | Srv: @nodeId</small>
</div> </div>
<div class="col-7 pl-0 text-right"> <div class="col-7 pl-0 text-right">
<span class="small">@adesso</span> <span class="small">@adesso</span>
<a class="text-light" href="https://www.egalware.com/" target="_blank">Egalware<img class="img-fluid" width="16" src="img/LogoBlu.svg" /></a> <a class="text-light" href="https://www.egalware.com/" target="_blank">Egalware<img class="img-fluid" width="16" src="img/EgalwareLogo.svg" /></a>
</div> </div>
</div> </div>
@code {
protected DateTime adesso = DateTime.Now;
Version version = typeof(Program).Assembly.GetName().Version;
}
+91
View File
@@ -0,0 +1,91 @@
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Configuration;
using System;
using System.Threading.Tasks;
namespace GWMS.UI.Components
{
public partial class CmpFooter : IDisposable
{
#region Public Methods
public void Dispose()
{
if (aTimer != null)
{
aTimer.Elapsed -= ElapsedTimer;
aTimer.Stop();
aTimer.Dispose();
}
}
public void ElapsedTimer(Object source, System.Timers.ElapsedEventArgs e)
{
var pUpd = Task.Run(async () =>
{
adesso = DateTime.Now;
await InvokeAsync(StateHasChanged);
});
pUpd.Wait();
}
public void StartTimer()
{
if (aTimer != null)
{
aTimer.Stop();
aTimer.Dispose();
}
int tOutPeriod = 1000;
aTimer = new System.Timers.Timer(tOutPeriod);
aTimer.Elapsed += ElapsedTimer;
aTimer.Enabled = true;
aTimer.Start();
}
#endregion Public Methods
#region Protected Fields
protected DateTime adesso = DateTime.Now;
private string nodeId = Environment.MachineName;
#endregion Protected Fields
#region Protected Methods
protected override void OnInitialized()
{
var rawVers = typeof(Program).Assembly.GetName().Version;
version = rawVers != null ? rawVers : new Version("0.0.0.0");
nodeId = Environment.MachineName;
#if DEBUG
// nome completo...
#else
//Se non fosse develop --> prende gli ultimi 2 caratteri(es. "01")
if (nodeId.Length > 2)
{
nodeId = nodeId.Substring(nodeId.Length - 2);
}
#endif
StartTimer();
}
#endregion Protected Methods
#region Private Fields
private System.Timers.Timer aTimer = null!;
private Version? version = null!;
#endregion Private Fields
#region Private Properties
[Inject]
private IConfiguration Configuration { get; set; }
#endregion Private Properties
}
}
+2 -21
View File
@@ -4,14 +4,13 @@
@using GWMS.UI.Data @using GWMS.UI.Data
@inject MessageService AppMessages @inject MessageService AppMessages
@inject AuthenticationStateProvider AuthenticationStateProvider
<div class="form-row pt-3"> <div class="form-row pt-3">
<div class="col-7 col-md-6 col-lg-4 col-xl-3"> <div class="col-7 col-md-6 col-lg-4 col-xl-3">
<LoginDisplay></LoginDisplay> <LoginDisplay></LoginDisplay>
</div> </div>
<div class="col-12 col-lg-4 col-xl-6 d-none d-lg-block text-center h4 text-truncate"> <div class="col-12 col-lg-4 col-xl-6 d-none d-lg-block text-center h4 text-truncate">
<span class="@PageIcon" aria-hidden="true"></span> @PageName <span><i class="@PageIcon" aria-hidden="true"></i> @PageName</span>
</div> </div>
<div class="col-5 col-md-6 col-lg-4 col-xl-3 text-right"> <div class="col-5 col-md-6 col-lg-4 col-xl-3 text-right">
@if (ShowSearch) @if (ShowSearch)
@@ -23,20 +22,17 @@
@code { @code {
[CascadingParameter]
private Task<AuthenticationState> AuthenticationStateTask { get; set; }
[CascadingParameter(Name = "ShowSearch")] [CascadingParameter(Name = "ShowSearch")]
private bool ShowSearch { get; set; } private bool ShowSearch { get; set; }
private string userName = "";
private string PageName { get; set; } private string PageName { get; set; }
private string PageIcon { get; set; } private string PageIcon { get; set; }
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
{ {
await forceReload(); await Task.Delay(0);
} }
protected override void OnInitialized() protected override void OnInitialized()
@@ -58,21 +54,6 @@
AppMessages.EA_PageUpdated -= OnPageUpdate; AppMessages.EA_PageUpdated -= OnPageUpdate;
} }
private async Task forceReload()
{
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
var user = authState.User;
if (user.Identity.IsAuthenticated)
{
userName = $"{user.Identity.Name}";
}
else
{
userName = "N.A.";
}
}
} }
@* // Vedere anche: @* // Vedere anche:
+58
View File
@@ -0,0 +1,58 @@
@using System
@inject IJSRuntime JSRuntime
<div class="input-group input-group-sm">
@if (ShowText)
{
<input class="form-control" readonly type="text" value="@Text" />
}
else
{
<span class="form-control fas fa-eye-slash" readonly></span>
}
<div class="input-group-append">
<button type="button" class="btn @btnStyle" @onclick="CopyTextToClipboard" title="Copy to Clipboard">
@if (copyDone)
{
<span><i class="far fa-thumbs-up"></i></span>
}
else
{
<span><i class="far fa-copy"></i></span>
}
</button>
</div>
</div>
@code {
/// <summary>
/// Metodi per copia verso clipboard:
/// link:
/// - https://chrissainty.com/copy-to-clipboard-in-blazor/
/// - https://www.daveabrock.com/2021/02/18/copy-to-clipboard-markdown-editor/
/// - https://www.meziantou.net/
/// </summary>
[Parameter]
public string Text { get; set; }
[Parameter]
public bool ShowText { get; set; } = true;
protected string btnStyle = "btn-primary";
protected bool copyDone = false;
private async Task CopyTextToClipboard()
{
// cambio colore..
btnStyle = "btn-success";
copyDone = true;
await JSRuntime.InvokeVoidAsync("clipboardCopy.copyText", Text);
await Task.Delay(1100);
// fix cambio colore..
btnStyle = "btn-primary";
copyDone = false;
await Task.Delay(10);
}
}
+30 -40
View File
@@ -1,40 +1,20 @@
<div class="row"> <div class="row">
<div class="col-12 col-lg-9 text-left"> <div class="col-12 col-lg-8 text-start">
<div class="row"> <div class="row">
<div class="col-12 small"> <div class="col-12 small">
@if (totalCount > 0) @if (totalCount > 0)
{ {
<Pagination Class="mb-0"> <ul class="pagination pagination-sm mb-1">
<PaginationItem> <li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(1)"><i class="fas fa-angle-double-left"></i></button></li>
<PaginationLink Clicked="@HandlePaginationItemClick" Page="1"> <li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(prevBlock)"><i class="fas fa-angle-left"></i></button></li>
<i class="fas fa-angle-double-left"></i>
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink Clicked="@HandlePaginationItemClick" Page="@prevBlock.ToString()">
<span aria-hidden="true"><i class="fas fa-angle-left"></i></span>
</PaginationLink>
</PaginationItem>
@for (int i = @startPage; i <= endPage; ++i) @for (int i = @startPage; i <= endPage; ++i)
{ {
var pageNum = i; var pageNum = i;
<PaginationItem Active="@(currPage.Equals(pageNum))"> <li class="page-item @cssActive(pageNum)"><button class="page-link" @onclick="() => PaginationItemClick(pageNum)">@pageNum</button></li>
<PaginationLink Clicked="@HandlePaginationItemClick" Page="@pageNum.ToString()">
@pageNum
</PaginationLink>
</PaginationItem>
} }
<PaginationItem> <li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(nextBlock)"><i class="fas fa-angle-right"></i></button></li>
<PaginationLink Clicked="@HandlePaginationItemClick" Page="@nextBlock.ToString()"> <li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(LastPage)"><i class="fas fa-angle-double-right"></i></button></li>
<i class="fas fa-angle-right"></i> </ul>
</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationLink Clicked="@HandlePaginationItemClick" Page="@LastPage.ToString()">
<i class="fas fa-angle-double-right"></i>
</PaginationLink>
</PaginationItem>
</Pagination>
} }
</div> </div>
</div> </div>
@@ -42,31 +22,41 @@
<div class="col-12 small"> <div class="col-12 small">
@if (showLoading) @if (showLoading)
{ {
<Progress> <div class="progress" style="height: 10px;">
<ProgressBar Value="@percLoading" Striped="true" Animated="true" /> <div class="progress-bar progress-bar-striped progress-bar-animated" style="width:@percLoading%;"></div>
</Progress> </div>
} }
</div> </div>
</div> </div>
</div> </div>
<div class="col-12 col-lg-3"> <div class="col-12 col-lg-4">
<div class="d-flex"> <div class="d-flex">
<div class="p-1 flex-fill text-right"> <div class="p-1 flex-fill text-end">
@if (!showLoading) @if (!showLoading)
{ {
<span>@totalCount records</span> <span>@totalCount records</span>
} }
@if (exportEnabled && totalCount > 0)
{
if (!fileExist)
{
<button class="btn btn-block btn-sm btn-primary" @onclick="() => requestSave()"><span class="oi oi-wrench"></span> Prepare Data</button>
}
else
{
<a target="_blank" href="Download?fileName=@fileName" class="btn btn-block btn-sm btn-success"><span class="oi oi-cloud-download"></span> Download Data</a>
}
}
</div> </div>
<div class="p-1 flex-fill text-right small"> <div class="p-1 flex-fill text-end small">
@if (totalCount > 0) @if (totalCount > 0)
{ {
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
<select @bind="@PageSize" class="form-control form-control-sm"> <select @bind="@PageSize" class="form-select form-select-sm">
<option value="5">5</option> @foreach (var item in PageSizeList)
<option value="10">10</option> {
<option value="25">25</option> <option value="@item">@item</option>
<option value="50">50</option> }
<option value="100">100</option>
</select> </select>
</div> </div>
} }
+179 -95
View File
@@ -5,17 +5,188 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using GWMS.UI.Components; using GWMS.UI.Components;
using GWMS.UI.Data; using GWMS.UI.Data;
using System.IO;
namespace GWMS.UI.Components namespace GWMS.UI.Components
{ {
public partial class DataPager : ComponentBase public partial class DataPager : ComponentBase
{ {
#region Public Properties
/// <summary>
/// Num pagina correntemente selezioanta
/// </summary>
[Parameter]
public int currPage
{
get
{
return _numPage;
}
set
{
bool doReport = !_numPage.Equals(value);
if (doReport)
{
_numPage = value;
reportChangePage();
}
}
}
/// <summary>
/// Export (csv) abilitato
/// </summary>
[Parameter]
public bool exportEnabled { get; set; } = false;
/// <summary>
/// Evento richiesta export
/// </summary>
[Parameter]
public EventCallback<int> exportRequested { get; set; }
/// <summary>
/// Filename x export
/// </summary>
[Parameter]
public string fileName { get; set; } = "";
/// <summary>
/// Evento cambio pagina nel paginatore
/// </summary>
[Parameter]
public EventCallback<int> numPageChanged { get; set; }
/// <summary>
/// PageSize = Num record da mostrare cambiato
/// </summary>
[Parameter]
public EventCallback<int> numRecordChanged { get; set; }
/// <summary>
/// Attuale PageSize
/// </summary>
[Parameter]
public int PageSize
{
get
{
return _numRecord;
}
set
{
bool doReport = !_numRecord.Equals(value);
if (doReport)
{
_numRecord = value;
reportChange();
}
}
}
/// <summary>
/// Fase di loading
/// </summary>
[Parameter]
public bool showLoading
{
get
{
return _showLoading;
}
set
{
if (value)
{
Random random = new Random();
percLoading = random.Next(30, 90);
}
else
{
percLoading = 5;
}
_showLoading = value;
}
}
/// <summary>
/// Totale record da mostrare
/// </summary>
[Parameter]
public int totalCount { get; set; } = 0;
/// <summary>
/// Elenco dei PageSize ammessi
/// </summary>
[Parameter]
public List<int> PageSizeList { get; set; } = new List<int>()
{
5,10,25,50,100
};
#endregion Public Properties
#region Public Methods
public void resetCurrPage()
{
//await Task.Delay(1);
currPage = 1;
}
#endregion Public Methods
#region Protected Fields #region Protected Fields
protected bool _showLoading = false; protected bool _showLoading = false;
protected string exportDir = $"{Directory.GetCurrentDirectory()}\\temp";
#endregion Protected Fields #endregion Protected Fields
#region Protected Properties
protected int _numPage { get; set; } = 1;
protected int _numRecord { get; set; } = 10;
protected bool fileExist
{
get
{
return File.Exists(fullPath);
}
}
protected string fullPath
{
get => $"{exportDir}\\{fileName}";
}
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 #region Private Properties
private int endPage private int endPage
@@ -71,87 +242,6 @@ namespace GWMS.UI.Components
#endregion Private Properties #endregion Private Properties
#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 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();
}
}
}
[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 Private Methods #region Private Methods
private void reportChange() private void reportChange()
@@ -164,20 +254,14 @@ namespace GWMS.UI.Components
numPageChanged.InvokeAsync(currPage); numPageChanged.InvokeAsync(currPage);
} }
private async Task requestSave()
{
showLoading = true;
await Task.Delay(1);
await exportRequested.InvokeAsync(currPage);
showLoading = false;
}
#endregion Private Methods #endregion Private Methods
#region Protected Methods
protected void HandlePaginationItemClick(string page)
{
currPage = int.Parse(page);
}
protected override async Task OnInitializedAsync()
{
await Task.Run(() => showLoading = false);
}
#endregion Protected Methods
} }
} }
+124
View File
@@ -0,0 +1,124 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Rendering;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
namespace GWMS.UI.Components
{
/// <summary>
/// override calsse inputdate da
/// https://github.com/dotnet/aspnetcore/issues/18078
/// </summary>
/// <typeparam name="TValue"></typeparam>
public class InputDateTime<TValue> : InputDate<TValue>
{
#region Private Fields
private const string DateFormat = "yyyy-MM-ddTHH:mm:ss";
#endregion Private Fields
#region Private Methods
private static bool TryParseDateTime(string value, out TValue result)
{
var success = BindConverter.TryConvertToDateTime(value, CultureInfo.InvariantCulture, DateFormat, out var parsedValue);
if (success)
{
result = (TValue)(object)parsedValue;
return true;
}
else
{
result = default;
return false;
}
}
private static bool TryParseDateTimeOffset(string value, out TValue result)
{
var success = BindConverter.TryConvertToDateTimeOffset(value, CultureInfo.InvariantCulture, DateFormat, out var parsedValue);
if (success)
{
result = (TValue)(object)parsedValue;
return true;
}
else
{
result = default;
return false;
}
}
#endregion Private Methods
#region Protected Methods
/// <inheritdoc />
protected override void BuildRenderTree(RenderTreeBuilder builder)
{
builder.OpenElement(0, "input");
builder.AddMultipleAttributes(1, AdditionalAttributes);
builder.AddAttribute(2, "type", "datetime-local");
builder.AddAttribute(3, "class", CssClass);
builder.AddAttribute(4, "value", BindConverter.FormatValue(CurrentValueAsString));
builder.AddAttribute(5, "onchange", EventCallback.Factory.CreateBinder<string>(this, __value => CurrentValueAsString = __value, CurrentValueAsString));
builder.CloseElement();
}
/// <inheritdoc />
protected override string FormatValueAsString(TValue value)
{
switch (value)
{
case DateTime dateTimeValue:
return BindConverter.FormatValue(dateTimeValue, DateFormat, CultureInfo.InvariantCulture);
case DateTimeOffset dateTimeOffsetValue:
return BindConverter.FormatValue(dateTimeOffsetValue, DateFormat, CultureInfo.InvariantCulture);
default:
return string.Empty; // Handles null for Nullable<DateTime>, etc.
}
}
/// <inheritdoc />
protected override bool TryParseValueFromString(string value, out TValue result, out string validationErrorMessage)
{
// Unwrap nullable types. We don't have to deal with receiving empty values for nullable
// types here, because the underlying InputBase already covers that.
var targetType = Nullable.GetUnderlyingType(typeof(TValue)) ?? typeof(TValue);
bool success;
if (targetType == typeof(DateTime))
{
success = TryParseDateTime(value, out result);
}
else if (targetType == typeof(DateTimeOffset))
{
success = TryParseDateTimeOffset(value, out result);
}
else
{
throw new InvalidOperationException($"The type '{targetType}' is not a supported date type.");
}
if (success)
{
validationErrorMessage = null;
return true;
}
else
{
validationErrorMessage = string.Format(ParsingErrorMessage, FieldIdentifier.FieldName);
return false;
}
}
#endregion Protected Methods
}
}
@@ -0,0 +1,6 @@
<div class="row p-2 m-2">
<div class="col-12 text-center mt-2 py-2 alert alert-primary">
<b>loading data</b>
<i class="fas fa-spinner fa-spin fa-2x"></i>
</div>
</div>
+8 -2
View File
@@ -1,6 +1,8 @@
@using Microsoft.AspNetCore.Components.Authorization @using Microsoft.AspNetCore.Components.Authorization
@using GWMS.UI.Data
@inject AuthenticationStateProvider AuthenticationStateProvider @inject AuthenticationStateProvider AuthenticationStateProvider
@inject MessageService MServ
<AuthorizeView> <AuthorizeView>
<Authorized> <Authorized>
@@ -30,9 +32,13 @@
</NotAuthorized> </NotAuthorized>
</AuthorizeView> </AuthorizeView>
@code{ @code {
private string userName = ""; private string userName
{
get => MServ.UserName;
set => MServ.UserName = value;
}
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
{ {
await forceReload(); await forceReload();
+1 -3
View File
@@ -71,11 +71,9 @@
protected async Task ReloadData() protected async Task ReloadData()
{ {
var resultUser = await Health.Checks.DbUserApp(DbConfig.DATABASE_NAME);
var resultIden = await Health.Checks.DbIdentity(DbConfig.DATABASE_NAME); var resultIden = await Health.Checks.DbIdentity(DbConfig.DATABASE_NAME);
DbUserOk = (resultUser.Status == HealthStatus.Healthy);
DbIdentity = (resultIden.Status == HealthStatus.Healthy); DbIdentity = (resultIden.Status == HealthStatus.Healthy);
DbAllOk = (DbUserOk && DbIdentity); DbAllOk = (DbIdentity);
} }
private void reportChange() private void reportChange()
+10 -146
View File
@@ -5,6 +5,8 @@
@using GWMS.UI.Data @using GWMS.UI.Data
@using Microsoft.Extensions.Configuration @using Microsoft.Extensions.Configuration
@inherits BaseComp
@inject MessageService AppMService @inject MessageService AppMService
@inject GWMSDataService DataService @inject GWMSDataService DataService
@inject NavigationManager NavManager @inject NavigationManager NavManager
@@ -40,7 +42,7 @@
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><span class="fas fa-calendar" aria-hidden="true"></span></span> <span class="input-group-text"><span class="fas fa-calendar" aria-hidden="true"></span></span>
</div> </div>
<DateEdit class="form-control" InputMode="DateInputMode.DateTime" @bind-Date="@_currItem.DtOrder" /> <input class="form-control" type="datetime-local" @bind="@_currItem.DtOrder" />
</div> </div>
</div> </div>
<div class="col-3 pl-0"> <div class="col-3 pl-0">
@@ -87,7 +89,7 @@
</div> </div>
</div> </div>
<div class="col-3 pl-0 mt-2"> <div class="col-3 pl-0 mt-2">
<div class="input-group"> <div class="input-group" title="Ordinato">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"> <span class="input-group-text">
<span class="fas fa-cart-plus" title="Ordinato"></span> <span class="fas fa-cart-plus" title="Ordinato"></span>
@@ -95,7 +97,7 @@
</div> </div>
<InputNumber @bind-Value="@_currItem.OrderQty" class="form-control"></InputNumber> <InputNumber @bind-Value="@_currItem.OrderQty" class="form-control"></InputNumber>
<div class="input-group-append"> <div class="input-group-append">
<span class="input-group-text" title="Ordinato">kg</span> <span class="input-group-text">kg</span>
</div> </div>
</div> </div>
</div> </div>
@@ -127,10 +129,7 @@
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><span class="fas fa-calendar" aria-hidden="true"></span></span> <span class="input-group-text"><span class="fas fa-calendar" aria-hidden="true"></span></span>
</div> </div>
<DateEdit class="form-control" InputMode="DateInputMode.DateTime" @bind-Date="@_currItem.DtExecStart" /> <input class="form-control" type="datetime-local" @bind="@_currItem.DtExecStart" />
@*<div class="input-group-append">
<span class="input-group-text">inizio carico</span>
</div>*@
</div> </div>
</div> </div>
<div class="col-3 pl-0"> <div class="col-3 pl-0">
@@ -149,10 +148,7 @@
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><span class="fas fa-calendar" aria-hidden="true"></span></span> <span class="input-group-text"><span class="fas fa-calendar" aria-hidden="true"></span></span>
</div> </div>
<DateEdit class="form-control" InputMode="DateInputMode.DateTime" @bind-Date="@_currItem.DtExecEnd" /> <input class="form-control" type="datetime-local" @bind="@_currItem.DtExecEnd" />
@*<div class="input-group-append">
<span class="input-group-text">fine carico</span>
</div>*@
</div> </div>
</div> </div>
<div class="col-3 pl-0"> <div class="col-3 pl-0">
@@ -169,15 +165,15 @@
</div> </div>
</div> </div>
<div class="col-12 col-lg-2"> <div class="col-12 col-lg-2">
<div class="input-group"> <div class="input-group" title="Versato">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"> <span class="input-group-text">
<span class="fas fa-weight" aria-hidden="true" title="Consegnato"></span> <span class="fas fa-truck-moving" aria-hidden="true"></span>
</span> </span>
</div> </div>
<InputNumber @bind-Value="@_currItem.ExecutionQty" class="form-control"></InputNumber> <InputNumber @bind-Value="@_currItem.ExecutionQty" class="form-control"></InputNumber>
<div class="input-group-append"> <div class="input-group-append">
<span class="input-group-text" title="Consegnato">kg</span> <span class="input-group-text" title="Versato">kg</span>
</div> </div>
</div> </div>
</div> </div>
@@ -187,135 +183,3 @@
</div> </div>
</div> </div>
@code {
private List<SupplierModel> suppList;
private List<TransporterModel> transpList;
protected OrderModel _currItem = new OrderModel();
protected int _supplierId { get; set; } = 0;
[Parameter]
public OrderModel currItem
{
get
{
return _currItem = null;
}
set
{
_currItem = value;
}
}
private bool editAll { get; set; } = false;
[Parameter]
public EventCallback<int> DataReset { get; set; }
[Parameter]
public EventCallback<int> DataUpdated { get; set; }
[Parameter]
public int SupplierId
{
get
{
return _supplierId;
}
set
{
_supplierId = value;
// condiziono visualizzazione...
var pUpd = Task.Run(async () => await ReloadAllData());
pUpd.Wait();
}
}
private async Task saveUpdate()
{
if (_currItem != null)
{
await DataService.OrderUpdate(_currItem);
await DataUpdated.InvokeAsync(1);
}
else
{
Console.WriteLine("Order null!");
}
}
private async Task cancelUpdate()
{
await DataReset.InvokeAsync(0);
}
private async Task deleteRecord()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Sicuro di voler eliminare l'ordine selezionato??"))
return;
if (_currItem != null)
{
await DataService.OrderDelete(_currItem);
await DataUpdated.InvokeAsync(1);
}
else
{
Console.WriteLine("User null!");
}
}
protected override async Task OnInitializedAsync()
{
await ReloadAllData();
await JSRuntime.InvokeVoidAsync("displayQr", "qrCodeImg", rawCode);
}
protected string rawCode
{
get
{
string answ = "";
if (_currItem != null)
{
answ = _currItem.OrderCode;
}
return answ;
}
}
protected async Task ReloadAllData()
{
suppList = await DataService.SuppliersGetAll();
transpList = await DataService.TransportersGetAll();
// vedere anche https://www.mikesdotnetting.com/article/340/working-with-query-strings-in-blazor
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
var currMode = GetQueryParm("currMode");
if (!string.IsNullOrEmpty(currMode))
{
editAll = currMode.Equals("debug");
}
}
// Blazor: get query parm from the URL
protected string GetQueryParm(string parmName)
{
var uriBuilder = new UriBuilder(NavManager.Uri);
var q = System.Web.HttpUtility.ParseQueryString(uriBuilder.Query);
return q[parmName] ?? "";
}
///// <summary>
///// Restituisce URL immagine QRCode
///// </summary>
///// <param name="QrValue">Parametro da renderizzare con QRCode</param>
///// <returns></returns>
//protected string getImgUrl(object QrValue)
//{
// string baseUrl = $"{Configuration["ZCodeUrl"]}/HOME/QR_site/JSON?val=";
// string payload = "{'baseUrl':'{0}','parameters':['" + $"{QrValue}" + "']}";
// string answ = $"{baseUrl}{payload}";
// return answ;
//}
}
@@ -0,0 +1,171 @@
using GWMS.Data.DatabaseModels;
using GWMS.UI.Data;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace GWMS.UI.Components
{
public partial class OrderAdminEditor
{
#region Public Properties
[Parameter]
public OrderModel currItem
{
get
{
return _currItem = null;
}
set
{
_currItem = value;
}
}
[Parameter]
public EventCallback<int> DataReset { get; set; }
[Parameter]
public EventCallback<int> DataUpdated { get; set; }
[Parameter]
public int SupplierId
{
get
{
return _supplierId;
}
set
{
_supplierId = value;
// condiziono visualizzazione...
var pUpd = Task.Run(async () => await ReloadAllData());
pUpd.Wait();
}
}
#endregion Public Properties
#region Protected Fields
protected OrderModel _currItem = new OrderModel();
#endregion Protected Fields
#region Protected Properties
protected int _supplierId { get; set; } = 0;
[Inject]
protected MessageService MServ { get; set; } = null;
protected string rawCode
{
get
{
string answ = "";
if (_currItem != null)
{
answ = _currItem.OrderCode;
}
return answ;
}
}
#endregion Protected Properties
#region Protected Methods
// Blazor: get query parm from the URL
protected string GetQueryParm(string parmName)
{
var uriBuilder = new UriBuilder(NavManager.Uri);
var q = System.Web.HttpUtility.ParseQueryString(uriBuilder.Query);
return q[parmName] ?? "";
}
protected override async Task OnInitializedAsync()
{
await ReloadAllData();
await JSRuntime.InvokeVoidAsync("displayQr", "qrCodeImg", rawCode);
}
protected async Task ReloadAllData()
{
suppList = await DataService.SuppliersGetAllAsync();
transpList = await DataService.TransportersGetAllAsync();
// vedere anche https://www.mikesdotnetting.com/article/340/working-with-query-strings-in-blazor
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
var currMode = GetQueryParm("currMode");
if (!string.IsNullOrEmpty(currMode))
{
editAll = currMode.Equals("debug");
}
}
#endregion Protected Methods
#region Private Fields
private List<SupplierModel> suppList;
private List<TransporterModel> transpList;
#endregion Private Fields
#region Private Properties
private bool editAll { get; set; } = false;
#endregion Private Properties
#region Private Methods
private async Task cancelUpdate()
{
await DataReset.InvokeAsync(0);
}
private async Task deleteRecord()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Sicuro di voler eliminare l'ordine selezionato??"))
return;
if (_currItem != null)
{
using var activity = StartTracing("Delete");
await DataService.OrderDeleteAsync(_currItem);
activity?.SetTag("order.code", _currItem.OrderCode);
activity?.SetTag("order.operator", MServ.UserName);
activity?.SetTag("order.quantity_req", _currItem.OrderQty);
await DataUpdated.InvokeAsync(1);
}
else
{
Console.WriteLine("User null!");
}
}
private async Task saveUpdate()
{
if (_currItem != null)
{
using var activity = StartTracing("SaveUpdate");
await DataService.OrderUpdateAsync(_currItem);
activity?.SetTag("order.code", _currItem.OrderCode);
activity?.SetTag("order.operator", MServ.UserName);
activity?.SetTag("order.quantity_req", _currItem.OrderQty);
await DataUpdated.InvokeAsync(1);
}
else
{
Console.WriteLine("Order null!");
}
}
#endregion Private Methods
}
}
+5 -2
View File
@@ -1,4 +1,6 @@
@if (@_currItem != null) @inherits BaseComp
@if (@_currItem != null)
{ {
<ul class="list-group"> <ul class="list-group">
<li class="list-group-item active"> <li class="list-group-item active">
@@ -41,4 +43,5 @@
} }
} }
</ul> </ul>
} }
+114 -87
View File
@@ -1,23 +1,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using GWMS.UI.Components;
using GWMS.UI.Data;
using GWMS.Data.DatabaseModels; using GWMS.Data.DatabaseModels;
using GWMS.Data.DTO; using GWMS.Data.DTO;
using GWMS.UI.Data;
using Microsoft.AspNetCore.Components;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
namespace GWMS.UI.Components namespace GWMS.UI.Components
{ {
public partial class OrderLoad : ComponentBase public partial class OrderLoad
{ {
#region Private Fields #region Public Properties
private PlantDTO currPlantData = null; public string _orderCode { get; set; } = "";
private List<PlantDTO> plantsData = new List<PlantDTO>(); public int _plantId { get; set; } = 0;
#endregion Private Fields [Parameter]
public OrderModel currItem
{
get
{
return _currItem;
}
set
{
_currItem = value;
}
}
[Parameter]
public EventCallback<bool> loadCompleted { get; set; }
[Parameter]
public string OrderCode
{
get
{
return _orderCode;
}
set
{
_orderCode = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
[Parameter]
public int PlantId
{
get
{
return _plantId;
}
set
{
_plantId = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
#endregion Public Properties
#region Protected Fields #region Protected Fields
@@ -30,6 +76,9 @@ namespace GWMS.UI.Components
[Inject] [Inject]
protected GWMSDataService DataService { get; set; } protected GWMSDataService DataService { get; set; }
[Inject]
protected MessageService MServ { get; set; } = null;
/// <summary> /// <summary>
/// verifica correttezza plant/ordine /// verifica correttezza plant/ordine
/// </summary> /// </summary>
@@ -93,81 +142,12 @@ namespace GWMS.UI.Components
#endregion Protected Properties #endregion Protected Properties
#region Public Properties
public string _orderCode { get; set; } = "";
public int _plantId { get; set; } = 0;
[Parameter]
public OrderModel currItem
{
get
{
return _currItem;
}
set
{
_currItem = value;
}
}
[Parameter]
public string OrderCode
{
get
{
return _orderCode;
}
set
{
_orderCode = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
[Parameter]
public int PlantId
{
get
{
return _plantId;
}
set
{
_plantId = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
#endregion Public Properties
#region Private Methods
private async Task ReloadData()
{
plantsData = await DataService.PlantsGetAll();
// recupero dato del plant corrente
currPlantData = plantsData.Where(x => x.PlantId == PlantId).FirstOrDefault();
// solo se ho valore QR selezionato
if (!string.IsNullOrEmpty(OrderCode))
{
currItem = await DataService.OrderGetByCode(OrderCode);
}
else
{
currItem = null;
}
}
#endregion Private Methods
#region Protected Methods #region Protected Methods
protected void RefillEnd() protected async Task RefillEnd()
{ {
using var activity = StartTracing("RefillEnd");
//using var activity = UIActivitySource.StartActivity("RefillEnd");
if (currPlantData != null) if (currPlantData != null)
{ {
// aggiorno il record corrente con livello e dataora inizio carico... // aggiorno il record corrente con livello e dataora inizio carico...
@@ -176,11 +156,24 @@ namespace GWMS.UI.Components
} }
// salvo... // salvo...
DataService.OrderUpdate(_currItem); await DataService.OrderUpdateAsync(_currItem);
// telemetria!
activity?.SetStatus(ActivityStatusCode.Ok);
activity?.SetTag("order.code", _currItem.OrderCode);
activity?.SetTag("order.operator", MServ.UserName);
activity?.SetTag("order.level_start", _currItem.LevelStart);
activity?.SetTag("order.level_end", _currItem.LevelEnd);
activity?.SetTag("plant.level_act", currPlantData.LevelAct);
// segnalo completato
await loadCompleted.InvokeAsync(true);
} }
protected void RefillStart() protected async Task RefillStart()
{ {
//using var activity = ActivitySource.StartActivity("RefillEnd");
using var activity = StartTracing("RefillStart");
if (currPlantData != null) if (currPlantData != null)
{ {
// aggiorno il record corrente con livello e dataora inizio carico... // aggiorno il record corrente con livello e dataora inizio carico...
@@ -189,9 +182,43 @@ namespace GWMS.UI.Components
} }
// salvo... // salvo...
DataService.OrderUpdate(_currItem); await DataService.OrderUpdateAsync(_currItem);
// telemetria!
activity?.SetStatus(ActivityStatusCode.Ok);
activity?.SetTag("order.code", _currItem.OrderCode);
activity?.SetTag("order.operator", MServ.UserName);
activity?.SetTag("order.level_start", _currItem.LevelStart);
activity?.SetTag("plant.level_act", currPlantData.LevelAct);
} }
#endregion Protected Methods #endregion Protected Methods
#region Private Fields
private PlantDTO currPlantData = null;
private List<PlantDTO> plantsData = new List<PlantDTO>();
#endregion Private Fields
#region Private Methods
private async Task ReloadData()
{
plantsData = await DataService.PlantDtoGetAllAsync();
// recupero dato del plant corrente
currPlantData = plantsData.Where(x => x.PlantId == PlantId).FirstOrDefault();
// solo se ho valore QR selezionato
if (!string.IsNullOrEmpty(OrderCode))
{
currItem = await DataService.OrderGetByCodeAsync(OrderCode);
}
else
{
currItem = null;
}
}
#endregion Private Methods
} }
} }
+2 -15
View File
@@ -123,7 +123,7 @@
{ {
if (_currItem != null) if (_currItem != null)
{ {
DataService.OrderUpdate(_currItem); await DataService.OrderUpdateAsync(_currItem);
await DataUpdated.InvokeAsync(1); await DataUpdated.InvokeAsync(1);
} }
else else
@@ -158,20 +158,7 @@
protected async Task ReloadAllData() protected async Task ReloadAllData()
{ {
transpList = await DataService.TransportersGetAll(); transpList = await DataService.TransportersGetAllAsync();
} }
///// <summary>
///// Restituisce URL immagine QRCode
///// </summary>
///// <param name="QrValue">Parametro da renderizzare con QRCode</param>
///// <returns></returns>
//protected string getImgUrl(object QrValue)
//{
// string baseUrl = $"{Configuration["ZCodeUrl"]}/HOME/QR_site/JSON?val=";
// string payload = "{'baseUrl':'{0}','parameters':['" + $"{QrValue}" + "']}";
// string answ = $"{baseUrl}{payload}";
// return answ;
//}
} }
+2 -20
View File
@@ -52,11 +52,6 @@
} }
} }
public async void refreshQr()
{
await JSRuntime.InvokeVoidAsync("refreshQr", rawCode);
}
[Parameter] [Parameter]
public EventCallback<int> DataReset { get; set; } public EventCallback<int> DataReset { get; set; }
[Parameter] [Parameter]
@@ -81,7 +76,7 @@
{ {
if (_currItem != null) if (_currItem != null)
{ {
DataService.OrderUpdate(_currItem); await DataService.OrderUpdateAsync(_currItem);
await DataUpdated.InvokeAsync(1); await DataUpdated.InvokeAsync(1);
} }
else else
@@ -116,20 +111,7 @@
protected async Task ReloadAllData() protected async Task ReloadAllData()
{ {
transpList = await DataService.TransportersGetAll(); transpList = await DataService.TransportersGetAllAsync();
} }
///// <summary>
///// Restituisce URL immagine QRCode
///// </summary>
///// <param name="QrValue">Parametro da renderizzare con QRCode</param>
///// <returns></returns>
//protected string getImgUrl(object QrValue)
//{
// string baseUrl = $"{Configuration["ZCodeUrl"]}/HOME/QR_site/JSON?val=";
// string payload = "{'baseUrl':'{0}','parameters':['" + $"{QrValue}" + "']}";
// string answ = $"{baseUrl}{payload}";
// return answ;
//}
} }
+54
View File
@@ -0,0 +1,54 @@
@using GWMS.UI.Components
@using Microsoft.AspNetCore.Components.Authorization
@using GWMS.UI.Data
@using Microsoft.Extensions.Configuration
<div class="card">
<div class="card-header bg-info text-light">
<b>Modifica</b>
</div>
<div class="card-body p-1">
<EditForm Model="@_currItem">
<DataAnnotationsValidator />
<div class="row">
<div class="col-12 col-lg-5">
<ParamSet PlantIdSel="@PlantId" ParamUidSel="@ParamUid"></ParamSet>
</div>
<div class="col-12 col-lg-5 align-items-center">
<div class="d-flex">
<div class="p-2">
<b>@_currItem.uid</b>
</div>
<div class="p-2 text-right">
@_currItem.name
</div>
</div>
<div class="row">
<div class="col">
<div class="input-group">
<div class="input-group-prepend">
<button @onclick="() => setCalc()" class="btn btn-primary">@CalcVal.ToString("N3") <i class="fas fa-arrow-alt-circle-right"></i></button>
</div>
<InputNumber @bind-Value="@_currItem.reqValDec" class="form-control text-right"></InputNumber>
<div class="input-group-append">
<span class="input-group-text" title="Valore Richiesto">Act: <b>@_currItem.value</b></span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<ParamSendEditor PlantIdSel="@PlantId" ParamUidSel="@ParamUid"></ParamSendEditor>
</div>
</div>
</div>
<div class="col-12 col-lg-2">
<button type="button" class="btn btn-warning btn-block" value="Cancel" @onclick="cancelUpdate">Cancel <i class="fas fa-ban"></i></button>
<div class="mt-2">
<button type="button" class="btn btn-success btn-block" value="Save" @onclick="saveUpdate">Save <i class="far fa-save"></i></button>
</div>
</div>
</div>
</EditForm>
</div>
</div>
+190
View File
@@ -0,0 +1,190 @@
using GWMS.Data.DatabaseModels;
using GWMS.UI.Data;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Configuration;
using Microsoft.JSInterop;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using static GWMS.Data.IobObjects;
namespace GWMS.UI.Components
{
public partial class ParamEditor
{
#region Public Properties
[Parameter]
public objItem currItem
{
get
{
return _currItem;
}
set
{
_currItem = value;
ParamUid = _currItem.uid;
}
}
[Parameter]
public EventCallback<int> DataReset { get; set; }
[Parameter]
public EventCallback<int> DataUpdated { get; set; }
[Parameter]
public string IdxMacchina { get; set; } = "";
[Parameter]
public int PlantId
{
get
{
return _plantId;
}
set
{
_plantId = value;
}
}
#endregion Public Properties
#region Protected Properties
[Inject]
protected IConfiguration _configuration { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
// fix arrotondamento
roundFactor = _configuration.GetValue<int>("RuntimeOpt:RoundFact", 10);
await ReloadData();
}
protected async Task ReloadData()
{
ListRecords = null;
try
{
ListRecords = await DataService.ParamSetGetFiltAsync(PlantId, ParamUid);
}
catch (Exception exc)
{
Log.Error($"Eccezione in ReloadData:{Environment.NewLine}{exc}");
}
}
#endregion Protected Methods
#region Private Fields
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private objItem _currItem = new objItem();
private int _plantId = 0;
private List<ParamSetModel> ListRecords;
private string ParamUid = "";
/// <summary>
/// fattore arrotondamento valori calcolati
/// </summary>
private int roundFactor = 100;
#endregion Private Fields
#region Private Properties
private decimal CalcVal
{
get
{
decimal answ = currItem.reqValDec;
if (totalCount > 0)
{
// prendo i 2 valori precedente e successivo
DateTime oggi = DateTime.Today;
var prevPar = ListRecords.Where(x => x.Scadenza <= oggi).OrderByDescending(x => x.Scadenza).FirstOrDefault();
var nextPar = ListRecords.Where(x => x.Scadenza >= oggi).OrderBy(x => x.Scadenza).FirstOrDefault();
// se ho valori
if (prevPar != null && nextPar != null)
{
double num = oggi.Subtract(prevPar.Scadenza).TotalDays;
double den = nextPar.Scadenza.Subtract(prevPar.Scadenza).TotalDays;
den = den != 0 ? den : 1;
answ = prevPar.TargetVal + (nextPar.TargetVal - prevPar.TargetVal) * (decimal)(num / den);
}
}
return answ;
}
}
[Inject]
private GWMSDataService DataService { get; set; }
[Inject]
private IJSRuntime JSRuntime { get; set; }
private int totalCount
{
get
{
int answ = 0;
if (ListRecords != null)
{
answ = ListRecords.Count;
}
return answ;
}
}
#endregion Private Properties
#region Private Methods
private async Task cancelUpdate()
{
await DataReset.InvokeAsync(0);
}
private async Task ChildUpdated()
{
//await EC_DataReset.InvokeAsync(0);
await Task.Delay(1);
}
private async Task saveUpdate()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Sicuro di voler inviare il valore per parametro richiesto?"))
return;
if (_currItem != null)
{
await DataService.UpdateMachineParameterAsync(IdxMacchina, _currItem.uid, _currItem.reqValue);
await DataUpdated.InvokeAsync(0);
}
else
{
Console.WriteLine("Record null!");
}
}
private void setCalc()
{
currItem.reqValDec = Math.Round(CalcVal * roundFactor) / roundFactor;
}
#endregion Private Methods
}
}
+38
View File
@@ -0,0 +1,38 @@
@using GWMS.UI.Components
@if (currRecord == null)
{
<LoadingData></LoadingData>
}
else
{
<div class="form-row">
<div class="col-2">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
</div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="togSend" title="Abilitato" @bind-value="@IsEnabled" checked="@IsEnabled" />
<label class="custom-control-label small" for="togSend"><sub>Invio Abilitato</sub></label>
</div>
</div>
</div>
<div class="col-4">
<div class="input-group input-group-sm text-right">
<div class="input-group-prepend">
<span class="input-group-text">Periodo Invio</span>
</div>
<input type="text" class="form-control" title="Inizio Periodo Invio" @bind-value="@SendWindStart">
<input type="text" class="form-control" title="Fine Periodo Invio" @bind-value="@SendWindEnd">
</div>
</div>
<div class="col-6 small text-right">
<div>
Ultimo Invio: <span>@currRecord.LastSend.ToString("yyyy.MM.dd HH:mm.ss")</span>
</div>
<div>
Invio Previsto: <span>@currRecord.VetoSend.ToString("yyyy.MM.dd HH:mm.ss")</span>
</div>
</div>
</div>
}
+169
View File
@@ -0,0 +1,169 @@
using GWMS.Data.DatabaseModels;
using GWMS.UI.Data;
using Microsoft.AspNetCore.Components;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace GWMS.UI.Components
{
public partial class ParamSendEditor
{
#region Private Fields
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Protected Fields
protected string _paramUid = "";
protected int _plantId = 0;
protected ParamSendModel currRecord;
#endregion Protected Fields
#region Protected Properties
[Inject]
protected GWMSDataService DataService { get; set; }
#endregion Protected Properties
#region Public Properties
[Parameter]
public EventCallback<int> DataUpdated { get; set; }
public bool IsEnabled
{
get
{
return currRecord.enabled;
}
set
{
currRecord.enabled = value;
bool paramSent = false;
// salvo!
var pUpd = Task.Run(async () =>
{
await DataService.ParamSendUpdateAsync(currRecord);
// se viene abilitato --> verifico comunque invio
if (value)
{
// test set parametri + invio...
await DataService.ParamsSendCheckAsync();
paramSent = true;
}
await ReloadData();
if (paramSent)
{
await DataUpdated.InvokeAsync(0);
}
});
pUpd.Wait();
}
}
[Parameter]
public string ParamUidSel
{
get
{
return _paramUid;
}
set
{
_paramUid = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
[Parameter]
public int PlantIdSel
{
get
{
return _plantId;
}
set
{
_plantId = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
public int SendWindEnd
{
get
{
return currRecord.windEnd;
}
set
{
currRecord.windEnd = value;
// salvo!
var pUpd = Task.Run(async () =>
{
await DataService.ParamSendUpdateAsync(currRecord);
await ReloadData();
});
pUpd.Wait();
}
}
public int SendWindStart
{
get
{
return currRecord.windStart;
}
set
{
currRecord.windStart = value;
// salvo!
var pUpd = Task.Run(async () =>
{
await DataService.ParamSendUpdateAsync(currRecord);
await ReloadData();
});
pUpd.Wait();
}
}
#endregion Public Properties
#region Private Methods
private async Task ReloadData()
{
currRecord = null;
try
{
currRecord = await DataService.ParamSendGetAsync(PlantIdSel, ParamUidSel);
}
catch (Exception exc)
{
Log.Error($"Eccezione in ReloadData:{Environment.NewLine}{exc}");
}
}
#endregion Private Methods
#region Protected Methods
protected override async Task OnInitializedAsync()
{
await ReloadData();
}
#endregion Protected Methods
}
}
+74
View File
@@ -0,0 +1,74 @@
@using GWMS.UI.Components
@if (currRecord != null)
{
<ParamSetEditor currItem="@currRecord" EC_DataReset="ResetData" EC_DataUpdated="UpdateData"></ParamSetEditor>
}
@if (ListRecords == null)
{
<LoadingData></LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-warning text-center display-5">Nessun record trovato</div>
<button class="btn btn-success" @onclick="() => AddNew()"><i class="fas fa-plus"></i> Aggiungi Nuovo</button>
}
else
{
<div class="row">
<div class="col-12">
<table class="table table-sm table-striped table-responsive-lg">
<thead>
<tr>
<th><button class="btn btn-success" @onclick="() => AddNew()"><i class="fas fa-plus"></i></button></th>
<th>Parametro</th>
<th class="text-right">Scadenza</th>
<th class="text-right">Valore</th>
<th class="text-right">Note</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(@record.ParamSetId)">
<td class="text-nowrap">
@if (currRecord == null)
{
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)">
<span class="oi oi-pencil"></span>
</button>
}
else
{
<button class="btn btn-sm btn-secondary disabled">
<i class="oi oi-pencil"></i>
</button>
}
</td>
<td>
<div class="small">@record.ParamUid</div>
</td>
<td class="text-right">
<div class="small">@record.Scadenza.ToString("yyyy.MM.dd")</div>
</td>
<td class="text-right">
<div>@record.TargetVal.ToString("N2")</div>
</td>
<td class="text-right">
<div>
<i>@record.Note</i>
</div>
</td>
<td class="text-right">
<button class="btn btn-sm btn-danger" title="Elimina Set" @onclick="() => RemoveItem(record)">
<i class="fas fa-trash"></i>
</button>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
}
+187
View File
@@ -0,0 +1,187 @@
using GWMS.Data.DatabaseModels;
using GWMS.UI.Data;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using NLog;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace GWMS.UI.Components
{
public partial class ParamSet
{
#region Private Fields
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private ParamSetModel currRecord = null;
private List<ParamSetModel> ListRecords;
#endregion Private Fields
#region Protected Fields
protected string _paramUid = "";
protected int _plantId = 0;
#endregion Protected Fields
#region Private Properties
private bool isLoading { get; set; } = false;
[Inject]
private IJSRuntime JSRuntime { get; set; }
#endregion Private Properties
#region Protected Properties
[Inject]
protected GWMSDataService DataService { get; set; }
protected int totalCount
{
get
{
int answ = 0;
if (ListRecords != null)
{
answ = ListRecords.Count;
}
return answ;
}
}
#endregion Protected Properties
#region Public Properties
[Parameter]
public string ParamUidSel
{
get
{
return _paramUid;
}
set
{
_paramUid = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
[Parameter]
public int PlantIdSel
{
get
{
return _plantId;
}
set
{
_plantId = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
#endregion Public Properties
#region Private Methods
/// <summary>
/// Aggiunta nuovo record
/// </summary>
private async void AddNew()
{
// creo un nuovo evento su oggi...
var newRecord = new ParamSetModel()
{
ParamUid = ParamUidSel,
PlantId = PlantIdSel,
Scadenza = DateTime.Today.AddDays(1),
TargetVal = 0,
Note = "Nuovo record"
};
await DataService.ParamSetUpdateAsync(newRecord);
await ReloadData();
}
private async Task ReloadData()
{
isLoading = true;
ListRecords = null;
try
{
ListRecords = await DataService.ParamSetGetFiltAsync(PlantIdSel, ParamUidSel);
}
catch (Exception exc)
{
Log.Error($"Eccezione in ReloadData:{Environment.NewLine}{exc}");
}
isLoading = false;
}
#endregion Private Methods
#region Protected Methods
protected void Edit(ParamSetModel selRecord)
{
currRecord = selRecord;
}
protected override async Task OnInitializedAsync()
{
await ReloadData();
}
protected async Task RemoveItem(ParamSetModel selRecord)
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Sicuro di voler rimuovere il parametro progammato {selRecord.ParamUid} in data ({selRecord.Scadenza:yyyy.MM.dd})?"))
return;
if (selRecord != null)
{
await DataService.ParamSetDeleteAsync(selRecord);
}
await ReloadData();
}
protected void ResetData()
{
DataService.rollBackEdit(currRecord);
currRecord = null;
}
protected async Task UpdateData()
{
currRecord = null;
//await DataService.ParamSetUpdateAsync(currRecord);
await ReloadData();
}
#endregion Protected Methods
#region Public Methods
public string checkSelect(int ParamSetId)
{
string answ = "";
if (currRecord != null)
{
try
{
answ = (currRecord.ParamSetId == ParamSetId) ? "table-info" : "";
}
catch
{ }
}
return answ;
}
#endregion Public Methods
}
}
+54
View File
@@ -0,0 +1,54 @@
@using GWMS.UI.Components
@using Microsoft.AspNetCore.Components.Authorization
@using GWMS.UI.Data
@using Microsoft.Extensions.Configuration
<div class="card">
<div class="card-header bg-info text-light">
<b>Modifica</b>
</div>
<div class="card-body p-1">
<EditForm Model="@_currItem">
<DataAnnotationsValidator />
<div class="form-row">
<div class="col-4">
<b>@_currItem.ParamUid</b>
</div>
<div class="col-8 text-right">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">Note:</span>
</div>
<InputText @bind-Value="@_currItem.Note" class="form-control text-right" title="Note" />
</div>
</div>
</div>
<div class="form-row mt-2">
<div class="col-6">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">Scadenza</span>
</div>
<InputDate @bind-Value="@_currItem.Scadenza" class="form-control text-right" title="Data Parametro" />
</div>
</div>
<div class="col-6 text-right">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">Valore</span>
</div>
<InputNumber @bind-value="@_currItem.TargetVal" class="form-control text-right" title="Valore Richiesto" />
</div>
</div>
</div>
<div class="form-row mt-2">
<div class="col-6">
<button type="button" class="btn btn-warning btn-block" value="Cancel" @onclick="cancelUpdate">Cancel <i class="fas fa-ban"></i></button>
</div>
<div class="col-6">
<button type="button" class="btn btn-success btn-block" value="Save" @onclick="saveUpdate">Save <i class="far fa-save"></i></button>
</div>
</div>
</EditForm>
</div>
</div>
+110
View File
@@ -0,0 +1,110 @@
using GWMS.Data.DatabaseModels;
using GWMS.UI.Data;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Configuration;
using Microsoft.JSInterop;
using System;
using System.Threading.Tasks;
namespace GWMS.UI.Components
{
public partial class ParamSetEditor
{
#region Public Properties
[Parameter]
public ParamSetModel currItem
{
get
{
return _currItem;
}
set
{
_currItem = value;
}
}
[Parameter]
public EventCallback<int> EC_DataReset { get; set; }
[Parameter]
public EventCallback<int> EC_DataUpdated { get; set; }
[Parameter]
public string IdxMacchina { get; set; } = "";
#endregion Public Properties
#region Protected Fields
protected ParamSetModel _currItem = new ParamSetModel();
#endregion Protected Fields
/// <summary>
/// fattore arrotondamento valori calcolati
/// </summary>
private int roundFactor = 100;
[Inject]
protected IConfiguration _configuration { get; set; } = null!;
protected override void OnParametersSet()
{
// fix arrotondamento
roundFactor = _configuration.GetValue<int>("RuntimeOpt:RoundFact", 10);
// aggiorno targetVal...
if (_currItem != null)
{
_currItem.TargetVal = Math.Round(_currItem.TargetVal * roundFactor) / roundFactor;
}
}
#region Protected Properties
[Inject]
protected GWMSDataService DataService { get; set; }
#endregion Protected Properties
#region Protected Methods
protected string? FormatValueAsString(TValue? value)
{
return $"{value:N3}";
}
#endregion Protected Methods
#region Private Properties
[Inject]
private IJSRuntime JSRuntime { get; set; }
#endregion Private Properties
#region Private Methods
private async Task cancelUpdate()
{
await EC_DataReset.InvokeAsync(0);
}
private async Task saveUpdate()
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Sicuro di voler modificare la programmazione del parametro?"))
return;
if (_currItem != null)
{
await DataService.ParamSetUpdateAsync(_currItem);
await EC_DataUpdated.InvokeAsync(0);
}
else
{
Console.WriteLine("Record null!");
}
}
#endregion Private Methods
}
}
+1 -3
View File
@@ -1,9 +1,7 @@
@using Blazorise @using GWMS.UI.Components
@using GWMS.UI.Components
@using Microsoft.AspNetCore.Components.Authorization @using Microsoft.AspNetCore.Components.Authorization
@using GWMS.UI.Data @using GWMS.UI.Data
@using Microsoft.Extensions.Configuration @using Microsoft.Extensions.Configuration
@using Microsoft.AspNetCore.Components.Authorization
<div class="card"> <div class="card">
<div class="card-header bg-info text-light"> <div class="card-header bg-info text-light">
+1 -2
View File
@@ -5,7 +5,6 @@ using System.Threading.Tasks;
using GWMS.UI.Data; using GWMS.UI.Data;
using GWMS.Data.DTO; using GWMS.Data.DTO;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Blazorise.Charts;
using System.Threading; using System.Threading;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.JSInterop; using Microsoft.JSInterop;
@@ -95,7 +94,7 @@ namespace GWMS.UI.Components
{ {
if (_currItem != null) if (_currItem != null)
{ {
await DataService.PlantUpdate(_currItem); await DataService.PlantUpdateAsync(_currItem);
await DataUpdated.InvokeAsync(0); await DataUpdated.InvokeAsync(0);
} }
else else
+128 -39
View File
@@ -1,23 +1,23 @@
@using Blazorise @using GWMS.UI.Components
@using GWMS.UI.Components @using GWMS.UI.Components.ChartJs
<div class="card"> <div class="card">
<div class="card-header table-primary py-1"> <div class="card-header table-primary py-1 px-1 px-md-2">
@if (currItem != null) @if (currItem != null)
{ {
<div class="row py-0"> <div class="d-flex justify-content-between">
<div class="col-8 pr-0 font-weight-bold"> <div class="py-0 px-1 mb-0">
<h2>@currItem.PlantCode</h2> <h2 class="mb-0">@currItem.PlantCode</h2>
</div> </div>
<div class="col-4 text-right align-bottom"> <div class="py-0 px-1 mb-0">
<button class="btn btn-primary btn-lg btn-block" @onclick="() => ShowDetail(currItem.PlantId)"> <button class="btn btn-primary" style="min-width:10rem;" @onclick="() => ShowDetail(currItem.PlantId)">
<b>@currItem.PlantDesc&nbsp;<i class="fas fa-angle-double-right"></i></b> <b>@currItem.PlantDesc&nbsp;<i class="fas fa-angle-double-right"></i></b>
</button> </button>
</div> </div>
</div> </div>
} }
</div> </div>
<div class="card-body p-1"> <div class="card-body p-0 p-md-1 p-lg-2">
<div class="row"> <div class="row">
<div class="col-4 pr-0"> <div class="col-4 pr-0">
<div class="row"> <div class="row">
@@ -26,19 +26,54 @@
<li class="list-group-item d-flex justify-content-between align-items-center p-0 border border-primary"> <li class="list-group-item d-flex justify-content-between align-items-center p-0 border border-primary">
<img src="./img/Plant/@(currItem.PlantCode).jpg" class="img-fluid" /> <img src="./img/Plant/@(currItem.PlantCode).jpg" class="img-fluid" />
</li> </li>
<li class="list-group-item active d-flex justify-content-between align-items-center py-1">PB Alta</li> <li class="list-group-item d-flex justify-content-between align-items-center p-1 p-md-2">
<li class="list-group-item d-flex justify-content-between align-items-center small"> <span><i class="fas fa-gas-pump"></i> Pressione:</span> <span style="font-size:1.2em;"><b>@currItem.PressAct["Main"].ToString("N1")</b> <span class="small"> <sub>bar</sub></span></span>
<span><i class="fas fa-compress-arrows-alt"></i> Stoccaggio</span> <span><b>@getPressData("BH", "N1")</b> <sub>bar</sub></span>
</li> </li>
<li class="list-group-item d-flex justify-content-between align-items-center small"> <li class="list-group-item-primary d-flex justify-content-between align-items-center py-1 px-2">
<span><i class="fas fa-compress-arrows-alt"></i> Alimentazione</span> <span><b>@getPressData("BHA", "N1")</b> <sub>bar</sub></span> <span><i class="fas fa-compress-arrows-alt"></i> PB Alta</span>
</li> </li>
<li class="list-group-item active d-flex justify-content-between align-items-center py-1">PB Media</li> <li class="list-group-item d-flex justify-content-between align-items-center small p-1 px-md-2">
<li class="list-group-item d-flex justify-content-between align-items-center small"> @if (getPressData("BH", "N1") != "")
<span><i class="fas fa-compress-arrows-alt"></i> Stoccaggio</span> <span><b>@getPressData("BL", "N1")</b> <sub>bar</sub></span> {
<span> Stoccaggio:</span> <span><b>@getPressData("BH", "N1")</b> <sub>bar</sub></span>
}
else
{
<span> Stoccaggio:</span> <span><b>ND</b> <sub>bar</sub></span>
}
</li> </li>
<li class="list-group-item d-flex justify-content-between align-items-center small"> <li class="list-group-item d-flex justify-content-between align-items-center small p-1 px-md-2">
<span><i class="fas fa-compress-arrows-alt"></i> Alimentazione</span> <span><b>@getPressData("BLA", "N1")</b> <sub>bar</sub></span> @if (getPressData("BHA", "N1") != "")
{
<span> Alimentazione:</span> <span><b>@getPressData("BHA", "N1")</b> <sub>bar</sub></span>
}
else
{
<span> Alimentazione:</span> <span><b>ND</b> <sub>bar</sub></span>
}
</li>
<li class="list-group-item-primary d-flex justify-content-between align-items-center py-1 px-2">
<span><i class="fas fa-compress-arrows-alt"></i> PB Media</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center small p-1 px-md-2">
@if (getPressData("BL", "N1") != "")
{
<span> Stoccaggio:</span> <span><b>@getPressData("BL", "N1")</b> <sub>bar</sub></span>
}
else
{
<span> Stoccaggio:</span> <span><b>ND</b> <sub>bar</sub></span>
}
</li>
<li class="list-group-item d-flex justify-content-between align-items-center small p-1 px-md-2">
@if (getPressData("BLA", "N1") != "")
{
<span> Alimentazione:</span> <span><b>@getPressData("BLA", "N1")</b> <sub>bar</sub></span>
}
else
{
<span> Alimentazione:</span> <span><b>ND</b> <sub>bar</sub></span>
}
</li> </li>
</ul> </ul>
</div> </div>
@@ -48,42 +83,96 @@
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<ul class="list-group"> <ul class="list-group">
<li class="list-group-item @headerStatus d-flex justify-content-between align-items-center px-0 py-1 small"> @{
<div class="px-1" title="@checkRTime"> headerStatus = deviceOnline ? "list-group-item-info" : "text-secondary";
SERBATOIO Principale <i class="fas fa-play @playStatus"></i> playCss = dataIsRT ? "text-success" : "text-danger";
</div> checkRTime = dataIsRT ? $"Dati Realtime aggiornati al {_currItem.LastUpdate}" : $"Mancata ricezione: ultimo aggiornamento {_currItem.LastUpdate}";
<div class="px-1 text-right"> <li class="list-group-item @headerStatus d-flex justify-content-between align-items-center px-0 py-1 small">
<span><i class="fas fa-database"></i> Livello:</span><span>@currItem.LevelAct.ToString("N0")/@currItem.LevelMax.ToString("N0")</span> | <span style="font-size:1.2em;"><b>@currItem.LevelRatio</b> <sub>%</sub></span> <div class="px-1" title="@checkRTime">
</div> SERBATOIO
</li> <i class="fas fa-play @playCss"></i>
</div>
<div class="px-1 text-right">
<span><i class="fas fa-database"></i> Livello:</span><span>@currItem.LevelAct.ToString("N0")/@currItem.LevelMax.ToString("N0")</span> | <span style="font-size:1.2em;"><b>@currItem.LevelRatio</b> <sub>%</sub></span>
</div>
</li>
}
<li class="list-group-item align-items-center px-1 py-2"> <li class="list-group-item align-items-center px-1 py-2">
<div class="d-flex flex-column"> <div class="d-flex flex-column">
<div class="p-1 flex-grow-1"> <div class="px-1 py-0 flex-grow-1">
<Progress> <ProgressBar Value="@currItem.LevelRatio" Striped="false" Animated="false" />
<ProgressBar Value="@currItem.LevelRatio" Striped="false" Animated="false" />
</Progress>
</div> </div>
<div class="px-1 py-2"> <div class="py-0 px-1">
<LineChart @ref="LevelVal" TItem="double" OptionsObject="lineChartOptions" /> @if (LevelVal == null || LevelVal.Count == 0)
{
<LoadingDataSmall></LoadingDataSmall>
}
else
{
<Line Id="@(currItem.PlantCode)" AspRatio="2" DataTS="@LevelVal" lineColor="@getLineColors("0.75")" backColor="@getFillColors("0.25")" pointColor="@getPointColors("1")" lTens="0" Title="Livello" MinValue="0" MaxValue="30000"></Line>
}
</div> </div>
</div> </div>
</li> </li>
<li class="list-group-item d-flex justify-content-between align-items-center"> <li class="list-group-item d-flex justify-content-between align-items-center p-1 p-md-2">
<span><i class="fas fa-compress-arrows-alt"></i> Pressione</span> <span style="font-size:1.2em;"><b>@currItem.PressAct["Main"].ToString("N1")</b> <span class="small"> <sub>bar</sub></span></span> <div class="col-6">
<div><i class="fas fa-file-invoice-dollar"></i> Venduto Ieri: </div>
@if (PlantLevelDto != null && PlantLevelDto.Count > 1)
{
@if (PlantLevelDto[1].QtaVenduta > 0)
{
<div style="font-size:1.2em;"><b>@($"{PlantLevelDto[1].QtaVenduta:N0}")</b> <span class="small"> <sub>kg</sub></span></div>
@* <div style="font-size:1.2em;" class="text-secondary"><b>@($"{currItem.SoldTS[0].ValDouble:N0}")</b> <span class="small"> <sub>kg</sub></span></div> *@
}
else
{
<div style="font-size:1.2em;"><b>ND</b> <span class="small"></span></div>
<div style="font-size:0.8em;"><span class="small text-danger">(<i>@($"{PlantLevelDto[1].QtaVenduta:N0}")<sub>kg</sub></i>)</span></div>
}
}
else
{
<div style="font-size:1.2em;" class="text-secondary"><b>NA</b> <span class="small"></span></div>
}
</div>
<div class="col-6 text-right">
<div><i class="fas fa-file-invoice-dollar"></i> Venduto Oggi: </div>
@if (PlantLevelDto != null && PlantLevelDto.Count > 0)
{
@if (PlantLevelDto[0].QtaVenduta > 0)
{
<div style="font-size:1.2em;"><b>@($"{PlantLevelDto[0].QtaVenduta:N0}")</b> <span class="small"> <sub>kg</sub></span></div>
@* <div style="font-size:1.2em;" class="text-secondary"><b>@($"{currItem.SoldTS[1].ValDouble:N0}")</b> <span class="small"> <sub>kg</sub></span></div> *@
}
else
{
<div style="font-size:1.2em;"><b>ND</b> <span class="small"></span></div>
<div style="font-size:0.8em;"><span class="small text-danger">(<i>@($"{PlantLevelDto[0].QtaVenduta:N0}") <sub>kg</sub></i>)</span></div>
}
}
else
{
<div style="font-size:1.2em;" class="text-secondary"><b>NA</b> <span class="small"></span></div>
}
</div>
</li> </li>
</ul> </ul>
</div> </div>
<div class="col-12 small text-right">
<sup class="px-1">updated: @($"{DateTime.Now:HH:mm:ss}")</sup>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="card-footer alert alert-primary mb-0 p-1"> <div class="card-footer alert alert-primary mb-0 p-0 p-md-1">
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<div class="py-1 px-2 mb-0"> <div class="py-0 px-2 mb-0">
<h4>Ordini aperti: <b>@currItem.OrderTS.Count</b></h4> <h4>Ordini aperti: <b>@currItem.OrderTS.Count</b></h4>
</div> </div>
<div class="py-1 px-2"> <div class="py-0 px-2">
<button class="btn btn-block btn-primary" title="Mostra Ordini" @onclick="() => ShowOrders(currItem.PlantId)">Mostra Ordini <i class="fas fa-file-invoice"></i></button> <button class="btn btn-block btn-info" style="min-width:10rem;" title="Mostra Ordini" @onclick="() => ShowOrders(currItem.PlantId)">Mostra Ordini <i class="fas fa-file-invoice"></i></button>
</div> </div>
</div> </div>
</div> </div>
+165 -209
View File
@@ -1,71 +1,67 @@
using System; using GWMS.Data;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using GWMS.UI.Data;
using GWMS.Data.DTO; using GWMS.Data.DTO;
using GWMS.UI.Data;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Blazorise.Charts;
using System.Threading;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace GWMS.UI.Components namespace GWMS.UI.Components
{ {
public partial class PlantOverview public partial class PlantOverview
{ {
#region Public Properties
[Parameter]
public PlantDTO currItem
{
get
{
return _currItem;
}
set
{
_currItem = value;
if (value != null)
{
var dataReload = Task.Run(async () =>
{
// legge i valori di plantLog ultimi 2 gg...
SelectOrderData plantLevFilt = new SelectOrderData()
{
PlantId = value.PlantId,
DateEnd = DateTime.Today.AddDays(1),
DateStart = DateTime.Today.AddDays(-1),
ShowClosed = false
};
PlantLevelDto = await DataService.PlantsAnalisysByFiltAsync(plantLevFilt);
// aggiunta delay o non riesce a disegnare
int ChartWaitDelay = 150;
int.TryParse(Configuration["ChartWaitDelay"], out ChartWaitDelay);
await Task.Delay(ChartWaitDelay);
await HandleRedraw();
});
dataReload.Wait();
}
}
}
#endregion Public Properties
#region Protected Fields #region Protected Fields
protected PlantDTO _currItem = new PlantDTO(); protected PlantDTO _currItem = new PlantDTO();
protected LineChart<double> LevelVal = new LineChart<double>(); protected string checkRTime;
protected string headerStatus;
protected List<chartJsData.chartJsTSerie> LevelVal = new List<chartJsData.chartJsTSerie>();
protected object lineChartOptions = new protected string playCss = "";
{
Scales = new
{
XAxes = new object[]
{
new {
display = true,
//type = "timeseries",
//type = "time",
//Time = new {
// unit="day"
//}
}
},
YAxes = new object[]
{
new {
display = true,
position = "right",
//text = "Kg",
ticks = new {
suggestedMin = 0,
suggestedMax = 30000
}
}
}
},
Tooltips = new
{
Mode = "nearest",
Intersect = false
},
Hover = new
{
Mode = "nearest",
Intersect = false
},
Animation = false,
Responsive = true,
AspectRatio = 2,
type = "line",
Legend = new
{
display = false
}
};
/// <summary> /// <summary>
/// fattore di riduzione x visualizzare meno punti (in base alla numerosità... /// fattore di riduzione x visualizzare meno punti (in base alla numerosità...
@@ -74,14 +70,115 @@ namespace GWMS.UI.Components
#endregion Protected Fields #endregion Protected Fields
#region Protected Properties
[Inject]
protected MessageService AppMService { get; set; }
[Inject]
protected GWMSDataService DataService { get; set; }
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// Genera colori sfondo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> getFillColors(string alpha)
{
List<string> answ = new List<string>();
answ.Add($"rgba(108, 164, 254, {alpha})");
return answ;
}
/// <summary>
/// Genera colori linea
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> getLineColors(string alpha)
{
List<string> answ = new List<string>();
answ.Add($"rgba(54, 82, 254, {alpha})");
return answ;
}
/// <summary>
/// Genera colori punti
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> getPointColors(string alpha)
{
List<string> answ = new List<string>();
answ.Add($"rgba(108, 118, 158, {alpha})");
return answ;
}
protected string getPressData(string valore, string formato)
{
string answ = "";
if (currItem.PressAct.ContainsKey(valore))
{
answ = currItem.PressAct[valore].ToString(formato);
}
return answ;
}
protected async Task HandleRedraw()
{
checkRt();
fixRedFactor();
await Task.Delay(1);
LevelVal = _currItem.LevelTS.OrderByDescending(x => x.DtEvent).Where((cat, index) => index % redFact == 0).OrderBy(x => x.DtEvent).Select(r => new chartJsData.chartJsTSerie() { x = r.DtEvent, y = r.ValDouble }).ToList();
await Task.Delay(1);
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await HandleRedraw();
}
}
protected override async Task OnInitializedAsync()
{
await HandleRedraw();
}
protected void ShowDetail(int currPlantId)
{
SelPlantId = currPlantId;
// rimando...
NavManager.NavigateTo($"PlantAnalisys");
}
protected void ShowOrders(int currPlantId)
{
SelPlantId = currPlantId;
// rimando...
NavManager.NavigateTo($"Orders");
}
#endregion Protected Methods
#region Private Properties #region Private Properties
[Inject] [Inject]
private IConfiguration Configuration { get; set; } private IConfiguration Configuration { get; set; }
private bool dataIsRT { get; set; } = false;
private bool deviceOnline { get; set; } = false;
[Inject] [Inject]
private NavigationManager NavManager { get; set; } private NavigationManager NavManager { get; set; }
private List<PlantLevSumDTO>? PlantLevelDto { get; set; } = null;
private int SelPlantId private int SelPlantId
{ {
get get
@@ -104,174 +201,33 @@ namespace GWMS.UI.Components
#endregion Private Properties #endregion Private Properties
#region Protected Properties
[Inject]
protected MessageService AppMService { get; set; }
[Inject]
protected GWMSDataService DataService { get; set; }
#endregion Protected Properties
#region Public Properties
public string checkRTime
{
get => DateTime.Now.Subtract(_currItem.LastUpdate).TotalMinutes > 2 ? $"Mancata ricezione: ultimo aggiornamento {_currItem.LastUpdate}" : $"Dati Realtime aggiornati al {_currItem.LastUpdate}";
}
[Parameter]
public PlantDTO currItem
{
get
{
return _currItem;
}
set
{
_currItem = value;
if (value != null)
{
var dataReload = Task.Run(async () =>
{
// aggiunta delay o non riesce a disegnare
int ChartWaitDelay = 150;
int.TryParse(Configuration["ChartWaitDelay"], out ChartWaitDelay);
Thread.Sleep(ChartWaitDelay);
await HandleRedraw();
});
}
}
}
public string headerStatus
{
get
{
string answ = "";
int TimeoutOffline = 5;
int.TryParse(Configuration["TimeoutOffline"], out TimeoutOffline);
answ = DateTime.Now.Subtract(_currItem.LastUpdate).TotalMinutes > TimeoutOffline ? "text-secondary" : "active";
return answ;
}
}
public string playStatus
{
get => DateTime.Now.Subtract(_currItem.LastUpdate).TotalMinutes > 2 ? "text-danger" : "text-success";
}
#endregion Public Properties
#region Private Methods #region Private Methods
private void checkRt()
{
DateTime adesso = DateTime.Now;
int TimeoutOffline = 5;
int.TryParse(Configuration["TimeoutOffline"], out TimeoutOffline);
deviceOnline = adesso.Subtract(_currItem.LastUpdate).TotalMinutes <= TimeoutOffline;
dataIsRT = adesso.Subtract(_currItem.LastUpdate).TotalMinutes <= 2;
}
private void fixRedFactor() private void fixRedFactor()
{ {
int answ = 1; int answ = 1;
int numCount = _currItem.LevelTS.Count; int numCount = _currItem.LevelTS.Count;
// passo a 2h se > 3 gg // passo a 2h se > 3 gg
if (numCount > 72) if (numCount > 240)
answ = 3; answ = 5;
// passo a 3h se > 5 gg // passo a 3h se > 5 gg
else if (numCount > 120) else if (numCount > 120)
answ = 4; answ = 4;
// passo a 4h se > 10 gg // passo a 4h se > 10 gg
else if (numCount > 240) else if (numCount > 72)
answ = 5; answ = 3;
redFact = answ; redFact = answ;
} }
private LineChartDataset<double> GetLineChartDataset()
{
fixRedFactor();
var answ = new LineChartDataset<double>
{
//Label = "Livello",
Data = _currItem.LevelTS.Where((cat, index) => index % redFact == 0).Select(x => x.ValDouble).ToList(),
BorderColor = getLineColors(1f),
BackgroundColor = getFillColors(0.25f),
Fill = true,
PointRadius = 3,
BorderWidth = 2,
LineTension = 0,
BorderDash = new List<int> { }
};
return answ;
}
private List<string> GetLineChartLabels()
{
fixRedFactor();
var answ = _currItem.LevelTS.Where((cat, index) => index % redFact == 0).Select(x => x.DtEvent.ToString("dd/MM HH")).ToList();
return answ;
}
#endregion Private Methods #endregion Private Methods
#region Protected Methods
/// <summary>
/// Genera colori sfondo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> getFillColors(float alpha)
{
List<string> answ = new List<string>();
answ.Add(ChartColor.FromRgba(108, 164, 254, alpha));
return answ;
}
/// <summary>
/// Genera colori linea
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> getLineColors(float alpha)
{
List<string> answ = new List<string>();
answ.Add(ChartColor.FromRgba(54, 82, 254, alpha));
return answ;
}
protected async Task HandleRedraw()
{
if (LevelVal != null)
{
await LevelVal.Clear();
await LevelVal.AddLabelsDatasetsAndUpdate(GetLineChartLabels(), GetLineChartDataset());
}
}
protected void ShowDetail(int currPlantId)
{
SelPlantId = currPlantId;
// rimando...
NavManager.NavigateTo($"PlantAnalisys");
}
protected void ShowOrders(int currPlantId)
{
SelPlantId = currPlantId;
// rimando...
NavManager.NavigateTo($"Orders");
}
#endregion Protected Methods
#region Public Methods
public string getPressData(string valore, string formato)
{
string answ = "";
if (currItem.PressAct.ContainsKey(valore))
{
answ = currItem.PressAct[valore].ToString(formato);
}
return answ;
}
#endregion Public Methods
} }
} }
+21
View File
@@ -0,0 +1,21 @@
<div class="progress">
<div class="progress-bar" style="@cssClassWidth">@(Value)</div>
</div>
@code {
[Parameter]
public bool Striped { get; set; } = false;
[Parameter]
public bool Animated { get; set; } = false;
[Parameter]
public double Value { get; set; } = 0;
private string cssClassWidth
{
get => $"width: {Value}%;";
}
}
+28
View File
@@ -0,0 +1,28 @@
@using GWMS.UI.Components
@using GWMS.Data.DatabaseModels
@using System.Security.Claims
@using Microsoft.AspNetCore.Components.Authorization
@using GWMS.UI.Data
@using Microsoft.Extensions.Configuration
@using Microsoft.JSInterop
@inject IJSRuntime JSRuntime
<div id="qrCodeImg"></div>
@code {
[Parameter]
public string rawCode { get; set; } = "EmptyQr";
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await InitDefault();
}
protected async Task InitDefault()
{
await JSRuntime.InvokeVoidAsync("displayQr", "qrCodeImg", rawCode);
}
}
+4 -5
View File
@@ -23,7 +23,7 @@
</EditForm> </EditForm>
</div> </div>
} }
else if (!(DbUserTableOk && DbIdentity)) else if (!(DbIdentity))
{ {
<div class="col-12"> <div class="col-12">
<MigrationManager evRefresh="()=> Done()" evProcessing="()=> Processing()" /> <MigrationManager evRefresh="()=> Done()" evProcessing="()=> Processing()" />
@@ -56,7 +56,6 @@
return model.Password == "f@mmiEntrare!"; return model.Password == "f@mmiEntrare!";
} }
} }
protected bool DbUserTableOk { get; set; } = false;
protected bool DbLogOk { get; set; } = false; protected bool DbLogOk { get; set; } = false;
protected bool DbAllOk { get; set; } = false; protected bool DbAllOk { get; set; } = false;
protected bool DbIdentity { get; set; } = false; protected bool DbIdentity { get; set; } = false;
@@ -79,6 +78,8 @@
protected async Task Processing() protected async Task Processing()
{ {
processRunning = true; processRunning = true;
DbConfig.ExecMigrationMain();
DbConfig.ExecMigrationIdentity();
await ReloadData(); await ReloadData();
} }
@@ -89,13 +90,11 @@
} }
protected async Task ReloadData() protected async Task ReloadData()
{ {
var resultUser = await Health.Checks.DbUserApp(DbConfig.DATABASE_NAME);
var resultLog = await Health.Checks.DbPlantTable(DbConfig.DATABASE_NAME); var resultLog = await Health.Checks.DbPlantTable(DbConfig.DATABASE_NAME);
var resultIden = await Health.Checks.DbIdentity(DbConfig.DATABASE_NAME); var resultIden = await Health.Checks.DbIdentity(DbConfig.DATABASE_NAME);
DbUserTableOk = (resultUser.Status == HealthStatus.Healthy);
DbLogOk = (resultLog.Status == HealthStatus.Healthy); DbLogOk = (resultLog.Status == HealthStatus.Healthy);
DbIdentity = (resultIden.Status == HealthStatus.Healthy); DbIdentity = (resultIden.Status == HealthStatus.Healthy);
DbAllOk = (DbUserTableOk && DbLogOk && DbIdentity); DbAllOk = (DbLogOk && DbIdentity);
} }
} }
+6
View File
@@ -0,0 +1,6 @@
namespace GWMS.UI.Components
{
public class TValue
{
}
}
-223
View File
@@ -1,223 +0,0 @@
@using GWMS.UI.Components
@using GWMS.Data.DatabaseModels
@using System.Security.Claims
@using Microsoft.AspNetCore.Components.Authorization
@using GWMS.UI.Data
@using GWMS.Data.DTO
@using Microsoft.Extensions.Configuration
@inject MessageService AppMService
@inject GWMSDataService DataService
@inject IConfiguration Configuration
<div class="card">
<div class="card-header bg-info text-light">
<b>Modifica</b>
</div>
<div class="card-body small p-1">
<EditForm Model="@_currItem">
<DataAnnotationsValidator />
<div class="row">
<div class="col-9 col-lg-10">
<div class="row mb-2">
<div class="col-3">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-puzzle-piece"></i></span>
</div>
<InputText @bind-Value="_currItem.UserName" class="form-control" title="User Name" />
</div>
</div>
<div class="col-3">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-user"></i></span>
</div>
<InputText @bind-Value="_currItem.Lastname" class="form-control" title="Cognome" />
</div>
</div>
<div class="col-3">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text"><i class="far fa-user"></i></span>
</div>
<InputText @bind-Value="_currItem.Firstname" class="form-control" title="Nome" />
</div>
</div>
<div class="col-2">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fas fa-user-shield"></i>
</span>
</div>
<select @bind="_currItem.Livello" class="form-control">
@foreach (var itemVal in Enum.GetValues(typeof(GWMS.Data.UserLevel)))
{
<option>@itemVal</option>
}
</select>
</div>
</div>
<div class="col-1">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="switchAtt" title="attivo" @bind="_currItem.IsActive">
<label class="custom-control-label" for="switchAtt">Att</label>
</div>
</div>
</div>
<div class="row">
<div class="col-3">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-at"></i></span>
</div>
<InputText @bind-Value="_currItem.Email" class="form-control" title="Email" />
</div>
</div>
<div class="col-3">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="fas fa-gas-pump" aria-hidden="true"></span>
</span>
</div>
<select @bind="_currItem.MaskPlantId" class="form-control form-control-sm">
<option value="0">--- Tutti ---</option>
@if (PlantsList != null)
{
foreach (var item in PlantsList)
{
<option value="@item.PlantId">@item.PlantCode | @item.PlantDesc</option>
}
}
</select>
</div>
</div>
<div class="col-3">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="fas fa-industry" aria-hidden="true"></span>
</span>
</div>
<select @bind="_currItem.MaskSupplierId" class="form-control form-control-sm">
<option value="0">--- Tutti ---</option>
@if (SuppliersList != null)
{
foreach (var item in SuppliersList)
{
<option value="@item.SupplierId">@item.SupplierCode | @item.SupplierDesc</option>
}
}
</select>
</div>
</div>
<div class="col-3">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="fas fa-truck-moving" aria-hidden="true"></span>
</span>
</div>
<select @bind="_currItem.MaskTranspId" class="form-control form-control-sm" title="Trasportatore">
<option value="0">--- Tutti ---</option>
@if (TransportersList != null)
{
foreach (var item in TransportersList)
{
<option value="@item.TransporterId">@item.TransporterCode | @item.TransporterDesc</option>
}
}
</select>
</div>
</div>
</div>
</div>
<div class="col-3 col-lg-2">
<div class="mb-2">
<button type="button" class="btn btn-sm btn-outline-success btn-block" value="Save" @onclick="saveUpdate">Save <i class="far fa-save"></i></button>
</div>
<div>
<button type="button" class="btn btn-sm btn-outline-warning btn-block" value="Cancel" @onclick="cancelUpdate">Cancel <i class="fas fa-ban"></i></button>
</div>
</div>
</div>
</EditForm>
</div>
</div>
@code {
private List<PlantDTO> PlantsList;
private List<SupplierModel> SuppliersList;
private List<TransporterModel> TransportersList;
protected UserModel _currItem = new UserModel();
protected int _supplierId { get; set; } = 0;
[Parameter]
public UserModel currItem
{
get
{
return _currItem = null;
}
set
{
_currItem = value;
}
}
[Parameter]
public EventCallback<int> DataReset { get; set; }
[Parameter]
public EventCallback<int> DataUpdated { get; set; }
[Parameter]
public int SupplierId
{
get
{
return _supplierId;
}
set
{
_supplierId = value;
// condiziono visualizzazione...
var pUpd = Task.Run(async () => await ReloadAllData());
pUpd.Wait();
}
}
private async Task saveUpdate()
{
if (_currItem != null)
{
DataService.UserUpdate(_currItem);
await DataUpdated.InvokeAsync(1);
}
else
{
Console.WriteLine("User null!");
}
}
private async Task cancelUpdate()
{
await DataReset.InvokeAsync(0);
}
protected override async Task OnInitializedAsync()
{
await ReloadAllData();
}
protected async Task ReloadAllData()
{
PlantsList = await DataService.PlantsGetAll();
SuppliersList = await DataService.SuppliersGetAll();
TransportersList = await DataService.TransportersGetAll();
}
}
+6 -6
View File
@@ -142,7 +142,7 @@
@code { @code {
private List<PlantDTO> PlantsList; private List<PlantDetailModel> PlantsList;
private List<SupplierModel> SuppliersList; private List<SupplierModel> SuppliersList;
private List<TransporterModel> TransportersList; private List<TransporterModel> TransportersList;
@@ -195,7 +195,7 @@
{ {
if (_currItem != null) if (_currItem != null)
{ {
DataService.WeekPlanUpdate(_currItem); DataService.WeekPlanUpdateAsync(_currItem);
await DataUpdated.InvokeAsync(1); await DataUpdated.InvokeAsync(1);
} }
else else
@@ -211,7 +211,7 @@
if (_currItem != null) if (_currItem != null)
{ {
DataService.WeekPlanDelete(_currItem); DataService.WeekPlanDeleteAsync(_currItem);
await DataUpdated.InvokeAsync(1); await DataUpdated.InvokeAsync(1);
} }
else else
@@ -232,9 +232,9 @@
protected async Task ReloadAllData() protected async Task ReloadAllData()
{ {
PlantsList = await DataService.PlantsGetAll(); PlantsList = await DataService.PlantsListAsync();
SuppliersList = await DataService.SuppliersGetAll(); SuppliersList = await DataService.SuppliersGetAllAsync();
TransportersList = await DataService.TransportersGetAll(); TransportersList = await DataService.TransportersGetAllAsync();
} }
} }
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -47,16 +47,16 @@ namespace GWMS.UI.Controllers
[HttpDelete("{id}")] [HttpDelete("{id}")]
public void Delete(int id) public void Delete(int id)
{ {
//Log.Debug($"Chiamata Delete | {id}"); Log.Debug($"PlantData: Chiamata Delete | {id} | nothing 2 do");
} }
// GET: api/PlantData // GET: api/PlantData
[HttpGet] [HttpGet]
public async Task<List<PlantDTO>> Get() public async Task<List<PlantDTO>> Get()
{ {
//Log.Debug("Chiamata Get"); Log.Debug("PlantData: Chiamata Get");
// serializzo i dati di PlantDTO dell'impianto richiesto // serializzo i dati di PlantDTO dell'impianto richiesto
List<PlantDTO> ListRecords = await _DataService.PlantsGetAll(); List<PlantDTO> ListRecords = await _DataService.PlantDtoGetAllAsync();
return ListRecords; return ListRecords;
} }
@@ -64,9 +64,9 @@ namespace GWMS.UI.Controllers
[HttpGet("{id}")] [HttpGet("{id}")]
public async Task<PlantDTO> Get(int id) public async Task<PlantDTO> Get(int id)
{ {
//Log.Debug($"Chiamata Get | {id}"); Log.Debug($"PlantData: Chiamata Get | id: {id}");
// serializzo i dati di PlantDTO dell'impianto richiesto // serializzo i dati di PlantDTO dell'impianto richiesto
var ListRecords = await _DataService.PlantsGetAll(); var ListRecords = await _DataService.PlantDtoGetAllAsync();
//seleziono plant... //seleziono plant...
var SelRecords = ListRecords.Where(X => X.PlantId == id).FirstOrDefault(); var SelRecords = ListRecords.Where(X => X.PlantId == id).FirstOrDefault();
return SelRecords; return SelRecords;
@@ -76,14 +76,14 @@ namespace GWMS.UI.Controllers
[HttpPost] [HttpPost]
public void Post([FromBody] string value) public void Post([FromBody] string value)
{ {
//Log.Debug("Chiamata Post"); Log.Debug("PlantData: Chiamata Post | nothing 2 do");
} }
// PUT api/PlantData/5 // PUT api/PlantData/5
[HttpPut("{id}")] [HttpPut("{id}")]
public void Put(int id, [FromBody] string value) public void Put(int id, [FromBody] string value)
{ {
//Log.Debug($"Chiamata Put | {id}"); Log.Debug("PlantData: Chiamata Put | nothing 2 do");
} }
#endregion Public Methods #endregion Public Methods
+3 -3
View File
@@ -62,7 +62,7 @@ namespace GWMS.UI.Controllers
DateTime limite = DateTime.Today.AddHours(dayHour).AddMinutes(dayMin); DateTime limite = DateTime.Today.AddHours(dayHour).AddMinutes(dayMin);
// serializzo i dati di PlantDTO dell'impianto richiesto // serializzo i dati di PlantDTO dell'impianto richiesto
var ListRecords = await _DataService.PlantLogGetFilt(0, limite, 100); var ListRecords = await _DataService.PlantLogGetFiltAsync(0, limite, 100);
return ListRecords; return ListRecords;
} }
@@ -78,7 +78,7 @@ namespace GWMS.UI.Controllers
DateTime limite = DateTime.Today.AddHours(dayHour).AddMinutes(dayMin); DateTime limite = DateTime.Today.AddHours(dayHour).AddMinutes(dayMin);
// serializzo i dati di PlantDTO dell'impianto richiesto // serializzo i dati di PlantDTO dell'impianto richiesto
var ListRecords = await _DataService.PlantLogGetFilt(id, limite, 100); var ListRecords = await _DataService.PlantLogGetFiltAsync(id, limite, 100);
return ListRecords; return ListRecords;
} }
@@ -91,7 +91,7 @@ namespace GWMS.UI.Controllers
// verifico ci sia valore // verifico ci sia valore
if (newItems != null) if (newItems != null)
{ {
fatto = await _DataService.PlantLogInsert(newItems); fatto = await _DataService.PlantLogInsertAsync(newItems);
} }
if (fatto) if (fatto)
{ {
File diff suppressed because it is too large Load Diff
+23 -5
View File
@@ -13,7 +13,8 @@ namespace GWMS.UI.Data
private string _pageIcon; private string _pageIcon;
private string _pageName; private string _pageName;
private string _searchVal; private string _searchVal;
private bool showSearch; private string _userName;
private bool _showSearch;
#endregion Private Fields #endregion Private Fields
@@ -50,6 +51,9 @@ namespace GWMS.UI.Data
} }
} }
public string SelPlantId { get; set; } = "0";
public string SelOrderCode { get; set; } = "";
public SelectOrderData Order_Filter { get; set; } = SelectOrderData.Init(5, 30); public SelectOrderData Order_Filter { get; set; } = SelectOrderData.Init(5, 30);
public string PageIcon public string PageIcon
@@ -65,6 +69,20 @@ namespace GWMS.UI.Data
} }
} }
public string UserName
{
get => _userName;
set
{
if (_userName != value)
{
_userName = value;
ReportPageUpd();
}
}
}
public string PageName public string PageName
{ {
get => _pageName; get => _pageName;
@@ -97,13 +115,13 @@ namespace GWMS.UI.Data
public bool ShowSearch public bool ShowSearch
{ {
get => showSearch; get => _showSearch;
set set
{ {
if (showSearch != value) if (_showSearch != value)
{ {
showSearch = value; _showSearch = value;
if (showSearch) if (_showSearch)
{ {
if (EA_ShowSearch != null) if (EA_ShowSearch != null)
{ {
+97
View File
@@ -0,0 +1,97 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>1.0.2406.0417</Version>
<UserSecretsId>95c9f021-52d1-4390-a670-5810b7b777b0</UserSecretsId>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Services\**" />
<Content Remove="Services\**" />
<EmbeddedResource Remove="Services\**" />
<None Remove="Services\**" />
</ItemGroup>
<ItemGroup>
<Compile Remove="QuartzHostedService.cs" />
</ItemGroup>
<ItemGroup>
<Content Remove="bundleconfig.json" />
</ItemGroup>
<ItemGroup>
<None Remove="NLog.config.dev" />
<None Remove="NLog.config.disabled" />
<None Remove="NLog.config.rel" />
</ItemGroup>
<ItemGroup>
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS02.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfile.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfileLinux.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfileWin.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\W2019-IIS-DEV.pubxml" />
</ItemGroup>
<ItemGroup>
<Content Include="NLog.config.rel">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Content>
<Content Include="NLog.config.dev">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GWMS.Data\GWMS.Data.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.MySql" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.Redis" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.System" Version="6.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI" Version="6.0.4" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="6.0.4" />
<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="6.0.4" />
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="6.0.3" />
<PackageReference Include="BlazorBarcodeScanner.ZXing.JS" Version="0.2.7" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.2" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.2" ExcludeAssets="All" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.11" />
<PackageReference Include="ZXingBlazor" Version="0.1.6" />
</ItemGroup>
<ItemGroup>
<None Include="bundleconfig.json" />
</ItemGroup>
<ItemGroup>
<Compile Update="Components\ParamEditor - Copy.razor.cs">
<DependentUpon>ParamEditor.razor.cs</DependentUpon>
</Compile>
<Compile Update="Pages\Transporters - Copy - Copy.razor.cs">
<DependentUpon>Transporters - Copy.razor.cs</DependentUpon>
</Compile>
<Compile Update="Pages\Transporters - Copy.razor.cs">
<DependentUpon>Transporters.razor.cs</DependentUpon>
</Compile>
</ItemGroup>
<Target Name="PreBuild" AfterTargets="PreBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\pre-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath) -Config $(Configuration)" />
</Target>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath) -Config $(Configuration)" />
</Target>
</Project>
+100 -67
View File
@@ -1,79 +1,112 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<Version>1.0.2110.0119</Version> <Version>1.2.2603.1310</Version>
<UserSecretsId>95c9f021-52d1-4390-a670-5810b7b777b0</UserSecretsId> <UserSecretsId>95c9f021-52d1-4390-a670-5810b7b777b0</UserSecretsId>
<EnableNETAnalyzers>true</EnableNETAnalyzers> <EnableNETAnalyzers>true</EnableNETAnalyzers>
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild> <RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
<ServerGarbageCollection>true</ServerGarbageCollection> <ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Remove="QuartzHostedService.cs" /> <Compile Remove="Services\**" />
<Compile Remove="Services\BlazorTimer.cs" /> <Content Remove="Services\**" />
</ItemGroup> <EmbeddedResource Remove="Services\**" />
<None Remove="Services\**" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Content Remove="bundleconfig.json" /> <Compile Remove="QuartzHostedService.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS02.pubxml" /> <Content Remove="bundleconfig.json" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfile.pubxml" /> </ItemGroup>
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfileLinux.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfileWin.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\W2019-IIS-DEV.pubxml" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\GWMS.Data\GWMS.Data.csproj" /> <None Remove="NLog.config.dev" />
</ItemGroup> <None Remove="NLog.config.disabled" />
<None Remove="NLog.config.rel" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.MySql" Version="5.0.1" /> <_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS02.pubxml" />
<PackageReference Include="AspNetCore.HealthChecks.Redis" Version="5.0.2" /> <_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfile.pubxml" />
<PackageReference Include="AspNetCore.HealthChecks.System" Version="5.0.1" /> <_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfileLinux.pubxml" />
<PackageReference Include="AspNetCore.HealthChecks.UI" Version="5.0.1" /> <_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfileWin.pubxml" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="5.0.1" /> <_WebToolingArtifacts Remove="Properties\PublishProfiles\W2019-IIS-DEV.pubxml" />
<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="5.0.1" /> </ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="5.0.1" />
<PackageReference Include="BlazorBarcodeScanner.ZXing.JS" Version="0.2.4" />
<PackageReference Include="Blazorise" Version="0.9.4.4" />
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.4.4" />
<PackageReference Include="Blazorise.Charts" Version="0.9.4.4" />
<PackageReference Include="Blazorise.Components" Version="0.9.4.4" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.4.4" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="5.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.10">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" ExcludeAssets="All" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.14.0" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Services\" /> <Content Include="NLog.config.rel">
</ItemGroup> <CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Content>
<Content Include="NLog.config.dev">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="bundleconfig.json" /> <ProjectReference Include="..\GWMS.Data\GWMS.Data.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="Pages\Transporters - Copy - Copy.razor.cs"> <PackageReference Include="AspNetCore.HealthChecks.MySql" Version="6.0.2" />
<DependentUpon>Transporters - Copy.razor.cs</DependentUpon> <PackageReference Include="AspNetCore.HealthChecks.Redis" Version="6.0.4" />
</Compile> <PackageReference Include="AspNetCore.HealthChecks.System" Version="6.0.5" />
<Compile Update="Pages\Transporters - Copy.razor.cs"> <PackageReference Include="AspNetCore.HealthChecks.UI" Version="6.0.4" />
<DependentUpon>Transporters.razor.cs</DependentUpon> <PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="6.0.5" />
</Compile> <PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="6.0.5" />
</ItemGroup> <PackageReference Include="AspNetCore.HealthChecks.Uris" Version="6.0.3" />
<PackageReference Include="BlazorBarcodeScanner.ZXing.JS" Version="0.2.7" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.2" ExcludeAssets="All" />
<PackageReference Include="NLog" Version="6.1.1" />
<PackageReference Include="NLog.Targets.OpenTelemetryProtocol" Version="1.2.6" />
<PackageReference Include="NLog.Web.AspNetCore" Version="6.1.2" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.15.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.15.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.15.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.15.0-beta.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.15.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.StackExchangeRedis" Version="1.15.0-beta.1" />
<PackageReference Include="StackExchange.Redis" Version="2.7.33" />
<PackageReference Include="ZXingBlazor" Version="0.1.6" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent"> <ItemGroup>
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" /> <None Include="bundleconfig.json" />
</Target> </ItemGroup>
<ItemGroup>
<Compile Update="Components\ParamEditor - Copy.razor.cs">
<DependentUpon>ParamEditor.razor.cs</DependentUpon>
</Compile>
<Compile Update="Pages\Transporters - Copy - Copy.razor.cs">
<DependentUpon>Transporters - Copy.razor.cs</DependentUpon>
</Compile>
<Compile Update="Pages\Transporters - Copy.razor.cs">
<DependentUpon>Transporters.razor.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Update="NLog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Target Name="PreBuild" AfterTargets="PreBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\pre-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath) -Config $(Configuration)" />
</Target>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath) -Config $(Configuration)" />
</Target>
</Project> </Project>
+17 -38
View File
@@ -82,33 +82,6 @@ namespace GWMS.UI.Health
} }
} }
public static async Task<HealthCheckResult> DbUserApp(string dbName)
{
using (var appDb = new GWMSContext())
{
string description = "Try check Table AppUser";
List<GWMS.Data.DatabaseModels.UserModel> userList = new List<GWMS.Data.DatabaseModels.UserModel>();
var healthCheckData = new Dictionary<string, object>();
try
{
// provo a controllare se ho tab utenti
userList = await Task.FromResult(appDb.DbSetUser.ToList());
//userList = await Task.FromResult(appDb.DbSetUser.ToList()).ConfigureAwait(false);
if (userList.Count > 0)
{
description = $"Check AppUser table, found {userList.Count} records";
return HealthCheckResult.Healthy(description, healthCheckData);
}
}
catch (Exception exc)
{
Log.Error(exc, "Errore in esecuzione DbUserApp");
}
return HealthCheckResult.Degraded(description + $" {dbName}", null, healthCheckData);
}
}
public static async Task<HealthCheckResult> DbUserRoot(string dbName) public static async Task<HealthCheckResult> DbUserRoot(string dbName)
{ {
using (var adminDb = new AdminContext()) using (var adminDb = new AdminContext())
@@ -137,20 +110,26 @@ namespace GWMS.UI.Health
public static async Task<HealthCheckResult> PingCheck(string hostName) public static async Task<HealthCheckResult> PingCheck(string hostName)
{ {
using (var thePing = new Ping()) if (hostName.Contains("::") || hostName.Contains("0.0.0.0"))
{ {
var pingResult = await thePing.SendPingAsync(hostName); return HealthCheckResult.Unhealthy($"Wrong Hostname: {hostName}");
var description = $"Ping to {hostName}"; }
var healthCheckData = new Dictionary<string, object>(); else
healthCheckData.Add("RoundTripMS", pingResult.RoundtripTime); {
healthCheckData.Add("ActualIPAddress", pingResult.Address.ToString()); using (var thePing = new Ping())
if (pingResult.Status == IPStatus.Success)
{ {
description += $" - {pingResult.RoundtripTime}ms"; var pingResult = await thePing.SendPingAsync(hostName);
return HealthCheckResult.Healthy(description, healthCheckData); var description = $"Ping to {hostName}";
var healthCheckData = new Dictionary<string, object>();
healthCheckData.Add("RoundTripMS", pingResult.RoundtripTime);
healthCheckData.Add("ActualIPAddress", pingResult.Address.ToString());
if (pingResult.Status == IPStatus.Success)
{
description += $" - {pingResult.RoundtripTime}ms";
return HealthCheckResult.Healthy(description, healthCheckData);
}
return HealthCheckResult.Unhealthy(description + $" {hostName}", null, healthCheckData);
} }
return HealthCheckResult.Unhealthy(description + $" {hostName}", null, healthCheckData);
} }
} }
+11 -3
View File
@@ -29,7 +29,7 @@
layout="${longdate} ${uppercase:${level}} ${message}" /> 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="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}" /> <target xsi:type="ColoredConsole" name="consoleTarget" layout="${longdate} | ${uppercase:${level}} | ${logger:shortName=true} | ${message}" />
</targets> </targets>
<rules> <rules>
@@ -39,8 +39,16 @@
Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f" 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="f" />
--> -->
<logger name="*" minlevel="Trace" writeTo="consoleTarget" />
<logger name="System.*" finalMinLevel="Warn" />
<logger name="Microsoft.*" finalMinLevel="Warn" />
<!--<logger name="Microsoft.AspNetCore.SignalR" finalMinLevel="Debug" />
<logger name="Microsoft.AspNetCore.Http.Connections" finalMinLevel="Debug" />-->
<logger name="Microsoft.AspNetCore.*" finalMinLevel="Warn" />
<logger name="Microsoft.Hosting.Lifetime*" finalMinLevel="Info" />
<logger name="*" minlevel="Debug" writeTo="consoleTarget" />
<!--<logger name="Microsoft.*" maxlevel="Info" final="true" />--> <!--<logger name="Microsoft.*" maxlevel="Info" final="true" />-->
<logger name="*" minlevel="Trace" writeTo="fileTarget" /> <logger name="*" minlevel="Debug" writeTo="fileTarget" />
</rules> </rules>
</nlog> </nlog>

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