Compare commits
357 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| caa4b4f590 | |||
| e45cb0595e | |||
| 77e7e39985 | |||
| b2e9ae76d4 | |||
| 460eb769dc | |||
| 5e38749c65 | |||
| 91083b6c4a | |||
| de562b1287 | |||
| 470c9a2191 | |||
| 26e36e7124 | |||
| bef0ee6000 | |||
| 9e4822d529 | |||
| 7f9685a007 | |||
| d8978f84f3 | |||
| 946f157cff | |||
| 47f1ae5cb2 | |||
| a428ecb4ab | |||
| c4b6f289af | |||
| 1cc90d2459 | |||
| e438fa3930 | |||
| 6c88e2687a | |||
| fba6eca9cc | |||
| 330e208866 | |||
| 013b21e055 | |||
| 8e763e52a4 | |||
| d5f5cf9b11 | |||
| a4810826f8 | |||
| 7f3a73ba0e | |||
| d108b74f7d | |||
| 16278b6ae0 | |||
| 1f10e8537d | |||
| a6408ba2af | |||
| 924a5017f5 | |||
| 5bcc32023a | |||
| e87d14bd8a | |||
| cbaa16a850 | |||
| cc272cac29 | |||
| b032b6bbb9 | |||
| 91174a2f67 | |||
| 2a96b63f17 | |||
| 08634b5656 | |||
| 5d63c41cf8 | |||
| de3ce0f114 | |||
| 2ec29bbe68 | |||
| 7416f6e7b5 | |||
| a604e5741b | |||
| 923094054b | |||
| c28dae0c8d | |||
| 6fb9cbe085 | |||
| 4f03661182 | |||
| dd26773590 | |||
| 75894fa3c7 | |||
| 9fc73c5c85 | |||
| 0f9c01ae82 | |||
| ea60e785f9 | |||
| 1849101028 | |||
| a1f9a958b3 | |||
| fd585aee93 | |||
| 4ecd647b1b | |||
| 8aace3fb82 | |||
| 4acf2a2970 | |||
| 9b6c449354 | |||
| c11e05123d | |||
| 862960bae4 | |||
| 4cdf0033cd | |||
| 25b75101e9 | |||
| 50dbe7691f | |||
| 9c762969ac | |||
| 09b2008f25 | |||
| baa42fbd2f | |||
| 90d4a46087 | |||
| 5b12ac47d3 | |||
| 81fd2820df | |||
| 624d6d3411 | |||
| 21fa81f09c | |||
| 0795cae1d5 | |||
| 6a0eeba75f | |||
| b476829a73 | |||
| 78c90a8e93 | |||
| 9515906e20 | |||
| c929e3cf65 | |||
| 43f0569fe3 | |||
| 2807bd9edc | |||
| c4a682cc24 | |||
| 5ef3139bd5 | |||
| 2a679504eb | |||
| 10f9ed08a8 | |||
| 374902d5f0 | |||
| 59b43f6005 | |||
| 1ad6222543 | |||
| b97394b067 | |||
| 9d35441b07 | |||
| f71ec80c16 | |||
| d1b6c804be | |||
| 391078dd06 | |||
| 55c6790d7b | |||
| 66642032bf | |||
| da76bc96f8 | |||
| 23fbacba87 | |||
| b9d67616cb | |||
| 79da055771 | |||
| 7e879fe2f6 | |||
| 95e83f7d56 | |||
| 0efe322f7a | |||
| 3bc3746a9d | |||
| 08901bcebc | |||
| 4d481699a1 | |||
| 3efeb994cf | |||
| 5014bb1ecb | |||
| 523b1683d9 | |||
| 35c0f2856d | |||
| 77457df40a | |||
| add4fe13fa | |||
| b748c76cad | |||
| 279d2799ae | |||
| 198d18002b | |||
| 838ebe55da | |||
| f58253341f | |||
| 4644646fa4 | |||
| c3c5300830 | |||
| ebeeab69e1 | |||
| 2a41e8070b | |||
| 3a5b77314a | |||
| 16c7b0bc6b | |||
| 46f284ae0c | |||
| e945aad224 | |||
| 8510731366 | |||
| 5df4195e6c | |||
| a3dc1e1657 | |||
| 27149e2131 | |||
| 91be755781 | |||
| 84f6730023 | |||
| b51c2679e4 | |||
| 9d7502d1a4 | |||
| d3b8160634 | |||
| 601c817aa2 | |||
| d0d30bd1c3 | |||
| 0e9e7f3dda | |||
| e518c17db2 | |||
| 0a281827f9 | |||
| 141473ce28 | |||
| 45af089e3f | |||
| 4e4387620b | |||
| 8c2c48a63f | |||
| 534a668496 | |||
| eed45695e8 | |||
| ff2fbe0c34 | |||
| 3324c736c6 | |||
| 0a6a0bc5cb | |||
| e18e0ddff3 | |||
| 580a498238 | |||
| c97557722e | |||
| c17fa17d76 | |||
| 5b054ee2ec | |||
| 2771d9957d | |||
| 5893152761 | |||
| b7d57e935a | |||
| 61b613a8fb | |||
| d2fef81f55 | |||
| cd7a8ccad8 | |||
| 08079d3e0e | |||
| 8156828ec3 | |||
| 9bb95c5a49 | |||
| 7ba3aeb65d | |||
| 6ea938a91a | |||
| 92c196023d | |||
| 10d9625b6d | |||
| 5f955499e2 | |||
| 716813abe1 | |||
| 6f0d0419c5 | |||
| 300c2dc294 | |||
| fddfbb6dfa | |||
| b2858c9c8a | |||
| 68404c928a | |||
| ca16c3a1b0 | |||
| c11163896c | |||
| 891def5bcd | |||
| 65aa95d1e7 | |||
| 1b20cd8ef5 | |||
| 11934fcae2 | |||
| 687a254a8d | |||
| 25f274d4d6 | |||
| 0ec3a4c31a | |||
| 1b89501529 | |||
| 191b23ee7d | |||
| ae39db267d | |||
| 7cc25ac9be | |||
| 5c30c8a1ba | |||
| d5777c0020 | |||
| f5bbcae0db | |||
| 1efd5f5a4b | |||
| 47ddab4e67 | |||
| 07c58c5738 | |||
| fcf1ec5ea9 | |||
| 673eb62d8c | |||
| 6790088950 | |||
| d46f3fd38d | |||
| 0fe40dacc7 | |||
| 0c01e93ff3 | |||
| 6da702e31f | |||
| ce92f70eb0 | |||
| 37a62a34ae | |||
| c138ea3143 | |||
| 4e11685415 | |||
| 32398cd7fb | |||
| d5f2ed3950 | |||
| f120bb6c28 | |||
| 7abd135f30 | |||
| bae58ec4bb | |||
| f44838d235 | |||
| 9c11e877aa | |||
| 5fdd74ae9a | |||
| b838e95c28 | |||
| 0e2036cb42 | |||
| b29bac08a2 | |||
| 5559e7daa8 | |||
| d3fb78810e | |||
| 30dac79e7c | |||
| bf8f7b8fa3 | |||
| 5915e5f532 | |||
| 658488fe0e | |||
| 5f8e60b4ba | |||
| fff3659939 | |||
| 385c5cf7ea | |||
| 31ed8b2edb | |||
| 0ef6d161d5 | |||
| a0b88fd157 | |||
| ed93a04fd0 | |||
| 00a0fc81ce | |||
| 681aa44b32 | |||
| 9d43a221ed | |||
| 53a7630d97 | |||
| 7317fa58b4 | |||
| dd56701b5b | |||
| 014bed96f9 | |||
| ac196be0b7 | |||
| a77862b372 | |||
| ed5b55cf77 | |||
| aec6271f5a | |||
| 62359ac858 | |||
| 73df595421 | |||
| 2cd1d57cd3 | |||
| 8934c86f7b | |||
| cee1718208 | |||
| 9407b451c7 | |||
| 66469b9df7 | |||
| 57833b368d | |||
| 634f5f7120 | |||
| 0e376c070c | |||
| 387df699b0 | |||
| 2016379205 | |||
| 0ad15c90c3 | |||
| 190e572bce | |||
| 02e7b7c4e7 | |||
| e03b590844 | |||
| 4ee291c12d | |||
| 81c04ef70b | |||
| 19b89db170 | |||
| 623ecd6308 | |||
| c5e598a0d6 | |||
| a46dc9cb32 | |||
| 3634f85359 | |||
| 54d2cd634c | |||
| 4cd61462c0 | |||
| 5444722c25 | |||
| d5d47076df | |||
| 612c3c95f7 | |||
| dddac15b52 | |||
| a315e4f0ef | |||
| d71e9465e5 | |||
| 876197b0ac | |||
| cd07a940d0 | |||
| d2f7dd53f3 | |||
| 8c75556240 | |||
| a025057865 | |||
| c5ebcd5b40 | |||
| df1526d522 | |||
| fb88e6e30d | |||
| e83945488d | |||
| 23835d330d | |||
| b57885576e | |||
| 417ea1a77d | |||
| 335fdf78f0 | |||
| d50e5a6860 | |||
| 86d28f1901 | |||
| 202c5f6faf | |||
| e2947d1017 | |||
| 55faefcb9a | |||
| 1e5f894fd9 | |||
| cf8baa054f | |||
| 871a0c8ca5 | |||
| 78cb17d8fc | |||
| 22ff799204 | |||
| a26408a21c | |||
| ee043f81be | |||
| 97741b4973 | |||
| 544c977740 | |||
| dc38127291 | |||
| 8e7bdf2b77 | |||
| 7e922555b1 | |||
| acbbd5c9e6 | |||
| 77f06c465e | |||
| 4bfba522ce | |||
| cbbdc8e8d8 | |||
| e8e3d63d09 | |||
| 9dc73936da | |||
| a2afeab317 | |||
| 2c62abdf73 | |||
| d17cb03c7b | |||
| c749f10a8a | |||
| f2973cb0be | |||
| 8f2afd8ab5 | |||
| 1d46b75608 | |||
| 7c28833874 | |||
| 1a019f1c72 | |||
| cae553c47f | |||
| 7634fc42ba | |||
| c24935afce | |||
| 2c4ce635c0 | |||
| a4b01773ea | |||
| b076148e65 | |||
| 02369f87f7 | |||
| 4b04feedff | |||
| e99def8664 | |||
| a8744cfc56 | |||
| 03761b81ec | |||
| dd4f403b7a | |||
| c7d1ca046c | |||
| 2c3494f9f0 | |||
| 7dc0aef175 | |||
| e2afe6a586 | |||
| e3ed9a7f35 | |||
| db003d2bc3 | |||
| c203ab6eb3 | |||
| c10633b6f1 | |||
| a9fd0e2f83 | |||
| 112c73aea1 | |||
| 9e8e885ef9 | |||
| 1f964ded92 | |||
| eeba41cb5c | |||
| c418812ba2 | |||
| 6169d8cfcc | |||
| 75596c61bc | |||
| b51e164c18 | |||
| c35d625c36 | |||
| c893ce4d44 | |||
| c47fb1787c | |||
| aca61c24dc | |||
| 167c9d89d4 | |||
| 2295f12958 | |||
| 9762628abc | |||
| a7918e1a89 | |||
| 7a8e05462c | |||
| aaeae6e99e | |||
| 533f3f4f8f | |||
| 5135987f1b | |||
| 458d788a13 |
+218
-2
@@ -1,5 +1,6 @@
|
||||
variables:
|
||||
NEXUS_PATH: 'MP-STATS'
|
||||
PROJ_PATH: ''
|
||||
APP_NAME: 'MP.Stats'
|
||||
SOL_NAME: 'MP-STATS'
|
||||
|
||||
@@ -120,6 +121,33 @@ MON:build:
|
||||
script:
|
||||
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
SPEC:build:
|
||||
stage: build
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
APP_NAME: MP.SPEC
|
||||
SOL_NAME: MP-SPEC
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
script:
|
||||
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
# WAMON:build:
|
||||
# stage: build
|
||||
# tags:
|
||||
# - win
|
||||
# variables:
|
||||
# PROJ_PATH: MP.WASM.Mon\Server
|
||||
# APP_NAME: MP.WASM.Mon.Server
|
||||
# SOL_NAME: MP-WAMON
|
||||
# before_script:
|
||||
# - *nuget-fix
|
||||
# - dotnet restore "$env:SOL_NAME.sln"
|
||||
# script:
|
||||
# - dotnet build $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
|
||||
LAND:test:
|
||||
stage: test
|
||||
tags:
|
||||
@@ -184,6 +212,39 @@ MON:test:
|
||||
script:
|
||||
- dotnet test $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
# WAMON:test:
|
||||
# stage: test
|
||||
# tags:
|
||||
# - win
|
||||
# variables:
|
||||
# PROJ_PATH: MP.WASM.Mon\Server
|
||||
# APP_NAME: MP.WASM.Mon.Server
|
||||
# SOL_NAME: MP-WAMON
|
||||
# before_script:
|
||||
# - *nuget-fix
|
||||
# - dotnet restore "$env:SOL_NAME.sln"
|
||||
# only:
|
||||
# - develop
|
||||
# needs: ["WAMON:build"]
|
||||
# script:
|
||||
# - dotnet test $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
|
||||
SPEC:test:
|
||||
stage: test
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
APP_NAME: MP.SPEC
|
||||
SOL_NAME: MP-SPEC
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
only:
|
||||
- develop
|
||||
needs: ["SPEC:build"]
|
||||
script:
|
||||
- dotnet test $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
LAND:IIS01:deploy:
|
||||
stage: deploy
|
||||
tags:
|
||||
@@ -248,6 +309,39 @@ MON:IIS01:deploy:
|
||||
script:
|
||||
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
# WAMON:IIS01:deploy:
|
||||
# stage: deploy
|
||||
# tags:
|
||||
# - win
|
||||
# variables:
|
||||
# PROJ_PATH: MP.WASM.Mon\Server
|
||||
# APP_NAME: MP.WASM.Mon.Server
|
||||
# SOL_NAME: MP-WAMON
|
||||
# before_script:
|
||||
# - *nuget-fix
|
||||
# - dotnet restore "$env:SOL_NAME.sln"
|
||||
# only:
|
||||
# - develop
|
||||
# needs: ["WAMON:test"]
|
||||
# script:
|
||||
# - dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
|
||||
SPEC:IIS01:deploy:
|
||||
stage: deploy
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
APP_NAME: MP.SPEC
|
||||
SOL_NAME: MP-SPEC
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
only:
|
||||
- develop
|
||||
needs: ["SPEC:test"]
|
||||
script:
|
||||
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
LAND:IIS02:deploy:
|
||||
stage: deploy
|
||||
tags:
|
||||
@@ -316,6 +410,41 @@ MON:IIS02:deploy:
|
||||
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
# WAMON:IIS02:deploy:
|
||||
# stage: deploy
|
||||
# tags:
|
||||
# - win
|
||||
# variables:
|
||||
# PROJ_PATH: MP.WASM.Mon\Server
|
||||
# APP_NAME: MP.WASM.Mon.Server
|
||||
# SOL_NAME: MP-WAMON
|
||||
# before_script:
|
||||
# - *nuget-fix
|
||||
# - dotnet restore "$env:SOL_NAME.sln"
|
||||
# only:
|
||||
# - master
|
||||
# needs: ["WAMON:build"]
|
||||
# script:
|
||||
# - dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
# - dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
|
||||
SPEC:IIS02:deploy:
|
||||
stage: deploy
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
APP_NAME: MP.SPEC
|
||||
SOL_NAME: MP-SPEC
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
only:
|
||||
- master
|
||||
needs: ["SPEC:build"]
|
||||
script:
|
||||
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
LAND:installer:
|
||||
stage: installer
|
||||
tags:
|
||||
@@ -400,6 +529,49 @@ MON:installer:
|
||||
- *hashBuild
|
||||
- *nexusUpload
|
||||
|
||||
# WAMON:installer:
|
||||
# stage: installer
|
||||
# tags:
|
||||
# - win
|
||||
# variables:
|
||||
# PROJ_PATH: MP.WASM.Mon\Server
|
||||
# APP_NAME: MP.WASM.Mon.Server
|
||||
# SOL_NAME: MP-WAMON
|
||||
# NEXUS_PATH: MP-WAMON
|
||||
# before_script:
|
||||
# - *nuget-fix
|
||||
# - dotnet restore "$env:SOL_NAME.sln"
|
||||
# only:
|
||||
# - develop
|
||||
# - master
|
||||
# needs: ["WAMON:build"]
|
||||
# script:
|
||||
# - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:PROJ_PATH/$env:APP_NAME.csproj -o:publish
|
||||
# # qui il deploy su nexus...
|
||||
# - *hashBuild
|
||||
# - *nexusUpload
|
||||
|
||||
SPEC:installer:
|
||||
stage: installer
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
APP_NAME: MP.SPEC
|
||||
SOL_NAME: MP-SPEC
|
||||
NEXUS_PATH: MP-SPEC
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
only:
|
||||
- develop
|
||||
- master
|
||||
needs: ["SPEC:build"]
|
||||
script:
|
||||
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish
|
||||
# qui il deploy su nexus...
|
||||
- *hashBuild
|
||||
- *nexusUpload
|
||||
|
||||
LAND:release:
|
||||
stage: release
|
||||
tags:
|
||||
@@ -484,8 +656,6 @@ MON:release:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
only:
|
||||
#- feature/Deploy_CI_CD
|
||||
# - master
|
||||
- tags
|
||||
except:
|
||||
- branches
|
||||
@@ -495,3 +665,49 @@ MON:release:
|
||||
- publish/
|
||||
script:
|
||||
- dotnet publish -c Release -o ./publish $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
# WAMON:release:
|
||||
# stage: release
|
||||
# tags:
|
||||
# - win
|
||||
# variables:
|
||||
# PROJ_PATH: MP.WASM.Mon\Server
|
||||
# APP_NAME: MP.WASM.Mon.Server
|
||||
# SOL_NAME: MP-WAMON
|
||||
# NEXUS_PATH: MP-WAMON
|
||||
# before_script:
|
||||
# - *nuget-fix
|
||||
# - dotnet restore "$env:SOL_NAME.sln"
|
||||
# only:
|
||||
# - tags
|
||||
# except:
|
||||
# - branches
|
||||
# needs: ["WAMON:build"]
|
||||
# artifacts:
|
||||
# paths:
|
||||
# - publish/
|
||||
# script:
|
||||
# - dotnet publish -c Release -o ./publish $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
|
||||
SPEC:release:
|
||||
stage: release
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
APP_NAME: MP.SPEC
|
||||
SOL_NAME: MP-SPEC
|
||||
NEXUS_PATH: MP-SPEC
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
only:
|
||||
- tags
|
||||
except:
|
||||
- branches
|
||||
needs: ["SPEC:build"]
|
||||
artifacts:
|
||||
paths:
|
||||
- publish/
|
||||
script:
|
||||
- dotnet publish -c Release -o ./publish $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
|
||||
@@ -30,7 +30,14 @@ namespace Egw.Core
|
||||
{
|
||||
string passPhrase = string.Format("{0}|{1}", cliente.PadLeft(50, ':'), applicativo);
|
||||
plainAuthKey = SteamCrypto.DecryptString(authKey, passPhrase); // uso combinazione cliente+applicativo come passphrase!
|
||||
answ = Convert.ToDateTime(plainAuthKey.Replace(string.Format("{0}#{1}-", cliente, applicativo.PadLeft(20, '-')), "").Replace(string.Format("%{0}%", licenze), ""));
|
||||
string datePart = plainAuthKey.Replace($"{cliente}#{applicativo.PadLeft(20, '-')}-", "").Replace($"%{licenze}%", "");
|
||||
//string datePart = plainAuthKey.Replace(string.Format("{0}#{1}-", cliente, applicativo.PadLeft(20, '-')), "").Replace(string.Format("%{0}%", licenze), "");
|
||||
// se non avesse "bonificato" la parte num licenze (es non corrisponde al max) forzo il trim
|
||||
if (datePart.Contains("%"))
|
||||
{
|
||||
datePart = datePart.Substring(0, datePart.IndexOf("%"));
|
||||
}
|
||||
answ = Convert.ToDateTime(datePart);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.32126.317
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Data", "MP.Data\MP.Data.csproj", "{10BA8450-301D-49C7-8E1E-21B7469C225C}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.SPEC", "MP.SPEC\MP.SPEC.csproj", "{C777A098-6F91-45AF-A85E-0AD08CBCAC52}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C777A098-6F91-45AF-A85E-0AD08CBCAC52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C777A098-6F91-45AF-A85E-0AD08CBCAC52}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C777A098-6F91-45AF-A85E-0AD08CBCAC52}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C777A098-6F91-45AF-A85E-0AD08CBCAC52}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {632D11D1-088B-4795-97E5-048534002558}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.32126.317
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Data", "MP.Data\MP.Data.csproj", "{10BA8450-301D-49C7-8E1E-21B7469C225C}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Mon", "MP.Mon\MP.Mon.csproj", "{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MP.WASM.Mon.Server", "MP.WASM.Mon\Server\MP.WASM.Mon.Server.csproj", "{4A98B7F4-4EC6-4284-9D6C-63203DB981B1}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MP.WASM.Mon.Client", "MP.WASM.Mon\Client\MP.WASM.Mon.Client.csproj", "{9BF7BDE7-016A-458C-8791-494FD4204301}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{10BA8450-301D-49C7-8E1E-21B7469C225C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7780FA7A-3597-4098-81C1-DC9AD6AE7A98}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4A98B7F4-4EC6-4284-9D6C-63203DB981B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4A98B7F4-4EC6-4284-9D6C-63203DB981B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4A98B7F4-4EC6-4284-9D6C-63203DB981B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4A98B7F4-4EC6-4284-9D6C-63203DB981B1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9BF7BDE7-016A-458C-8791-494FD4204301}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9BF7BDE7-016A-458C-8791-494FD4204301}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9BF7BDE7-016A-458C-8791-494FD4204301}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9BF7BDE7-016A-458C-8791-494FD4204301}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {632D11D1-088B-4795-97E5-048534002558}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -54,7 +54,9 @@ namespace MP.AppAuth
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public virtual DbSet<AnagraficaGruppi> DbSetAnagraficaGruppi { get; set; }
|
||||
public virtual DbSet<AnagraficaOperatori> DbSetAnagOpr { get; set; }
|
||||
public virtual DbSet<Gruppi2Operatori> DbSetGruppi2Oper { get; set; }
|
||||
public virtual DbSet<UpdMan> DbSetUpdMan { get; set; }
|
||||
public virtual DbSet<Vocabolario> DbSetVocabolario { get; set; }
|
||||
|
||||
@@ -103,6 +105,37 @@ namespace MP.AppAuth
|
||||
.HasMaxLength(500);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<AnagraficaGruppi>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.CodGruppo);
|
||||
|
||||
entity.ToTable("AnagraficaGruppi");
|
||||
|
||||
entity.Property(e => e.CodGruppo).HasMaxLength(50);
|
||||
|
||||
entity.Property(e => e.DescrGruppo)
|
||||
.IsRequired()
|
||||
.HasMaxLength(250)
|
||||
.HasDefaultValueSql("('')");
|
||||
|
||||
entity.Property(e => e.SelEnabled).HasComment("Indica se sia selezionabile a livello di tendina x inserimento BCode");
|
||||
|
||||
entity.Property(e => e.TipoGruppo)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasDefaultValueSql("('REPARTO')")
|
||||
.HasComment("tipo gruppo: reparto (es x gestione operatori assegnati), GRUPPO FASE (es macchien che fanno lo stesso tipo di lavoro), ...");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Gruppi2Operatori>(entity =>
|
||||
{
|
||||
entity.HasKey(e => new { e.MatrOpr, e.CodGruppo });
|
||||
|
||||
entity.ToTable("Gruppi2Operatori");
|
||||
|
||||
entity.Property(e => e.CodGruppo).HasMaxLength(50);
|
||||
});
|
||||
|
||||
//
|
||||
modelBuilder.Seed();
|
||||
|
||||
|
||||
@@ -31,6 +31,38 @@ namespace MP.AppAuth.Controllers
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Record x Gruppi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<Models.AnagraficaGruppi> AnagGruppiFilt(string codTipo)
|
||||
{
|
||||
List<Models.AnagraficaGruppi> dbResult = new List<Models.AnagraficaGruppi>();
|
||||
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetAnagraficaGruppi
|
||||
.Where(x => x.TipoGruppo == codTipo)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
/// <summary>
|
||||
/// Elenco Record x Gruppi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<Models.AnagraficaGruppi> AnagGruppiGetAll()
|
||||
{
|
||||
List<Models.AnagraficaGruppi> dbResult = new List<Models.AnagraficaGruppi>();
|
||||
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetAnagraficaGruppi
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public List<Models.AnagraficaOperatori> AnagOpGetAll(string searchVal)
|
||||
{
|
||||
List<Models.AnagraficaOperatori> dbResult = new List<Models.AnagraficaOperatori>();
|
||||
@@ -53,6 +85,41 @@ namespace MP.AppAuth.Controllers
|
||||
// ritorno
|
||||
return dbResult;
|
||||
}
|
||||
public List<Models.AnagraficaOperatori> AnagOpByGruppoGetFilt(string codGruppo, string searchVal)
|
||||
{
|
||||
List<Models.AnagraficaOperatori> dbResult = new List<Models.AnagraficaOperatori>();
|
||||
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(searchVal))
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetGruppi2Oper
|
||||
.Where(x => x.CodGruppo == codGruppo || string.IsNullOrEmpty(codGruppo))
|
||||
.Join(
|
||||
localDbCtx.DbSetAnagOpr.Where(x => x.Cognome.Contains(searchVal) || x.Nome.Contains(searchVal)),
|
||||
gruppo => gruppo.MatrOpr,
|
||||
operatore => operatore.MatrOpr,
|
||||
(gruppo, operatore) => operatore
|
||||
)
|
||||
.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetGruppi2Oper
|
||||
.Where(x => x.CodGruppo == codGruppo || string.IsNullOrEmpty(codGruppo))
|
||||
.Join(
|
||||
localDbCtx.DbSetAnagOpr,
|
||||
gruppo => gruppo.MatrOpr,
|
||||
operatore => operatore.MatrOpr,
|
||||
(gruppo, operatore) => operatore
|
||||
)
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
// ritorno
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
@@ -2,22 +2,17 @@
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.AppAuth.Controllers
|
||||
{
|
||||
public class MPController : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
#region Public Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
public static AppAuth.Controllers.MPController dbController;
|
||||
|
||||
#endregion Private Fields
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
@@ -31,12 +26,6 @@ namespace MP.AppAuth.Controllers
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database controller
|
||||
dbController.Dispose();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Record x AnagKeyValue
|
||||
@@ -54,7 +43,19 @@ namespace MP.AppAuth.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database controller
|
||||
dbController.Dispose();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -9,18 +9,18 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.10">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.9">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.10">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.9">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NLog" Version="4.7.11" />
|
||||
<PackageReference Include="NLog" Version="5.0.4" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace MP.AppAuth.Models
|
||||
{
|
||||
public partial class AnagraficaGruppi
|
||||
{
|
||||
public string CodGruppo { get; set; }
|
||||
public string TipoGruppo { get; set; }
|
||||
public string DescrGruppo { get; set; }
|
||||
public bool SelEnabled { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace MP.AppAuth.Models
|
||||
{
|
||||
public partial class Gruppi2Operatori
|
||||
{
|
||||
public int MatrOpr { get; set; }
|
||||
public string CodGruppo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ namespace MP.AppAuth
|
||||
public virtual DbSet<ListValue> ListValues { get; set; }
|
||||
public virtual DbSet<Macchine> Macchines { get; set; }
|
||||
public virtual DbSet<UpdMan> UpdMan { get; set; }
|
||||
public virtual DbSet<Vocabolario> Vocabolario { get; set; }
|
||||
public virtual DbSet<Vocabolario> DbSetVocabolario { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
@@ -503,6 +503,8 @@ namespace MP.AppAuth
|
||||
.HasMaxLength(500);
|
||||
});
|
||||
|
||||
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MP.Data.Conf
|
||||
{
|
||||
/// <summary>
|
||||
/// Struttura conf del file conf TAG x IOB
|
||||
/// </summary>
|
||||
public class IobTags
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto dizionario di configurazione x IOB
|
||||
/// </summary>
|
||||
public Dictionary<string, List<TagData>> IobSetup = new Dictionary<string, List<TagData>>();
|
||||
|
||||
#endregion Public Fields
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
namespace MP.Data.Conf
|
||||
{
|
||||
/// <summary>
|
||||
/// Item da mostrare nei blocchi MON degli impianti come override ai dati MSE
|
||||
/// </summary>
|
||||
public class TagData
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Indice della colonna (ordine) del dato
|
||||
/// </summary>
|
||||
public int ColNum { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Indice della riga del dato
|
||||
/// </summary>
|
||||
public int RowNum { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Override CSS (es fontSmall)
|
||||
/// </summary>
|
||||
public string TagCss { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Indicazione della chiave REDIS dove recuperare il tag indicato (già in formato string)
|
||||
/// </summary>
|
||||
public string TagLocation { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Etichetta da mostrare
|
||||
/// </summary>
|
||||
public string TagName { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Clone dell'oggetto
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public TagData Clone()
|
||||
{
|
||||
return (TagData)this.MemberwiseClone();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace MP.Data
|
||||
{
|
||||
public class Constants
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
public static readonly string ACT_BLINK_KEY = $"{BASE_HASH}:Current:Blink";
|
||||
|
||||
public static readonly string ACT_MSE_DATA_KEY = $"{BASE_HASH}:Current:MSE";
|
||||
|
||||
// dati conf REDIS Cache
|
||||
public static readonly string BASE_HASH = "MAPO";
|
||||
|
||||
// REDIS KEY Dati correnti
|
||||
public static readonly string CONF_MON_KEY = $"{BASE_HASH}:Conf:MonDispData";
|
||||
|
||||
#endregion Public Fields
|
||||
}
|
||||
}
|
||||
@@ -10,14 +10,6 @@ namespace MP.Data.Controllers
|
||||
{
|
||||
public class MpMonController : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public MpMonController(IConfiguration configuration)
|
||||
@@ -36,13 +28,14 @@ namespace MP.Data.Controllers
|
||||
/// <param name="numRecord"></param>
|
||||
/// <param name="searchVal"></param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.AnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
|
||||
public List<DatabaseModels.StatsAnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
|
||||
{
|
||||
List<DatabaseModels.AnagArticoli> dbResult = new List<DatabaseModels.AnagArticoli>();
|
||||
List<DatabaseModels.StatsAnagArticoli> dbResult = new List<DatabaseModels.StatsAnagArticoli>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetArticoli
|
||||
.DbSetStatArticoli
|
||||
.AsNoTracking()
|
||||
.Where(x => x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
|
||||
.OrderBy(x => x.CodArticolo)
|
||||
.Take(numRecord)
|
||||
@@ -51,6 +44,24 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco da tabella Macchine
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.ConfigModel> ConfigGetAll()
|
||||
{
|
||||
List<DatabaseModels.ConfigModel> dbResult = new List<DatabaseModels.ConfigModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetConfig
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.Chiave)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
@@ -66,29 +77,13 @@ namespace MP.Data.Controllers
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetMacchine
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.IdxMacchina)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco da tabella Macchine
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.ConfigModel> ConfigGetAll()
|
||||
{
|
||||
List<DatabaseModels.ConfigModel> dbResult = new List<DatabaseModels.ConfigModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetConfig
|
||||
.OrderBy(x => x.Chiave)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco da tabella MappaStatoExpl
|
||||
/// </summary>
|
||||
@@ -103,6 +98,7 @@ namespace MP.Data.Controllers
|
||||
dbResult = dbCtx
|
||||
.DbSetMSE
|
||||
.FromSqlRaw("EXEC stp_MSE_getData @maxAgeSec", maxAgeSec)
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
@@ -134,5 +130,13 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,967 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.Data.DatabaseModels;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Data.Controllers
|
||||
{
|
||||
public class MpSpecController : IDisposable
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public MpSpecController(IConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
Log.Info("Avviata classe MpSpecController");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Gruppi tipo Azienda
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AnagGruppi> AnagGruppiAziende()
|
||||
{
|
||||
return AnagGruppiGetTipo("AZIENDA");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Gruppi tipo Fasi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AnagGruppi> AnagGruppiFase()
|
||||
{
|
||||
return AnagGruppiGetTipo("FASE");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Gruppi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AnagGruppi> AnagGruppiGetAll()
|
||||
{
|
||||
List<AnagGruppi> dbResult = new List<AnagGruppi>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetAnagGruppi
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.CodGruppo)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gruppi x tipo
|
||||
/// </summary>
|
||||
/// <param name="tipoGruppo"></param>
|
||||
/// <returns></returns>
|
||||
public List<AnagGruppi> AnagGruppiGetTipo(string tipoGruppo)
|
||||
{
|
||||
List<AnagGruppi> dbResult = new List<AnagGruppi>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetAnagGruppi
|
||||
.Where(x => x.TipoGruppo == tipoGruppo)
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.CodGruppo)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco valori ammessi x Stati commessa (es Yacht Baglietto)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<ListValues> AnagStatiComm()
|
||||
{
|
||||
return ListValuesFilt("PODL", "StatoComm");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco valori ammessi x Tipo articoli
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<ListValues> AnagTipoArtLV()
|
||||
{
|
||||
return ListValuesFilt("AnagArticoli", "Tipo");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco codice articoli che abbiano dati Dossier
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<string> ArticleWithDossier()
|
||||
{
|
||||
List<string> dbResult = new List<string>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetDossiers
|
||||
.AsNoTracking()
|
||||
.Select(i => i.OdlNav.CodArticolo)
|
||||
.Distinct()
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazione Record
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> ArticoliDeleteRecord(AnagArticoli currRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currVal = dbCtx
|
||||
.DbSetArticoli
|
||||
.Where(x => x.CodArticolo == currRec.CodArticolo)
|
||||
.FirstOrDefault();
|
||||
dbCtx
|
||||
.DbSetArticoli
|
||||
.Remove(currVal);
|
||||
await dbCtx.SaveChangesAsync();
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante ArticoliDeleteRecord{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco tabella Articoli da filtro
|
||||
/// </summary>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <param name="searchVal"></param>
|
||||
/// <returns></returns>
|
||||
public List<AnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
|
||||
{
|
||||
List<AnagArticoli> dbResult = new List<AnagArticoli>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetArticoli
|
||||
.AsNoTracking()
|
||||
.Where(x => x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
|
||||
.OrderBy(x => x.CodArticolo)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco tabella Articoli da filtro
|
||||
/// </summary>
|
||||
/// <param name="numRecord"></param>
|
||||
/// <param name="azienda"></param>
|
||||
/// <param name="searchVal"></param>
|
||||
/// <returns></returns>
|
||||
public List<AnagArticoli> ArticoliGetSearch(int numRecord, string azienda = "*", string searchVal = "")
|
||||
{
|
||||
List<AnagArticoli> dbResult = new List<AnagArticoli>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetArticoli
|
||||
.AsNoTracking()
|
||||
.Where(x => (x.Azienda == azienda || azienda == "*") && (x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal) || string.IsNullOrEmpty(searchVal)))
|
||||
.OrderBy(x => x.CodArticolo)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco tabella Articoli IMPIEGATI (da stored stp_ART_getUsed)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AnagArticoli> ArticoliGetUsed()
|
||||
{
|
||||
List<AnagArticoli> dbResult = new List<AnagArticoli>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetArticoli
|
||||
.FromSqlRaw("EXEC stp_ART_getUsed")
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update Record
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> ArticoliUpdateRecord(AnagArticoli editRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currRec = dbCtx
|
||||
.DbSetArticoli
|
||||
.Where(x => x.CodArticolo == editRec.CodArticolo)
|
||||
.FirstOrDefault();
|
||||
if (currRec != null)
|
||||
{
|
||||
currRec.Disegno = editRec.Disegno;
|
||||
currRec.DescArticolo = editRec.DescArticolo;
|
||||
currRec.Tipo = editRec.Tipo;
|
||||
currRec.Azienda = editRec.Azienda;
|
||||
dbCtx.Entry(currRec).State = EntityState.Modified;
|
||||
}
|
||||
else
|
||||
{
|
||||
dbCtx
|
||||
.DbSetArticoli
|
||||
.Add(editRec);
|
||||
}
|
||||
await dbCtx.SaveChangesAsync();
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante ArticoliUpdateRecord{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco da tabella Config
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<ConfigModel> ConfigGetAll()
|
||||
{
|
||||
List<ConfigModel> dbResult = new List<ConfigModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetConfig
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.Chiave)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update record config
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool ConfigUpdate(ConfigModel updRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
ConfigModel dbResult = new ConfigModel();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetConfig
|
||||
.Where(x => x.Chiave == updRec.Chiave)
|
||||
.FirstOrDefault();
|
||||
if (dbResult != null)
|
||||
{
|
||||
dbResult.Valore = updRec.Valore;
|
||||
dbCtx.SaveChanges();
|
||||
fatto = true;
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazione di un dossier
|
||||
/// </summary>
|
||||
/// <param name="currRec">record dossier da eliminare</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DossiersDeleteRecord(Dossiers currRec)
|
||||
{
|
||||
bool answ = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currVal = dbCtx
|
||||
.DbSetDossiers
|
||||
.Where(x => x.IdxDossier == currRec.IdxDossier)
|
||||
.FirstOrDefault();
|
||||
dbCtx
|
||||
.DbSetDossiers
|
||||
.Remove(currVal);
|
||||
await dbCtx.SaveChangesAsync();
|
||||
answ = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante DossiersDeleteRecord{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ultimi n record DOssiers (che contengono ad esempio "salvataggi" di FLuxLog) dato
|
||||
/// macchina (ordinato x data registrazione)
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
|
||||
/// <param name="CodArticolo">* = tutti, altrimenti solo x un dato articolo</param>
|
||||
/// <param name="DtRef">Data di riferimento (Massima) per estrazioen records</param>
|
||||
/// <param name="MaxRec">numero massimo record da restituire</param>
|
||||
/// <returns></returns>
|
||||
public List<Dossiers> DossiersGetLastFilt(string IdxMacchina, string CodArticolo, DateTime DtRef, int MaxRec)
|
||||
{
|
||||
List<Dossiers> dbResult = new List<Dossiers>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetDossiers
|
||||
.AsNoTracking()
|
||||
.Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && (CodArticolo == "*" || x.OdlNav.CodArticolo == CodArticolo) && x.DtRif <= DtRef)
|
||||
.Include(m => m.MachineNav)
|
||||
.Include(o => o.OdlNav)
|
||||
.Include(a => a.OdlNav.ArticoloNav)
|
||||
.OrderByDescending(x => x.DtRif)
|
||||
.Take(MaxRec)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina">macchina</param>
|
||||
/// <param name="maxSec">Num massimo secondi per recuperare dati correnti</param>
|
||||
/// <param name="dtRif">DataOra riferimento x cui prendere valori antecedenti</param>
|
||||
public bool DossiersTakeParamsSnapshot(string idxMacchina, int maxSec, DateTime dtRif)
|
||||
{
|
||||
bool answ = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
var pIdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
var pMaxSec = new SqlParameter("@MaxSec", maxSec);
|
||||
var pDtRif = new SqlParameter("@DtRif", dtRif);
|
||||
|
||||
var dbResult = dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRaw("EXEC stp_FL_TakeSnapshot @IdxMacchina,@MaxSec,@DtRif", pIdxMacchina, pMaxSec, pDtRif);
|
||||
answ = true;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina">macchina</param>
|
||||
/// <param name="dtMin">Data min x selezione</param>
|
||||
/// <param name="dtMax">Data MAX x selezione</param>
|
||||
public bool DossiersTakeParamsSnapshotLast(string idxMacchina, DateTime dtMin, DateTime dtMax)
|
||||
{
|
||||
bool answ = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
var pIdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
var pDtMin = new SqlParameter("@DtMin", dtMin);
|
||||
var pDtMax = new SqlParameter("@DtMax", dtMax);
|
||||
|
||||
var dbResult = dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRaw("EXEC stp_FL_TakeSnapshotLast @IdxMacchina,@DtMin,@DtMax", pIdxMacchina, pDtMin, pDtMax);
|
||||
answ = true;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update ddel campo VALORE di un dossier (che contiene json flux log serializzati)
|
||||
/// </summary>
|
||||
/// <param name="editRec">record dossier da modificare</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DossiersUpdateValore(Dossiers editRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currRec = dbCtx
|
||||
.DbSetDossiers
|
||||
.Where(x => x.IdxDossier == editRec.IdxDossier)
|
||||
.FirstOrDefault();
|
||||
if (currRec != null)
|
||||
{
|
||||
currRec.Valore = editRec.Valore;
|
||||
dbCtx.Entry(currRec).State = EntityState.Modified;
|
||||
}
|
||||
else
|
||||
{
|
||||
dbCtx
|
||||
.DbSetDossiers
|
||||
.Add(editRec);
|
||||
}
|
||||
await dbCtx.SaveChangesAsync();
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante DossiersUpdateRecord{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco valori link (x home e navMenu laterale)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<LinkMenu> ElencoLink()
|
||||
{
|
||||
return ListLinkFilt("SpecLink");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiunta record EventList
|
||||
/// </summary>
|
||||
/// <param name="newRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> EvListInsert(EventListModel newRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currRec = dbCtx
|
||||
.DbSetEvList
|
||||
.Add(newRec);
|
||||
await dbCtx.SaveChangesAsync();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante EvListInsert{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
await Task.Delay(1);
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ultimi n record flux log dato macchina e flusso (ordinato x data registrazione)
|
||||
/// </summary>
|
||||
/// <param name="DtMax">Data massima (recupera eventi antecedenti)</param>
|
||||
/// <param name="IdxMacchina">* = tutte, altrimenti solo x una data macchina</param>
|
||||
/// <param name="CodFlux">*=tutti, altrimenti solo selezionato</param>
|
||||
/// <param name="MaxRec">numero massimo record da restituire</param>
|
||||
/// <returns></returns>
|
||||
public List<FluxLog> FluxLogGetLastFilt(DateTime DtMax, string IdxMacchina, string CodFlux, int MaxRec)
|
||||
{
|
||||
List<FluxLog> dbResult = new List<FluxLog>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetFluxLog
|
||||
.AsNoTracking()
|
||||
.Where(x => (x.dtEvento <= DtMax) && (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina) && (CodFlux == "*" || x.CodFlux == CodFlux))
|
||||
.OrderByDescending(x => x.dtEvento)
|
||||
.Take(MaxRec)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public List<LinkMenu> ListLinkFilt(string tipoLink)
|
||||
{
|
||||
List<LinkMenu> dbResult = new List<LinkMenu>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetLinkMenu
|
||||
.Where(x => x.TipoLink == tipoLink)
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.ordine)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ODL filtrati x stato, articolo, KeyRich (che contiene stato)
|
||||
/// </summary>
|
||||
/// <param name="inCorso">Stato ODL: true=in corso/completato</param>
|
||||
/// <param name="codArt">Cod articolo</param>
|
||||
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
|
||||
/// <param name="startDate">Data inizio</param>
|
||||
/// <param name="endDate">Data fine</param>
|
||||
/// <returns></returns>
|
||||
public List<ODLModel> ListODLFilt(bool inCorso, string codArt, string keyRichPart, string IdxMacchina, DateTime startDate, DateTime endDate)
|
||||
{
|
||||
List<ODLModel> dbResult = new List<ODLModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetODL
|
||||
.Where(x => ((inCorso && x.DataFine == null) || ((!inCorso && x.DataFine != null) && x.DataInizio >= startDate && x.DataInizio <= endDate)) && (x.KeyRichiesta.Contains(keyRichPart) || keyRichPart == "*") && (x.IdxMacchina.Contains(IdxMacchina) || IdxMacchina == "*") && (codArt == "*" || x.CodArticolo.Contains(codArt)))
|
||||
.AsNoTracking()
|
||||
.Include(m => m.MachineNav)
|
||||
.Include(a => a.ArticoloNav)
|
||||
.OrderByDescending(x => x.IdxOdl)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco PODL non avviati filtrati x articolo, KeyRich (che contiene stato)
|
||||
/// </summary>
|
||||
/// <param name="codArt">Cod articolo</param>
|
||||
/// <param name="keyRichPart">KeyRich (parziale) da cercare (es cod stato x yacht)</param>
|
||||
/// <returns></returns>
|
||||
public List<PODLModel> ListPODLFilt(string codArt, string keyRichPart)
|
||||
{
|
||||
List<PODLModel> dbResult = new List<PODLModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetPODL
|
||||
.Where(x => (x.IdxOdl == 0) && (x.KeyRichiesta.Contains(keyRichPart) || keyRichPart == "*") && (codArt == "*" || x.CodArticolo.Contains(codArt)))
|
||||
.AsNoTracking()
|
||||
.Include(m => m.MachineNav)
|
||||
.Include(a => a.ArticoloNav)
|
||||
.OrderBy(x => x.InsertDate)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco valori ammessi x tabella/colonna
|
||||
/// </summary>
|
||||
/// <param name="tabName"></param>
|
||||
/// <param name="fieldName"></param>
|
||||
/// <returns></returns>
|
||||
public List<ListValues> ListValuesFilt(string tabName, string fieldName)
|
||||
{
|
||||
List<ListValues> dbResult = new List<ListValues>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetListValues
|
||||
.Where(x => x.TableName == tabName && x.FieldName == fieldName)
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.ordinal)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco da tabella Macchine
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<Macchine> MacchineGetAll()
|
||||
{
|
||||
List<Macchine> dbResult = new List<Macchine>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetMacchine
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.IdxMacchina)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco id Macchine che abbiano dati FLuxLog
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<string>> MacchineWithFlux()
|
||||
{
|
||||
List<string> dbResult = new List<string>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = await dbCtx
|
||||
.DbSetFluxLog
|
||||
.AsNoTracking()
|
||||
.Select(i => i.IdxMacchina)
|
||||
.Distinct()
|
||||
.ToListAsync();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco da tabella MappaStatoExpl
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<MappaStatoExpl> MseGetAll(int maxAge = 2000)
|
||||
{
|
||||
List<MappaStatoExpl> dbResult = new List<MappaStatoExpl>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
var maxAgeSec = new SqlParameter("@maxAgeSec", maxAge);
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetMSE
|
||||
.FromSqlRaw("EXEC stp_MSE_getData @maxAgeSec", maxAgeSec)
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiusura ODL con eventuale conferma pezzi
|
||||
/// </summary>
|
||||
/// <param name="idxOdl">idx odl da chiudere</param>
|
||||
/// <param name="idxMacchina">idx macchina</param>
|
||||
/// <param name="matrOpr">matricola operatore</param>
|
||||
/// <param name="confPezzi">indica se confermare i pezzi prima di chiudere ODL</param>
|
||||
/// <param name="confRett">Conferma con rettifica (ev 121) x pezzi lasciati in macchina</param>
|
||||
/// <param name="modoConfProd">Modo conferma produzione (0=periodo, 1=giorno, 2=turno)</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> ODLClose(int idxOdl, string idxMacchina, int matrOpr, bool confPezzi, bool confRett, int modoConfProd)
|
||||
{
|
||||
bool fatto = false;
|
||||
if (idxOdl > 0)
|
||||
{
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
DateTime adesso = DateTime.Now;
|
||||
// preparo i parametri
|
||||
var IdxODL = new SqlParameter("@IdxODL", idxOdl);
|
||||
var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
|
||||
// FARE FIXME TODO !!! da valutare casi setup/autoconferma...
|
||||
#if false
|
||||
// controllo se HO pezzi da confermare...
|
||||
var statoProd = StatoProdMacchina(idxMacchina);
|
||||
if (statoProd.pezziNonConfermati < 1)
|
||||
{ }
|
||||
#endif
|
||||
|
||||
// se richiesto confermo produzione
|
||||
if (confPezzi)
|
||||
{
|
||||
var MatrApp = new SqlParameter("@MatrApp", idxMacchina);
|
||||
|
||||
/* ----------------------------------
|
||||
* CONFERMA PEZZI
|
||||
*
|
||||
* condizioni da verificare:
|
||||
* - gestione rettifica (ev121) / pezzi da LASCIARE in macchina
|
||||
* - conferma a zero pezzi (setup) oppure con i pezzi fatti e non ancora confermati
|
||||
*
|
||||
*
|
||||
*
|
||||
* */
|
||||
|
||||
// recupero i dati dei pezzi da confermare... con DbSetPzProd + exec
|
||||
// stp_PzProd_getByMacchina 'SIMUL_01'
|
||||
|
||||
// stp_ConfermaProduzCompletaFull
|
||||
/*
|
||||
* @idxMacchina NVARCHAR(50),
|
||||
@MatrApp INT,
|
||||
@dataFrom DATETIME,
|
||||
@dataTo DATETIME,
|
||||
@pezziConf INT,
|
||||
@pezziLasciati INT, -- pezzi lasciati = evento 121 (-) pre conferma e (+) dopo --> da lasciare in macchina post conferma
|
||||
@pezziScar INT = 0, -- pezzi scartati (registrati da 2016.11.20) DA INDICARE COME VALORE > 0!!! sennò faccio ABS...
|
||||
@TipoConf INT = 0, -- Tipo intervallo conferma: 0 = periodo intero, 1 = per giorni, 2 = per turni
|
||||
@DataOraApp DATETIME = NULL, -- di norma GETDATE() nel programma - serve per ricalcolo
|
||||
@TestConferma BIT = 1 -- TestConferma : 1 = verifica conf. duplicata e inserisci in ElencoConfermeProd, 0 = nessuna verifica e inserimento ( per ricalcolo )
|
||||
*/
|
||||
}
|
||||
|
||||
// ora chiudo ODL
|
||||
try
|
||||
{
|
||||
var dbResult = await dbCtx
|
||||
.DbSetStatOdl
|
||||
.FromSqlRaw("EXEC stp_ODL_fineProd @IdxODL, @IdxMacchina", IdxODL, IdxMacchina)
|
||||
.AsNoTracking()
|
||||
.ToListAsync();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante ODLClose{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupero odl data chiave
|
||||
/// </summary>
|
||||
/// <param name="idxOdl"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public ODLModel OdlGetByKey(int idxOdl)
|
||||
{
|
||||
ODLModel dbResult = new ODLModel();
|
||||
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetODL
|
||||
.FirstOrDefault(x => x.IdxOdl == idxOdl);
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco parametri validi x una data macchina
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
public List<string> ParametriGetFilt(string IdxMacchina)
|
||||
{
|
||||
List<string> dbResult = new List<string>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetFluxLog
|
||||
.AsNoTracking()
|
||||
.Where(x => (IdxMacchina == "*" || x.IdxMacchina == IdxMacchina))
|
||||
.Select(i => i.CodFlux)
|
||||
.Distinct()
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Avvio setup ODL da PODL
|
||||
/// </summary>
|
||||
/// <param name="editRec"></param>
|
||||
/// <param name="matrOpr"></param>
|
||||
/// <param name="tcRich"></param>
|
||||
/// <param name="pzPallet"></param>
|
||||
/// <param name="note"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ODLModel> PODL_startSetup(PODLModel editRec, int matrOpr, double tcRich, int pzPallet, string note)
|
||||
{
|
||||
ODLModel dbResult = new ODLModel();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currRec = dbCtx
|
||||
.DbSetPODL
|
||||
.Where(x => x.IdxPromessa == editRec.IdxPromessa)
|
||||
.FirstOrDefault();
|
||||
if (currRec != null)
|
||||
{
|
||||
// eseguo stored attrezzaggio
|
||||
var IdxPromessa = new SqlParameter("@idxPromessa", editRec.IdxPromessa);
|
||||
var MatrOpr = new SqlParameter("@MatrOpr", matrOpr);
|
||||
var IdxMacchina = new SqlParameter("@IdxMacchina", editRec.IdxMacchina);
|
||||
var TCRichAttr = new SqlParameter("@TCRichAttr", tcRich);
|
||||
var PzPallet = new SqlParameter("@PzPallet", pzPallet);
|
||||
var Note = new SqlParameter("@Note", note);
|
||||
var callResult = await dbCtx
|
||||
.Database
|
||||
.ExecuteSqlRawAsync("EXEC stp_ODL_inizioSetupPromessa @idxPromessa, @MatrOpr, @IdxMacchina @TCRichAttr, @PzPallet, @Note", IdxPromessa, MatrOpr, IdxMacchina, TCRichAttr, PzPallet, Note);
|
||||
|
||||
// recupero info su ODL corrente
|
||||
dbResult = await dbCtx
|
||||
.DbSetODL
|
||||
.Where(x => x.IdxMacchina == editRec.IdxMacchina && x.DataInizio != null && x.DataFine == null)
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante PODL_doSetup{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
await Task.Delay(1);
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazione Record
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> PODLDeleteRecord(PODLModel currRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currVal = dbCtx
|
||||
.DbSetPODL
|
||||
.Where(x => x.IdxPromessa == currRec.IdxPromessa)
|
||||
.FirstOrDefault();
|
||||
dbCtx
|
||||
.DbSetPODL
|
||||
.Remove(currVal);
|
||||
await dbCtx.SaveChangesAsync();
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante PODLDeleteRecord{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update Record
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> PODLUpdateRecord(PODLModel editRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currRec = dbCtx
|
||||
.DbSetPODL
|
||||
.Where(x => x.IdxPromessa == editRec.IdxPromessa)
|
||||
.FirstOrDefault();
|
||||
if (currRec != null)
|
||||
{
|
||||
currRec.CodGruppo = editRec.CodGruppo;
|
||||
currRec.CodArticolo = editRec.CodArticolo;
|
||||
currRec.IdxMacchina = editRec.IdxMacchina;
|
||||
currRec.KeyBCode = editRec.KeyBCode;
|
||||
currRec.KeyRichiesta = editRec.KeyRichiesta;
|
||||
currRec.NumPezzi = editRec.NumPezzi;
|
||||
currRec.Tcassegnato = editRec.Tcassegnato;
|
||||
currRec.Note = editRec.Note;
|
||||
dbCtx.Entry(currRec).State = EntityState.Modified;
|
||||
}
|
||||
else
|
||||
{
|
||||
dbCtx
|
||||
.DbSetPODL
|
||||
.Add(editRec);
|
||||
}
|
||||
await dbCtx.SaveChangesAsync();
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante PODLUpdateRecord{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Annulla modifiche su una specifica entity (cancel update)
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
/// <returns></returns>
|
||||
public bool RollBackEntity(object item)
|
||||
{
|
||||
bool answ = false;
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
if (dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Deleted || dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Modified)
|
||||
{
|
||||
dbCtx.Entry(item).Reload();
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione in rollBackEntity{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Statistiche ODL calcolate (da stored stp_STAT_ODL)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<StatODLModel>> StatOdl(int IdxOdl)
|
||||
{
|
||||
List<StatODLModel> dbResult = new List<StatODLModel>();
|
||||
if (IdxOdl > 0)
|
||||
{
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
var IdxODL = new SqlParameter("@IdxODL", IdxOdl);
|
||||
|
||||
dbResult = await dbCtx
|
||||
.DbSetStatOdl
|
||||
.FromSqlRaw("EXEC stp_STAT_ODL @IdxODL", IdxODL)
|
||||
.AsNoTracking()
|
||||
.ToListAsync();
|
||||
}
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stato prod macchina
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
public StatoProdModel StatoProdMacchina(string idxMacchina)
|
||||
{
|
||||
StatoProdModel dbResult = new StatoProdModel();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacchina);
|
||||
dbResult = dbCtx
|
||||
.DbSetStatoProd
|
||||
.FromSqlRaw("EXEC stp_PzProd_getByMacchina @IdxMacchina", IdxMacchina)
|
||||
.AsNoTracking()
|
||||
.FirstOrDefault();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -10,14 +10,6 @@ namespace MP.Data.Controllers
|
||||
{
|
||||
public class MpStatsController : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public MpStatsController(IConfiguration configuration)
|
||||
@@ -52,9 +44,9 @@ namespace MP.Data.Controllers
|
||||
/// <param name="numRecord"></param>
|
||||
/// <param name="searchVal"></param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.AnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
|
||||
public List<DatabaseModels.StatsAnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
|
||||
{
|
||||
List<DatabaseModels.AnagArticoli> dbResult = new List<DatabaseModels.AnagArticoli>();
|
||||
List<DatabaseModels.StatsAnagArticoli> dbResult = new List<DatabaseModels.StatsAnagArticoli>();
|
||||
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
@@ -73,9 +65,9 @@ namespace MP.Data.Controllers
|
||||
/// <param name="numRecord"></param>
|
||||
/// <param name="searchVal"></param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.ODL> CommesseGetSearch(int numRecord, string searchVal = "")
|
||||
public List<DatabaseModels.StatsODL> CommesseGetSearch(int numRecord, string searchVal = "")
|
||||
{
|
||||
List<DatabaseModels.ODL> dbResult = new List<DatabaseModels.ODL>();
|
||||
List<DatabaseModels.StatsODL> dbResult = new List<DatabaseModels.StatsODL>();
|
||||
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
@@ -223,9 +215,9 @@ namespace MP.Data.Controllers
|
||||
/// <param name="numRecord"></param>
|
||||
/// <param name="searchVal"></param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.ODL> StatOdlGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
|
||||
public List<DatabaseModels.StatsODL> StatOdlGetAll(DateTime DataStart, DateTime DataEnd, string IdxMacchina, int IdxODL, string KeyRichiesta, string CodArticolo)
|
||||
{
|
||||
List<DatabaseModels.ODL> dbResult = new List<DatabaseModels.ODL>();
|
||||
List<DatabaseModels.StatsODL> dbResult = new List<DatabaseModels.StatsODL>();
|
||||
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||
{
|
||||
var dataFrom = new SqlParameter("@dataFrom", DataStart);
|
||||
@@ -326,5 +318,13 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using MP.Data.DatabaseModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DTO
|
||||
{
|
||||
public class DossierFluxLogDTO
|
||||
{
|
||||
/// <summary>
|
||||
/// Elenco valori FluxLogDTO serializzato (compreso valori edit)
|
||||
/// </summary>
|
||||
public List<FluxLogDTO> ODL { get; set; } = new List<FluxLogDTO>();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Data.DTO
|
||||
{
|
||||
public class FluxLogDTO
|
||||
{
|
||||
public string IdxMacchina { get; set; }
|
||||
|
||||
public DateTime dtEvento { get; set; }
|
||||
|
||||
public string CodFlux { get; set; }
|
||||
|
||||
public string Valore { get; set; }
|
||||
|
||||
public string ValoreEdit { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("AnagArticoli")]
|
||||
public partial class AnagArticoli
|
||||
{
|
||||
#region Public Properties
|
||||
@@ -13,6 +17,7 @@ namespace MP.Data.DatabaseModels
|
||||
public string DescArticolo { get; set; }
|
||||
public string Disegno { get; set; }
|
||||
public string Tipo { get; set; }
|
||||
public string Azienda { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("AnagraficaGruppi")]
|
||||
public partial class AnagGruppi
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
//[Key, DatabaseGenerated(DatabaseGeneratedOption.None), MaxLength(50)]
|
||||
public string CodGruppo { get; set; }
|
||||
|
||||
//[MaxLength(50)]
|
||||
public string TipoGruppo { get; set; }
|
||||
|
||||
//[MaxLength(250)]
|
||||
public string DescrGruppo { get; set; }
|
||||
|
||||
public bool SelEnabled { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,9 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class AzioniUL
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("Config")]
|
||||
|
||||
@@ -4,6 +4,9 @@ using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("Dossiers")]
|
||||
public partial class Dossiers
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int IdxDossier { get; set; }
|
||||
|
||||
[MaxLength(50)]
|
||||
public string DataType { get; set; }
|
||||
|
||||
public DateTime DtRif { get; set; }
|
||||
|
||||
[MaxLength(50)]
|
||||
public string IdxMacchina { get; set; } = "";
|
||||
[MaxLength(50)]
|
||||
public string CodArticolo { get; set; } = "";
|
||||
|
||||
public int IdxODL { get; set; } = 0;
|
||||
|
||||
public string Valore { get; set; } = "";
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Navigazione oggetto Machine
|
||||
/// </summary>
|
||||
[ForeignKey("IdxMacchina")]
|
||||
public virtual Macchine MachineNav { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Navigazione oggetto ODL
|
||||
/// </summary>
|
||||
[ForeignKey("IdxODL")]
|
||||
public virtual ODLModel OdlNav { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("EventList")]
|
||||
public partial class EventListModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[MaxLength(50)]
|
||||
public string IdxMacchina { get; set; } = "NA";
|
||||
public DateTime? InizioStato { get; set; } = DateTime.Now;
|
||||
public int IdxTipo { get; set; } = 0;
|
||||
|
||||
[MaxLength(50)]
|
||||
public string CodArticolo { get; set; } = "";
|
||||
|
||||
[MaxLength(250)]
|
||||
public string Value { get; set; } = "";
|
||||
|
||||
public int MatrOpr { get; set; } = 0;
|
||||
|
||||
[MaxLength(20)]
|
||||
public string pallet { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Navigazione oggetto Machine
|
||||
/// </summary>
|
||||
[ForeignKey("IdxMacchina")]
|
||||
public virtual Macchine MachineNav { get; set; } = null!;
|
||||
/// <summary>
|
||||
/// Navigazione oggetto Articolo
|
||||
/// </summary>
|
||||
[ForeignKey("CodArticolo")]
|
||||
public virtual AnagArticoli ArticoloNav { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("FluxLog")]
|
||||
public partial class FluxLog
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[MaxLength(50)]
|
||||
public string IdxMacchina { get; set; }
|
||||
|
||||
public DateTime dtEvento { get; set; }
|
||||
|
||||
[MaxLength(50)]
|
||||
public string CodFlux { get; set; }
|
||||
|
||||
[MaxLength(250)]
|
||||
public string Valore { get; set; }
|
||||
|
||||
public int Cnt { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("LinkMenuJQM")]
|
||||
public partial class LinkMenu
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int idxLink { get; set; }
|
||||
|
||||
[MaxLength(50)]
|
||||
public string TipoLink { get; set; } = "";
|
||||
|
||||
public int ordine { get; set; } = 0;
|
||||
|
||||
[MaxLength(50)]
|
||||
public string Testo { get; set; } = "";
|
||||
|
||||
[MaxLength(50)]
|
||||
public string NavigateUrl { get; set; } = "";
|
||||
|
||||
[MaxLength(50)]
|
||||
public string icona { get; set; } = "";
|
||||
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("ListValues")]
|
||||
public partial class ListValues
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[MaxLength(50)]
|
||||
public string TableName { get; set; }
|
||||
|
||||
[MaxLength(50)]
|
||||
public string FieldName { get; set; }
|
||||
|
||||
[MaxLength(50)]
|
||||
public string value { get; set; }
|
||||
|
||||
[MaxLength(50)]
|
||||
public string label { get; set; }
|
||||
|
||||
public int ordinal { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class Macchine
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class MappaStatoExpl
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("ODL")]
|
||||
public partial class ODLModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int IdxOdl { get; set; }
|
||||
[MaxLength(50)]
|
||||
public string CodArticolo { get; set; } = "";
|
||||
[MaxLength(50)]
|
||||
public string IdxMacchina { get; set; }
|
||||
public int NumPezzi { get; set; }
|
||||
public decimal Tcassegnato { get; set; }
|
||||
public DateTime? DataInizio { get; set; }
|
||||
public DateTime? DataFine { get; set; }
|
||||
[MaxLength(2500)]
|
||||
public string Note { get; set; } = "";
|
||||
[MaxLength(50)]
|
||||
public string KeyRichiesta { get; set; }
|
||||
public int PzPallet { get; set; } = 1;
|
||||
[MaxLength(50)]
|
||||
public string CodCli { get; set; } = "";
|
||||
|
||||
[NotMapped]
|
||||
public string DurataMinuti
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
DateTime end = DataFine != null ? (DateTime)DataFine : DateTime.Now;
|
||||
var tsDurata = (end).Subtract((DateTime)DataInizio);
|
||||
if (tsDurata.TotalDays < 1)
|
||||
{
|
||||
answ = $"{tsDurata.Hours:00}h {tsDurata.Minutes:00}'";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = $"{tsDurata.Days}gg {tsDurata.Hours:00}h";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Navigazione oggetto Machine
|
||||
/// </summary>
|
||||
[ForeignKey("IdxMacchina")]
|
||||
public virtual Macchine MachineNav { get; set; } = null!;
|
||||
/// <summary>
|
||||
/// Navigazione oggetto Articolo
|
||||
/// </summary>
|
||||
[ForeignKey("CodArticolo")]
|
||||
public virtual AnagArticoli ArticoloNav { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
[Table("PromesseODL")]
|
||||
public partial class PODLModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int IdxPromessa { get; set; }
|
||||
[MaxLength(50)]
|
||||
public string KeyRichiesta { get; set; }
|
||||
[MaxLength(50)]
|
||||
public string KeyBCode { get; set; }
|
||||
public bool Attivabile { get; set; } = false;
|
||||
public int IdxOdl { get; set; } = 0;
|
||||
[MaxLength(50)]
|
||||
public string CodArticolo { get; set; } = "";
|
||||
[MaxLength(50)]
|
||||
public string CodGruppo { get; set; } = "";
|
||||
[MaxLength(50)]
|
||||
public string IdxMacchina { get; set; }
|
||||
public int NumPezzi { get; set; } = 1;
|
||||
public decimal Tcassegnato { get; set; } = 1;
|
||||
public DateTime? DueDate { get; set; }
|
||||
public int Priorita { get; set; } = 1;
|
||||
public int PzPallet { get; set; } = 1;
|
||||
[MaxLength(2500)]
|
||||
public string Note { get; set; } = "";
|
||||
[MaxLength(50)]
|
||||
public string CodCli { get; set; } = "";
|
||||
public DateTime InsertDate { get; set; } = DateTime.Now;
|
||||
|
||||
[NotMapped]
|
||||
public string CodFase
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "*";
|
||||
var allData = KeyRichiesta.Split('_');
|
||||
if (allData.Length > 0)
|
||||
{
|
||||
answ = allData[0];
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Navigazione oggetto Machine
|
||||
/// </summary>
|
||||
[ForeignKey("IdxMacchina")]
|
||||
public virtual Macchine MachineNav { get; set; } = null!;
|
||||
/// <summary>
|
||||
/// Navigazione oggetto Articolo
|
||||
/// </summary>
|
||||
[ForeignKey("CodArticolo")]
|
||||
public virtual AnagArticoli ArticoloNav { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class ResControlli
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class ResScarti
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class StatODLModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Key]
|
||||
public int IdxStato { get; set; }
|
||||
public string Descrizione { get; set; } = "";
|
||||
public string Semaforo { get; set; }
|
||||
public string Css { get; set; }
|
||||
public double TotDurata { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class StatoProdModel
|
||||
{
|
||||
[Key]
|
||||
public string idxMacchina { get; set; } = "NA";
|
||||
public int pezziNonConfermati { get; set; } = 0;
|
||||
public DateTime DataFrom { get; set; } = DateTime.Now;
|
||||
public DateTime DataTo { get; set; } = DateTime.Now;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class StatsAnagArticoli
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string CodArticolo { get; set; }
|
||||
public string DescArticolo { get; set; }
|
||||
public string Disegno { get; set; }
|
||||
public string Tipo { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class ODL
|
||||
public partial class StatsODL
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
@@ -3,8 +3,11 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class TurniOee
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#nullable disable
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data.DatabaseModels
|
||||
{
|
||||
public partial class UserActionLog
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
@@ -12,14 +12,14 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.4">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.9">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.4" />
|
||||
<PackageReference Include="NLog" Version="4.7.15" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.9" />
|
||||
<PackageReference Include="NLog" Version="5.0.4" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,131 @@
|
||||
using NLog;
|
||||
using StackExchange.Redis;
|
||||
using System;
|
||||
|
||||
namespace MP.Data
|
||||
{
|
||||
public class MessagePipe
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public MessagePipe(IConnectionMultiplexer redisConn, string channelName, bool enableLog = false)
|
||||
{
|
||||
_channel = channelName;
|
||||
redis = redisConn;
|
||||
redisDb = redis.GetDatabase();
|
||||
this.enableLog = enableLog;
|
||||
// aggiungo sottoscrittore
|
||||
setupSubscriber();
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Events
|
||||
|
||||
public event EventHandler EA_NewMessage = delegate { };
|
||||
|
||||
#endregion Public Events
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public bool saveAndSendMessage(string memKey, string message)
|
||||
{
|
||||
bool answ = false;
|
||||
// invio notifica tramite il canale richiesto
|
||||
answ = sendMessage(message);
|
||||
if (redisDb != null)
|
||||
{
|
||||
redisDb.StringSetAsync(memKey, message);
|
||||
if (enableLog)
|
||||
{
|
||||
Log.Info($"Redis Cache Key: {memKey}");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invio messaggio sul canale
|
||||
/// </summary>
|
||||
/// <param name="newMess"></param>
|
||||
/// <returns></returns>
|
||||
public bool sendMessage(string newMess)
|
||||
{
|
||||
bool answ = false;
|
||||
ISubscriber sub = redis.GetSubscriber();
|
||||
sub.Publish(_channel, newMess);
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private bool enableLog = false;
|
||||
private IConnectionMultiplexer redis;
|
||||
private IDatabase? redisDb;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Canale associato al gestore pipeline messaggi
|
||||
/// </summary>
|
||||
private string _channel { get; set; } = "";
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void setupSubscriber()
|
||||
{
|
||||
ISubscriber sub = redis.GetSubscriber();
|
||||
//Subscribe to the channel named messages
|
||||
sub.Subscribe(_channel, (channel, message) =>
|
||||
{
|
||||
Log.Trace($"ch {channel} | {message}");
|
||||
// messaggio
|
||||
PubSubEventArgs mea = new PubSubEventArgs(message);
|
||||
// se qualcuno ascolta sollevo evento nuovo valore...
|
||||
if (EA_NewMessage != null)
|
||||
{
|
||||
EA_NewMessage(this, mea);
|
||||
}
|
||||
});
|
||||
Log.Info($"Subscribed {_channel}");
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Invio messaggio sul canale + salvataggio in cache REDIS
|
||||
/// </summary>
|
||||
/// <param name="memKey">Chiave REDIS x salvare valore</param>
|
||||
/// <param name="message"></param>
|
||||
}
|
||||
|
||||
public class PubSubEventArgs : EventArgs
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public PubSubEventArgs(string messaggio)
|
||||
{
|
||||
this.newMessage = messaggio;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public string newMessage { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,9 @@ using MP.Data.DatabaseModels;
|
||||
using NLog;
|
||||
|
||||
#nullable disable
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data
|
||||
{
|
||||
public partial class MoonProContext : DbContext
|
||||
@@ -34,10 +36,21 @@ namespace MP.Data
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public virtual DbSet<StatsAnagArticoli> DbSetStatArticoli { get; set; }
|
||||
public virtual DbSet<AnagArticoli> DbSetArticoli { get; set; }
|
||||
public virtual DbSet<Macchine> DbSetMacchine { get; set; }
|
||||
public virtual DbSet<MappaStatoExpl> DbSetMSE { get; set; }
|
||||
public virtual DbSet<ConfigModel> DbSetConfig { get; set; }
|
||||
public virtual DbSet<AnagGruppi> DbSetAnagGruppi { get; set; }
|
||||
public virtual DbSet<ListValues> DbSetListValues { get; set; }
|
||||
public virtual DbSet<LinkMenu> DbSetLinkMenu { get; set; }
|
||||
public virtual DbSet<ODLModel> DbSetODL { get; set; }
|
||||
public virtual DbSet<PODLModel> DbSetPODL { get; set; }
|
||||
public virtual DbSet<FluxLog> DbSetFluxLog { get; set; }
|
||||
public virtual DbSet<Dossiers> DbSetDossiers { get; set; }
|
||||
public virtual DbSet<StatODLModel> DbSetStatOdl { get; set; }
|
||||
public virtual DbSet<StatoProdModel> DbSetStatoProd { get; set; }
|
||||
public virtual DbSet<EventListModel> DbSetEvList { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
@@ -53,7 +66,15 @@ namespace MP.Data
|
||||
{
|
||||
if (!optionsBuilder.IsConfigured)
|
||||
{
|
||||
string connString = _configuration.GetConnectionString("Mp.Mon");
|
||||
string connString = _configuration.GetConnectionString("Mp.Data");
|
||||
if (string.IsNullOrEmpty(connString))
|
||||
{
|
||||
connString = _configuration.GetConnectionString("Mp.Mon");
|
||||
}
|
||||
if (string.IsNullOrEmpty(connString))
|
||||
{
|
||||
connString = _configuration.GetConnectionString("Mp.STATS");
|
||||
}
|
||||
|
||||
optionsBuilder.UseSqlServer(connString);
|
||||
//optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;");
|
||||
@@ -64,9 +85,9 @@ namespace MP.Data
|
||||
{
|
||||
modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS");
|
||||
|
||||
modelBuilder.Entity<AnagArticoli>(entity =>
|
||||
modelBuilder.Entity<StatsAnagArticoli>(entity =>
|
||||
{
|
||||
entity.HasNoKey();
|
||||
entity.HasKey(e => e.CodArticolo);
|
||||
|
||||
entity.ToView("v_UI_AnagArticoli");
|
||||
|
||||
@@ -86,10 +107,36 @@ namespace MP.Data
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
});
|
||||
modelBuilder.Entity<AnagArticoli>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.CodArticolo);
|
||||
|
||||
entity.ToView("AnagArticoli");
|
||||
|
||||
entity.Property(e => e.CodArticolo)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
entity.Property(e => e.DescArticolo)
|
||||
.IsRequired()
|
||||
.HasMaxLength(250);
|
||||
|
||||
entity.Property(e => e.Disegno)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
entity.Property(e => e.Tipo)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
|
||||
entity.Property(e => e.Azienda)
|
||||
.IsRequired()
|
||||
.HasMaxLength(50);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Macchine>(entity =>
|
||||
{
|
||||
entity.HasNoKey();
|
||||
entity.HasKey(e => e.IdxMacchina);
|
||||
|
||||
entity.ToView("Macchine");
|
||||
|
||||
@@ -223,6 +270,42 @@ namespace MP.Data
|
||||
.HasColumnName("valoreStd")
|
||||
.HasComment("Valore di default/riferimento per la variabile");
|
||||
});
|
||||
modelBuilder.Entity<AnagGruppi>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.CodGruppo);
|
||||
|
||||
entity.Property(e => e.CodGruppo)
|
||||
.HasMaxLength(50)
|
||||
.HasColumnName("CodGruppo");
|
||||
|
||||
entity.Property(e => e.TipoGruppo)
|
||||
.HasMaxLength(50)
|
||||
.HasColumnName("TipoGruppo");
|
||||
|
||||
entity.Property(e => e.DescrGruppo)
|
||||
.HasMaxLength(250)
|
||||
.HasColumnName("DescrGruppo");
|
||||
|
||||
entity.Property(e => e.SelEnabled)
|
||||
.HasColumnName("SelEnabled");
|
||||
|
||||
});
|
||||
modelBuilder.Entity<ListValues>(entity =>
|
||||
{
|
||||
entity.HasKey(e => new { e.TableName, e.FieldName, e.value });
|
||||
|
||||
});
|
||||
modelBuilder.Entity<FluxLog>(entity =>
|
||||
{
|
||||
entity.HasKey(e => new { e.IdxMacchina, e.dtEvento, e.CodFlux });
|
||||
|
||||
});
|
||||
|
||||
modelBuilder.Entity<EventListModel>(entity =>
|
||||
{
|
||||
entity.HasKey(e => new { e.IdxMacchina, e.InizioStato, e.IdxTipo});
|
||||
|
||||
});
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@ using MP.Data.DatabaseModels;
|
||||
using NLog;
|
||||
|
||||
#nullable disable
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.Data
|
||||
{
|
||||
public partial class MoonPro_STATSContext : DbContext
|
||||
@@ -34,12 +36,12 @@ namespace MP.Data
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public virtual DbSet<AnagArticoli> DbSetArticoli { get; set; }
|
||||
public virtual DbSet<StatsAnagArticoli> DbSetArticoli { get; set; }
|
||||
public virtual DbSet<AzioniUL> DbSetAzioniUL { get; set; }
|
||||
public virtual DbSet<ResControlli> DbSetControlli { get; set; }
|
||||
public virtual DbSet<DdbTurni> DbSetDdbTurni { get; set; }
|
||||
public virtual DbSet<Macchine> DbSetMacchine { get; set; }
|
||||
public virtual DbSet<ODL> DbSetODL { get; set; }
|
||||
public virtual DbSet<StatsODL> DbSetODL { get; set; }
|
||||
public virtual DbSet<ResScarti> DbSetScarti { get; set; }
|
||||
public virtual DbSet<TurniOee> DbSetTurniOee { get; set; }
|
||||
public virtual DbSet<UserActionLog> DbSetUserLog { get; set; }
|
||||
@@ -98,7 +100,7 @@ namespace MP.Data
|
||||
.HasMaxLength(5);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<AnagArticoli>(entity =>
|
||||
modelBuilder.Entity<StatsAnagArticoli>(entity =>
|
||||
{
|
||||
entity.HasNoKey();
|
||||
|
||||
@@ -325,7 +327,7 @@ namespace MP.Data
|
||||
.HasMaxLength(250);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<ODL>(entity =>
|
||||
modelBuilder.Entity<StatsODL>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdxOdl)
|
||||
.HasName("PK_ODL_1");
|
||||
|
||||
+69
-3
@@ -3,13 +3,26 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Data
|
||||
{
|
||||
public class Utils
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public static string redKeyArtUsed
|
||||
{
|
||||
get => RedHash($"CACHE:CheckArtUsed");
|
||||
}
|
||||
|
||||
public static string redKeyTabCheckArt
|
||||
{
|
||||
get => RedHash($"CACHE:TabCheckArt");
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public static string ConvMinToTime(double minutes)
|
||||
@@ -28,17 +41,70 @@ namespace MP.Data
|
||||
return answ;
|
||||
}
|
||||
|
||||
public static async Task SaveToCsv<T>(List<T> reportData, string path)
|
||||
/// <summary>
|
||||
/// Nome della variabile HASH da utilizzare (dato CodModulo / Server / DB impiegato da
|
||||
/// funzionalita' DbConfig) + keyName richiesto...
|
||||
/// </summary>
|
||||
public static string RedHash(string keyName)
|
||||
{
|
||||
string answ = keyName;
|
||||
try
|
||||
{
|
||||
answ = $"MP:Data:{keyName}";
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua salvataggio in file di un generico oggetto in formato CSV
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="reportData"></param>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="separator">Separatore da impiegare</param>
|
||||
/// <returns></returns>
|
||||
public static async Task SaveToCsv<T>(List<T> reportData, string path, char separator)
|
||||
{
|
||||
var lines = new List<string>();
|
||||
IEnumerable<PropertyDescriptor> props = TypeDescriptor.GetProperties(typeof(T)).OfType<PropertyDescriptor>();
|
||||
var header = string.Join(";", props.ToList().Select(x => x.Name));
|
||||
lines.Add(header);
|
||||
var valueLines = reportData.Select(row => string.Join(";", header.Split(';').Select(a => row.GetType().GetProperty(a).GetValue(row, null))));
|
||||
var valueLines = reportData.Select(row => string.Join(separator, header.Split(separator).Select(a => row.GetType().GetProperty(a).GetValue(row, null))));
|
||||
//var valueLines = reportData.Select(row => string.Join(";", header.Split(';').Select(a => row.GetType().GetProperty(a).GetValue(row, null))));
|
||||
lines.AddRange(valueLines);
|
||||
await Task.Run(() => File.WriteAllLines(path, lines.ToArray()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inizializzazione con periodo e arrotondamento
|
||||
/// </summary>
|
||||
/// <param name="minRound"></param>
|
||||
/// <returns></returns>
|
||||
public static DateTime InitDatetime(DateTime dtRif, int minRound)
|
||||
{
|
||||
TimeSpan DayElapsed = dtRif.Subtract(dtRif.Date);
|
||||
int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound;
|
||||
DateTime endRounded = DateTime.Today.AddMinutes(minDay);
|
||||
return endRounded;
|
||||
}
|
||||
|
||||
public static string FormDurata(double durataMinuti)
|
||||
{
|
||||
string answ = "";
|
||||
TimeSpan tsDurata = TimeSpan.FromMinutes(durataMinuti);
|
||||
if (tsDurata.TotalDays < 1)
|
||||
{
|
||||
answ = $"{tsDurata.Hours:00}h {tsDurata.Minutes:00}'";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = $"{tsDurata.Days}gg {tsDurata.Hours:00}h";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
Gruppi
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
<select @bind="@groupName" class="form-control form-control-sm">
|
||||
<option value="">--- Tutti ---</option>
|
||||
@if (ListGroups != null)
|
||||
{
|
||||
@foreach (var item in ListGroups)
|
||||
{
|
||||
<option value="@item.CodGruppo">@item.DescrGruppo</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Net.Http;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.Web.Virtualization;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Land;
|
||||
using MP.Land.Shared;
|
||||
using MP.AppAuth.Models;
|
||||
using MP.Land.Data;
|
||||
|
||||
namespace MP.Land.Components
|
||||
{
|
||||
public partial class CmpGroupFilt
|
||||
{
|
||||
|
||||
[Inject]
|
||||
protected MessageService AppMService { get; set; }
|
||||
|
||||
[Inject]
|
||||
protected AppAuthService DataService { get; set; }
|
||||
|
||||
private List<AnagraficaGruppi> ListGroups;
|
||||
private string groupName
|
||||
{
|
||||
get
|
||||
{
|
||||
return AppMService.CodGruppo;
|
||||
}
|
||||
set
|
||||
{
|
||||
AppMService.CodGruppo = value;
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
// carico i gruppi
|
||||
ListGroups = await DataService.AnagGruppiFilt("REPARTO");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,9 +42,9 @@
|
||||
{
|
||||
<div class="input-group input-group-sm">
|
||||
<select @bind="@PageSize" class="form-control form-control-sm">
|
||||
<option value="2">2</option>
|
||||
<option value="4">4</option>
|
||||
<option value="10">10</option>
|
||||
<option value="3">3</option>
|
||||
<option value="6">6</option>
|
||||
<option value="9">9</option>
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace MP.Land.Components
|
||||
|
||||
protected int _numPage { get; set; } = 1;
|
||||
|
||||
protected int _numRecord { get; set; } = 4;
|
||||
protected int _numRecord { get; set; } = 6;
|
||||
|
||||
protected int percLoading { get; set; } = 0;
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ else // disegno box non cliccabile e licenza mancante
|
||||
|
||||
protected string fullUrl(string relUrl)
|
||||
{
|
||||
return $"{Configuration["BaseUrl"]}{relUrl}";
|
||||
return $"{Configuration["ServerConf:BaseUrl"]}{relUrl}";
|
||||
}
|
||||
|
||||
protected MarkupString traduci(string lemma)
|
||||
|
||||
@@ -81,12 +81,12 @@ namespace MP.Land.Components
|
||||
|
||||
protected string fullUrl(string relUrl)
|
||||
{
|
||||
return $"{Configuration["BaseUrl"]}{relUrl}";
|
||||
return $"{Configuration["ServerConf:BaseUrl"]}{relUrl}";
|
||||
}
|
||||
|
||||
protected string localPath(string localRepo)
|
||||
{
|
||||
return @$"{Configuration["downloadPath"]}\{localRepo}\{Configuration["appVers"]}"; ;
|
||||
return @$"{Configuration["ServerConf:downloadPath"]}\{localRepo}\{Configuration["appVers"]}"; ;
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (!firstRender)
|
||||
if (firstRender)
|
||||
{
|
||||
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{CurrItem.MatrOpr}");
|
||||
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{CurrItem.MatrOpr}", rawCode);
|
||||
|
||||
@@ -129,6 +129,46 @@ namespace MP.Land.Data
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public async Task<List<AppAuth.Models.AnagraficaGruppi>> AnagGruppiAll()
|
||||
{
|
||||
List<AppAuth.Models.AnagraficaGruppi> dbResult = new List<AppAuth.Models.AnagraficaGruppi>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = dbController.AnagGruppiGetAll();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagGruppiAll: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
public async Task<List<AppAuth.Models.AnagraficaGruppi>> AnagGruppiFilt(string codTipo)
|
||||
{
|
||||
List<AppAuth.Models.AnagraficaGruppi> dbResult = new List<AppAuth.Models.AnagraficaGruppi>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
dbResult = dbController.AnagGruppiFilt(codTipo);
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagGruppiFilt: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
public async Task<List<AppAuth.Models.AnagraficaOperatori>> AnagOperByGroupList(string codGruppo, string searchVal)
|
||||
{
|
||||
List<AppAuth.Models.AnagraficaOperatori> dbResult = new List<AppAuth.Models.AnagraficaOperatori>();
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
var rawData = dbController
|
||||
.AnagOpByGruppoGetFilt(codGruppo, searchVal);
|
||||
dbResult = rawData
|
||||
.GroupBy(user => user.MatrOpr)
|
||||
.Select(grp => grp.First())
|
||||
.ToList();
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Effettuata lettura da DB per AnagOperByGroupList: {ts.TotalMilliseconds} ms");
|
||||
return await Task.FromResult(dbResult);
|
||||
}
|
||||
|
||||
public async Task<List<AppAuth.Models.AnagraficaOperatori>> AnagOperList(string searchVal)
|
||||
{
|
||||
List<AppAuth.Models.AnagraficaOperatori> dbResult = new List<AppAuth.Models.AnagraficaOperatori>();
|
||||
|
||||
@@ -106,6 +106,21 @@ namespace MP.Land.Data
|
||||
}
|
||||
}
|
||||
|
||||
protected string _groupName { get; set; } = "";
|
||||
public string CodGruppo
|
||||
{
|
||||
get => _groupName;
|
||||
set
|
||||
{
|
||||
if (_groupName != value)
|
||||
{
|
||||
_groupName = value;
|
||||
ReportFilter();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace MP.Land.Data
|
||||
public bool OnlyMod { get; set; } = false;
|
||||
public bool OnlyNoTag { get; set; } = false;
|
||||
public int PageNum { get; set; } = 1;
|
||||
public int PageSize { get; set; } = 4;
|
||||
public int PageSize { get; set; } = 6;
|
||||
public string SearchVal { get; set; } = "";
|
||||
public string Tag { get; set; } = "";
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>MP.Land</RootNamespace>
|
||||
<Version>6.15.2204.2612</Version>
|
||||
<Version>6.16.2209.2118</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -45,14 +45,14 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DiffMatchPatch" Version="1.0.3" />
|
||||
<PackageReference Include="Majorsoft.Blazor.Components.Debounce" Version="1.5.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.10">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.9">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.9" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" Version="4.14.0" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" Version="5.1.4" />
|
||||
<PackageReference Include="RestSharp" Version="107.1.2" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<b>@Applicazione</b>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="d-flex justify-content-between @licenseCss">
|
||||
<div class="px-2">
|
||||
<i class="fa fa-users" aria-hidden="true"></i> Licenze:
|
||||
</div>
|
||||
@@ -80,7 +80,7 @@
|
||||
<b>@($"{Scadenza:yyyy/MM/dd}")</b>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="d-flex justify-content-between @licenseCss">
|
||||
<div class="px-2">
|
||||
<i class="fa fa-key" aria-hidden="true"></i> Key
|
||||
</div>
|
||||
|
||||
@@ -14,24 +14,27 @@ using Microsoft.JSInterop;
|
||||
using MP.Land;
|
||||
using MP.Land.Shared;
|
||||
using MP.Land.Data;
|
||||
using NLog;
|
||||
|
||||
namespace MP.Land.Pages
|
||||
{
|
||||
public partial class About
|
||||
{
|
||||
protected string Titolo = "";
|
||||
protected string Messaggio = "";
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private string Titolo = "";
|
||||
private string Messaggio = "";
|
||||
|
||||
protected string ServerStatus = "SrvState";
|
||||
protected string Installazione = "Inst";
|
||||
protected string Applicazione = "App";
|
||||
protected string Licenze = "#";
|
||||
protected DateTime Scadenza = DateTime.Today;
|
||||
protected string MastKey = "########################";
|
||||
private string ServerStatus = "SrvState";
|
||||
private string Installazione = "Inst";
|
||||
private string Applicazione = "App";
|
||||
private string Licenze = "#";
|
||||
private DateTime Scadenza = DateTime.Today;
|
||||
private string MastKey = "########################";
|
||||
|
||||
protected string mainCss = "alert alert-info";
|
||||
protected string remSrvCss = "bg-danger text-warning";
|
||||
protected string expDateCss = "bg-danger text-warning";
|
||||
private string mainCss = "alert alert-info";
|
||||
private string remSrvCss = "bg-warning text-secondary";
|
||||
private string expDateCss = "bg-warning text-secondary";
|
||||
private string licenseCss = "bg-warning text-secondary";
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
@@ -45,24 +48,33 @@ namespace MP.Land.Pages
|
||||
int cDelay = 5;
|
||||
// recupero dati
|
||||
await Task.Delay(cDelay);
|
||||
LicServ.InitAkv();
|
||||
Installazione = LicServ.Installazione;
|
||||
Applicazione = LicServ.Applicazione;
|
||||
MastKey = LicServ.MasterKey;
|
||||
await Task.Delay(cDelay);
|
||||
var fatto = await LicServ.RefreshLicense();
|
||||
await Task.Delay(cDelay);
|
||||
Licenze = $"{LicServ.NumLicDb}/{LicServ.NumLicRemote}";
|
||||
// verifico stati
|
||||
ServerStatus = await LicServ.checkLimanServer();
|
||||
try
|
||||
{
|
||||
LicServ.InitAkv();
|
||||
// verifico stati
|
||||
ServerStatus = await LicServ.checkLimanServer();
|
||||
Installazione = LicServ.Installazione;
|
||||
Applicazione = LicServ.Applicazione;
|
||||
MastKey = LicServ.MasterKey;
|
||||
await Task.Delay(cDelay);
|
||||
var fatto = await LicServ.RefreshLicense();
|
||||
await Task.Delay(cDelay);
|
||||
Licenze = $"{LicServ.NumLicDb}/{LicServ.NumLicRemote}";
|
||||
licenseCss = "";
|
||||
}
|
||||
catch(Exception exc)
|
||||
{
|
||||
licenseCss = "bg-dark text-warning";
|
||||
Log.Error($"Eccezione in reloadLicenseData:{Environment.NewLine}{exc}");
|
||||
}
|
||||
bool okRemoteSrv = ServerStatus == "OK";
|
||||
bool okScadenza = LicServ.checkLicenseActive(LicServ.MasterKey);
|
||||
bool okNumLic = (LicServ.NumLicDb <= LicServ.NumLicRemote);
|
||||
|
||||
// aggiornamento css secondo status colore da check
|
||||
mainCss = okNumLic ? "alert alert-success shadowBox" : "alert alert-warning shadowBox";
|
||||
expDateCss = okScadenza ? "d-flex justify-content-between" : "d-flex justify-content-between bg-danger text-warning";
|
||||
remSrvCss = okRemoteSrv ? "d-flex justify-content-between" : "d-flex justify-content-between bg-danger text-warning";
|
||||
expDateCss = okScadenza ? "" : "bg-danger text-warning";
|
||||
remSrvCss = okRemoteSrv ? "" : "bg-danger text-warning";
|
||||
await Task.Delay(cDelay);
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace MP.Land.Pages
|
||||
|
||||
protected string localPath(string localRepo)
|
||||
{
|
||||
return @$"{Configuration["downloadPath"]}\{localRepo}\{Configuration["appVers"]}"; ;
|
||||
return @$"{Configuration["ServerConf:downloadPath"]}\{localRepo}\{Configuration["appVers"]}"; ;
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<CmpGroupFilt></CmpGroupFilt>
|
||||
@if (ListRecords == null)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
@@ -15,6 +16,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<div class="row">
|
||||
@foreach (var item in ListRecords)
|
||||
{
|
||||
|
||||
+102
-75
@@ -11,12 +11,14 @@ namespace MP.Land.Pages
|
||||
{
|
||||
public partial class UserQr : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
#region Public Methods
|
||||
|
||||
private List<AnagraficaOperatori> ListRecords;
|
||||
private List<AnagraficaOperatori> SearchRecords;
|
||||
public void Dispose()
|
||||
{
|
||||
AppMService.EA_SearchUpdated -= OnSeachUpdated;
|
||||
}
|
||||
|
||||
#endregion Private Fields
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
@@ -25,6 +27,74 @@ namespace MP.Land.Pages
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected MessageService AppMService { get; set; }
|
||||
|
||||
protected string BaseUrlTab
|
||||
{
|
||||
get => $"{Configuration["ServerConf:BaseUrl"]}{Configuration["QrJumpPath"]}";
|
||||
}
|
||||
|
||||
[Inject]
|
||||
protected AppAuthService DataService { get; set; }
|
||||
|
||||
protected string Environment
|
||||
{
|
||||
get => Configuration["Environment"];
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
AppMService.ShowSearch = true;
|
||||
AppMService.PageName = "User Card";
|
||||
AppMService.PageIcon = "fas fa-qrcode pr-2";
|
||||
await ReloadData();
|
||||
AppMService.EA_SearchUpdated += OnSeachUpdated;
|
||||
AppMService.EA_FilterUpdated += OnFilterUpdated;
|
||||
}
|
||||
|
||||
protected async Task PagerReloadNum(int newNum)
|
||||
{
|
||||
ListRecords = null;
|
||||
numRecord = newNum;
|
||||
await ReloadData();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
protected async Task PagerReloadPage(int newNum)
|
||||
{
|
||||
ListRecords = null;
|
||||
currPage = newNum;
|
||||
await ReloadData();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
protected MarkupString traduci(string lemma)
|
||||
{
|
||||
MarkupString answ;
|
||||
//string rawHtml = "<li>primo</li><li>secondo</li>";
|
||||
string rawHtml = DataService.Traduci(lemma, "IT");
|
||||
answ = new MarkupString(rawHtml);
|
||||
// cerco nella cache Redis
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private List<AnagraficaOperatori> ListRecords;
|
||||
|
||||
private List<AnagraficaOperatori> SearchRecords;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
[Inject]
|
||||
@@ -42,6 +112,14 @@ namespace MP.Land.Pages
|
||||
}
|
||||
}
|
||||
|
||||
private string groupName
|
||||
{
|
||||
get
|
||||
{
|
||||
return AppMService.CodGruppo;
|
||||
}
|
||||
}
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
|
||||
private int numRecord
|
||||
@@ -58,28 +136,16 @@ namespace MP.Land.Pages
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected MessageService AppMService { get; set; }
|
||||
|
||||
protected string BaseUrlTab
|
||||
{
|
||||
get => $"{Configuration["BaseUrl"]}{Configuration["QrJumpPath"]}";
|
||||
}
|
||||
|
||||
[Inject]
|
||||
protected AppAuthService DataService { get; set; }
|
||||
|
||||
protected string Environment
|
||||
{
|
||||
get => Configuration["Environment"];
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async void OnFilterUpdated()
|
||||
{
|
||||
ListRecords = null;
|
||||
currPage = 1;
|
||||
await Task.Delay(1);
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
private async void OnSeachUpdated()
|
||||
{
|
||||
ListRecords = null;
|
||||
@@ -88,41 +154,21 @@ namespace MP.Land.Pages
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
AppMService.ShowSearch = true;
|
||||
AppMService.PageName = "User Card";
|
||||
AppMService.PageIcon = "fas fa-qrcode pr-2";
|
||||
await ReloadData();
|
||||
AppMService.EA_SearchUpdated += OnSeachUpdated;
|
||||
}
|
||||
|
||||
protected async Task PagerReloadNum(int newNum)
|
||||
{
|
||||
ListRecords = null;
|
||||
numRecord = newNum;
|
||||
await ReloadData();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
protected async Task PagerReloadPage(int newNum)
|
||||
{
|
||||
ListRecords = null;
|
||||
currPage = newNum;
|
||||
await ReloadData();
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
protected async Task ReloadData()
|
||||
private async Task ReloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
// importante altrimenti NON mostra update UI
|
||||
await Task.Delay(1);
|
||||
SearchRecords = await DataService.AnagOperList(AppMService.SearchVal);
|
||||
// se ho selezionato qualcosa cerco x gruppo
|
||||
//if (groupName != "")
|
||||
//{
|
||||
SearchRecords = await DataService.AnagOperByGroupList(groupName, AppMService.SearchVal);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// //altrimenti TUTTI
|
||||
// SearchRecords = await DataService.AnagOperList(AppMService.SearchVal);
|
||||
//}
|
||||
ListRecords = SearchRecords.Skip((currPage - 1) * numRecord).Take(numRecord).ToList();
|
||||
totalCount = SearchRecords.Count();
|
||||
await Task.Delay(1);
|
||||
@@ -130,25 +176,6 @@ namespace MP.Land.Pages
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
protected MarkupString traduci(string lemma)
|
||||
{
|
||||
MarkupString answ;
|
||||
//string rawHtml = "<li>primo</li><li>secondo</li>";
|
||||
string rawHtml = DataService.Traduci(lemma, "IT");
|
||||
answ = new MarkupString(rawHtml);
|
||||
// cerco nella cache Redis
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
AppMService.EA_SearchUpdated -= OnSeachUpdated;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
+25
-31
@@ -36,11 +36,30 @@
|
||||
<a class="dismiss">🗙</a>
|
||||
</div>
|
||||
|
||||
@* Riconnessione server app: https://www.syncfusion.com/faq/how-do-i-reconnect-blazor-server-side-automatically *@
|
||||
@*Gestione autoriconnessione: https://github.com/dotnet/aspnetcore/issues/38305 (vedere anche https://docs.microsoft.com/it-it/aspnet/core/blazor/fundamentals/signalr?view=aspnetcore-6.0#modify-the-reconnection-handler-blazor-server)*@
|
||||
<script>
|
||||
Blazor.defaultReconnectionHandler._reconnectCallback = function (d) {
|
||||
document.location.reload();
|
||||
}
|
||||
//Blazor.start().then(() => {
|
||||
// Blazor.defaultReconnectionHandler._reconnectionDisplay = {
|
||||
// show: () => { },
|
||||
// update: (d) => { },
|
||||
// rejected: (d) => document.location.reload()
|
||||
// };
|
||||
//});
|
||||
|
||||
Blazor.start().then(() => {
|
||||
Object.defineProperty(Blazor.defaultReconnectionHandler, '_reconnectionDisplay', {
|
||||
get() {
|
||||
return this.__reconnectionDisplay;
|
||||
},
|
||||
set(value) {
|
||||
this.__reconnectionDisplay = {
|
||||
show: () => value.show(),
|
||||
update: (d) => value.update(d),
|
||||
rejected: (d) => document.location.reload()
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- inside of body section and after the div/app tag -->
|
||||
@@ -50,33 +69,8 @@
|
||||
|
||||
<script src="font-awesome/js/all.min.js"></script>
|
||||
<script src="_framework/blazor.server.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="~/lib/qrcode.js"></script>
|
||||
<script type="text/javascript">
|
||||
function clearContent(elementID) {
|
||||
console.log(elementID);
|
||||
document.getElementById(elementID).innerHTML = "";
|
||||
}
|
||||
// gestione qrcode... da https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-enable-qrcodes?view=aspnetcore-5.0
|
||||
//var qrcode = new QRCode("qrCodeImg");
|
||||
function displayQr(elementName, rawData) {
|
||||
console.log(elementName);
|
||||
try {
|
||||
if (elementName != "" && rawData != "") {
|
||||
qrcode = new QRCode(document.getElementById(elementName),
|
||||
{
|
||||
text: rawData,
|
||||
width: 200,
|
||||
height: 200
|
||||
});
|
||||
//qrcode = new QRCode(document.getElementById(elementName));
|
||||
//qrcode.clear();
|
||||
//qrcode.makeCode(rawData);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="~/lib/qrHelper.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo gestione Programmi MAPO</i>
|
||||
<h4>Versione: 6.15.2204.2612</h4>
|
||||
<h4>Versione: 6.16.2209.2118</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.15.2204.2612
|
||||
6.16.2209.2118
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.15.2204.2612</version>
|
||||
<version>6.16.2209.2118</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
{
|
||||
"DetailedErrors": true,
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"Environment": "Steam PROD",
|
||||
"BaseUrl": "https://iis02.egalware.com/",
|
||||
"AllowedHosts": "*",
|
||||
"QrJumpPath": "MP/TAB/jumper?",
|
||||
"downloadPath": "C:\\Steamware\\installers\\MP",
|
||||
"appVers": "stable",
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;MultipleActiveResultSets=true",
|
||||
"MP.Land": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
|
||||
"Redis": "localhost:6379,defaultDatabase=1,keepAlive=180,asyncTimeout=5000"
|
||||
"DetailedErrors": true,
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"Environment": "Steam PROD",
|
||||
"AllowedHosts": "*",
|
||||
"QrJumpPath": "MP/TAB/jumper?",
|
||||
"appVers": "stable",
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;MultipleActiveResultSets=true",
|
||||
"MP.Land": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
|
||||
"Redis": "localhost:6379,defaultDatabase=1,keepAlive=180,asyncTimeout=5000"
|
||||
},
|
||||
"ServerConf": {
|
||||
"BaseUrl": "https://iis02.egalware.com/",
|
||||
"downloadPath": "C:\\Steamware\\installers\\MP"
|
||||
}
|
||||
}
|
||||
@@ -8,5 +8,8 @@
|
||||
}
|
||||
},
|
||||
"Environment": "Steam DEV",
|
||||
"BaseUrl": "https://iis01.egalware.com/"
|
||||
"ServerConf": {
|
||||
"BaseUrl": "https://iis01.egalware.com/",
|
||||
"downloadPath": "C:\\Steamware\\installers\\MP"
|
||||
}
|
||||
}
|
||||
@@ -7,19 +7,21 @@
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"BaseUrl": "https://localhost:44309/",
|
||||
"QrJumpPath": "MP/TAB/jumper?",
|
||||
"Environment": "Steam DEV",
|
||||
"downloadPath": "C:\\Steamware\\installers\\MP",
|
||||
"appVers": "stable",
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;MultipleActiveResultSets=true",
|
||||
"MP.Land": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
|
||||
"Redis": "localhost:6379,defaultDatabase=1,keepAlive=180,asyncTimeout=5000"
|
||||
},
|
||||
"ServerConf": {
|
||||
"BaseUrl": "https://localhost:44309/",
|
||||
"downloadPath": "C:\\Steamware\\installers\\MP"
|
||||
}
|
||||
//"ConnectionStrings": {
|
||||
// "DefaultConnection": "Server=SQL2016PROD;Database=Valvital_MoonPro_Prod;Trusted_Connection=True;MultipleActiveResultSets=true",
|
||||
// "MP.Land": "Server=SQL2016PROD;Database=Valvital_MoonPro_Prod;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
|
||||
// "DefaultConnection": "Server=SQL2016PROD;Database=Jetco_MoonPro_Prod;Trusted_Connection=True;MultipleActiveResultSets=true",
|
||||
// "MP.Land": "Server=SQL2016PROD;Database=Jetco_MoonPro_Prod;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
|
||||
// "Redis": "localhost:6379,defaultDatabase=11,keepAlive=180,asyncTimeout=5000"
|
||||
//}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
function clearContent(elementID) {
|
||||
//console.log("Remove " + elementID);
|
||||
document.getElementById(elementID).innerHTML = "";
|
||||
}
|
||||
// gestione qrcode... da https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-enable-qrcodes?view=aspnetcore-5.0
|
||||
//var qrcode = new QRCode("qrCodeImg");
|
||||
function displayQr(elementName, rawData) {
|
||||
//console.log("Add " + elementName);
|
||||
try {
|
||||
if (elementName != "" && rawData != "") {
|
||||
qrcode = new QRCode(document.getElementById(elementName),
|
||||
{
|
||||
text: rawData,
|
||||
width: 200,
|
||||
height: 200
|
||||
});
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
@@ -7,41 +7,3 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
Version version = typeof(Program).Assembly.GetName().Version;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
StartTimer();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
aTimer.Stop();
|
||||
aTimer.Dispose();
|
||||
}
|
||||
|
||||
private static System.Timers.Timer aTimer;
|
||||
|
||||
public void StartTimer()
|
||||
{
|
||||
int tOutPeriod = 1000;
|
||||
//int.TryParse(Configuration["ReloadStatusTimer"], out tOutPeriod);
|
||||
aTimer = new System.Timers.Timer(tOutPeriod);
|
||||
aTimer.Elapsed += ElapsedTimer;
|
||||
aTimer.Enabled = true;
|
||||
aTimer.Start();
|
||||
}
|
||||
|
||||
public void ElapsedTimer(Object source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
//await ReloadData();
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using NLog;
|
||||
|
||||
namespace MP.Mon.Components
|
||||
{
|
||||
public partial class CmpFooter
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
//aTimer.Elapsed -= ElapsedTimer;
|
||||
aTimer.Stop();
|
||||
aTimer.Dispose();
|
||||
}
|
||||
|
||||
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
});
|
||||
pUpd.Wait();
|
||||
//Log.Trace($"Elapsed Timer Footer");
|
||||
}
|
||||
|
||||
public void StartTimer()
|
||||
{
|
||||
int tOutPeriod = 5000;
|
||||
//int.TryParse(Configuration["ReloadStatusTimer"], out tOutPeriod);
|
||||
aTimer = new System.Timers.Timer(tOutPeriod);
|
||||
aTimer.Elapsed += ElapsedTimer;
|
||||
aTimer.Enabled = true;
|
||||
aTimer.Start();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
var currAssembly = typeof(Program).Assembly.GetName();
|
||||
version = currAssembly.Version != null ? currAssembly.Version : new Version();
|
||||
StartTimer();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static System.Timers.Timer aTimer = null!;
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private Version version = null!;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
<div class="px-2">
|
||||
<img class="logoImg img-fluid" src="images/LogoMapo.png" width="80" />
|
||||
<span class="mainHead p-3"><b><span style="color: #DEDEDE;">MP MON</span>itor</b></span>
|
||||
<img class="logoImg img-fluid" src="images/LogoMapo.png" height="24" />
|
||||
<span class="mainHead p-3 align-middle"><b><span style="color: #DEDEDE;">MP MON</span>itor</b></span>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<span id="text-white text-right">
|
||||
@($"{DateTime.Now:dddd dd MMMM yyyy}")
|
||||
</span>
|
||||
<img class="logoImg img-fluid" src="images/logoCliente.png" width="32" />
|
||||
<img class="logoImg img-fluid" src="images/logoCliente.png" height="24" />
|
||||
EgalWare
|
||||
</div>
|
||||
|
||||
|
||||
@@ -9,44 +9,107 @@
|
||||
<div class="d-flex mb-1 ui-title justify-content-center align-items-center text-uppercase">
|
||||
@CurrRecord.Nome
|
||||
</div>
|
||||
<div class="d-flex justify-content-between pt-0 pb-2 px-1 fontSmall text-uppercase">
|
||||
<div class="px-1 pe-0">Art</div>
|
||||
<div class="px-1 ps-0 ui-art">
|
||||
@if (showArt == "CodArticolo")
|
||||
@if (hasRow(1))
|
||||
{
|
||||
<div class="d-flex justify-content-between pt-0 pb-0 px-1">
|
||||
@foreach (var item in rowValues(1))
|
||||
{
|
||||
<span>@CurrRecord.CodArticolo</span>
|
||||
<div class="px-1 @item.TagCss">@item.TagName: <b>@currVal(item.TagLocation)</b></div>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (string.IsNullOrEmpty(CurrRecord.Disegno))
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="d-flex justify-content-between pt-0 pb-2 px-1 fontSmall text-uppercase">
|
||||
<div class="px-1 pe-0">Art</div>
|
||||
<div class="px-1 ps-0 ui-art">
|
||||
@if (showArt == "CodArticolo")
|
||||
{
|
||||
<span>[@CurrRecord.CodArticolo]</span>
|
||||
<span>@CurrRecord.CodArticolo</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>@CurrRecord.Disegno</span>
|
||||
if (string.IsNullOrEmpty(CurrRecord.Disegno))
|
||||
{
|
||||
<span>[@CurrRecord.CodArticolo]</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>@CurrRecord.Disegno</span>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (hasRow(2))
|
||||
{
|
||||
<div class="d-flex justify-content-between pt-0 pb-0 px-1">
|
||||
@foreach (var item in rowValues(2))
|
||||
{
|
||||
<div class="px-1 @item.TagCss">@item.TagName: <b>@currVal(item.TagLocation)</b></div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between pt-0 pb-2 px-1 fontSmall">
|
||||
<div class="px-1 text-uppercase"><b>@CurrRecord.DescrizioneStato</b></div>
|
||||
<div class="px-1 ps-0">@getMinSec((decimal)CurrRecord.Durata)</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between pt-0 pb-2 px-1 fontSmall text-uppercase">
|
||||
@*<div class="col-6 pe-0">OEE</div>
|
||||
<div class="col-6 ps-0">xx%</div>*@
|
||||
<div class="px-1 pe-0">TCiclo</div>
|
||||
<div class="px-1 ps-0">std: @getMinSec(@CurrRecord.TCAssegnato)</div>
|
||||
<div class="px-1 ps-0">act: @getMinSec(@CurrRecord.TCLavRT)</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between pt-0 pb-0 px-1 fontSmall1 text-uppercase">
|
||||
@*<div class="px-1 pe-0">Pezzi</div>
|
||||
<div class="px-1 ps-0">prod: @CurrRecord.PezziProd</div>
|
||||
<div class="px-1 ps-0">ord: @CurrRecord.NumPezzi</div>*@
|
||||
<div class="px-1 pe-0">Pezzi<sub>(prod/ord)</sub></div>
|
||||
<div class="px-1 ps-0">@CurrRecord.PezziProd / @CurrRecord.NumPezzi</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="d-flex justify-content-between pt-0 pb-2 px-1 fontSmall">
|
||||
<div class="px-1 text-uppercase"><b>@CurrRecord.DescrizioneStato</b></div>
|
||||
<div class="px-1 ps-0">@getMinSec(getDecimal(@CurrRecord.Durata))</div>
|
||||
</div>
|
||||
}
|
||||
@if (hasRow(3))
|
||||
{
|
||||
<div class="d-flex justify-content-between pt-0 pb-0 px-1">
|
||||
@foreach (var item in rowValues(3))
|
||||
{
|
||||
<div class="px-1 @item.TagCss">@item.TagName: <b>@currVal(item.TagLocation)</b></div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="d-flex justify-content-between pt-0 pb-2 px-1 fontSmall text-uppercase">
|
||||
@*<div class="col-6 pe-0">OEE</div>
|
||||
<div class="col-6 ps-0">xx%</div>*@
|
||||
<div class="px-1 pe-0">TCiclo</div>
|
||||
<div class="px-1 ps-0">std: @getMinSec(@CurrRecord.TCAssegnato)</div>
|
||||
<div class="px-1 ps-0">act: @getMinSec(@CurrRecord.TCLavRT)</div>
|
||||
</div>
|
||||
}
|
||||
@if (hasRow(4))
|
||||
{
|
||||
<div class="d-flex justify-content-between pt-0 pb-0 px-1">
|
||||
@foreach (var item in rowValues(4))
|
||||
{
|
||||
<div class="px-1 @item.TagCss">@item.TagName: <b>@currVal(item.TagLocation)</b></div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="d-flex justify-content-between pt-0 pb-0 px-1 fontSmall1 text-uppercase">
|
||||
<div class="px-1 pe-0">Pezzi<sub>(prod/ord)</sub></div>
|
||||
<div class="px-1 ps-0">@CurrRecord.PezziProd / @CurrRecord.NumPezzi</div>
|
||||
</div>
|
||||
}
|
||||
@if (hasRow(5))
|
||||
{
|
||||
<div class="d-flex justify-content-between pt-0 pb-0 px-1">
|
||||
@foreach (var item in rowValues(5))
|
||||
{
|
||||
<div class="px-1 @item.TagCss">@item.TagName: <b>@currVal(item.TagLocation)</b></div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@if (hasRow(6))
|
||||
{
|
||||
<div class="d-flex justify-content-between pt-0 pb-0 px-1">
|
||||
@foreach (var item in rowValues(6))
|
||||
{
|
||||
<div class="px-1 @item.TagCss">@item.TagName: <b>@currVal(item.TagLocation)</b></div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="@cssComStatus(CurrRecord.Semaforo, CurrRecord.LastUpdate) p-1">
|
||||
<div class="row fontSmaller mt-1">
|
||||
|
||||
@@ -1,64 +1,208 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Net.Http;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.Web.Virtualization;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Mon;
|
||||
using MP.Mon.Shared;
|
||||
using MP.Mon.Components;
|
||||
using MP.Data.Conf;
|
||||
using MP.Data.DatabaseModels;
|
||||
using NLog;
|
||||
|
||||
namespace MP.Mon.Components
|
||||
{
|
||||
public partial class DetailMSE
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
protected string baseCss = "sem";
|
||||
protected bool dataLoaded { get; set; } = false;
|
||||
protected int kaFactor = 60 / 2;
|
||||
[Parameter]
|
||||
public MappaStatoExpl? CurrRecord { get; set; } = null;
|
||||
|
||||
[Parameter]
|
||||
public List<TagData>? currTagConf { get; set; } = null;
|
||||
|
||||
[Parameter]
|
||||
public Dictionary<string, string> currTagVal { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
[Parameter]
|
||||
public bool doAnimate { get; set; } = true;
|
||||
|
||||
[Parameter]
|
||||
public string showArt { get; set; } = "";
|
||||
public bool doBlink { get; set; } = false;
|
||||
|
||||
[Parameter]
|
||||
public int keepAliveMin { get; set; } = 5;
|
||||
[Parameter]
|
||||
public MappaStatoExpl? CurrRecord { get; set; } = null;
|
||||
|
||||
private string cssStatus(string codSemaforo)
|
||||
[Parameter]
|
||||
public string showArt { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// se vuoto --> mostra nero!
|
||||
if (string.IsNullOrEmpty(codSemaforo))
|
||||
aTimer.Elapsed -= ElapsedTimer;
|
||||
aTimer.Stop();
|
||||
aTimer.Dispose();
|
||||
}
|
||||
|
||||
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
codSemaforo = "sNe";
|
||||
}
|
||||
string codColore = codSemaforo.Substring(1, 2);
|
||||
string answ = $"{baseCss}{codColore}";
|
||||
if (doAnimate && codColore != "Ve")
|
||||
{
|
||||
// blink se secondo pari...
|
||||
DateTime adesso = DateTime.Now;
|
||||
int resto = 0;
|
||||
Math.DivRem(adesso.Second, 2, out resto);
|
||||
if (resto == 0)
|
||||
await Task.Delay(1);
|
||||
// verifica variazione x blink...
|
||||
bool needUpdate = false;
|
||||
if (CurrRecord == null)
|
||||
{
|
||||
answ += "_b";
|
||||
needUpdate = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (OldRecord == null)
|
||||
{
|
||||
needUpdate = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!CurrRecord.Semaforo.Equals(OldRecord.Semaforo) || CurrRecord.Semaforo != "sVe")
|
||||
{
|
||||
needUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (needUpdate)
|
||||
{
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
}
|
||||
OldRecord = CurrRecord;
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
|
||||
public void StartTimer()
|
||||
{
|
||||
int tOutPeriod = 1000;
|
||||
//int.TryParse(Configuration["ReloadStatusTimer"], out tOutPeriod);
|
||||
aTimer = new System.Timers.Timer(tOutPeriod);
|
||||
aTimer.Elapsed += ElapsedTimer;
|
||||
aTimer.Enabled = true;
|
||||
aTimer.Start();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected string baseCss = "sem";
|
||||
|
||||
protected int kaFactor = 60 / 2;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected string codIOB
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (CurrRecord != null)
|
||||
{
|
||||
answ = CurrRecord.IdxMacchina;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
protected bool dataLoaded { get; set; } = false;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// restituisce il valore data la tagLocation
|
||||
/// </summary>
|
||||
/// <param name="tagLocation"></param>
|
||||
/// <returns></returns>
|
||||
protected string currVal(string tagLocation)
|
||||
{
|
||||
string answ = "";
|
||||
if (currTagVal.ContainsKey(tagLocation))
|
||||
{
|
||||
answ = currTagVal[tagLocation];
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se ci sia un override per la riga indicata
|
||||
/// </summary>
|
||||
/// <param name="numRow"></param>
|
||||
/// <returns></returns>
|
||||
protected bool hasRow(int numRow)
|
||||
{
|
||||
bool answ = false;
|
||||
if (currTagConf != null)
|
||||
{
|
||||
if (currTagConf.Count > 0)
|
||||
{
|
||||
var currVals = rowValues(numRow);
|
||||
answ = currVals.Count > 0;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
//StartTimer();
|
||||
Random rnd = new Random();
|
||||
await Task.Delay(rnd.Next(5));
|
||||
setupConf();
|
||||
dataLoaded = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce (se presenti) valori di override per la riga indicata
|
||||
/// </summary>
|
||||
/// <param name="numRow"></param>
|
||||
/// <returns></returns>
|
||||
protected List<TagData> rowValues(int numRow)
|
||||
{
|
||||
List<TagData>? rowVals = null;
|
||||
if (currTagConf != null)
|
||||
{
|
||||
if (currTagConf.Count > 0)
|
||||
{
|
||||
//cerco solo la riga corrente...
|
||||
rowVals = currTagConf.Where(x => x.RowNum == numRow).ToList();
|
||||
}
|
||||
}
|
||||
if (rowVals == null)
|
||||
{
|
||||
rowVals = new List<TagData>();
|
||||
}
|
||||
return rowVals;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private static System.Timers.Timer aTimer { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Valore precedente x calcolo variazione
|
||||
/// </summary>
|
||||
private MappaStatoExpl? OldRecord { get; set; } = null;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private string cssComStatus(string semaforo, DateTime? lastUpdateN)
|
||||
{
|
||||
DateTime lastUpdate = lastUpdateN.HasValue ? (DateTime)lastUpdateN : DateTime.Now.AddHours(-1);
|
||||
@@ -77,18 +221,63 @@ namespace MP.Mon.Components
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
protected override async Task OnInitializedAsync()
|
||||
|
||||
private string cssStatus(string codSemaforo)
|
||||
{
|
||||
StartTimer();
|
||||
Random rnd = new Random();
|
||||
//await Task.Delay(rnd.Next(500));
|
||||
dataLoaded = true;
|
||||
setupConf();
|
||||
// se vuoto --> mostra nero!
|
||||
if (string.IsNullOrEmpty(codSemaforo))
|
||||
{
|
||||
codSemaforo = "sNe";
|
||||
}
|
||||
string codColore = codSemaforo.Substring(1, 2);
|
||||
string answ = $"{baseCss}{codColore}";
|
||||
if (doAnimate && codColore != "Ve")
|
||||
{
|
||||
if (doBlink)
|
||||
{
|
||||
answ += "_b";
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
private decimal getDecimal(object? rawData)
|
||||
{
|
||||
decimal answ = 0;
|
||||
if (rawData != null)
|
||||
{
|
||||
decimal.TryParse($"{rawData}", out answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
private string getMinSec(decimal? currTimeMin)
|
||||
{
|
||||
string answ = "nd";
|
||||
TimeSpan tSpan = new TimeSpan(0);
|
||||
try
|
||||
{
|
||||
double cTimeMin = currTimeMin != null ? (double)currTimeMin : 0;
|
||||
tSpan = TimeSpan.FromMinutes(cTimeMin);
|
||||
if (tSpan.TotalHours < 1)
|
||||
{
|
||||
answ = $"{tSpan:mm}:{tSpan:ss}";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = $"{tSpan.TotalHours:N0}h {tSpan:mm}:{tSpan:ss}";
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
private void setupConf()
|
||||
{
|
||||
//baseCss = doAnimate ? "semBlink" : "sem";
|
||||
}
|
||||
|
||||
private bool showComErr(DateTime? lastUpdateN)
|
||||
{
|
||||
DateTime lastUpdate = lastUpdateN.HasValue ? (DateTime)lastUpdateN : DateTime.Now.AddHours(-1);
|
||||
@@ -100,45 +289,6 @@ namespace MP.Mon.Components
|
||||
return answ;
|
||||
}
|
||||
|
||||
private string getMinSec(decimal? currTimeMin)
|
||||
{
|
||||
string answ = "nd";
|
||||
TimeSpan tSpan = new TimeSpan(0);
|
||||
try
|
||||
{
|
||||
tSpan = TimeSpan.FromMinutes((double)currTimeMin);
|
||||
answ = $"{tSpan:mm}:{tSpan:ss}";
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
aTimer.Stop();
|
||||
aTimer.Dispose();
|
||||
}
|
||||
|
||||
private static System.Timers.Timer aTimer = new System.Timers.Timer(60 * 1000);
|
||||
|
||||
public void StartTimer()
|
||||
{
|
||||
int tOutPeriod = 1000;
|
||||
//int.TryParse(Configuration["ReloadStatusTimer"], out tOutPeriod);
|
||||
aTimer = new System.Timers.Timer(tOutPeriod);
|
||||
aTimer.Elapsed += ElapsedTimer;
|
||||
aTimer.Enabled = true;
|
||||
aTimer.Start();
|
||||
}
|
||||
|
||||
public void ElapsedTimer(Object source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
<div class="row p-5 m-5 bg-light">
|
||||
<div class="col-12 text-center mt-5 py-5 alert alert-primary">
|
||||
<div class="row p-5 m-5 alert alert-primary">
|
||||
<div class="col-6 text-center mt-4 py-3 bg-light">
|
||||
<h1>MAPO MON</h1>
|
||||
EgalWare MES suite <img class="logoImg img-fluid" src="images/logoCliente.png" />
|
||||
</div>
|
||||
<div class="col-6 text-center mt-4 py-3 bg-light">
|
||||
<h3>loading data</h3>
|
||||
<i class="fas fa-spinner fa-spin fa-5x"></i>
|
||||
<i class="fas fa-spinner fa-spin fa-4x"></i>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"IobSetup": {
|
||||
"***": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"IobSetup": {
|
||||
"***": [
|
||||
{
|
||||
"ColNum": 1,
|
||||
"RowNum": 5,
|
||||
"TagCss": "fontSmall",
|
||||
"TagName": "Feed Over",
|
||||
"TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:***:FEED_OVER"
|
||||
},
|
||||
{
|
||||
"ColNum": 2,
|
||||
"RowNum": 5,
|
||||
"TagCss": "fontSmall",
|
||||
"TagName": "Rapid Over",
|
||||
"TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:***:RAPID_OVER"
|
||||
}
|
||||
],
|
||||
"SIMUL_01": [
|
||||
{
|
||||
"ColNum": 1,
|
||||
"RowNum": 6,
|
||||
"TagCss": "fontSmall",
|
||||
"TagName": "Power",
|
||||
"TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:SIMUL_01:POWER_01"
|
||||
}
|
||||
],
|
||||
"SIMUL_02": [
|
||||
{
|
||||
"ColNum": 1,
|
||||
"RowNum": 6,
|
||||
"TagCss": "fontSmall",
|
||||
"TagName": "Power",
|
||||
"TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:SIMUL_02:POWER_01"
|
||||
}
|
||||
],
|
||||
"GIACO_ICOEL_001": [
|
||||
{
|
||||
"ColNum": 1,
|
||||
"RowNum": 1,
|
||||
"TagName": "Vel",
|
||||
"TagLocation": "FluxData:TonnOra"
|
||||
},
|
||||
{
|
||||
"ColNum": 2,
|
||||
"RowNum": 1,
|
||||
"TagName": "Vel",
|
||||
"TagLocation": "FluxData:PezziMin"
|
||||
},
|
||||
{
|
||||
"ColNum": 1,
|
||||
"RowNum": 2,
|
||||
"TagName": "Batch SX",
|
||||
"TagLocation": "FluxData:BatchL1"
|
||||
},
|
||||
{
|
||||
"ColNum": 2,
|
||||
"RowNum": 2,
|
||||
"TagName": "Batch DX",
|
||||
"TagLocation": "FluxData:BatchL2"
|
||||
}
|
||||
],
|
||||
"GIACO_ICOEL_002": [
|
||||
{
|
||||
"ColNum": 1,
|
||||
"RowNum": 1,
|
||||
"TagName": "Vel",
|
||||
"TagLocation": "FluxData:TonnOra"
|
||||
},
|
||||
{
|
||||
"ColNum": 2,
|
||||
"RowNum": 1,
|
||||
"TagName": "Vel",
|
||||
"TagLocation": "FluxData:PezziMin"
|
||||
},
|
||||
{
|
||||
"ColNum": 1,
|
||||
"RowNum": 2,
|
||||
"TagName": "Batch SX",
|
||||
"TagLocation": "FluxData:BatchL1"
|
||||
},
|
||||
{
|
||||
"ColNum": 2,
|
||||
"RowNum": 2,
|
||||
"TagName": "Batch DX",
|
||||
"TagLocation": "FluxData:BatchL2"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+256
-22
@@ -1,29 +1,30 @@
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data;
|
||||
using MP.Data.Conf;
|
||||
using MP.Data.DatabaseModels;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using StackExchange.Redis;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
|
||||
namespace MP.Mon.Data
|
||||
{
|
||||
public class MpDataService : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
private static ILogger<MpDataService> _logger;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Fields
|
||||
|
||||
public static MP.Data.Controllers.MpMonController dbController;
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public MpDataService(IConfiguration configuration, ILogger<MpDataService> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
_configuration = configuration;
|
||||
|
||||
// setup compoenti REDIS
|
||||
redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis"));
|
||||
redisDb = redisConn.GetDatabase();
|
||||
// setup canali pub/sub
|
||||
dataPipe = new MessagePipe(redisConn, Constants.ACT_MSE_DATA_KEY);
|
||||
blinkPipe = new MessagePipe(redisConn, Constants.ACT_BLINK_KEY);
|
||||
|
||||
// conf DB
|
||||
string connStr = _configuration.GetConnectionString("Mp.Mon");
|
||||
if (string.IsNullOrEmpty(connStr))
|
||||
@@ -35,13 +36,33 @@ namespace MP.Mon.Data
|
||||
dbController = new MP.Data.Controllers.MpMonController(configuration);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine($"DbController OK");
|
||||
//sb.AppendLine($"CST: {dbController.CustomersCount()} | CNT: {dbController.CountersCount()} | BSK: {dbController.BasketsCount()} | NGT: {dbController.NegotiationsCount()} | DOC: {dbController.DocsCount()} | ITM: {dbController.ItemsCount()} | RES: {dbController.ResourcesCount()}");
|
||||
_logger.LogInformation(sb.ToString());
|
||||
}
|
||||
|
||||
// setup conf IOB da dizionario
|
||||
tryLoadIobTags();
|
||||
|
||||
// avvio timers...
|
||||
startTimers();
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public static MP.Data.Controllers.MpMonController dbController { get; set; } = null!;
|
||||
|
||||
public MessagePipe blinkPipe { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario dei tag configurati per IOB
|
||||
/// </summary>
|
||||
public Dictionary<string, List<TagData>> currTagConf { get; set; } = new Dictionary<string, List<TagData>>();
|
||||
|
||||
public MessagePipe dataPipe { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public Task<List<ConfigModel>> ConfigGetAll()
|
||||
@@ -55,21 +76,234 @@ namespace MP.Mon.Data
|
||||
dbController.Dispose();
|
||||
}
|
||||
|
||||
public Task<List<Macchine>> MacchineGetAll()
|
||||
/// <summary>
|
||||
/// Richiesta attivazione --> sposto avanti 1 minuto il periodo limite x fast running
|
||||
/// </summary>
|
||||
public void doActivate()
|
||||
{
|
||||
return Task.FromResult(dbController.MacchineGetAll().ToList());
|
||||
fastLimit = DateTime.Now.AddMinutes(1);
|
||||
}
|
||||
|
||||
public Task<List<MappaStatoExpl>> MseGetAll()
|
||||
/// <summary>
|
||||
/// Elenco setup dei tag conf correnti
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Task<Dictionary<string, List<TagData>>> getAllTags()
|
||||
{
|
||||
var dbResult = dbController.MseGetAll();
|
||||
if (dbResult == null)
|
||||
return Task.FromResult(currTagConf);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// restituisce il valore da REDIS associato al tag richeisto
|
||||
/// </summary>
|
||||
/// <param name="redKey">Chiave in cui cercare il valore</param>
|
||||
/// <returns></returns>
|
||||
public string getTagConf(string redKey)
|
||||
{
|
||||
string outVal = "";
|
||||
// cerco in REDIS la conf x l'IOB
|
||||
var rawData = redisDb.StringGet(redKey);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
dbResult = new List<MappaStatoExpl>();
|
||||
outVal = $"{rawData}";
|
||||
}
|
||||
return Task.FromResult(dbResult);
|
||||
return outVal;
|
||||
}
|
||||
|
||||
public Task<List<Macchine>> MacchineGetAll()
|
||||
{
|
||||
return Task.FromResult(dbController.MacchineGetAll());
|
||||
}
|
||||
|
||||
public async Task<List<MappaStatoExpl>> MseGetAll()
|
||||
{
|
||||
int maxAge = 2000;
|
||||
int.TryParse(_configuration.GetValue<string>("ServerConf:maxAge"), out maxAge);
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
List<MappaStatoExpl>? result = new List<MappaStatoExpl>();
|
||||
// cerco in redis...
|
||||
RedisValue rawData = await redisDb.StringGetAsync(redisMseKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<MappaStatoExpl>>($"{rawData}");
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"Read from REDIS: {ts.TotalMilliseconds}ms");
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(dbController.MseGetAll(maxAge));
|
||||
// serializzp e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await redisDb.StringSetAsync(redisMseKey, rawData, TimeSpan.FromMilliseconds(maxAge));
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Debug($"Read from DB: {ts.TotalMilliseconds}ms");
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
result = new List<MappaStatoExpl>();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration = null!;
|
||||
|
||||
private static ILogger<MpDataService> _logger = null!;
|
||||
|
||||
private static System.Timers.Timer fastTimer = new System.Timers.Timer(4000);
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
/// <summary>
|
||||
/// Limite in formato data-ora per inviare dati rapidamente (incrementato come now + 1 min
|
||||
/// ad ogni chiamata client)
|
||||
/// </summary>
|
||||
private DateTime fastLimit = DateTime.Now;
|
||||
|
||||
private int fastRefreshMs = 1000;
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto per connessione a REDIS
|
||||
/// </summary>
|
||||
private ConnectionMultiplexer redisConn = null!;
|
||||
|
||||
//ISubscriber sub = redis.GetSubscriber();
|
||||
/// <summary>
|
||||
/// Oggetto DB redis da impiegare x chiamate R/W
|
||||
/// </summary>
|
||||
private IDatabase redisDb = null!;
|
||||
|
||||
private string redisMseKey = "MP:MON:Cache:MSE";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void ElapsedFastTimer(object? source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
// secondi pari --> blink, secondi dispari --> ricarica
|
||||
DateTime adesso = DateTime.Now;
|
||||
int resto = 0;
|
||||
Math.DivRem(adesso.Second, 2, out resto);
|
||||
if (resto == 0)
|
||||
{
|
||||
// invio in channel blink il segnale
|
||||
blinkPipe.sendMessage("true");
|
||||
Log.Debug("Elapsed Fast Timer Blink");
|
||||
}
|
||||
else
|
||||
{
|
||||
// invio in channel blink segnale false
|
||||
blinkPipe.sendMessage("false");
|
||||
// rileggo dati...
|
||||
var newData = await MseGetAll();
|
||||
// invio tramite la pipe...
|
||||
dataPipe.sendMessage(JsonConvert.SerializeObject(newData));
|
||||
Log.Debug("Elapsed Fast Timer reload");
|
||||
}
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
|
||||
private void startTimers()
|
||||
{
|
||||
fastTimer = new System.Timers.Timer(fastRefreshMs);
|
||||
fastTimer.Elapsed += ElapsedFastTimer;
|
||||
fastTimer.Enabled = true;
|
||||
fastTimer.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prova a caricare da file la conf degli IOB se presente
|
||||
/// </summary>
|
||||
private void tryLoadIobTags()
|
||||
{
|
||||
Dictionary<string, List<TagData>> currConf = new Dictionary<string, List<TagData>>();
|
||||
string strExeFilePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
|
||||
if (!string.IsNullOrEmpty(strExeFilePath))
|
||||
{
|
||||
string? strWorkPath = Path.GetDirectoryName(strExeFilePath);
|
||||
if (!string.IsNullOrEmpty(strWorkPath))
|
||||
{
|
||||
string filePath = $"{strWorkPath}/Conf/iobTagsConf.json";
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
string rawData = File.ReadAllText(filePath);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
var fileConfData = JsonConvert.DeserializeObject<IobTags>(rawData);
|
||||
if (fileConfData != null)
|
||||
{
|
||||
// effettuo esplosione conf SE contenesse il valore "***" = tutti
|
||||
// gli IOB
|
||||
if (fileConfData.IobSetup.ContainsKey("***"))
|
||||
{
|
||||
// recupero elenco macchine...
|
||||
var elencoMacc = dbController.MacchineGetAll();
|
||||
// x ogni macchina creo le righe standard da conf...
|
||||
var baseConf = fileConfData.IobSetup.Where(x => x.Key == "***").FirstOrDefault();
|
||||
foreach (var item in elencoMacc)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.IdxMacchina))
|
||||
{
|
||||
// converto i valori x la macchina corrente... clono in
|
||||
// nuovo oggetto
|
||||
var specVal = baseConf.Value.Select(i => i.Clone()).ToList();
|
||||
// sostituisco segnaposto
|
||||
foreach (var singleVal in specVal)
|
||||
{
|
||||
singleVal.TagLocation = singleVal.TagLocation.Replace("***", item.IdxMacchina);
|
||||
}
|
||||
// ora aggiungo eventuali valori in override...
|
||||
if (fileConfData.IobSetup.ContainsKey(item.IdxMacchina))
|
||||
{
|
||||
var otConf = fileConfData.IobSetup.Where(x => x.Key == item.IdxMacchina).FirstOrDefault();
|
||||
//verifico x ogni valore other...
|
||||
foreach (var otTag in otConf.Value)
|
||||
{
|
||||
var ovrTag = specVal.Where(x => x.ColNum == otTag.ColNum && x.RowNum == otTag.RowNum).FirstOrDefault();
|
||||
// se contiene --> sovrascrivo
|
||||
if (ovrTag != null)
|
||||
{
|
||||
//ovrTag = otTag.Clone();
|
||||
specVal.Remove(ovrTag);
|
||||
specVal.Add(otTag.Clone());
|
||||
}
|
||||
// se non contiene --> aggiungo
|
||||
else
|
||||
{
|
||||
specVal.Add(otTag);
|
||||
}
|
||||
}
|
||||
}
|
||||
currConf.Add(item.IdxMacchina, specVal);
|
||||
}
|
||||
}
|
||||
}
|
||||
// altrimenti copio ed ho finito
|
||||
else
|
||||
{
|
||||
currConf = fileConfData.IobSetup;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (currConf != null)
|
||||
{
|
||||
currTagConf = currConf;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>6.15.2205.219</Version>
|
||||
<Version>6.16.2209.2118</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -30,14 +30,20 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="NLog" Version="4.7.15" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.5.61" />
|
||||
<PackageReference Include="NLog" Version="5.0.4" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.6.66" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MP.Data\MP.Data.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="Conf\iobTagsConf.office.json">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="logs\.placeholder">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@
|
||||
layout="${longdate} ${uppercase:${level}} ${message}" />
|
||||
-->
|
||||
<target xsi:type="File" name="fileTarget" fileName="${basedir}/logs/${shortdate}.log" layout="${longdate} | ${uppercase:${level}} | ${logger:shortName=false} | ${message}" />
|
||||
<target xsi:type="ColoredConsole" name="consoleTarget" layout="${longdate} | ${uppercase:${level}} | ${logger:shortName=true}| ${message}" />
|
||||
<target xsi:type="ColoredConsole" name="consoleTarget" layout="${longdate} | ${uppercase:${level}} | ${logger:shortName=true} | ${message}" />
|
||||
</targets>
|
||||
|
||||
<rules>
|
||||
@@ -39,7 +39,7 @@
|
||||
Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f"
|
||||
<logger name="*" minlevel="Debug" writeTo="f" />
|
||||
-->
|
||||
<logger name="*" minlevel="Trace" writeTo="consoleTarget" />
|
||||
<logger name="*" minlevel="Debug" writeTo="consoleTarget" />
|
||||
<!--<logger name="Microsoft.*" maxlevel="Info" final="true" />-->
|
||||
<logger name="*" minlevel="Info" writeTo="fileTarget" />
|
||||
</rules>
|
||||
|
||||
@@ -2,18 +2,16 @@
|
||||
|
||||
|
||||
|
||||
<PageTitle>Index</PageTitle>
|
||||
|
||||
|
||||
<PageTitle>MP MON</PageTitle>
|
||||
|
||||
<div class="row statusMap mx-1 my-1">
|
||||
@if (ListMSE == null)
|
||||
@if (listMSE == null)
|
||||
{
|
||||
<div class="col-12">
|
||||
<LoadingData></LoadingData>
|
||||
</div>
|
||||
}
|
||||
else if (ListMSE.Count == 0)
|
||||
else if (listMSE.Count == 0)
|
||||
{
|
||||
<div class="col-12">
|
||||
<div class="alert alert-warning">
|
||||
@@ -24,23 +22,21 @@
|
||||
else
|
||||
{
|
||||
int currIdx = 0;
|
||||
foreach (var macchina in ListMSE)
|
||||
foreach (var recordIob in listMSE)
|
||||
{
|
||||
<DetailMSE CurrRecord="@macchina" doAnimate="@doAnimate" keepAliveMin="@keepAliveMin" showArt="@showArt"></DetailMSE>
|
||||
<DetailMSE CurrRecord="@recordIob" currTagConf="@getIobTag(recordIob.IdxMacchina)" currTagVal="@getTagVal(recordIob.IdxMacchina)" doAnimate="@doAnimate" keepAliveMin="@keepAliveMin" showArt="@showArt" doBlink="@doBlink"></DetailMSE>
|
||||
currIdx++;
|
||||
if (currIdx >= maxCol)
|
||||
{
|
||||
currIdx = 0;
|
||||
@((MarkupString)"</div><div class=\"row statusMap mx-1 my-1\">")
|
||||
;
|
||||
@((MarkupString)"</div><div class=\"row statusMap mx-1 my-1\">");
|
||||
}
|
||||
}
|
||||
// controllo se devo "chiudere riga...
|
||||
int currNum = (currIdx % maxCol);
|
||||
while (currNum < (maxCol))
|
||||
{
|
||||
@((MarkupString)"<div class=\"col machBlock\"> </div>")
|
||||
;
|
||||
@((MarkupString)"<div class=\"col machBlock\"> </div>");
|
||||
currNum++;
|
||||
|
||||
}
|
||||
|
||||
+201
-98
@@ -1,62 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Net.Http;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.Web.Virtualization;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Mon;
|
||||
using MP.Mon.Shared;
|
||||
using MP.Mon.Components;
|
||||
using MP.Data;
|
||||
using MP.Data.Conf;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Mon.Components;
|
||||
using MP.Mon.Data;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
|
||||
namespace MP.Mon.Pages
|
||||
{
|
||||
public partial class Index : IDisposable
|
||||
{
|
||||
protected List<MappaStatoExpl>? ListMSE = null;
|
||||
List<ConfigModel>? CurrConfig = null;
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
disposeTimers();
|
||||
}
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
public async void ElapsedSlowTimer(object? source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
listMSE = null;
|
||||
await Task.Delay(10);
|
||||
Log.Info("Elapsed Slow Timer --> full page reload");
|
||||
// dispongo i vari timers...
|
||||
disposeTimers();
|
||||
await Task.Delay(10);
|
||||
// reload pagina
|
||||
NavManager.NavigateTo(NavManager.Uri);
|
||||
}
|
||||
|
||||
protected int keepAliveMin = 1;
|
||||
public void StartTimer()
|
||||
{
|
||||
// timer lento
|
||||
slowTimer = new System.Timers.Timer(slowRefreshMs);
|
||||
slowTimer.Elapsed += ElapsedSlowTimer;
|
||||
slowTimer.Enabled = true;
|
||||
slowTimer.Start();
|
||||
}
|
||||
|
||||
protected int maxCol = 4;
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected bool doAnimate = true;
|
||||
|
||||
protected int fastRefreshMs = 1000;
|
||||
protected int keepAliveMin = 1;
|
||||
protected int maxCol = 6;
|
||||
protected string showArt = "";
|
||||
|
||||
protected int slowRefreshSec = 300;
|
||||
protected int fastRefreshSec = 10;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
protected int slowRefreshMs
|
||||
{
|
||||
get => 1000 * slowRefreshSec;
|
||||
}
|
||||
protected int fastRefreshMs
|
||||
{
|
||||
get => 1000 * fastRefreshSec;
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await setupConf();
|
||||
await ReloadData();
|
||||
StartTimer();
|
||||
}
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected MpDataService MMDataService { get; set; } = null!;
|
||||
@@ -64,24 +59,40 @@ namespace MP.Mon.Pages
|
||||
[Inject]
|
||||
protected NavigationManager NavManager { get; set; } = null!;
|
||||
|
||||
private async Task setupConf()
|
||||
protected int slowRefreshMs
|
||||
{
|
||||
CurrConfig = await MMDataService.ConfigGetAll();
|
||||
get
|
||||
{
|
||||
// tempo variabile tra +/- 10% del target
|
||||
int answ = rnd.Next(900, 1100) * slowRefreshSec;
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Recupera il valore e se trovato aggiorna
|
||||
/// </summary>
|
||||
/// <param name="chiave">Valore da cercare</param>
|
||||
/// <param name="varObj">String in cui salvare il valore se trovato</param>
|
||||
/// <returns></returns>
|
||||
protected bool getConfVal(string chiave, ref string varObj)
|
||||
{
|
||||
bool answ = false;
|
||||
if (CurrConfig != null && CurrConfig.Count > 0)
|
||||
{
|
||||
// sistemo i parametri opzionali...
|
||||
|
||||
getConfValInt("keepAliveMin", ref keepAliveMin);
|
||||
getConfValInt("MON_maxCol", ref maxCol);
|
||||
int intDoAnim = 0;
|
||||
getConfValInt("doAnimate", ref intDoAnim);
|
||||
doAnimate = intDoAnim == 1;
|
||||
getConfValInt("pageRefreshSec", ref slowRefreshSec);
|
||||
getConfValInt("MSE_cacheDuration", ref fastRefreshSec);
|
||||
getConfVal("sART", ref showArt);
|
||||
|
||||
Log.Info($"Effettuato setup parametri | keepAlive: {keepAliveMin} | MaxCol: {maxCol} | doAnimate: {doAnimate} | slowRefreshSec: {slowRefreshSec} | fastRefreshSec: {fastRefreshSec}");
|
||||
ConfigModel? risultato = CurrConfig.FirstOrDefault(x => x.Chiave == chiave);
|
||||
if (risultato != null)
|
||||
{
|
||||
varObj = risultato.Valore;
|
||||
answ = !string.IsNullOrEmpty(risultato.Valore);
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -106,72 +117,164 @@ namespace MP.Mon.Pages
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera il valore e se trovato aggiorna
|
||||
/// Recupera da conf eventuale setup tag dell'IOB indicato
|
||||
/// </summary>
|
||||
/// <param name="chiave">Valore da cercare</param>
|
||||
/// <param name="varObj">String in cui salvare il valore se trovato</param>
|
||||
/// <param name="codIob"></param>
|
||||
/// <returns></returns>
|
||||
protected bool getConfVal(string chiave, ref string varObj)
|
||||
protected List<TagData>? getIobTag(string codIob)
|
||||
{
|
||||
bool answ = false;
|
||||
if (CurrConfig != null && CurrConfig.Count > 0)
|
||||
List<TagData>? answ = null;
|
||||
if (MMDataService.currTagConf != null)
|
||||
{
|
||||
// sistemo i parametri opzionali...
|
||||
ConfigModel? risultato = CurrConfig.FirstOrDefault(x => x.Chiave == chiave);
|
||||
if (risultato != null)
|
||||
// cerco x chiave IOB...
|
||||
if (MMDataService.currTagConf.ContainsKey(codIob))
|
||||
{
|
||||
varObj = risultato.Valore;
|
||||
answ = !string.IsNullOrEmpty(risultato.Valore);
|
||||
answ = MMDataService.currTagConf[codIob];
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
/// <summary>
|
||||
/// Recupera da redis (in una chiamata soltanto) tutti i valori richiesti e compone un
|
||||
/// dizionario x ottimizzare visualizzazione
|
||||
/// </summary>
|
||||
/// <param name="codIob"></param>
|
||||
/// <returns></returns>
|
||||
protected Dictionary<string, string> getTagVal(string codIob)
|
||||
{
|
||||
ListMSE = await MMDataService.MseGetAll();
|
||||
Dictionary<string, string> answ = new Dictionary<string, string>();
|
||||
// recupero conf tags...
|
||||
var currTags = getIobTag(codIob);
|
||||
if (currTags != null && currTags.Count > 0)
|
||||
{
|
||||
// FIXME TODO !!!! FARE !!!! - da verificare
|
||||
answ = currTags.ToDictionary(x => x.TagLocation, x => MMDataService.getTagConf(x.TagLocation));
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
fastTimer.Stop();
|
||||
fastTimer.Dispose();
|
||||
await setupConf();
|
||||
MMDataService.dataPipe.EA_NewMessage += DataPipe_EA_NewMessage;
|
||||
MMDataService.blinkPipe.EA_NewMessage += BlinkPipe_EA_NewMessage;
|
||||
Random rnd = new Random();
|
||||
await Task.Delay(rnd.Next(1000, 1200));
|
||||
StartTimer();
|
||||
}
|
||||
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
//private static System.Timers.Timer fastTimer = new System.Timers.Timer(4000);
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private static System.Timers.Timer slowTimer = new System.Timers.Timer(300000);
|
||||
private List<ConfigModel>? CurrConfig = null;
|
||||
private bool doBlink = false;
|
||||
private List<MappaStatoExpl>? listMSE = null;
|
||||
private Random rnd = new Random();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void BlinkPipe_EA_NewMessage(object? sender, EventArgs e)
|
||||
{
|
||||
PubSubEventArgs currArgs = (PubSubEventArgs)e;
|
||||
// conversione on-the-fly List<string> --> allarmi
|
||||
if (!string.IsNullOrEmpty(currArgs.newMessage))
|
||||
{
|
||||
try
|
||||
{
|
||||
var dataRaw = JsonConvert.DeserializeObject<string>(currArgs.newMessage);
|
||||
if (dataRaw != null)
|
||||
{
|
||||
bool.TryParse($"{dataRaw}", out doBlink);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
InvokeAsync(() =>
|
||||
{
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ricevuto nuovi dati da mostrare!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void DataPipe_EA_NewMessage(object? sender, EventArgs e)
|
||||
{
|
||||
PubSubEventArgs currArgs = (PubSubEventArgs)e;
|
||||
// conversione on-the-fly List<string> --> allarmi
|
||||
if (!string.IsNullOrEmpty(currArgs.newMessage))
|
||||
{
|
||||
try
|
||||
{
|
||||
var dataList = JsonConvert.DeserializeObject<List<MappaStatoExpl>>(currArgs.newMessage);
|
||||
if (dataList != null)
|
||||
{
|
||||
#if DEBUG
|
||||
// hack: legge 4 volte i dati x stressare sistema
|
||||
var singleData = dataList;
|
||||
listMSE = new List<MappaStatoExpl>();
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
listMSE.AddRange(singleData);
|
||||
}
|
||||
#else
|
||||
listMSE = dataList;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
InvokeAsync(() =>
|
||||
{
|
||||
#if false
|
||||
// attesa random 0-50ms...
|
||||
Random rnd = new Random();
|
||||
Task.Delay(rnd.Next(5, 50));
|
||||
#endif
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
|
||||
private void disposeTimers()
|
||||
{
|
||||
slowTimer.Elapsed -= ElapsedSlowTimer;
|
||||
slowTimer.Stop();
|
||||
slowTimer.Dispose();
|
||||
}
|
||||
|
||||
private static System.Timers.Timer fastTimer = new System.Timers.Timer(4000);
|
||||
private static System.Timers.Timer slowTimer = new System.Timers.Timer(300000);
|
||||
|
||||
public void StartTimer()
|
||||
private async Task setupConf()
|
||||
{
|
||||
// timer veloce
|
||||
fastTimer = new System.Timers.Timer(fastRefreshMs);
|
||||
fastTimer.Elapsed += ElapsedFastTimer;
|
||||
fastTimer.Enabled = true;
|
||||
fastTimer.Start();
|
||||
// timer lento
|
||||
slowTimer = new System.Timers.Timer(slowRefreshMs);
|
||||
slowTimer.Elapsed += ElapsedSlowTimer;
|
||||
slowTimer.Enabled = true;
|
||||
slowTimer.Start();
|
||||
}
|
||||
|
||||
public void ElapsedFastTimer(Object source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
var pUpd = Task.Run(async () =>
|
||||
CurrConfig = await MMDataService.ConfigGetAll();
|
||||
if (CurrConfig != null && CurrConfig.Count > 0)
|
||||
{
|
||||
await ReloadData();
|
||||
//await Task.Delay(1);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
});
|
||||
pUpd.Wait();
|
||||
// sistemo i parametri opzionali...
|
||||
|
||||
getConfValInt("keepAliveMin", ref keepAliveMin);
|
||||
getConfValInt("MON_maxCol", ref maxCol);
|
||||
int intDoAnim = 0;
|
||||
getConfValInt("doAnimate", ref intDoAnim);
|
||||
doAnimate = intDoAnim == 1;
|
||||
getConfValInt("pageRefreshSec", ref slowRefreshSec);
|
||||
getConfVal("sART", ref showArt);
|
||||
|
||||
Log.Info($"setupConf | Effettuato setup parametri | keepAlive: {keepAliveMin} | MaxCol: {maxCol} | doAnimate: {doAnimate} | slowRefreshSec: {slowRefreshSec} | fastRefreshMs: {fastRefreshMs}");
|
||||
}
|
||||
}
|
||||
|
||||
public async void ElapsedSlowTimer(Object source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
ListMSE = null;
|
||||
NavManager.NavigateTo(NavManager.Uri);
|
||||
}
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -5,4 +5,4 @@
|
||||
Layout = "_Layout";
|
||||
}
|
||||
|
||||
<component type="typeof(App)" render-mode="ServerPrerendered" />
|
||||
<component type="typeof(App)" render-mode="Server" />
|
||||
+22
-10
@@ -7,6 +7,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="google" content="notranslate">
|
||||
<base href="~/" />
|
||||
<link rel="stylesheet" href="lib/bootstrap/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="css/site.css" />
|
||||
@@ -28,17 +29,28 @@
|
||||
<a class="dismiss">🗙</a>
|
||||
</div>
|
||||
|
||||
@* Riconnessione server app: https://www.syncfusion.com/faq/how-do-i-reconnect-blazor-server-side-automatically *@
|
||||
<script src="_framework/blazor.server.js" autostart="false"></script>
|
||||
@*Gestione autoriconnessione: https://github.com/dotnet/aspnetcore/issues/38305 (vedere anche https://docs.microsoft.com/it-it/aspnet/core/blazor/fundamentals/signalr?view=aspnetcore-6.0#modify-the-reconnection-handler-blazor-server)*@
|
||||
<script>
|
||||
Blazor.defaultReconnectionHandler._reconnectCallback = function (d) {
|
||||
document.location.reload();
|
||||
}
|
||||
Blazor.start({
|
||||
reconnectionOptions: {
|
||||
maxRetries: 300,
|
||||
retryIntervalMilliseconds: 2000
|
||||
}
|
||||
}).then(() => {
|
||||
Object.defineProperty(Blazor.defaultReconnectionHandler, '_reconnectionDisplay', {
|
||||
get() {
|
||||
return this.__reconnectionDisplay;
|
||||
},
|
||||
set(value) {
|
||||
this.__reconnectionDisplay = {
|
||||
show: () => value.show(),
|
||||
update: (d) => value.update(d),
|
||||
rejected: (d) => document.location.reload()
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="_framework/blazor.server.js"></script>
|
||||
<script src="lib/Chart.js/chart.js"></script>
|
||||
<script src="lib/luxon/luxon.js"></script>
|
||||
<script src="lib/chartjs-adapter-luxon/chartjs-adapter-luxon.js"></script>
|
||||
<script src="lib/chartBoot.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -21,7 +21,6 @@ string redisSrvAddr = connStringRedis.Substring(0, connStringRedis.IndexOf(":"))
|
||||
// avvio oggetto shared x redis...
|
||||
var redisMultiplexer = ConnectionMultiplexer.Connect(connStringRedis);
|
||||
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddRazorPages();
|
||||
builder.Services.AddServerSideBlazor();
|
||||
|
||||
@@ -7,6 +7,6 @@ by editing this MSBuild file. In order to learn more about this please visit htt
|
||||
<PropertyGroup>
|
||||
<TimeStampOfAssociatedLegacyPublishXmlFile />
|
||||
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA+11nhJeDSkeTlSej+COD3AAAAAACAAAAAAADZgAAwAAAABAAAACFCXZ0UR7Czo59aaRCHU5QAAAAAASAAACgAAAAEAAAACYlKt9E6s77uEikpKwyhdQYAAAAUwae989LovFbsfjRp69HCVpyUQZbqLyYFAAAAMW8mLSAxWmKaOvB4nkDgUpS27/b</EncryptedPassword>
|
||||
<History>True|2022-04-14T07:37:09.1341280Z;True|2022-02-26T18:24:32.0833123+01:00;False|2022-02-26T18:24:15.3994092+01:00;False|2022-02-26T18:23:44.8358586+01:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00;</History>
|
||||
<History>True|2022-07-12T14:34:20.2940329Z;True|2022-04-14T09:37:09.1341280+02:00;True|2022-02-26T18:24:32.0833123+01:00;False|2022-02-26T18:24:15.3994092+01:00;False|2022-02-26T18:23:44.8358586+01:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00;</History>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MON MAPO</i>
|
||||
<h4>Versione: 6.15.2205.219</h4>
|
||||
<h4>Versione: 6.16.2209.2118</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.15.2205.219
|
||||
6.16.2209.2118
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.15.2205.219</version>
|
||||
<version>6.16.2209.2118</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/MP.Mon.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -4,19 +4,6 @@
|
||||
|
||||
<div class="page">
|
||||
<main>
|
||||
@*<div class="top-row px-4 justify-content-between">
|
||||
<div class="px-2">
|
||||
<img class="logoImg img-fluid" src="images/LogoMapo.png" width="80" />
|
||||
<span class="mainHead p-3"><b><span style="color: #DEDEDE;">MP MON</span>itor</b></span>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<span id="text-white text-right">
|
||||
@($"{DateTime.Now:dddd dd MMMM yyyy, HH:mm}")
|
||||
</span>
|
||||
<img class="logoImg img-fluid" src="images/logoCliente.png" width="32" />
|
||||
EgalWare
|
||||
</div>
|
||||
</div>*@
|
||||
<div class="top-row px-4 justify-content-between">
|
||||
<CmpHeader></CmpHeader>
|
||||
</div>
|
||||
@@ -27,6 +14,5 @@
|
||||
<div class="fixed-bottom bottom-row px-2">
|
||||
<CmpFooter></CmpFooter>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@@ -13,14 +13,14 @@ main {
|
||||
/*border-bottom: 1px solid #696969;*/
|
||||
color: #696969;
|
||||
font-size: 1.4em;
|
||||
height: 3rem;
|
||||
height: 2.6rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
|
||||
.mainHead{
|
||||
font-size: 1.7rem;
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
|
||||
.top-row ::deep a,
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
<div class="top-row ps-3 navbar navbar-dark">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="">MP.Mon</a>
|
||||
<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="@NavMenuCssClass" @onclick="ToggleNavMenu">
|
||||
<nav class="flex-column">
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
|
||||
<span class="oi oi-home" aria-hidden="true"></span> Home
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="counter">
|
||||
<span class="oi oi-plus" aria-hidden="true"></span> Counter
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="fetchdata">
|
||||
<span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data
|
||||
</NavLink>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private bool collapseNavMenu = true;
|
||||
|
||||
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
|
||||
|
||||
private void ToggleNavMenu()
|
||||
{
|
||||
collapseNavMenu = !collapseNavMenu;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
<div class="alert alert-secondary mt-4">
|
||||
<span class="oi oi-pencil me-2" aria-hidden="true"></span>
|
||||
<strong>@Title</strong>
|
||||
|
||||
<span class="text-nowrap">
|
||||
Please take our
|
||||
<a target="_blank" class="font-weight-bold link-dark" href="https://go.microsoft.com/fwlink/?linkid=2149017">brief survey</a>
|
||||
</span>
|
||||
and tell us what you think.
|
||||
</div>
|
||||
|
||||
@code {
|
||||
// Demonstrates how a parent component can supply parameters
|
||||
[Parameter]
|
||||
public string? Title { get; set; }
|
||||
}
|
||||
@@ -10,6 +10,9 @@
|
||||
"ConnectionStrings": {
|
||||
"MP.Mon": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=Blazor.ServerApp;",
|
||||
"MP.Stats": "Server=SQL2016DEV;Database=MoonPro_STATS; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=Blazor.ServerApp;",
|
||||
"Redis": "localhost:6379,DefaultDatabase=13,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false"
|
||||
"Redis": "localhost:6379,DefaultDatabase=1,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false"
|
||||
},
|
||||
"ServerConf": {
|
||||
"maxAge": "2000"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-16
@@ -7,28 +7,13 @@
|
||||
"destination": "wwwroot/lib/bootstrap/"
|
||||
},
|
||||
{
|
||||
"library": "bootstrap-icons@1.8.1",
|
||||
"library": "bootstrap-icons@1.8.3",
|
||||
"destination": "wwwroot/lib/bootstrap-icons/"
|
||||
},
|
||||
{
|
||||
"provider": "cdnjs",
|
||||
"library": "font-awesome@6.1.1",
|
||||
"destination": "wwwroot/lib/font-awesome/"
|
||||
},
|
||||
{
|
||||
"provider": "cdnjs",
|
||||
"library": "Chart.js@3.7.1",
|
||||
"destination": "wwwroot/lib/Chart.js/"
|
||||
},
|
||||
{
|
||||
"provider": "cdnjs",
|
||||
"library": "chartjs-adapter-luxon@1.1.0",
|
||||
"destination": "wwwroot/lib/chartjs-adapter-luxon/"
|
||||
},
|
||||
{
|
||||
"provider": "cdnjs",
|
||||
"library": "luxon@2.3.1",
|
||||
"destination": "wwwroot/lib/luxon/"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -308,7 +308,7 @@ a,
|
||||
/* Gestione size caratteri */
|
||||
.mainHead,
|
||||
.logoImg {
|
||||
height: 1.6em;
|
||||
height: 1.5em;
|
||||
}
|
||||
@media all and (min-width: 425px) {
|
||||
.mainHead {
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 861 KiB |
File diff suppressed because one or more lines are too long
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user