Compare commits
361 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1271b44b15 | |||
| 132f5966dd | |||
| 02c46c99db | |||
| 485808e8d4 | |||
| d78c2d3173 | |||
| 2a1602c5b9 | |||
| a096f6a13e | |||
| 1cae70c244 | |||
| 18ee183b05 | |||
| d88c4cc2bd | |||
| 67922520b8 | |||
| c5b5b54586 | |||
| ae3864a614 | |||
| f878f1c496 | |||
| d453c1d944 | |||
| 921bf52659 | |||
| e948ae31af | |||
| b344180da2 | |||
| 4b885d780c | |||
| 01e181a4fc | |||
| 56f342a488 | |||
| ed72bdfa24 | |||
| 5e6924f0fe | |||
| cae7e50cbd | |||
| e769227bb3 | |||
| 60f757965e | |||
| 603ed3782f | |||
| 71177e04c7 | |||
| 1a211ebca5 | |||
| 591b66b52d | |||
| 96f4bb3b4c | |||
| f1c295993c | |||
| a293ce825e | |||
| e3b67ee6c0 | |||
| 0c5e41826e | |||
| 0d4e1aed88 | |||
| 93f4f09b85 | |||
| aebae6b406 | |||
| a2bf5f4a8b | |||
| 759373b5a4 | |||
| 0ea3ee6341 | |||
| a0ffe1bc6c | |||
| 6e75f590bb | |||
| 12473b5088 | |||
| f6406f833f | |||
| a21cd16362 | |||
| d659afacc2 | |||
| 56c3ba4064 | |||
| 8d0292d789 | |||
| 419863a684 | |||
| f56a7e5164 | |||
| 0cf6ecd38f | |||
| 094ce0d181 | |||
| b4de1c9880 | |||
| 67f0f74fbe | |||
| d00b4bbb8b | |||
| dd63bb292d | |||
| 57bc790074 | |||
| 41a00ffa45 | |||
| 633b5dda6e | |||
| 5d6bef0fc8 | |||
| d24b2ada0c | |||
| 0a9ccffe28 | |||
| 207d305327 | |||
| caa4b4f590 | |||
| e45cb0595e | |||
| 77e7e39985 | |||
| b2e9ae76d4 | |||
| 460eb769dc | |||
| 5e38749c65 | |||
| 91083b6c4a | |||
| de562b1287 | |||
| 470c9a2191 | |||
| 26e36e7124 | |||
| bef0ee6000 | |||
| 9e4822d529 | |||
| 7f9685a007 | |||
| 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 |
+144
-38
@@ -121,19 +121,32 @@ MON:build:
|
||||
script:
|
||||
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
WAMON:build:
|
||||
SPEC:build:
|
||||
stage: build
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
PROJ_PATH: MP.WASM.Mon\Server
|
||||
APP_NAME: MP.WASM.Mon.Server
|
||||
SOL_NAME: MP-WAMON
|
||||
APP_NAME: MP.SPEC
|
||||
SOL_NAME: MP-SPEC
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
script:
|
||||
- dotnet build $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
- 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
|
||||
@@ -199,22 +212,38 @@ MON:test:
|
||||
script:
|
||||
- dotnet test $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
WAMON:test:
|
||||
# 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:
|
||||
PROJ_PATH: MP.WASM.Mon\Server
|
||||
APP_NAME: MP.WASM.Mon.Server
|
||||
SOL_NAME: MP-WAMON
|
||||
APP_NAME: MP.SPEC
|
||||
SOL_NAME: MP-SPEC
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
only:
|
||||
- develop
|
||||
needs: ["WAMON:build"]
|
||||
needs: ["SPEC:build"]
|
||||
script:
|
||||
- dotnet test $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
- dotnet test $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
LAND:IIS01:deploy:
|
||||
stage: deploy
|
||||
@@ -280,22 +309,38 @@ 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:
|
||||
# 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:
|
||||
PROJ_PATH: MP.WASM.Mon\Server
|
||||
APP_NAME: MP.WASM.Mon.Server
|
||||
SOL_NAME: MP-WAMON
|
||||
APP_NAME: MP.SPEC
|
||||
SOL_NAME: MP-SPEC
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
only:
|
||||
- develop
|
||||
needs: ["WAMON:test"]
|
||||
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:PROJ_PATH/$env:APP_NAME.csproj
|
||||
- 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
|
||||
@@ -365,23 +410,40 @@ 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:
|
||||
# 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:
|
||||
PROJ_PATH: MP.WASM.Mon\Server
|
||||
APP_NAME: MP.WASM.Mon.Server
|
||||
SOL_NAME: MP-WAMON
|
||||
APP_NAME: MP.SPEC
|
||||
SOL_NAME: MP-SPEC
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
only:
|
||||
- master
|
||||
needs: ["WAMON:build"]
|
||||
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: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
|
||||
- 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
|
||||
@@ -467,24 +529,45 @@ MON:installer:
|
||||
- *hashBuild
|
||||
- *nexusUpload
|
||||
|
||||
WAMON:installer:
|
||||
# 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:
|
||||
PROJ_PATH: MP.WASM.Mon\Server
|
||||
APP_NAME: MP.WASM.Mon.Server
|
||||
SOL_NAME: MP-WAMON
|
||||
NEXUS_PATH: MP-WAMON
|
||||
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: ["WAMON:build"]
|
||||
needs: ["SPEC:build"]
|
||||
script:
|
||||
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:PROJ_PATH/$env:APP_NAME.csproj -o:publish
|
||||
- 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
|
||||
@@ -583,15 +666,37 @@ MON:release:
|
||||
script:
|
||||
- dotnet publish -c Release -o ./publish $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
WAMON:release:
|
||||
# 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:
|
||||
PROJ_PATH: MP.WASM.Mon\Server
|
||||
APP_NAME: MP.WASM.Mon.Server
|
||||
SOL_NAME: MP-WAMON
|
||||
NEXUS_PATH: MP-WAMON
|
||||
APP_NAME: MP.SPEC
|
||||
SOL_NAME: MP-SPEC
|
||||
NEXUS_PATH: MP-SPEC
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- dotnet restore "$env:SOL_NAME.sln"
|
||||
@@ -599,9 +704,10 @@ WAMON:release:
|
||||
- tags
|
||||
except:
|
||||
- branches
|
||||
needs: ["WAMON:build"]
|
||||
needs: ["SPEC:build"]
|
||||
artifacts:
|
||||
paths:
|
||||
- publish/
|
||||
script:
|
||||
- dotnet publish -c Release -o ./publish $env:PROJ_PATH/$env:APP_NAME.csproj
|
||||
- dotnet publish -c Release -o ./publish $env:APP_NAME/$env:APP_NAME.csproj
|
||||
|
||||
|
||||
+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
|
||||
@@ -9,18 +9,18 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.6">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.9">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.6">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.9">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NLog" Version="5.0.1" />
|
||||
<PackageReference Include="NLog" Version="5.0.4" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MP.Data.Conf
|
||||
{
|
||||
@@ -11,9 +7,13 @@ namespace MP.Data.Conf
|
||||
/// </summary>
|
||||
public class IobTags
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto dizionario di configurazione x IOB
|
||||
/// </summary>
|
||||
public Dictionary<string, List<TagData>> IobSetup = new Dictionary<string, List<TagData>>();
|
||||
|
||||
#endregion Public Fields
|
||||
}
|
||||
}
|
||||
}
|
||||
+18
-12
@@ -1,37 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Data.Conf
|
||||
namespace MP.Data.Conf
|
||||
{
|
||||
/// <summary>
|
||||
/// Item da mostrare nei blocchi MON degli impianti come override ai dati MSE
|
||||
/// </summary>
|
||||
public class TagData
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Indice della colonna (ordine) del dato
|
||||
/// </summary>
|
||||
public int ColNum { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Indice della riga del dato
|
||||
/// </summary>
|
||||
public int RowNum { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Override CSS (es fontSmall)
|
||||
/// </summary>
|
||||
public string TagCss { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Etichetta da mostrare
|
||||
/// </summary>
|
||||
public string TagName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Indicazione della chiave REDIS dove recuperare il tag indicato (già in formato string)
|
||||
/// </summary>
|
||||
public string TagLocation { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Etichetta da mostrare
|
||||
/// </summary>
|
||||
public string TagName { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Clone dell'oggetto
|
||||
/// </summary>
|
||||
@@ -40,5 +44,7 @@ namespace MP.Data.Conf
|
||||
{
|
||||
return (TagData)this.MemberwiseClone();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
-10
@@ -1,20 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Data
|
||||
namespace MP.Data
|
||||
{
|
||||
public class Constants
|
||||
public class Constants
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
public static readonly string ACT_BLINK_KEY = $"{BASE_HASH}:Current:Blink";
|
||||
|
||||
public static readonly string ACT_MSE_DATA_KEY = $"{BASE_HASH}:Current:MSE";
|
||||
|
||||
// dati conf REDIS Cache
|
||||
public static readonly string BASE_HASH = "MAPO";
|
||||
|
||||
// REDIS KEY Dati correnti
|
||||
public static readonly string CONF_MON_KEY = $"{BASE_HASH}:Conf:MonDispData";
|
||||
public static readonly string ACT_FLUX_DATA_KEY = $"{BASE_HASH}:Current:FluxData";
|
||||
|
||||
#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,13 @@ namespace MP.Data.Controllers
|
||||
/// <param name="numRecord"></param>
|
||||
/// <param name="searchVal"></param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.AnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
|
||||
public List<DatabaseModels.StatsAnagArticoli> ArticoliGetSearch(int numRecord, string searchVal = "")
|
||||
{
|
||||
List<DatabaseModels.AnagArticoli> dbResult = new List<DatabaseModels.AnagArticoli>();
|
||||
List<DatabaseModels.StatsAnagArticoli> dbResult = new List<DatabaseModels.StatsAnagArticoli>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetArticoli
|
||||
.DbSetStatArticoli
|
||||
.AsNoTracking()
|
||||
.Where(x => x.CodArticolo.Contains(searchVal) || x.DescArticolo.Contains(searchVal) || x.Disegno.Contains(searchVal) || string.IsNullOrEmpty(searchVal))
|
||||
.OrderBy(x => x.CodArticolo)
|
||||
@@ -52,6 +44,24 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco da tabella Macchine
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.ConfigModel> ConfigGetAll()
|
||||
{
|
||||
List<DatabaseModels.ConfigModel> dbResult = new List<DatabaseModels.ConfigModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetConfig
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.Chiave)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
@@ -74,24 +84,6 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco da tabella Macchine
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.ConfigModel> ConfigGetAll()
|
||||
{
|
||||
List<DatabaseModels.ConfigModel> dbResult = new List<DatabaseModels.ConfigModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetConfig
|
||||
.AsNoTracking()
|
||||
.OrderBy(x => x.Chiave)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco da tabella MappaStatoExpl
|
||||
/// </summary>
|
||||
@@ -138,5 +130,13 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.6">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" 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.6" />
|
||||
<PackageReference Include="NLog" Version="5.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.9" />
|
||||
<PackageReference Include="NLog" Version="5.0.4" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>MP.Land</RootNamespace>
|
||||
<Version>6.15.2207.0718</Version>
|
||||
<Version>6.16.2209.2118</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -45,14 +45,14 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DiffMatchPatch" Version="1.0.3" />
|
||||
<PackageReference Include="Majorsoft.Blazor.Components.Debounce" Version="1.5.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.6">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.9">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.6" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.9" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.9" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" Version="5.0.0" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" Version="5.1.4" />
|
||||
<PackageReference Include="RestSharp" Version="107.1.2" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace MP.Land.Pages
|
||||
|
||||
protected string BaseUrlTab
|
||||
{
|
||||
get => $"{Configuration["BaseUrl"]}{Configuration["QrJumpPath"]}";
|
||||
get => $"{Configuration["ServerConf:BaseUrl"]}{Configuration["QrJumpPath"]}";
|
||||
}
|
||||
|
||||
[Inject]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo gestione Programmi MAPO</i>
|
||||
<h4>Versione: 6.15.2207.0718</h4>
|
||||
<h4>Versione: 6.16.2209.2118</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.15.2207.0718
|
||||
6.16.2209.2118
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.15.2207.0718</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,15 +7,17 @@
|
||||
}
|
||||
},
|
||||
"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=Jetco_MoonPro_Prod;Trusted_Connection=True;MultipleActiveResultSets=true",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="px-2">
|
||||
<img class="logoImg img-fluid" src="images/LogoMapo.png" height="24" />
|
||||
<span class="mainHead p-3"><b><span style="color: #DEDEDE;">MP MON</span>itor</b></span>
|
||||
<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">
|
||||
|
||||
@@ -12,11 +12,6 @@ namespace MP.Mon.Components
|
||||
[Parameter]
|
||||
public MappaStatoExpl? CurrRecord { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Valore precedente x calcolo variazione
|
||||
/// </summary>
|
||||
private MappaStatoExpl? OldRecord { get; set; } = null;
|
||||
|
||||
[Parameter]
|
||||
public List<TagData>? currTagConf { get; set; } = null;
|
||||
|
||||
@@ -26,37 +21,22 @@ namespace MP.Mon.Components
|
||||
[Parameter]
|
||||
public bool doAnimate { get; set; } = true;
|
||||
|
||||
[Parameter]
|
||||
public bool doBlink { get; set; } = false;
|
||||
|
||||
[Parameter]
|
||||
public int keepAliveMin { get; set; } = 5;
|
||||
|
||||
[Parameter]
|
||||
public string showArt { get; set; } = "";
|
||||
|
||||
|
||||
[Parameter]
|
||||
public bool doBlink { get; set; } = false;
|
||||
//{
|
||||
// set
|
||||
// {
|
||||
// // se true --> ricarica
|
||||
// if (value)
|
||||
// {
|
||||
// var pUpd = Task.Run(async () =>
|
||||
// {
|
||||
// await InvokeAsync(() => StateHasChanged());
|
||||
// });
|
||||
// pUpd.Wait();
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
//aTimer.Elapsed -= ElapsedTimer;
|
||||
aTimer.Elapsed -= ElapsedTimer;
|
||||
aTimer.Stop();
|
||||
aTimer.Dispose();
|
||||
}
|
||||
@@ -88,10 +68,6 @@ namespace MP.Mon.Components
|
||||
}
|
||||
if (needUpdate)
|
||||
{
|
||||
if (false)
|
||||
{
|
||||
Log.Trace($"Elapsed Timer {CurrRecord?.CodMacchina}");
|
||||
}
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
}
|
||||
OldRecord = CurrRecord;
|
||||
@@ -114,6 +90,7 @@ namespace MP.Mon.Components
|
||||
#region Protected Fields
|
||||
|
||||
protected string baseCss = "sem";
|
||||
|
||||
protected int kaFactor = 60 / 2;
|
||||
|
||||
#endregion Protected Fields
|
||||
@@ -209,11 +186,21 @@ namespace MP.Mon.Components
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static System.Timers.Timer aTimer { get; set; } = null!;
|
||||
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)
|
||||
@@ -246,16 +233,6 @@ namespace MP.Mon.Components
|
||||
string answ = $"{baseCss}{codColore}";
|
||||
if (doAnimate && codColore != "Ve")
|
||||
{
|
||||
#if false
|
||||
// blink se secondo pari...
|
||||
DateTime adesso = DateTime.Now;
|
||||
int resto = 0;
|
||||
Math.DivRem(adesso.Second, 2, out resto);
|
||||
if (resto == 0)
|
||||
{
|
||||
answ += "_b";
|
||||
}
|
||||
#endif
|
||||
if (doBlink)
|
||||
{
|
||||
answ += "_b";
|
||||
@@ -282,7 +259,14 @@ namespace MP.Mon.Components
|
||||
{
|
||||
double cTimeMin = currTimeMin != null ? (double)currTimeMin : 0;
|
||||
tSpan = TimeSpan.FromMinutes(cTimeMin);
|
||||
answ = $"{tSpan:mm}:{tSpan:ss}";
|
||||
if (tSpan.TotalHours < 1)
|
||||
{
|
||||
answ = $"{tSpan:mm}:{tSpan:ss}";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = $"{tSpan.TotalHours:N0}h {tSpan:mm}:{tSpan:ss}";
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
@@ -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>
|
||||
@@ -1,4 +1,5 @@
|
||||
using MP.Data.Conf;
|
||||
using MP.Data;
|
||||
using MP.Data.Conf;
|
||||
using MP.Data.DatabaseModels;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
@@ -18,10 +19,11 @@ namespace MP.Mon.Data
|
||||
_configuration = configuration;
|
||||
|
||||
// setup compoenti REDIS
|
||||
this.redisConn = ConnectionMultiplexer.Connect(_configuration.GetConnectionString("Redis"));
|
||||
this.redisDb = this.redisConn.GetDatabase();
|
||||
//// setup canali pub/sub
|
||||
//actLogPipe = new MessagePipe(redisConn, Constants.ACT_LOG_M_QUEUE);
|
||||
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");
|
||||
@@ -34,12 +36,14 @@ 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
|
||||
@@ -48,11 +52,15 @@ namespace MP.Mon.Data
|
||||
|
||||
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
|
||||
@@ -68,6 +76,14 @@ namespace MP.Mon.Data
|
||||
dbController.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Richiesta attivazione --> sposto avanti 1 minuto il periodo limite x fast running
|
||||
/// </summary>
|
||||
public void doActivate()
|
||||
{
|
||||
fastLimit = DateTime.Now.AddMinutes(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco setup dei tag conf correnti
|
||||
/// </summary>
|
||||
@@ -101,27 +117,29 @@ namespace MP.Mon.Data
|
||||
|
||||
public async Task<List<MappaStatoExpl>> MseGetAll()
|
||||
{
|
||||
int maxAge = 2000;
|
||||
int.TryParse(_configuration.GetValue<string>("ServerConf:maxAge"), out maxAge);
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
List<MappaStatoExpl> result = new List<MappaStatoExpl>();
|
||||
List<MappaStatoExpl>? result = new List<MappaStatoExpl>();
|
||||
// cerco in redis...
|
||||
var rawData = await redisDb.StringGetAsync(redisMseKey);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
RedisValue rawData = await redisDb.StringGetAsync(redisMseKey);
|
||||
if (!string.IsNullOrEmpty($"{rawData}"))
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<List<MappaStatoExpl>>(rawData);
|
||||
result = JsonConvert.DeserializeObject<List<MappaStatoExpl>>($"{rawData}");
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Read from REDIS: {ts.TotalMilliseconds}ms");
|
||||
Log.Debug($"Read from REDIS: {ts.TotalMilliseconds}ms");
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await Task.FromResult(dbController.MseGetAll());
|
||||
result = await Task.FromResult(dbController.MseGetAll(maxAge));
|
||||
// serializzp e salvo...
|
||||
rawData = JsonConvert.SerializeObject(result);
|
||||
await redisDb.StringSetAsync(redisMseKey, rawData, TimeSpan.FromSeconds(2));
|
||||
await redisDb.StringSetAsync(redisMseKey, rawData, TimeSpan.FromMilliseconds(maxAge));
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
Log.Trace($"Read from DB: {ts.TotalMilliseconds}ms");
|
||||
Log.Debug($"Read from DB: {ts.TotalMilliseconds}ms");
|
||||
}
|
||||
if (result == null)
|
||||
{
|
||||
@@ -135,10 +153,21 @@ namespace MP.Mon.Data
|
||||
#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>
|
||||
@@ -156,6 +185,42 @@ namespace MP.Mon.Data
|
||||
|
||||
#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>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>6.15.2207.1217</Version>
|
||||
<Version>6.16.2209.2118</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -30,8 +30,8 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="NLog" Version="5.0.1" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.6.48" />
|
||||
<PackageReference Include="NLog" Version="5.0.4" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.6.66" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
+1
-1
@@ -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>
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
<PageTitle>MP MON</PageTitle>
|
||||
|
||||
<div class="row statusMap mx-1 my-1">
|
||||
|
||||
@if (listMSE == null)
|
||||
{
|
||||
<div class="col-12">
|
||||
|
||||
+85
-58
@@ -1,7 +1,9 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MP.Data;
|
||||
using MP.Data.Conf;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Mon.Data;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
|
||||
namespace MP.Mon.Pages
|
||||
@@ -12,58 +14,23 @@ namespace MP.Mon.Pages
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
#if false
|
||||
fastTimer.Stop();
|
||||
fastTimer.Dispose();
|
||||
slowTimer.Stop();
|
||||
slowTimer.Dispose();
|
||||
#endif
|
||||
disposeTimers();
|
||||
}
|
||||
|
||||
public 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)
|
||||
{
|
||||
doBlink = true;
|
||||
Log.Trace("Elapsed Fast Timer Blink");
|
||||
}
|
||||
else
|
||||
{
|
||||
doBlink = false;
|
||||
await ReloadData();
|
||||
Log.Trace("Elapsed Fast Timer reload");
|
||||
}
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
|
||||
public async void ElapsedSlowTimer(object? source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
listMSE = null;
|
||||
await Task.Delay(1);
|
||||
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);
|
||||
}
|
||||
|
||||
public void StartTimer()
|
||||
{
|
||||
// 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;
|
||||
@@ -94,7 +61,12 @@ namespace MP.Mon.Pages
|
||||
|
||||
protected int slowRefreshMs
|
||||
{
|
||||
get => 1000 * slowRefreshSec;
|
||||
get
|
||||
{
|
||||
// tempo variabile tra +/- 10% del target
|
||||
int answ = rnd.Next(900, 1100) * slowRefreshSec;
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
@@ -185,50 +157,105 @@ namespace MP.Mon.Pages
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await setupConf();
|
||||
await ReloadData();
|
||||
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 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()
|
||||
{
|
||||
fastTimer.Elapsed -= ElapsedFastTimer;
|
||||
fastTimer.Stop();
|
||||
fastTimer.Dispose();
|
||||
slowTimer.Elapsed -= ElapsedSlowTimer;
|
||||
slowTimer.Stop();
|
||||
slowTimer.Dispose();
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
#if DEBUG
|
||||
// hack: legge 4 volte i dati x stressare sistema
|
||||
var singleData = await MMDataService.MseGetAll();
|
||||
listMSE = new List<MappaStatoExpl>();
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
listMSE.AddRange(singleData);
|
||||
}
|
||||
#else
|
||||
listMSE = await MMDataService.MseGetAll();
|
||||
#endif
|
||||
}
|
||||
|
||||
private async Task setupConf()
|
||||
{
|
||||
CurrConfig = await MMDataService.ConfigGetAll();
|
||||
|
||||
+19
-14
@@ -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,24 +29,28 @@
|
||||
<a class="dismiss">🗙</a>
|
||||
</div>
|
||||
|
||||
<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.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()
|
||||
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>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MON MAPO</i>
|
||||
<h4>Versione: 6.15.2207.1217</h4>
|
||||
<h4>Versione: 6.16.2209.2118</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.15.2207.1217
|
||||
6.16.2209.2118
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.15.2207.1217</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>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -11,5 +11,8 @@
|
||||
"MP.Mon": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=Blazor.ServerApp;",
|
||||
"MP.Stats": "Server=SQL2016DEV;Database=MoonPro_STATS; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=Blazor.ServerApp;",
|
||||
"Redis": "localhost:6379,DefaultDatabase=1,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false"
|
||||
},
|
||||
"ServerConf": {
|
||||
"maxAge": "2000"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ a,
|
||||
/* Gestione size caratteri */
|
||||
.mainHead,
|
||||
.logoImg {
|
||||
height: 1.6em;
|
||||
height: 1.5em;
|
||||
}
|
||||
@media all and (min-width: 425px) {
|
||||
.mainHead {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>MP.Prog</RootNamespace>
|
||||
<Version>6.15.2202.2715</Version>
|
||||
<Version>6.15.2209.1609</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo gestione Programmi MAPO</i>
|
||||
<h4>Versione: 6.15.2202.2715</h4>
|
||||
<h4>Versione: 6.15.2209.1609</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.15.2202.2715
|
||||
6.15.2209.1609
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.15.2202.2715</version>
|
||||
<version>6.15.2209.1609</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/MP.Prog.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<CascadingAuthenticationState>
|
||||
<Router AppAssembly="@typeof(App).Assembly">
|
||||
<Found Context="routeData">
|
||||
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
|
||||
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
|
||||
</Found>
|
||||
<NotFound>
|
||||
<PageTitle>Not found</PageTitle>
|
||||
<LayoutView Layout="@typeof(MainLayout)">
|
||||
<p role="alert">Sorry, there's nothing at this address.</p>
|
||||
</LayoutView>
|
||||
</NotFound>
|
||||
</Router>
|
||||
</CascadingAuthenticationState>
|
||||
@@ -0,0 +1 @@
|
||||
<canvas id="@Id"></canvas>
|
||||
@@ -0,0 +1,60 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Data;
|
||||
using MP.SPEC.Data;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace MP.SPEC.Components.Chart
|
||||
{
|
||||
public partial class Doughnut
|
||||
{
|
||||
[Inject]
|
||||
private IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
|
||||
public enum ChartType
|
||||
{
|
||||
Pie,
|
||||
Bar,
|
||||
Doughnut
|
||||
}
|
||||
|
||||
//[Parameter]
|
||||
public string Id { get; set; } = "myChart";
|
||||
|
||||
[Parameter]
|
||||
public ChartType Type { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public double[] Data { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public List<DoughnutStyling> BackgroundColor { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public string[] Labels { get; set; }
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
var config = new
|
||||
{
|
||||
Type = Type.ToString().ToLower(),
|
||||
Options = new
|
||||
{
|
||||
Responsive = true,
|
||||
},
|
||||
Data = new
|
||||
{
|
||||
Datasets = new[]
|
||||
{
|
||||
new { Data = Data, BackgroundColor = BackgroundColor.Select(x=>x.color), borderColor = BackgroundColor.Select(x=>x.border), borderWidth= 0, offset= 1, borderRadius = 0
|
||||
}
|
||||
},
|
||||
Labels = Labels
|
||||
}
|
||||
};
|
||||
|
||||
await JSRuntime.InvokeVoidAsync("setup", Id, config);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<canvas id="@Id"></canvas>
|
||||
@@ -0,0 +1,162 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Data;
|
||||
|
||||
namespace MP.SPEC.Components.Chart
|
||||
{
|
||||
public partial class Line
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public double AspRatio { get; set; } = 0;
|
||||
|
||||
[Parameter]
|
||||
public List<string> backColor { get; set; } = new List<string>();
|
||||
|
||||
[Parameter]
|
||||
public string ChartId
|
||||
{
|
||||
get
|
||||
{
|
||||
return Id;
|
||||
}
|
||||
set
|
||||
{
|
||||
Id = value;
|
||||
}
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public List<chartJsData.chartJsTSerie> DataTS
|
||||
{
|
||||
get
|
||||
{
|
||||
return _DataTS;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_DataTS = value;
|
||||
//var pUpd = Task.Run(async () => await renderChart());
|
||||
//pUpd.Wait();
|
||||
}
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public List<string> Labels { get; set; } = new List<string>();
|
||||
|
||||
[Parameter]
|
||||
public List<string> lineColor { get; set; } = new List<string>();
|
||||
|
||||
[Parameter]
|
||||
public int lTens { get; set; } = 0;
|
||||
|
||||
[Parameter]
|
||||
public string MaxValue { get; set; } = "0";
|
||||
|
||||
[Parameter]
|
||||
public string MinValue { get; set; } = "0";
|
||||
|
||||
[Parameter]
|
||||
public List<string> pointColor { get; set; } = new List<string>();
|
||||
|
||||
[Parameter]
|
||||
public string Title { get; set; } = "Demo Line";
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected string Id { get; set; } = "CurrId";
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Inizializzazione rendering componente
|
||||
///
|
||||
/// partendo da qui: https://www.williamleme.com/posts/2020/003-chartjs-blazor/
|
||||
/// https://www.puresourcecode.com/dotnet/blazor/using-chart-js-with-blazor/ https://www.tutorialsteacher.com/csharp/csharp-anonymous-type
|
||||
/// </summary>
|
||||
/// <param name="firstRender"></param>
|
||||
/// <returns></returns>
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
await renderChart();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inizializzazione rendering componente
|
||||
///
|
||||
/// partendo da qui: https://www.williamleme.com/posts/2020/003-chartjs-blazor/
|
||||
/// https://www.puresourcecode.com/dotnet/blazor/using-chart-js-with-blazor/ https://www.tutorialsteacher.com/csharp/csharp-anonymous-type
|
||||
/// </summary>
|
||||
/// <param name="firstRender"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task renderChart()
|
||||
{
|
||||
// creazione di un oggetto anonymous type con tutte le opzioni da passare a chart.js
|
||||
var config = new
|
||||
{
|
||||
type = "line",
|
||||
options = new
|
||||
{
|
||||
responsive = true,
|
||||
scales = new
|
||||
{
|
||||
yAxes = new
|
||||
{
|
||||
display = true,
|
||||
position = "right",
|
||||
ticks = new
|
||||
{
|
||||
maxTicksLimit = 10
|
||||
},
|
||||
suggestedMin = MinValue != MaxValue ? MinValue : "auto",
|
||||
suggestedMax = MinValue != MaxValue ? MaxValue : "auto"
|
||||
},
|
||||
xAxes = new
|
||||
{
|
||||
type = "time",
|
||||
distribution = "linear",
|
||||
}
|
||||
},
|
||||
plugins = new
|
||||
{
|
||||
legend = new
|
||||
{
|
||||
display = false
|
||||
},
|
||||
},
|
||||
Animation = false,
|
||||
AspectRatio = AspRatio == 0 ? "auto" : $"{AspRatio}"
|
||||
},
|
||||
data = new
|
||||
{
|
||||
labels = Labels,
|
||||
datasets = new[]{new
|
||||
{
|
||||
data = DataTS, pointBorderColor = backColor, borderColor = lineColor, backgroundColor = backColor, fill = true, PointRadius = 2, BorderWidth = 1, lineTension = lTens, stepped = false, label = Title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
;
|
||||
await JSRuntime.InvokeVoidAsync("setup", Id, config);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private List<chartJsData.chartJsTSerie> _DataTS { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
private IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
#endregion Private Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<div class="row text-light">
|
||||
<div class="col-5 pe-0 text-left">
|
||||
<b>Mapo SPEC @(DateTime.Today.Year)</b> | <span class="small">v.@version</span>
|
||||
</div>
|
||||
<div class="col-7 ps-0 text-end">
|
||||
<span class="small">@($"{DateTime.Now:HH:mm:ss}")</span> | <a class="text-light" href="https://www.egalware.com/" target="_blank"><img class="img-fluid" width="16" src="images/LogoEgw.png" /> Egalware </a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
using NLog;
|
||||
|
||||
namespace MP.SPEC.Components
|
||||
{
|
||||
public partial class CmpFooter
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
aTimer.Elapsed -= ElapsedTimer;
|
||||
aTimer.Stop();
|
||||
aTimer.Dispose();
|
||||
}
|
||||
|
||||
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
|
||||
public void StartTimer()
|
||||
{
|
||||
int tOutPeriod = 5000;
|
||||
//int.TryParse(Configuration["ReloadStatusTimer"], out tOutPeriod);
|
||||
aTimer = new System.Timers.Timer(tOutPeriod);
|
||||
aTimer.Elapsed += ElapsedTimer;
|
||||
aTimer.Enabled = true;
|
||||
aTimer.Start();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
version = typeof(Program).Assembly.GetName().Version;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static System.Timers.Timer aTimer = null!;
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private Version version = null!;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
@using MP.SPEC.Components
|
||||
@using MP.SPEC.Data
|
||||
@using System.Security.Claims
|
||||
@using Microsoft.AspNetCore.Components.Authorization
|
||||
|
||||
@inject AuthenticationStateProvider AuthenticationStateProvider
|
||||
@inject MessageService MService
|
||||
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
<div class="px-2">
|
||||
<i class="fas fa-user-alt"></i> <b>@userName</b>
|
||||
</div>
|
||||
<div class="px-2 flex-grow-1 text-end">
|
||||
<span class="text-secondary">@TipoSearch</span>
|
||||
</div>
|
||||
<div class="px-2 text-end">
|
||||
@if (ShowSearch)
|
||||
{
|
||||
<SearchMod></SearchMod>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
protected bool ShowSearch
|
||||
{
|
||||
get => MService.ShowSearch;
|
||||
set => MService.ShowSearch = value;
|
||||
}
|
||||
|
||||
private string userName = "";
|
||||
|
||||
private string TipoSearch
|
||||
{
|
||||
get => MService.TipoSearch;
|
||||
set => MService.TipoSearch = value;
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
MService.EA_ShowSearch += MService_EA_ShowSearch;
|
||||
await forceReload();
|
||||
}
|
||||
private async void MService_EA_ShowSearch()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
}
|
||||
|
||||
private async Task forceReload()
|
||||
{
|
||||
|
||||
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
|
||||
var user = authState.User;
|
||||
|
||||
if (user.Identity != null&& user.Identity.IsAuthenticated)
|
||||
{
|
||||
userName = $"{user.Identity.Name}";
|
||||
}
|
||||
else
|
||||
{
|
||||
userName = "N.A.";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<div class="row">
|
||||
<div class="col-12 col-lg-8 text-left">
|
||||
<div class="row">
|
||||
<div class="col-12 small">
|
||||
@if (totalCount > 0)
|
||||
{
|
||||
<ul class="pagination pagination-sm mb-1">
|
||||
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(1)"><i class="fas fa-angle-double-left"></i></button></li>
|
||||
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(prevBlock)"><i class="fas fa-angle-left"></i></button></li>
|
||||
@for (int i = @startPage; i <= endPage; ++i)
|
||||
{
|
||||
var pageNum = i;
|
||||
<li class="page-item @cssActive(pageNum)"><button class="page-link" @onclick="() => PaginationItemClick(pageNum)">@pageNum</button></li>
|
||||
}
|
||||
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(nextBlock)"><i class="fas fa-angle-right"></i></button></li>
|
||||
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(LastPage)"><i class="fas fa-angle-double-right"></i></button></li>
|
||||
</ul>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 small">
|
||||
@if (showLoading)
|
||||
{
|
||||
<div class="progress" style="height: 10px;">
|
||||
<div class="progress-bar progress-bar-striped progress-bar-animated" style="width:@percLoading%;"></div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-4">
|
||||
<div class="d-flex">
|
||||
<div class="p-1 flex-fill">
|
||||
@if (!showLoading)
|
||||
{
|
||||
<span>@totalCount records</span>
|
||||
}
|
||||
</div>
|
||||
<div class="p-1 small">
|
||||
@if (totalCount > 0)
|
||||
{
|
||||
<div class="input-group input-group-sm">
|
||||
<select @bind="@PageSize" class="form-select form-select-sm text-end">
|
||||
<option value="5">5</option>
|
||||
<option value="10">10</option>
|
||||
<option value="25">25</option>
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,198 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace MP.SPEC.Components
|
||||
{
|
||||
public partial class DataPager : ComponentBase
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public int currPage
|
||||
{
|
||||
get
|
||||
{
|
||||
return _numPage;
|
||||
}
|
||||
set
|
||||
{
|
||||
bool doReport = !_numPage.Equals(value);
|
||||
if (doReport)
|
||||
{
|
||||
_numPage = value;
|
||||
reportChangePage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<int> numPageChanged { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<int> numRecordChanged { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public int PageSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return _numRecord;
|
||||
}
|
||||
set
|
||||
{
|
||||
bool doReport = !_numRecord.Equals(value);
|
||||
if (doReport)
|
||||
{
|
||||
_numRecord = value;
|
||||
reportChange();
|
||||
resetCurrPage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public bool showLoading
|
||||
{
|
||||
get
|
||||
{
|
||||
return _showLoading;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
Random random = new Random();
|
||||
percLoading = random.Next(30, 90);
|
||||
}
|
||||
else
|
||||
{
|
||||
percLoading = 5;
|
||||
}
|
||||
_showLoading = value;
|
||||
}
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public int totalCount { get; set; } = 0;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public async Task resetCurrPage()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
currPage = 1;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected bool _showLoading = false;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected int _numPage { get; set; } = 1;
|
||||
|
||||
protected int _numRecord { get; set; } = 10;
|
||||
|
||||
protected int percLoading { get; set; } = 0;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected string cssActive(int numPage)
|
||||
{
|
||||
string answ = "";
|
||||
if (numPage == currPage)
|
||||
{
|
||||
answ = "active";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Task.Run(() => showLoading = false);
|
||||
}
|
||||
|
||||
protected void PaginationItemClick(int page)
|
||||
{
|
||||
currPage = page;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int endPage
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = (int)(currPage / numPages) * numPages + numPages;
|
||||
answ = answ < LastPage ? answ : LastPage;
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
private int LastPage
|
||||
{
|
||||
get
|
||||
{
|
||||
return Math.Max((int)Math.Ceiling(totalCount / (double)PageSize), 1);
|
||||
}
|
||||
}
|
||||
|
||||
private int nextBlock
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = currPage + numPages;
|
||||
answ = answ < LastPage ? answ : LastPage;
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
private int numPages { get; set; } = 10;
|
||||
|
||||
private int prevBlock
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = currPage - numPages;
|
||||
answ = answ > 0 ? answ : 1;
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
// calcola un set 1 .. numPages centrato sulla pagina corrente...
|
||||
private int startPage
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = (int)(currPage / numPages) * numPages;
|
||||
answ = answ > 0 ? answ : 1;
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void reportChange()
|
||||
{
|
||||
numRecordChanged.InvokeAsync(PageSize);
|
||||
}
|
||||
|
||||
private void reportChangePage()
|
||||
{
|
||||
numPageChanged.InvokeAsync(currPage);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<div class="d-flex justify-content-end">
|
||||
<a class="pt-2 text-dark" data-bs-toggle="offcanvas" data-bs-target="#paramsFilterExample" aria-controls="paramsFilterExample">
|
||||
<i class="fa-solid fa-bars"></i>
|
||||
</a>
|
||||
<div class="offcanvas offcanvas-end" tabindex="-1" id="paramsFilterExample" aria-labelledby="paramsFilterExampleLabel">
|
||||
<div class="offcanvas-header">
|
||||
<h3 class="offcanvas-title" id="paramsFilterExampleLabel"><b>FILTRI</b></h3>
|
||||
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="offcanvas-body">
|
||||
<div>
|
||||
Seleziona i filtri per:
|
||||
</div>
|
||||
<div class="small mt-2">
|
||||
<label class="px-2" for="dtMin" title="Selezionare inizio periodo">Articolo</label>
|
||||
</div>
|
||||
<div class="input-group p-2">
|
||||
<label class="input-group-text" for="macchina" title="Selezionare l'articolo"><i class="fa-solid fa-file"></i></label>
|
||||
<select @bind="@selArticolo" class="form-select" id="macchina" title="Selezionare la macchina">
|
||||
<option value="*">--- Tutti ---</option>
|
||||
@if (ListArticoli != null)
|
||||
{
|
||||
foreach (var item in ListArticoli)
|
||||
{
|
||||
<option value="@item">@item</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="small mt-2">
|
||||
<label class="px-2" for="dtMin" title="Selezionare inizio periodo">Macchina</label>
|
||||
</div>
|
||||
<div class="input-group p-2">
|
||||
<label class="input-group-text" for="macchina" title="Selezionare la macchina"><i class="fa-solid fa-hard-drive"></i></label>
|
||||
<select @bind="@selMacchina" class="form-select" id="macchina" title="Selezionare la macchina">
|
||||
<option value="*">--- Tutti ---</option>
|
||||
@if (ListMacchine != null)
|
||||
{
|
||||
foreach (var item in ListMacchine)
|
||||
{
|
||||
<option value="@item">@item</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="small mt-2">
|
||||
<label class="px-2" for="dtMin" title="Selezionare inizio periodo">Inizio Periodo</label>
|
||||
</div>
|
||||
<div class="px-2 input-group">
|
||||
<label class="input-group-text" for="dtMin" title="Selezionare inizio periodo"><i class="fa-regular fa-calendar-minus"></i></label>
|
||||
<input class="form-control" @bind="@selDtMin" id="dtMin" type="datetime-local" title="Data minima eventi da visualizzare">
|
||||
</div>
|
||||
<div class="small mt-2">
|
||||
<label class="px-2" for="dtMax" title="Selezionare fine periodo">Fine Periodo</label>
|
||||
</div>
|
||||
<div class="px-2 input-group">
|
||||
<label class="input-group-text" for="dtMax" title="Selezionare fine periodo"><i class="fa-regular fa-calendar-plus"></i></label>
|
||||
<input class="form-control" @bind="@selDtMax" id="dtMax" type="datetime-local" title="Selezionare fine periodo">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MP.SPEC.Data;
|
||||
|
||||
namespace MP.SPEC.Components
|
||||
{
|
||||
public partial class DossiersFilter
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<SelectDossierParams> FilterChanged { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public SelectDossierParams SelFilterDossier { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected MpDataService MDService { get; set; } = null!;
|
||||
|
||||
protected string selArticolo
|
||||
{
|
||||
get
|
||||
{
|
||||
return SelFilterDossier.CodArticolo;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!SelFilterDossier.CodArticolo.Equals(value))
|
||||
{
|
||||
SelFilterDossier.CurrPage = 1;
|
||||
SelFilterDossier.CodArticolo = value;
|
||||
StateHasChanged();
|
||||
Task.Delay(1);
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected DateTime selDtMax
|
||||
{
|
||||
get
|
||||
{
|
||||
return SelFilterDossier.DtEnd;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (!SelFilterDossier.DtEnd.Equals(value))
|
||||
{
|
||||
SelFilterDossier.DtEnd = value;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected DateTime selDtMin
|
||||
{
|
||||
get
|
||||
{
|
||||
return SelFilterDossier.DtStart;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (!SelFilterDossier.DtStart.Equals(value))
|
||||
{
|
||||
SelFilterDossier.DtStart = value;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected string selMacchina
|
||||
{
|
||||
get
|
||||
{
|
||||
return SelFilterDossier.IdxMacchina;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!SelFilterDossier.IdxMacchina.Equals(value))
|
||||
{
|
||||
SelFilterDossier.CurrPage = 1;
|
||||
SelFilterDossier.IdxMacchina = value;
|
||||
StateHasChanged();
|
||||
Task.Delay(1);
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected int selMaxRecord
|
||||
{
|
||||
get
|
||||
{
|
||||
return SelFilterDossier.MaxRecord;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (!SelFilterDossier.MaxRecord.Equals(value))
|
||||
{
|
||||
SelFilterDossier.MaxRecord = value;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected bool showParam { get; set; } = false;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
SelFilterDossier = new SelectDossierParams();
|
||||
DateTime dtEnd = SelFilterDossier.DtEnd;
|
||||
DateTime dtStart = dtEnd.Subtract(SelFilterDossier.DtStart).TotalDays < 15 ? SelFilterDossier.DtStart : dtEnd.AddDays(-14);
|
||||
ListMacchine = await MDService.MacchineWithFlux(dtStart, dtEnd);
|
||||
ListArticoli = await MDService.ArticleWithDossier();
|
||||
await FilterChanged.InvokeAsync(SelFilterDossier);
|
||||
}
|
||||
|
||||
protected void toggleParams()
|
||||
{
|
||||
showEditPar = !showEditPar;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private List<string>? ListArticoli = null;
|
||||
private List<string>? ListMacchine = null;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private bool showEditPar { get; set; } = false;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void reportChange()
|
||||
{
|
||||
FilterChanged.InvokeAsync(SelFilterDossier);
|
||||
}
|
||||
|
||||
private void toggleShowParams()
|
||||
{
|
||||
showParam = !showParam;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
@using MP.SPEC.Components
|
||||
@using MP.SPEC.Data
|
||||
|
||||
|
||||
|
||||
|
||||
@if (ListRecords == null)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
else if (totalCount == 0)
|
||||
{
|
||||
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (currFluxLogDto != null)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card mb-5">
|
||||
<div class="card-header bg-primary text-light d-flex justify-content-between">
|
||||
<div>
|
||||
Modifica Parametro
|
||||
</div>
|
||||
<div>
|
||||
@if (isEditing)
|
||||
{
|
||||
<span class="text-light">PENDING CHANGES...</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-3 pe-0">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text" id="inputGroup-sizing-sm">MACCHINA</span>
|
||||
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currFluxLogDto.IdxMacchina">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3 pe-0">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text" id="inputGroup-sizing-sm">DATA</span>
|
||||
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currFluxLogDto.dtEvento">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3 pe-0">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text" id="inputGroup-sizing-sm">DATA TYPE</span>
|
||||
<input type="text" class="form-control" disabled aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currFluxLogDto.CodFlux">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3 pe-0">
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-text" id="inputGroup-sizing-sm">VALORE</span>
|
||||
<input type="text" class="form-control" aria-label="Art search" aria-describedby="inputGroup-sizing-sm" @bind-value="@currFluxLogDto.ValoreEdit" @onclick="()=> enableEditing()">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row pt-4" style="visibility: @css()">
|
||||
<div class="col-3 pe-0">
|
||||
</div>
|
||||
<div class="col-3 pe-0">
|
||||
</div>
|
||||
<div class="col-3 pe-0">
|
||||
<div class="d-grid gap-2">
|
||||
<button @onclick="() => cancel()" class="btn btn-warning">Annulla <i class="bi bi-x-circle"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3 pe-0">
|
||||
<div class="d-grid gap-2">
|
||||
<button @onclick="() => update(currFluxLogDto)" class="btn btn-success">Save <i class="bi bi-save"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="row">
|
||||
<div class="d-flex justify justify-content-between">
|
||||
<table class="table table-sm table-striped small">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<button @onclick="() => closeTableFlux()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
|
||||
</th>
|
||||
<th><i class="fa-solid fa-file"></i> Articolo</th>
|
||||
<th><i class="fa-solid fa-screwdriver-wrench"></i> Fase</th>
|
||||
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
|
||||
<th><i class="fa-regular fa-calendar-days"></i> Data Snap</th>
|
||||
<th><i class="fa-solid fa-sliders"></i> ODL</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr class="@checkSelect(@record)">
|
||||
<td>
|
||||
@if (isEditing == false)
|
||||
{
|
||||
|
||||
<button class="btn btn-primary btn-sm" @onclick="() => selRecord(record)"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-secondary btn-sm disabled"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@record.OdlNav.CodArticolo
|
||||
<div class="small textConsensed text-secondary">@record.OdlNav.ArticoloNav.DescArticolo</div>
|
||||
</td>
|
||||
<td>
|
||||
@tradFase(record.OdlNav.KeyRichiesta)
|
||||
</td>
|
||||
<td>
|
||||
@record.IdxMacchina
|
||||
<div class="small textConsensed text-secondary">@record.MachineNav.Descrizione</div>
|
||||
</td>
|
||||
<td>
|
||||
@record.DtRif
|
||||
</td>
|
||||
<td>
|
||||
@record.IdxODL
|
||||
</td>
|
||||
<td>
|
||||
@if (isEditing == false)
|
||||
{
|
||||
|
||||
<button @onclick="() => deleteRecord(record)" class="btn btn-danger btn-sm"><i class="bi bi-trash-fill"></i></button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-secondary btn-sm disabled"><i class="bi bi-trash-fill"></i></button>
|
||||
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@if (!visualizzaFlux)
|
||||
{
|
||||
if (listaFlux == null)
|
||||
{
|
||||
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="table selBlock p-2">
|
||||
<table class="table table-light table-sm table-striped small mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<button class="btn btn-info" @onclick="() => closeTableFlux()"><i class="fa-solid fa-xmark"></i></button>
|
||||
</th>
|
||||
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
|
||||
<th><i class="fa-regular fa-calendar-days"></i> Data</th>
|
||||
<th><i class="fa-solid fa-sliders"></i> Data Type</th>
|
||||
<th style="text-align: right;">
|
||||
<span class="col-11"> Valore </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in listaFlux)
|
||||
{
|
||||
<tr class="@checkSelPar(@record)">
|
||||
<td>
|
||||
<button @onclick="() => editRecord(record)" class="btn btn-primary btn-sm" title="Modifica Record"><i class="bi bi-pencil-square"></i></button>
|
||||
</td>
|
||||
<td>
|
||||
@record.IdxMacchina
|
||||
</td>
|
||||
<td>
|
||||
@record.dtEvento
|
||||
</td>
|
||||
<td>
|
||||
@record.CodFlux
|
||||
</td>
|
||||
<td style="text-align: right;">
|
||||
@if (record.ValoreEdit != record.Valore)
|
||||
{
|
||||
<div title="Valore Modificato"><span class="small text-dark"></span><b>@record.ValoreEdit</b></div>
|
||||
<div class="small text-secondary" title="Valore Registrato">(<i>@record.Valore</i>)</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div><span class="small text-dark"></span>@record.ValoreEdit</div>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,339 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.DTO;
|
||||
using MP.SPEC.Data;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace MP.SPEC.Components
|
||||
{
|
||||
public partial class ListDossiers : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<Dossiers> RecordSel { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<FluxLogDTO> RecordSelFlux { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public SelectDossierParams SelFilter { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<int> TotRecordChanged { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
private FluxLogDTO? currFluxLogDto = null;
|
||||
|
||||
|
||||
public string checkSelPar(FluxLogDTO recordSel)
|
||||
{
|
||||
string answ = "";
|
||||
if (currFluxLogDto != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = (currFluxLogDto.CodFlux == recordSel.CodFlux && currFluxLogDto.dtEvento == recordSel.dtEvento) ? "table-info" : "";
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public string checkSelect(Dossiers recordSel)
|
||||
{
|
||||
string answ = "";
|
||||
if (currRecord != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = (currRecord.IdxMacchina == recordSel.IdxMacchina && currRecord.DtRif == recordSel.DtRif) ? "table-info" : "";
|
||||
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
currRecord = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
GC.Collect();
|
||||
}
|
||||
private SelectDossierParams lastFilter { get; set; } = new SelectDossierParams() { CurrPage = -1 };
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
if (!lastFilter.Equals(SelFilter))
|
||||
{
|
||||
lastFilter = SelFilter.clone();
|
||||
await reloadData(true);
|
||||
}
|
||||
}
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected MpDataService MDService { get; set; } = null!;
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazione record selezionato (previa conferma)
|
||||
/// </summary>
|
||||
/// <param name="selRec"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task deleteRecord(Dossiers selRec)
|
||||
{
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Eliminazione Dossier: sei sicuro di voler procedere?"))
|
||||
return;
|
||||
await Task.Delay(1);
|
||||
var done = await MDService.DossiersDeleteRecord(selRec);
|
||||
currRecord = null;
|
||||
await reloadData(true);
|
||||
visualizzaFlux = true;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
protected async Task editRecord(FluxLogDTO selRec)
|
||||
{
|
||||
currFluxLogDto = selRec;
|
||||
// indico record selezionato
|
||||
await RecordSelFlux.InvokeAsync(selRec);
|
||||
}
|
||||
|
||||
private void enableEditing()
|
||||
{
|
||||
isEditing = true;
|
||||
}
|
||||
|
||||
protected async Task cancel()
|
||||
{
|
||||
var alert = await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler annullare TUTTE le modifiche? i dati saranno ricaricati.");
|
||||
if (alert)
|
||||
{
|
||||
currFluxLogDto = null;
|
||||
isEditing = false;
|
||||
await Task.Delay(1);
|
||||
listaFlux = MDService.getFluxLog(currRecord.Valore);
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task update(FluxLogDTO selRec)
|
||||
{
|
||||
var alert = await JSRuntime.InvokeAsync<bool>("confirm", "Confermi di voler salvare TUTTE le modifiche? queste saranno parte del dossier inviato all'impianto");
|
||||
|
||||
if (alert)
|
||||
{
|
||||
|
||||
await Task.Delay(1);
|
||||
if (currRecord != null)
|
||||
{
|
||||
// serializzo valore x flux log...
|
||||
DossierFluxLogDTO updatedResult = new DossierFluxLogDTO() { ODL = listaFlux };
|
||||
string newVal = JsonConvert.SerializeObject(updatedResult);
|
||||
currRecord.Valore = newVal;
|
||||
// METODO PER UPDATE FLUX
|
||||
await MDService.DossiersUpdateValore(currRecord);
|
||||
currFluxLogDto = null;
|
||||
isEditing = false;
|
||||
await Task.Delay(1);
|
||||
StateHasChanged();
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
currFluxLogDto = null;
|
||||
await Task.Delay(1);
|
||||
await JSRuntime.InvokeAsync<bool>("location.reload");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ListStati = await MDService.AnagStatiComm();
|
||||
await reloadData(true);
|
||||
}
|
||||
|
||||
protected async void OnSeachUpdated()
|
||||
{
|
||||
await InvokeAsync(() =>
|
||||
{
|
||||
currPage = 1;
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
|
||||
protected async Task selRecord(Dossiers selRec)
|
||||
{
|
||||
currRecord = selRec;
|
||||
await RecordSel.InvokeAsync(selRec);
|
||||
listaFlux = MDService.getFluxLog(selRec.Valore);
|
||||
await toggleTableFlux();
|
||||
}
|
||||
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
currRecord = null;
|
||||
await reloadData(true);
|
||||
}
|
||||
private string css()
|
||||
{
|
||||
string answ = "";
|
||||
if (isEditing)
|
||||
{
|
||||
answ = "visible";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "hidden";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private int _totalCount = 0;
|
||||
|
||||
private Dossiers? currRecord = null;
|
||||
|
||||
private FluxLogDTO? currRecordFlux;
|
||||
private List<Dossiers>? ListRecords;
|
||||
private List<ListValues>? ListStati;
|
||||
|
||||
private List<Dossiers>? SearchRecords;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int currPage
|
||||
{
|
||||
get => SelFilter.CurrPage;
|
||||
set => SelFilter.CurrPage = value;
|
||||
}
|
||||
|
||||
private bool isEditing
|
||||
{
|
||||
get => SelFilter.isEditing;
|
||||
set => SelFilter.isEditing = value;
|
||||
}
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
|
||||
private List<FluxLogDTO>? listaFlux { get; set; } = null;
|
||||
|
||||
private int MaxRecord
|
||||
{
|
||||
get => SelFilter.MaxRecord;
|
||||
}
|
||||
|
||||
private int numRecord
|
||||
{
|
||||
get => SelFilter.NumRec;
|
||||
set => SelFilter.NumRec = value;
|
||||
}
|
||||
|
||||
private string SelArticolo
|
||||
{
|
||||
get => SelFilter.CodArticolo;
|
||||
}
|
||||
|
||||
private DateTime SelDtEnd
|
||||
{
|
||||
get => SelFilter.DtEnd;
|
||||
}
|
||||
private DateTime SelDtStart
|
||||
{
|
||||
get => SelFilter.DtStart;
|
||||
}
|
||||
|
||||
private string SelMacchina
|
||||
{
|
||||
get => SelFilter.IdxMacchina;
|
||||
}
|
||||
|
||||
private int totalCount
|
||||
{
|
||||
get => _totalCount;
|
||||
set
|
||||
{
|
||||
if (_totalCount != value)
|
||||
{
|
||||
_totalCount = value;
|
||||
TotRecordChanged.InvokeAsync(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool visualizzaFlux { get; set; } = true;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async Task reloadData(bool setChanged)
|
||||
{
|
||||
isLoading = true;
|
||||
SearchRecords = await MDService.DossiersGetLastFilt(SelMacchina, SelArticolo, SelDtStart, SelDtEnd);
|
||||
totalCount = SearchRecords.Count;
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
if (setChanged)
|
||||
{
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
}
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
private async Task toggleTableFlux()
|
||||
{
|
||||
visualizzaFlux = false;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
private string tradFase(string codFase)
|
||||
{
|
||||
string answ = codFase;
|
||||
if (ListStati != null && ListStati.Count > 0)
|
||||
{
|
||||
var recSel = ListStati.FirstOrDefault(x => x.value == codFase);
|
||||
if (recSel != null)
|
||||
{
|
||||
answ = recSel.label;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
private async Task closeTableFlux()
|
||||
{
|
||||
currFluxLogDto = null;
|
||||
currRecord = null;
|
||||
visualizzaFlux = true;
|
||||
isEditing = false;
|
||||
await RecordSelFlux.InvokeAsync(currFluxLogDto);
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,266 @@
|
||||
@using MP.SPEC.Components
|
||||
@using MP.SPEC.Data
|
||||
|
||||
@if (ListRecords == null)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
else if (totalCount == 0)
|
||||
{
|
||||
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
@if (currRecord != null && !showStats && isCurrOdl)
|
||||
{
|
||||
<div class="col-6 col-lg-8">
|
||||
<button @onclick="() => forceSyncDb()" class="btn btn-success btn-sm btn-">Forza sync dati ODL <i class="bi bi-fast-forward-circle"></i></button>
|
||||
</div>
|
||||
<div class="col-6 col-lg-4 text-end">
|
||||
@*<div class="px-2 input-group" title="Selezionare Data-Ora chiusura ODL">
|
||||
<label class="input-group-text" for="dtMax"><i class="fa-regular fa-calendar-minus"></i></label>
|
||||
<input class="form-control" @bind="@selDtFine" id="dtMax" type="datetime-local">
|
||||
<button @onclick="() => chiudiOdl()" class="btn btn-danger btn-sm btn-">Registra chiusura ODL <i class="far fa-stop-circle"></i></button>
|
||||
</div>*@
|
||||
<button @onclick="() => chiudiOdl()" class="btn btn-danger btn-sm btn-">Registra chiusura ODL <i class="far fa-stop-circle"></i></button>
|
||||
</div>
|
||||
}
|
||||
<div class="col-12">
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<button @onclick="() => resetSel()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
|
||||
</th>
|
||||
<th><i class="fa-solid fa-file"></i> Articolo</th>
|
||||
<th><i class="fa-solid fa-screwdriver-wrench"></i> Fase</th>
|
||||
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
|
||||
<th><i class="fa-solid fa-circle-info"></i> Info ciclo</th>
|
||||
<th><i class="fa-solid fa-calendar-day"></i> Periodo</th>
|
||||
<th title="Durata in ore:min"><i class="fa-solid fa-clock"></i> Durata</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr class="@checkSelect(@record.IdxOdl)">
|
||||
|
||||
<td>
|
||||
@if (isCurrOdl)
|
||||
{
|
||||
<button class="btn btn-primary btn-sm" @onclick="() => selRecord(record)"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-secondary btn-sm disabled"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@record.CodArticolo
|
||||
<div class="small textConsensed text-secondary">@record.ArticoloNav.DescArticolo</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
@tradFase(record.KeyRichiesta)
|
||||
</div>
|
||||
@if (record.Note != "")
|
||||
{
|
||||
<div class="small textConsensed text-secondary badge text-bg-light border border-secondary rounded">
|
||||
<b class="text-dark"></b> <span class="text-wrap text-start"> @record.Note </span>
|
||||
</div>
|
||||
}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@record.IdxMacchina
|
||||
<div class="small textConsensed text-secondary">@record.MachineNav.Descrizione</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="small textConsensed"><b>N° pezzi:</b> @record.NumPezzi</div>
|
||||
<div class="small textConsensed"><b>T. Ciclo:</b> @record.Tcassegnato.ToString("N3")</div>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<div class="small d-flex justify-content-between">
|
||||
<div>
|
||||
<div><b>@($"{@record.DataInizio:yyyy/MM/dd}")</b></div>
|
||||
<div>@($"{@record.DataInizio:ddd HH:mm:ss}")</div>
|
||||
</div>
|
||||
<div class="p-0">
|
||||
<i class="fa-solid fa-angles-right"></i>
|
||||
</div>
|
||||
<div>
|
||||
@if (@record.DataFine != null)
|
||||
{
|
||||
<div><b>@($"{@record.DataFine:yyyy/MM/dd}")</b></div>
|
||||
<div>@($"{@record.DataFine:ddd HH:mm:ss}")</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="text-secondary">
|
||||
<div><b>@($"{DateTime.Now:yyyy/MM/dd}")</b></div>
|
||||
<div>@($"{DateTime.Now:ddd HH:mm:ss}")</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<b>@record.DurataMinuti</b>
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn btn-sm btn-primary py-0" type="button" @onclick="() => selectStatRecord(record)" data-bs-toggle="modal" data-bs-target="#myModal" title="Mostra statistiche"><i class="fa-solid fa-chart-pie"></i></button>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="modal fade" id="myModal" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-xl">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-primary col-12">
|
||||
@if (statRecord != null)
|
||||
{
|
||||
<div class="col-3">
|
||||
<b class="modal-title fs-1" id="staticBackdropLabel"><b>ODL @statRecord.IdxOdl</b></b>
|
||||
</div>
|
||||
<div class="col-6 fs-5">
|
||||
<b>@statRecord.CodArticolo</b>
|
||||
<div class="small textConsensed text-light">@statRecord.ArticoloNav.DescArticolo</div>
|
||||
</div>
|
||||
<div class="col-2 fs-5">
|
||||
<b>@statRecord.IdxMacchina</b>
|
||||
<div class="small textConsensed text-light">@statRecord.MachineNav.Descrizione</div>
|
||||
</div>
|
||||
}
|
||||
<div class="col-1 text-end">
|
||||
<button type="button" class="btn btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body col-12">
|
||||
@if (statRecord != null && showStats)
|
||||
{
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="col-8">
|
||||
<div>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 270px">
|
||||
<div class="small textConsensed"><b>N° pezzi:</b> @statRecord.NumPezzi</div>
|
||||
<div class="small textConsensed"><b>T. Ciclo:</b> @statRecord.Tcassegnato.ToString("N3")</div>
|
||||
</td>
|
||||
<td style="width: 300px">
|
||||
<div class="small d-flex justify-content-between">
|
||||
<div>
|
||||
<div><b>@($"{@statRecord.DataInizio:yyyy/MM/dd}")</b></div>
|
||||
<div>@($"{@statRecord.DataInizio:ddd HH:mm:ss}")</div>
|
||||
</div>
|
||||
<div class="p-0">
|
||||
<i class="fa-solid fa-angles-right"></i>
|
||||
</div>
|
||||
<div>
|
||||
@if (@statRecord.DataFine != null)
|
||||
{
|
||||
<div><b>@($"{@statRecord.DataFine:yyyy/MM/dd}")</b></div>
|
||||
<div>@($"{@statRecord.DataFine:ddd HH:mm:ss}")</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="text-secondary">
|
||||
<div><b>@($"{DateTime.Now:yyyy/MM/dd}")</b></div>
|
||||
<div>@($"{DateTime.Now:ddd HH:mm:ss}")</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div>
|
||||
@tradFase(statRecord.KeyRichiesta)
|
||||
</div>
|
||||
@if (statRecord.Note != "")
|
||||
{
|
||||
<div class="small textConsensed text-secondary badge text-bg-light border border-secondary rounded">
|
||||
<b class="text-dark"></b> <span class="text-wrap text-start"> @statRecord.Note </span>
|
||||
</div>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-text">
|
||||
<span class="me-1 @leftStringCSS">Tutti gli Stati</span>
|
||||
<span class="form-check form-check-sm form-switch py-1" title="Mostra/Nascondi macchina spenta">
|
||||
<input class="form-check-input" type="checkbox" id="switchSpenta" @onchange="() => toggleSpenta()" value="@hideSpenta">
|
||||
</span>
|
||||
<span class="@rightStringCSS">Nascondi Spenta</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
@if (statRecord != null)
|
||||
{
|
||||
@if (ListOdlStatsAct != null)
|
||||
{
|
||||
@foreach (var stat in ListOdlStatsAct)
|
||||
{
|
||||
<div class="p-1">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="text-uppercase">
|
||||
@stat.Descrizione
|
||||
</div>
|
||||
<div>
|
||||
<b>@(formDurata(stat.TotDurata))</b>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="progress">
|
||||
<div class="progress-bar @colorChanger(@stat.Css)" role="progressbar" aria-valuenow="0" aria-valuemin="0" style="width: @Math.Round(calcolaPerc(stat.TotDurata),0)%; background-color:@pbStyle(@stat.Css);" aria-valuemax="100">@($"{calcolaPerc(stat.TotDurata):N1}%")</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 dcContainer">
|
||||
@if (statRecord != null && ListOdlStats != null)
|
||||
{
|
||||
<div class="dcBox">
|
||||
<ODLPlot SelectedOdl="@statRecord.IdxOdl" hideSpenta="@hideSpenta"></ODLPlot>
|
||||
</div>
|
||||
<div class="dcBox dcOverlay d-flex">
|
||||
<div class="align-self-center text-center w-100">
|
||||
<b class="fs-3">@durataFilt</b>
|
||||
@*<b class="fs-3">@statRecord.DurataMinuti</b>*@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,437 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.SPEC.Data;
|
||||
using MP.SPEC.Services;
|
||||
using NLog;
|
||||
|
||||
namespace MP.SPEC.Components
|
||||
{
|
||||
public partial class ListODL : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public SelectOdlParams currFilter { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> PagerResetReq { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<int> updateRecordCount { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public string checkSelect(int IdxOdl)
|
||||
{
|
||||
string answ = "";
|
||||
if (currRecord != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = (currRecord.IdxOdl == IdxOdl) ? "table-info" : "";
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
currRecord = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
ListStati = null;
|
||||
ListOdlStats = null;
|
||||
ListOdlStatsNetto = null;
|
||||
statRecord = null;
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
public string formDurata(double durataMin)
|
||||
{
|
||||
return MP.Data.Utils.FormDurata(durataMin);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected MpDataService MDService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected IOApiService MpIoApiCall { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Registra chiusura ODL alla data indicata
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected async Task chiudiOdl()
|
||||
{
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Sei sicuro di voler chiudere l'ODL corrente?"))
|
||||
return;
|
||||
|
||||
if (currRecord != null)
|
||||
{
|
||||
// effettua chiusura sul DB
|
||||
await MDService.ODLClose(currRecord.IdxOdl, currRecord.IdxMacchina, 0, true);
|
||||
Log.Info($"Effettuata chiusura ODL {currRecord.IdxOdl}");
|
||||
// ricarica...
|
||||
await selRecord(null);
|
||||
}
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected string colorChanger(string colorCSS)
|
||||
{
|
||||
string answ = "";
|
||||
if (colorCSS == "yellow")
|
||||
{
|
||||
answ = "text-dark";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Richiesta invio sync all'IOB-WIN
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected async Task forceSyncDb()
|
||||
{
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Sei sicuro di voler reinviare i dati (Articoli, PODL) all'impianto?"))
|
||||
return;
|
||||
|
||||
if (currRecord != null)
|
||||
{
|
||||
await callSyncDb(currRecord.IdxMacchina);
|
||||
Log.Info($"Richiesto forceSyncDb per idxMacc {currRecord.IdxMacchina}");
|
||||
// ricarica...
|
||||
await selRecord(null);
|
||||
}
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ListStati = await MDService.AnagStatiComm();
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected async void OnSeachUpdated()
|
||||
{
|
||||
await InvokeAsync(() =>
|
||||
{
|
||||
PagerResetReq.InvokeAsync(true);
|
||||
Task task = UpdateData();
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
|
||||
protected async Task resetSel()
|
||||
{
|
||||
await selRecord(null);
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected async Task selectStatRecord(ODLModel? currRec)
|
||||
{
|
||||
showStats = true;
|
||||
await Task.Delay(1);
|
||||
statRecord = currRec;
|
||||
if (currRec != null)
|
||||
{
|
||||
await reloadStatsData(currRec);
|
||||
}
|
||||
else
|
||||
{
|
||||
showStats = false;
|
||||
ListOdlStats = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task selRecord(ODLModel? currRec)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
selDtFine = DateTime.Now;
|
||||
currRecord = currRec;
|
||||
showStats = false;
|
||||
ListOdlStats = null;
|
||||
ListOdlStatsNetto = null;
|
||||
}
|
||||
|
||||
protected async Task toggleSpenta()
|
||||
{
|
||||
hideSpenta = !hideSpenta;
|
||||
await Task.Delay(1);
|
||||
if (statRecord != null)
|
||||
{
|
||||
await reloadStatsData(statRecord);
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
await selRecord(null);
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private ODLModel? currRecord = null;
|
||||
|
||||
private List<StatODLModel>? ListOdlStats;
|
||||
|
||||
private List<StatODLModel>? ListOdlStatsNetto;
|
||||
|
||||
private List<ODLModel>? ListRecords;
|
||||
|
||||
private List<ListValues>? ListStati;
|
||||
|
||||
private List<ODLModel>? SearchRecords;
|
||||
|
||||
private ODLModel? statRecord = null;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int _totalCount { get; set; } = 0;
|
||||
|
||||
private int currPage
|
||||
{
|
||||
get => currFilter.CurrPage;
|
||||
set => currFilter.CurrPage = value;
|
||||
}
|
||||
|
||||
private string durataFilt
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "ND";
|
||||
if (statRecord != null)
|
||||
{
|
||||
if (hideSpenta)
|
||||
{
|
||||
if (ListOdlStatsNetto != null)
|
||||
{
|
||||
var tsDurata = TimeSpan.FromMinutes(ListOdlStatsNetto.Sum(x => x.TotDurata));
|
||||
if (tsDurata.TotalDays < 1)
|
||||
{
|
||||
answ = $"{tsDurata.Hours:00}h {tsDurata.Minutes:00}'";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = $"{tsDurata.Days}gg {tsDurata.Hours:00}h";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = statRecord.DurataMinuti;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
private bool hideSpenta { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Indica se si tratti di ODL correnti
|
||||
/// </summary>
|
||||
private bool isCurrOdl
|
||||
{
|
||||
get => currFilter.IsActive;
|
||||
}
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
|
||||
private string leftStringCSS
|
||||
{
|
||||
get => hideSpenta ? "text-secondary" : "text-dark fw-bold";
|
||||
}
|
||||
|
||||
private List<StatODLModel>? ListOdlStatsAct
|
||||
{
|
||||
get
|
||||
{
|
||||
List<StatODLModel> answ = new List<StatODLModel>();
|
||||
if (hideSpenta)
|
||||
{
|
||||
answ = ListOdlStatsNetto;
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = ListOdlStats;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
private int numRecord
|
||||
{
|
||||
get => currFilter.NumRec;
|
||||
set => currFilter.NumRec = value;
|
||||
}
|
||||
|
||||
private string rightStringCSS
|
||||
{
|
||||
get => hideSpenta ? "text-dark fw-bold" : "text-secondary";
|
||||
}
|
||||
|
||||
private DateTime selDtFine { get; set; } = DateTime.Now;
|
||||
|
||||
private bool showStats { get; set; } = false;
|
||||
|
||||
private int totalCount
|
||||
{
|
||||
get => _totalCount;
|
||||
set
|
||||
{
|
||||
if (_totalCount != value)
|
||||
{
|
||||
_totalCount = value;
|
||||
updateRecordCount.InvokeAsync(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Chiama metodo x chiedere sync DB
|
||||
/// </summary>
|
||||
/// <param name="selRec"></param>
|
||||
/// <returns></returns>
|
||||
private async Task addTask2Exe(string idxMacc, string taskName, string taskVal)
|
||||
{
|
||||
// compongo URL e chiamo
|
||||
string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName={taskName}&taskVal={taskVal}";
|
||||
try
|
||||
{
|
||||
var response = await MpIoApiCall.callMpIoUrlGet(restUrl);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Errore durante chiamata: {Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
|
||||
private double calcolaPerc(double durata)
|
||||
{
|
||||
double answ = 0;
|
||||
|
||||
double tot = 0;
|
||||
if (ListOdlStatsAct != null)
|
||||
{
|
||||
tot = ListOdlStatsAct.Sum(x => x.TotDurata);
|
||||
|
||||
double perc = (durata / tot) * 100;
|
||||
if (perc > 1)
|
||||
{
|
||||
answ = Math.Round(perc, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = Math.Round(perc, 4);
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiama metodo x chiedere sync DB
|
||||
/// </summary>
|
||||
/// <param name="IdxMacc"></param>
|
||||
/// <returns></returns>
|
||||
private async Task callSyncDb(string IdxMacc)
|
||||
{
|
||||
// chiamo aggiunta task SyncDb...
|
||||
await addTask2Exe(IdxMacc, "syncDbData", "");
|
||||
}
|
||||
|
||||
private string pbStyle(string css)
|
||||
{
|
||||
string answ = "";
|
||||
if (ListOdlStats != null)
|
||||
{
|
||||
if (css == "yellow")
|
||||
{
|
||||
answ = "orange";
|
||||
}
|
||||
else if (css == "blue")
|
||||
{
|
||||
answ = "#2874A6";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = css;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
private async Task reloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
SearchRecords = await MDService.ListODLFilt(currFilter.IsActive, currFilter.SearchVal, currFilter.CodStato, currFilter.IdxMacchina, currFilter.DtStart, currFilter.DtEnd);
|
||||
totalCount = SearchRecords.Count;
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
private async Task reloadStatsData(ODLModel? currRec)
|
||||
{
|
||||
showStats = true;
|
||||
if (currRec != null)
|
||||
{
|
||||
ListOdlStats = await MDService.StatOdl(currRec.IdxOdl);
|
||||
ListOdlStatsNetto = ListOdlStats.Where(x => x.Semaforo != "sGr").ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
ListOdlStats = null;
|
||||
ListOdlStatsNetto = null;
|
||||
}
|
||||
}
|
||||
|
||||
private string tradFase(string codFase)
|
||||
{
|
||||
string answ = codFase;
|
||||
if (ListStati != null && ListStati.Count > 0)
|
||||
{
|
||||
var recSel = ListStati.FirstOrDefault(x => x.value == codFase);
|
||||
if (recSel != null)
|
||||
{
|
||||
answ = recSel.label;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
@using MP.SPEC.Components
|
||||
@using MP.SPEC.Data
|
||||
|
||||
@if (ListRecords == null)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
else if (totalCount == 0)
|
||||
{
|
||||
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table table-sm table-striped small">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<button @onclick="() => resetSel()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
|
||||
</th>
|
||||
<th><i class="fa-regular fa-calendar-days"></i> Data</th>
|
||||
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
|
||||
<th><i class="fa-solid fa-sliders"></i> Parametro</th>
|
||||
<th style="text-align: right">Valore</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr class="@checkSelect(@record)">
|
||||
<td>
|
||||
<button @onclick="() => selRecord(record)" class="btn btn-primary btn-sm"><i class="bi bi-search"></i></button>
|
||||
</td>
|
||||
<td>
|
||||
@record.dtEvento
|
||||
</td>
|
||||
<td>
|
||||
@record.IdxMacchina
|
||||
</td>
|
||||
<td>
|
||||
@record.CodFlux
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
<b>@record.Valore</b>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,248 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.SPEC.Data;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace MP.SPEC.Components
|
||||
{
|
||||
public partial class ListPARAMS : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> PagerResetReq { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<FluxLog> RecordSel { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public SelectFluxParams SelFilter { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<int> TotRecordChanged { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
private SelectFluxParams lastFilter { get; set; } = new SelectFluxParams() { CurrPage = -1 };
|
||||
public string checkSelect(FluxLog selRecord)
|
||||
{
|
||||
string answ = "";
|
||||
if (currRecord != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = (currRecord.IdxMacchina == selRecord.IdxMacchina && currRecord.dtEvento == selRecord.dtEvento && currRecord.CodFlux == selRecord.CodFlux) ? "table-info" : "";
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
// se sono cambiati --> rileggo...
|
||||
if (!lastFilter.Equals(SelFilter))
|
||||
{
|
||||
lastFilter = SelFilter.clone();
|
||||
await reloadData(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SelectFluxParams? LastFilter = null;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
aTimer.Elapsed -= ElapsedTimer;
|
||||
aTimer.Stop();
|
||||
aTimer.Dispose();
|
||||
currRecord = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
if (!isLoading && LiveUpdate)
|
||||
{
|
||||
aTimer.Stop();
|
||||
// inizio misura esecuzione
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => reloadData(true));
|
||||
});
|
||||
pUpd.Wait();
|
||||
// misuro tempo esecuzione
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
int deltaTime = RefreshPeriod - (int)ts.TotalMilliseconds;
|
||||
aTimer.Interval = deltaTime > 100 ? deltaTime : 100;
|
||||
aTimer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task reloadData(bool setChanged)
|
||||
{
|
||||
isLoading = true;
|
||||
DateTime limitData = DateTime.Now;
|
||||
if (SelDtMax != null)
|
||||
{
|
||||
limitData = (DateTime)SelDtMax;
|
||||
}
|
||||
SearchRecords = await MDService.FluxLogGetLastFilt(limitData, SelMacchina, SelFlux, MaxRecord);
|
||||
totalCount = SearchRecords.Count;
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
if (setChanged)
|
||||
{
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
}
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
public void StartTimer()
|
||||
{
|
||||
aTimer = new System.Timers.Timer(RefreshPeriod);
|
||||
aTimer.Elapsed += ElapsedTimer;
|
||||
aTimer.Enabled = true;
|
||||
aTimer.Start();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected MpDataService MDService { get; set; } = null!;
|
||||
|
||||
protected int RefreshPeriod
|
||||
{
|
||||
get => SelFilter.TempoAgg;
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
StartTimer();
|
||||
}
|
||||
|
||||
|
||||
//protected int RefreshPeriod { get; set; } = 5000;
|
||||
protected async void OnSeachUpdated()
|
||||
{
|
||||
await InvokeAsync(() =>
|
||||
{
|
||||
PagerResetReq.InvokeAsync(false);
|
||||
//currPage = 1;
|
||||
Task task = UpdateData();
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
|
||||
protected async Task resetSel()
|
||||
{
|
||||
currRecord = null;
|
||||
await RecordSel.InvokeAsync(null);
|
||||
}
|
||||
|
||||
protected async Task selRecord(FluxLog selRec)
|
||||
{
|
||||
currRecord = selRec;
|
||||
SelFilter.IdxMacchina = selRec.IdxMacchina;
|
||||
await reloadData(false);
|
||||
await RecordSel.InvokeAsync(selRec);
|
||||
}
|
||||
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
currRecord = null;
|
||||
await reloadData(true);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static System.Timers.Timer aTimer = null!;
|
||||
|
||||
private int _totalCount = 0;
|
||||
private FluxLog? currRecord = null;
|
||||
private List<FluxLog>? ListRecords;
|
||||
private List<FluxLog>? SearchRecords;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int currPage
|
||||
{
|
||||
get => SelFilter.CurrPage;
|
||||
set => SelFilter.CurrPage = value;
|
||||
}
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
|
||||
private bool LiveUpdate
|
||||
{
|
||||
get => SelFilter.LiveUpdate;
|
||||
}
|
||||
|
||||
private int MaxRecord
|
||||
{
|
||||
get => SelFilter.MaxRecord;
|
||||
}
|
||||
|
||||
private int numRecord
|
||||
{
|
||||
get => SelFilter.NumRec;
|
||||
set => SelFilter.NumRec = value;
|
||||
}
|
||||
|
||||
private string SelFlux
|
||||
{
|
||||
get => SelFilter.CodFlux;
|
||||
}
|
||||
|
||||
private string SelMacchina
|
||||
{
|
||||
get => SelFilter.IdxMacchina;
|
||||
}
|
||||
private DateTime? SelDtMax
|
||||
{
|
||||
get => SelFilter.dtMax;
|
||||
}
|
||||
|
||||
private int totalCount
|
||||
{
|
||||
get => _totalCount;
|
||||
set
|
||||
{
|
||||
if (_totalCount != value)
|
||||
{
|
||||
_totalCount = value;
|
||||
TotRecordChanged.InvokeAsync(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
@using MP.SPEC.Components
|
||||
@using MP.SPEC.Data
|
||||
|
||||
@if (ListRecords == null || isLoading)
|
||||
{
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
else if (totalCount == 0)
|
||||
{
|
||||
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<button @onclick="() => resetSel()" class="btn btn-primary btn-sm"><i class="bi bi-arrow-counterclockwise"></i></button>
|
||||
</th>
|
||||
<th><i class="fa-solid fa-file"></i> Articolo</th>
|
||||
<th><i class="fa-solid fa-screwdriver-wrench"></i> Fase</th>
|
||||
<th><i class="fa-solid fa-hard-drive"></i> Macchina</th>
|
||||
<th><i class="fa-solid fa-circle-info"></i> Info ciclo</th>
|
||||
@*<th><i class="fa-solid fa-pen-to-square"></i> Note</th>*@
|
||||
<th title="Attivabile"><i class="fa-regular fa-square-check"></i> Att</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr class="@checkSelect(@record)">
|
||||
<td class="text-nowrap">
|
||||
<button @onclick="() => selRecord(record)" class="btn btn-primary btn-sm" title="Modifica Record"><i class="bi bi-pencil-square"></i></button>
|
||||
<button @onclick="() => cloneRecord(record)" class="btn btn-info btn-sm" title="Duplica Record"><i class="bi bi-clipboard-check"></i></button>
|
||||
@if (canStartOdl(record.IdxMacchina))
|
||||
{
|
||||
<button @onclick="() => startOdl(record)" class="btn btn-success btn-sm" title="Avvia PODL">
|
||||
<i class="far fa-play-circle"></i>
|
||||
</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-secondary btn-sm disabled" title="ODL ancora in corso">
|
||||
<i class="far fa-play-circle"></i>
|
||||
</button>}
|
||||
</td>
|
||||
<td>
|
||||
@record.CodArticolo
|
||||
<div class="small textConsensed text-secondary">@record.ArticoloNav.DescArticolo</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
@tradFase(record.KeyRichiesta)
|
||||
</div>
|
||||
@if (record.Note != "")
|
||||
{
|
||||
<div class="small textConsensed text-secondary badge text-bg-light border border-primary rounded">
|
||||
<b class="text-dark">Note:</b> @record.Note
|
||||
</div>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@record.IdxMacchina
|
||||
<div class="small textConsensed text-secondary">@record.MachineNav.Descrizione</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="small textConsensed"><b>N° pezzi:</b> @record.NumPezzi</div>
|
||||
<div class="small textConsensed"><b>T. Ciclo:</b> @record.Tcassegnato.ToString("N3")</div>
|
||||
</td>
|
||||
@*<td>@record.Note</td>*@
|
||||
<td>
|
||||
@if (@record.Attivabile)
|
||||
{
|
||||
<i class="fa-regular fa-square-check text-success"></i>
|
||||
}
|
||||
else
|
||||
{
|
||||
<i class="fa-regular fa-square text-secondary"></i>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (POdlDelEnabled(record.IdxOdl))
|
||||
{
|
||||
<button @onclick="() => deleteRecord(record)" class="btn btn-danger btn-sm"><i class="bi bi-trash-fill"></i></button>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,412 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.SPEC.Data;
|
||||
using MP.SPEC.Services;
|
||||
using NLog;
|
||||
|
||||
namespace MP.SPEC.Components
|
||||
{
|
||||
public partial class ListPODL : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public SelectPOdlParams actFilter { get; set; } = new SelectPOdlParams();
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> PagerResetReq { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<PODLModel> RecordSel { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<int> updateRecordCount { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public string checkSelect(PODLModel record)
|
||||
{
|
||||
string answ = "";
|
||||
if (currRecord != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = ((currRecord.IdxMacchina == record.IdxMacchina) && (currRecord.CodArticolo == record.CodArticolo) && (currRecord.CodFase == record.CodFase)) ? "table-info" : "";
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
currRecord = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
ListStati = null;
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected IJSRuntime JSRuntime { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected MpDataService MDService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected IOApiService MpIoApiCall { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected async Task cloneRecord(PODLModel selRec)
|
||||
{
|
||||
// creo record duplicato...
|
||||
PODLModel newRec = new PODLModel()
|
||||
{
|
||||
Attivabile = selRec.Attivabile,
|
||||
CodArticolo = selRec.CodArticolo,
|
||||
CodCli = selRec.CodCli,
|
||||
CodGruppo = selRec.CodGruppo,
|
||||
DueDate = selRec.DueDate,
|
||||
IdxMacchina = selRec.IdxMacchina,
|
||||
IdxOdl = selRec.IdxOdl,
|
||||
IdxPromessa = 0,
|
||||
InsertDate = selRec.InsertDate,
|
||||
KeyBCode = selRec.KeyBCode,
|
||||
KeyRichiesta = selRec.KeyRichiesta,
|
||||
Note = $"DUPLICATED - {selRec.Note}",
|
||||
NumPezzi = selRec.NumPezzi,
|
||||
Priorita = selRec.Priorita,
|
||||
PzPallet = selRec.PzPallet,
|
||||
Tcassegnato = selRec.Tcassegnato
|
||||
};
|
||||
currRecord = selRec;
|
||||
await RecordSel.InvokeAsync(newRec);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazione record selezionato (previa conferma)
|
||||
/// </summary>
|
||||
/// <param name="selRec"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task deleteRecord(PODLModel selRec)
|
||||
{
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Eliminazione Record: sei sicuro di voler procedere?"))
|
||||
return;
|
||||
await Task.Delay(1);
|
||||
var done = await MDService.PODLDeleteRecord(selRec);
|
||||
await callSyncDb(selRec.IdxMacchina);
|
||||
currRecord = null;
|
||||
await reloadData();
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
//await FilterChanged.InvokeAsync(actFilter);
|
||||
ListStati = await MDService.AnagStatiComm();
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
if (!lastFilter.Equals(actFilter))
|
||||
{
|
||||
lastFilter = actFilter.clone();
|
||||
await reloadData();
|
||||
}
|
||||
}
|
||||
|
||||
protected async void OnSeachUpdated()
|
||||
{
|
||||
await InvokeAsync(() =>
|
||||
{
|
||||
PagerResetReq.InvokeAsync(true);
|
||||
//currPage = 1;
|
||||
Task task = UpdateData();
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
|
||||
protected bool POdlDelEnabled(int idxOdl)
|
||||
{
|
||||
return idxOdl == 0;
|
||||
}
|
||||
|
||||
protected async Task resetSel()
|
||||
{
|
||||
currRecord = null;
|
||||
await RecordSel.InvokeAsync(null);
|
||||
}
|
||||
|
||||
protected async Task selRecord(PODLModel selRec)
|
||||
{
|
||||
currRecord = selRec;
|
||||
await RecordSel.InvokeAsync(selRec);
|
||||
}
|
||||
|
||||
protected async Task startOdl(PODLModel selRec)
|
||||
{
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Sei sicuro di voler avviare PODL selezionato?"))
|
||||
return;
|
||||
|
||||
if (selRec != null)
|
||||
{
|
||||
int idxEvento = 0;
|
||||
string evMess = "";
|
||||
// verifico ancora NON ci sia ODL corrente/aperto
|
||||
if (canStartOdl(selRec.IdxMacchina))
|
||||
{
|
||||
await callStartSetup(selRec.IdxMacchina);
|
||||
await Task.Delay(1);
|
||||
// chiamo stored stp_ODL_inizioSetupPromessa e recupero ODL corrente
|
||||
bool fatto = await MDService.POdlDoSetup(selRec);
|
||||
if (fatto)
|
||||
{
|
||||
var currPOdl = await MDService.PODL_getByKey(selRec.IdxPromessa);
|
||||
var newOdl = await MDService.OdlGetByKey(currPOdl.IdxOdl);
|
||||
|
||||
// registro evento...
|
||||
idxEvento = 2;
|
||||
evMess = $"Inizio Setup | PODL {selRec.IdxPromessa}";
|
||||
processaEvento(selRec.IdxMacchina, idxEvento, evMess, newOdl.IdxOdl, newOdl.CodArticolo);
|
||||
|
||||
// aspetto 1 sec
|
||||
await Task.Delay(1000);
|
||||
|
||||
// registro inizio produzione
|
||||
idxEvento = 2;
|
||||
evMess = $"Registrata inizio Produzione | PODL {selRec.IdxPromessa} | ODL {newOdl.IdxOdl} | ART {newOdl.CodArticolo}";
|
||||
processaEvento(selRec.IdxMacchina, idxEvento, evMess, newOdl.IdxOdl, newOdl.CodArticolo);
|
||||
|
||||
// chiamo task x IOB
|
||||
await callForceUpdate(selRec.IdxMacchina);
|
||||
await Task.Delay(1);
|
||||
await callForceUpdate(selRec.IdxMacchina);
|
||||
await Task.Delay(1);
|
||||
await callSyncDb(selRec.IdxMacchina);
|
||||
await Task.Delay(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
currRecord = null;
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private PODLModel? currRecord = null;
|
||||
private List<PODLModel>? ListRecords;
|
||||
private List<ListValues>? ListStati;
|
||||
|
||||
/// <summary>
|
||||
/// scadenza validità lista ODL correnti
|
||||
/// </summary>
|
||||
private DateTime odlCurrExp = DateTime.Now.AddMinutes(-1);
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ODL correnti...
|
||||
/// </summary>
|
||||
private List<string> odlCurrList = new List<string>();
|
||||
|
||||
private List<PODLModel>? SearchRecords;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int _totalCount { get; set; } = 0;
|
||||
|
||||
private int currPage
|
||||
{
|
||||
get => actFilter.CurrPage;
|
||||
set => actFilter.CurrPage = value;
|
||||
}
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
private SelectPOdlParams lastFilter { get; set; } = new SelectPOdlParams() { CurrPage = -1 };
|
||||
|
||||
private int numRecord
|
||||
{
|
||||
get => actFilter.NumRec;
|
||||
set => actFilter.NumRec = value;
|
||||
}
|
||||
|
||||
private string SearchVal
|
||||
{
|
||||
get => string.IsNullOrEmpty(actFilter.SearchVal) ? "*" : actFilter.SearchVal;
|
||||
}
|
||||
|
||||
private string StatoSel
|
||||
{
|
||||
get => actFilter.CodFase;
|
||||
set => actFilter.CodFase = value;
|
||||
}
|
||||
|
||||
private int totalCount
|
||||
{
|
||||
get => _totalCount;
|
||||
set
|
||||
{
|
||||
if (_totalCount != value)
|
||||
{
|
||||
_totalCount = value;
|
||||
updateRecordCount.InvokeAsync(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Chiama metodo x chiedere sync DB
|
||||
/// </summary>
|
||||
/// <param name="selRec"></param>
|
||||
/// <returns></returns>
|
||||
private async Task addTask2Exe(string idxMacc, string taskName, string taskVal)
|
||||
{
|
||||
// compongo URL e chiamo
|
||||
string restUrl = $"IOB/addTask2Exe/{idxMacc}?taskName={taskName}&taskVal={taskVal}";
|
||||
try
|
||||
{
|
||||
var response = await MpIoApiCall.callMpIoUrlGet(restUrl);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Errore durante chiamata: {Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiama metodo x chiedere force Update
|
||||
/// </summary>
|
||||
/// <param name="selRec"></param>
|
||||
/// <returns></returns>
|
||||
private async Task callForceUpdate(string IdxMacc)
|
||||
{
|
||||
// chiamo aggiunta task SyncDb...
|
||||
await addTask2Exe(IdxMacc, "ForceUpdate", $"SPEC|TS:{DateTime.Now:yyMMddHHmmss}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiama metodo x indicare inizio setup
|
||||
/// </summary>
|
||||
/// <param name="selRec"></param>
|
||||
/// <returns></returns>
|
||||
private async Task callStartSetup(string IdxMacc)
|
||||
{
|
||||
// chiamo evento inizio setup
|
||||
await addTask2Exe(IdxMacc, "startSetup", $"SPEC|TS:{DateTime.Now:yyMMddHHmmss}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiama metodo x chiedere sync DB
|
||||
/// </summary>
|
||||
/// <param name="IdxMacc"></param>
|
||||
/// <returns></returns>
|
||||
private async Task callSyncDb(string IdxMacc)
|
||||
{
|
||||
// chiamo aggiunta task SyncDb...
|
||||
await addTask2Exe(IdxMacc, "syncDbData", "");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// verifica se sia avviabile ODL x macchina
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
private bool canStartOdl(string idxMacchina)
|
||||
{
|
||||
// controllo se lista scaduta...
|
||||
bool answ = false;
|
||||
DateTime adesso = DateTime.Now;
|
||||
if (adesso > odlCurrExp || odlCurrList == null || odlCurrList.Count == 0)
|
||||
{
|
||||
odlCurrList = MDService.OdlGetCurrent();
|
||||
odlCurrExp = adesso.AddSeconds(2);
|
||||
}
|
||||
answ = !odlCurrList.Contains(idxMacchina);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// processa evento richiesto
|
||||
/// </summary>
|
||||
/// <param name="idxMacc"></param>
|
||||
/// <param name="idxEvento"></param>
|
||||
/// <param name="userMsg"></param>
|
||||
/// <param name="idxODL"></param>
|
||||
private async void processaEvento(string idxMacc, int idxEvento, string userMsg, int idxODL, string codArticolo)
|
||||
{
|
||||
// se manca codart calcolo...
|
||||
if (string.IsNullOrEmpty(codArticolo))
|
||||
{
|
||||
var currOdl = await MDService.OdlGetByKey(idxODL);
|
||||
if (currOdl != null)
|
||||
{
|
||||
codArticolo = currOdl.CodArticolo;
|
||||
}
|
||||
}
|
||||
|
||||
// scrivo evento scriviRigaEventoBarcode
|
||||
EventListModel newRec = new EventListModel()
|
||||
{
|
||||
IdxMacchina = idxMacc,
|
||||
InizioStato = DateTime.Now,
|
||||
IdxTipo = idxEvento,
|
||||
CodArticolo = codArticolo,
|
||||
MatrOpr = 0,
|
||||
pallet = "",
|
||||
Value = userMsg
|
||||
};
|
||||
|
||||
await MDService.EvListInsert(newRec);
|
||||
}
|
||||
|
||||
private async Task reloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
SearchRecords = await MDService.ListPODLFilt(SearchVal, StatoSel);
|
||||
totalCount = SearchRecords.Count;
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
//await updateRecordCount.InvokeAsync(totalCount);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
private string tradFase(string codFase)
|
||||
{
|
||||
string answ = codFase;
|
||||
if (ListStati != null && ListStati.Count > 0)
|
||||
{
|
||||
var recSel = ListStati.FirstOrDefault(x => x.value == codFase);
|
||||
if (recSel != null)
|
||||
{
|
||||
answ = recSel.label;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<div class="row p-5 m-5 alert alert-primary">
|
||||
<div class="col-6 text-center mt-4 py-3 bg-light">
|
||||
<h1>MAPO SPEC</h1>
|
||||
EgalWare MES suite <img class="logoImg img-fluid" src="images/logoCliente.png" width="64" />
|
||||
</div>
|
||||
<div class="col-6 text-center mt-4 py-3 bg-light">
|
||||
<h3>loading data</h3>
|
||||
<i class="fas fa-spinner fa-spin fa-4x"></i>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
<div class="row p-0 m-0">
|
||||
<div class="col-12 text-center py-2 mb-0 alert alert-primary">
|
||||
<b>loading data</b>
|
||||
<i class="fas fa-spinner fa-spin"></i>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
@if (@SelectedOdl != -1)
|
||||
{
|
||||
<div class="px-1 flex-fill">
|
||||
@if (isLoading)
|
||||
{
|
||||
<LoadingDataSmall></LoadingDataSmall>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MP.SPEC.Components.Chart.Doughnut Type="@Chart.Doughnut.ChartType.Doughnut" Data="@Data.ToArray()" BackgroundColor="@colors"></MP.SPEC.Components.Chart.Doughnut>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.SPEC.Data;
|
||||
|
||||
namespace MP.SPEC.Components
|
||||
{
|
||||
public partial class ODLPlot
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
public List<DoughnutStyling> colors = new List<DoughnutStyling>();
|
||||
|
||||
public List<double> Data = new List<double>();
|
||||
|
||||
public List<string> Labels = new List<string>();
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public bool hideSpenta { get; set; }
|
||||
|
||||
public int OdlId
|
||||
{
|
||||
get => _selParam;
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public int SelectedOdl
|
||||
{
|
||||
get => _selParam;
|
||||
set => _selParam = value;
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
//protected DataLogFilter _SelFilter { get; set; } = new DataLogFilter();
|
||||
protected int _selParam { get; set; } = -1;
|
||||
|
||||
[Inject]
|
||||
protected MpDataService MDService { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
isLoading = true;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
await ReloadData();
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
protected async Task ReloadData()
|
||||
{
|
||||
Data.Clear();
|
||||
Labels.Clear();
|
||||
colors.Clear();
|
||||
ListRecords = await MDService.StatOdl(SelectedOdl);
|
||||
// se hideSpenta --> filtro stato 11 = spenta...
|
||||
if (hideSpenta)
|
||||
{
|
||||
ListRecords = ListRecords.Where(x => x.Semaforo != "sGr").ToList();
|
||||
}
|
||||
foreach (var record in ListRecords)
|
||||
{
|
||||
Data.Add(record.TotDurata);
|
||||
Labels.Add($"{record.Descrizione} - {record.TotDurata:N1}min");
|
||||
if (record.Css == "yellow")
|
||||
{
|
||||
colors.Add(new DoughnutStyling("orange", "ccc"));
|
||||
}
|
||||
else if (record.Css == "blue")
|
||||
{
|
||||
colors.Add(new DoughnutStyling("#2874A6", "ccc"));
|
||||
}
|
||||
else
|
||||
{
|
||||
colors.Add(new DoughnutStyling(record.Css, "ccc"));
|
||||
}
|
||||
}
|
||||
await Task.Delay(1);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private List<StatODLModel>? ListRecords = null;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private bool isLoading { get; set; } = false;
|
||||
|
||||
#endregion Private Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="d-flex justify-content-between pt-1 mb-1">
|
||||
<div class="px-2">
|
||||
@if (!liveUpdate)
|
||||
{
|
||||
<button class="btn btn-secondary" type="button" @onclick="() => toggleUpdate()" title="Click per tornare a Valori Live">
|
||||
<small>@lastUpdate</small>
|
||||
</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-primary" type="button" @onclick="() => toggleUpdate()">
|
||||
<span class="spinner-grow spinner-grow-sm" role="status" aria-hidden="true"></span>
|
||||
Valori live
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
<div class="px-2">
|
||||
@if (selMacchina != "*")
|
||||
{
|
||||
<button class="btn btn-warning" type="button" @onclick="() => takeSnapshot()">
|
||||
<i class="fa-solid fa-camera"></i>
|
||||
@snapMode
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
<div class="px-2">
|
||||
@if (snapshotDone)
|
||||
{
|
||||
<button class="btn btn-success" type="button" @onclick="() => navDossier()">
|
||||
<div class="spinner-border spinner-border-sm" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
<i class="fa-solid fa-camera"></i>
|
||||
Fatto! Mostra Dossier
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<a class="pt-2" data-bs-toggle="offcanvas" data-bs-target="#paramsFilterExample" aria-controls="paramsFilterExample" @onclick="setDtMax">
|
||||
<i class="fa-solid fa-bars text-dark"></i>
|
||||
</a>
|
||||
<div class="offcanvas offcanvas-end" tabindex="-1" id="paramsFilterExample" aria-labelledby="paramsFilterExampleLabel">
|
||||
<div class="offcanvas-header">
|
||||
<h3 class="offcanvas-title" id="paramsFilterExampleLabel"><b>FILTRI</b></h3>
|
||||
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="offcanvas-body">
|
||||
<div class="small">
|
||||
<label class="px-2" for="macchina" title="Selezionare impianto">Impianto</label>
|
||||
</div>
|
||||
<div class="px-2 input-group">
|
||||
<label class="input-group-text" for="macchina" title="Selezionare impianto"><i class="fa-solid fa-hard-drive"></i></label>
|
||||
<select @bind="@selMacchina" class="form-select" id="macchina" title="Selezionare impianto">
|
||||
<option value="*">--- Tutti ---</option>
|
||||
@if (ListMacchine != null)
|
||||
{
|
||||
foreach (var item in ListMacchine)
|
||||
{
|
||||
<option value="@item">@item</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="small mt-2">
|
||||
<label class="px-2" for="flusso" title="Selezionare il parametro">Parametro</label>
|
||||
</div>
|
||||
<div class="px-2 input-group">
|
||||
<label class="input-group-text" for="flusso" title="Selezionare il parametro"><i class="fa-solid fa-sliders"></i></label>
|
||||
<select @bind="@selFlux" class="form-select" id="flusso" title="Selezionare il parametro">
|
||||
<option value="*">--- Tutti ---</option>
|
||||
@if (ListFlux != null)
|
||||
{
|
||||
foreach (var item in ListFlux)
|
||||
{
|
||||
<option value="@item">@item</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="small mt-2">
|
||||
<label class="px-2" for="dtMin" title="Selezionare inizio periodo">Inizio Periodo</label>
|
||||
</div>
|
||||
<div class="px-2 input-group">
|
||||
<label class="input-group-text" for="dtMin" title="Selezionare inizio periodo"><i class="fa-regular fa-calendar-minus"></i></label>
|
||||
<input class="form-control" @bind="@selDtMin" id="dtMin" type="datetime-local" title="Data minima eventi da visualizzare">
|
||||
</div>
|
||||
<div class="small mt-2">
|
||||
<label class="px-2" for="dtMax" title="Selezionare fine periodo">Fine Periodo</label>
|
||||
</div>
|
||||
<div class="px-2 input-group">
|
||||
<label class="input-group-text" for="dtMax" title="Selezionare fine periodo"><i class="fa-regular fa-calendar-plus"></i></label>
|
||||
<input class="form-control" @bind="@selDtMax" id="dtMax" type="datetime-local" title="Selezionare fine periodo">
|
||||
</div>
|
||||
<div class="small mt-2">
|
||||
<label class="px-2" for="tempoAgg" title="Selezionare refresh rate (sec) periodo">Refresh rate (sec)</label>
|
||||
</div>
|
||||
<div class="px-2 input-group">
|
||||
<label class="input-group-text" for="tempoAgg" title="Selezionare refresh rate (sec)"><i class="fa-solid fa-clock"></i></label>
|
||||
<select @bind="@selTempoAgg" class="form-select" id="tempoAgg" title="Selezionare refresh rate (sec)" style="width: 3em;">
|
||||
<option value="2">2</option>
|
||||
<option value="5">5</option>
|
||||
<option value="10">10</option>
|
||||
<option value="30">30</option>
|
||||
<option value="60">60</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="small mt-2">
|
||||
<label class="px-2" for="maxRecord" title="Numero massimo record da mostrare">Max Record</label>
|
||||
</div>
|
||||
<div class="px-2 input-group">
|
||||
<label class="input-group-text" for="maxRecord" title="Numero massimo record da mostrare"><i class="fa-solid fa-list-ol"></i></label>
|
||||
<select @bind="@selMaxRecord" class="form-select" id="maxRecord" title="Numero massimo record da mostrare">
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
<option value="250">250</option>
|
||||
<option value="500">500</option>
|
||||
<option value="1000">1000</option>
|
||||
<option value="2500">2500</option>
|
||||
<option value="5000">5000</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,322 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MP.SPEC.Data;
|
||||
|
||||
namespace MP.SPEC.Components
|
||||
{
|
||||
public partial class ParamsFilter : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<SelectFluxParams> FilterChanged { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public SelectFluxParams SelFilter { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Inizializzazione con periodo e arrotondamento
|
||||
/// </summary>
|
||||
/// <param name="minRound"></param>
|
||||
/// <returns></returns>
|
||||
public static DateTime RoundDatetime(int minRound)
|
||||
{
|
||||
TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today);
|
||||
int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound;
|
||||
DateTime endRounded = DateTime.Today.AddMinutes(minDay);
|
||||
return endRounded;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
aTimer.Elapsed -= ElapsedTimer;
|
||||
aTimer.Stop();
|
||||
aTimer.Dispose();
|
||||
}
|
||||
|
||||
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
snapshotDone = false;
|
||||
aTimer.Stop();
|
||||
aTimer.Enabled = false;
|
||||
//reportChange();
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected string lastUpdate
|
||||
{
|
||||
get => SelFilter.lastUpdate;
|
||||
set => SelFilter.lastUpdate = value;
|
||||
}
|
||||
|
||||
protected bool liveUpdate
|
||||
{
|
||||
get => SelFilter.LiveUpdate;
|
||||
set
|
||||
{
|
||||
if (!SelFilter.LiveUpdate.Equals(value))
|
||||
{
|
||||
SelFilter.LiveUpdate = value;
|
||||
if (!value)
|
||||
{
|
||||
SelFilter.CurrPage = 0;
|
||||
}
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Inject]
|
||||
protected MpDataService MDService { get; set; } = null!;
|
||||
|
||||
protected string selFlux
|
||||
{
|
||||
get
|
||||
{
|
||||
return SelFilter.CodFlux;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!SelFilter.CodFlux.Equals(value))
|
||||
{
|
||||
SelFilter.CurrPage = 1;
|
||||
SelFilter.CodFlux = value;
|
||||
StateHasChanged();
|
||||
Task.Delay(1);
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
protected bool showParam { get; set; } = false;
|
||||
protected bool selDt { get; set; } = false;
|
||||
protected string selMacchina
|
||||
{
|
||||
get => SelFilter.IdxMacchina;
|
||||
set
|
||||
{
|
||||
if (!SelFilter.IdxMacchina.Equals(value))
|
||||
{
|
||||
SelFilter.CurrPage = 1;
|
||||
SelFilter.IdxMacchina = value;
|
||||
SelFilter.CodFlux = "*";
|
||||
ListFlux = MDService.ParametriGetFilt(selMacchina).Result;
|
||||
StateHasChanged();
|
||||
Task.Delay(1);
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected int selMaxRecord
|
||||
{
|
||||
get
|
||||
{
|
||||
return SelFilter.MaxRecord;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (!SelFilter.MaxRecord.Equals(value))
|
||||
{
|
||||
SelFilter.MaxRecord = value;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected int selTempoAgg
|
||||
{
|
||||
get
|
||||
{
|
||||
return SelFilter.TempoAgg / 1000;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
int tempoMS = value * 1000;
|
||||
if (!SelFilter.TempoAgg.Equals(tempoMS))
|
||||
{
|
||||
SelFilter.TempoAgg = tempoMS;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected async Task navDossier()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
// rimando alla home
|
||||
NavManager.NavigateTo("DOSS", true);
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
SelFilter = new SelectFluxParams();
|
||||
setDtMax();
|
||||
DateTime dtStart = SelFilter.dtMin != null ? (DateTime)SelFilter.dtMin : DateTime.Now.AddDays(-7);
|
||||
DateTime dtEnd = SelFilter.dtMax != null ? (DateTime)SelFilter.dtMax : DateTime.Now;
|
||||
ListMacchine = await MDService.MacchineWithFlux(dtStart, dtEnd);
|
||||
ListFlux = await MDService.ParametriGetFilt(selMacchina);
|
||||
|
||||
var configData = await MDService.ConfigGetAll();
|
||||
var currRec = configData.FirstOrDefault(x => x.Chiave == "numOreAnticipoSnapshot");
|
||||
if (currRec != null)
|
||||
{
|
||||
var newInt = 40;
|
||||
int.TryParse(currRec.Valore, out newInt);
|
||||
numOreAnticipoSnapshot = newInt;
|
||||
}
|
||||
|
||||
await FilterChanged.InvokeAsync(SelFilter);
|
||||
}
|
||||
|
||||
protected void setDtMax()
|
||||
{
|
||||
// copio il filtro
|
||||
var currFilt = SelFilter;
|
||||
// fermo update
|
||||
currFilt.LiveUpdate = true;
|
||||
currFilt.CurrPage = 0;
|
||||
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
currFilt.dtMax = RoundDatetime(5);
|
||||
currFilt.dtMin = RoundDatetime(5).AddHours(-numOreAnticipoSnapshot);
|
||||
SelFilter = currFilt;
|
||||
}
|
||||
|
||||
|
||||
protected void startTimer()
|
||||
{
|
||||
aTimer = new System.Timers.Timer(5000);
|
||||
aTimer.Elapsed += ElapsedTimer;
|
||||
aTimer.Enabled = true;
|
||||
aTimer.Start();
|
||||
}
|
||||
|
||||
protected async Task takeSnapshot()
|
||||
{
|
||||
// fermo udpate
|
||||
liveUpdate = false;
|
||||
// se non ho data rif uso adesso...
|
||||
DateTime dtMax = selDtMax == null ? RoundDatetime(5) : (DateTime)selDtMax;
|
||||
DateTime dtMin = selDtMin == null ? RoundDatetime(5).AddHours(-numOreAnticipoSnapshot) : (DateTime)selDtMin;
|
||||
// aggiungo 15 sec
|
||||
dtMax = dtMax.AddSeconds(15);
|
||||
await MDService.DossiersTakeParamsSnapshotLast(selMacchina, dtMin, dtMax);
|
||||
lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
// indico snapshot fatto
|
||||
snapshotDone = true;
|
||||
startTimer();
|
||||
}
|
||||
|
||||
protected void toggleParams()
|
||||
{
|
||||
showEditPar = !showEditPar;
|
||||
selDtMax = null;
|
||||
}
|
||||
|
||||
protected async Task toggleUpdate()
|
||||
{
|
||||
liveUpdate = !liveUpdate;
|
||||
await Task.Delay(1);
|
||||
if (!liveUpdate)
|
||||
{
|
||||
lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
}
|
||||
else
|
||||
{
|
||||
selDtMax = null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static System.Timers.Timer aTimer = new System.Timers.Timer();
|
||||
private List<string>? ListFlux = null;
|
||||
private List<string>? ListMacchine = null;
|
||||
private int numOreAnticipoSnapshot { get; set; } = 50;
|
||||
private bool snapshotDone = false;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
[Inject]
|
||||
private NavigationManager NavManager { get; set; } = null!;
|
||||
|
||||
private DateTime? selDtMax
|
||||
{
|
||||
get => SelFilter.dtMax;
|
||||
set
|
||||
{
|
||||
if (SelFilter.dtMax != value)
|
||||
{
|
||||
// copio il filtro
|
||||
var currFilt = SelFilter;
|
||||
// fermo update
|
||||
currFilt.LiveUpdate = (value == null);
|
||||
currFilt.CurrPage = 0;
|
||||
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
currFilt.dtMax = value;
|
||||
SelFilter = currFilt;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private DateTime? selDtMin
|
||||
{
|
||||
get => SelFilter.dtMin;
|
||||
set
|
||||
{
|
||||
if (SelFilter.dtMin != value)
|
||||
{
|
||||
// copio il filtro
|
||||
var currFilt = SelFilter;
|
||||
// fermo update
|
||||
currFilt.LiveUpdate = false;
|
||||
currFilt.CurrPage = 0;
|
||||
currFilt.lastUpdate = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
currFilt.dtMin = value;
|
||||
SelFilter = currFilt;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool showEditPar { get; set; } = false;
|
||||
|
||||
private string snapMode
|
||||
{
|
||||
get => SelFilter.dtRif == null ? "Realtime Rec" : $"Rec {SelFilter.dtRif:yyyy/MM/dd HH:mm:ss}";
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void reportChange()
|
||||
{
|
||||
FilterChanged.InvokeAsync(SelFilter);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
@using MP.SPEC.Components
|
||||
@using MP.SPEC.Data
|
||||
|
||||
@inject MessageService AppMService
|
||||
|
||||
<div class="input-group input-group-sm" hidden>
|
||||
<input @bind-value="@searchVal" @bind-value:event="oninput" type="text" class="form-control" title="Campo Ricerca" placeholder="Ricerca [ALT-R]" accesskey="R" />
|
||||
<button @onclick="reset" class="btn btn-success input-group-text"><i class="fa-solid fa-rotate"></i></button>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> searchUpdated { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public string searchVal
|
||||
{
|
||||
get
|
||||
{
|
||||
return AppMService.SearchVal;
|
||||
}
|
||||
set
|
||||
{
|
||||
AppMService.SearchVal = value;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
|
||||
protected override Task OnInitializedAsync()
|
||||
{
|
||||
AppMService.EA_SearchUpdated += OnSeachUpdated;
|
||||
return base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
public async void OnSeachUpdated()
|
||||
{
|
||||
await InvokeAsync(() =>
|
||||
{
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void reportChange()
|
||||
{
|
||||
searchUpdated.InvokeAsync(searchVal);
|
||||
}
|
||||
|
||||
private void reset()
|
||||
{
|
||||
searchVal = "";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-text">
|
||||
<span class="me-1 @leftStringCSS">@leftString</span>
|
||||
<div class="form-check form-check-sm form-switch py-1" title="Parameter View Mode (RealTime / LogData)">
|
||||
<input class="form-check-input" type="checkbox" id="mySwitch" name="setupAlarms" checked @onclick="() => toggle()">
|
||||
</div>
|
||||
<span class="@rightStringCSS">@rightString</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Net.Http;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.Web.Virtualization;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.SPEC;
|
||||
using MP.SPEC.Shared;
|
||||
using MP.SPEC.Components;
|
||||
using MP.SPEC.Data;
|
||||
|
||||
namespace MP.SPEC.Components
|
||||
{
|
||||
public partial class ToggleMode
|
||||
{
|
||||
[Parameter]
|
||||
public EventCallback<SelectGlobalToggle> FilterChanged { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public SelectGlobalToggle SelFilter { get; set; } = new SelectGlobalToggle();
|
||||
|
||||
protected bool isActive
|
||||
{
|
||||
get => SelFilter.isActive;
|
||||
set
|
||||
{
|
||||
if (SelFilter.isActive != value)
|
||||
{
|
||||
SelFilter.isActive = value;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected string leftString
|
||||
{
|
||||
get => SelFilter.leftString;
|
||||
set
|
||||
{
|
||||
if (SelFilter.leftString != value)
|
||||
{
|
||||
SelFilter.leftString = value;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
protected string leftStringCSS
|
||||
{
|
||||
get => SelFilter.leftStringCSS;
|
||||
set
|
||||
{
|
||||
if (SelFilter.leftStringCSS != value)
|
||||
{
|
||||
SelFilter.leftStringCSS = value;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
protected string rightString
|
||||
{
|
||||
get => SelFilter.rightString;
|
||||
set
|
||||
{
|
||||
if (SelFilter.rightString != value)
|
||||
{
|
||||
SelFilter.rightString = value;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
protected string rightStringCSS
|
||||
{
|
||||
get => SelFilter.rightStringCSS;
|
||||
set
|
||||
{
|
||||
if (SelFilter.rightStringCSS != value)
|
||||
{
|
||||
SelFilter.rightStringCSS = value;
|
||||
reportChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void toggle()
|
||||
{
|
||||
var currFilt = SelFilter;
|
||||
currFilt.isActive = !currFilt.isActive;
|
||||
SelFilter = currFilt;
|
||||
if (isActive)
|
||||
{
|
||||
rightStringCSS = "fw-bold";
|
||||
leftStringCSS = "text-secondary";
|
||||
}
|
||||
else
|
||||
{
|
||||
leftStringCSS = "fw-bold";
|
||||
rightStringCSS = "text-secondary";
|
||||
}
|
||||
}
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (isActive)
|
||||
{
|
||||
rightStringCSS = "fw-bold";
|
||||
leftStringCSS = "text-secondary";
|
||||
}
|
||||
else
|
||||
{
|
||||
leftStringCSS = "fw-bold";
|
||||
rightStringCSS = "text-secondary";
|
||||
}
|
||||
await FilterChanged.InvokeAsync(SelFilter);
|
||||
}
|
||||
|
||||
private void reportChange()
|
||||
{
|
||||
FilterChanged.InvokeAsync(SelFilter);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Drawing;
|
||||
|
||||
namespace MP.SPEC.Data
|
||||
{
|
||||
public class DoughnutStyling
|
||||
{
|
||||
public string color { get; set; }
|
||||
public string border { get; set; }
|
||||
|
||||
public DoughnutStyling(string color, string border)
|
||||
{
|
||||
this.color = color;
|
||||
this.border = border;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
namespace MP.SPEC.Data
|
||||
{
|
||||
public class MessageService
|
||||
{
|
||||
#region Public Events
|
||||
|
||||
public event Action EA_PageUpdated;
|
||||
|
||||
public event Action EA_SearchUpdated;
|
||||
|
||||
public event Action EA_ShowSearch;
|
||||
|
||||
public event Action EA_StatoSearch;
|
||||
|
||||
#endregion Public Events
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public int currPage
|
||||
{
|
||||
get => _currPage;
|
||||
set
|
||||
{
|
||||
if (_currPage != value)
|
||||
{
|
||||
_currPage = value;
|
||||
if (EA_PageUpdated != null)
|
||||
{
|
||||
EA_PageUpdated?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int numRecord
|
||||
{
|
||||
get => _numRecord;
|
||||
set
|
||||
{
|
||||
if (_numRecord != value)
|
||||
{
|
||||
_numRecord = value;
|
||||
if (EA_PageUpdated != null)
|
||||
{
|
||||
EA_PageUpdated?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string SearchVal
|
||||
{
|
||||
get => searchVal;
|
||||
set
|
||||
{
|
||||
//if (searchVal != value)
|
||||
//{
|
||||
searchVal = value;
|
||||
|
||||
if (EA_SearchUpdated != null)
|
||||
{
|
||||
EA_SearchUpdated?.Invoke();
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowSearch
|
||||
{
|
||||
get => showSearch;
|
||||
set
|
||||
{
|
||||
if (showSearch != value)
|
||||
{
|
||||
showSearch = value;
|
||||
if (EA_ShowSearch != null)
|
||||
{
|
||||
EA_ShowSearch?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string StateSel
|
||||
{
|
||||
get => stateSel;
|
||||
set
|
||||
{
|
||||
stateSel = value;
|
||||
|
||||
if (EA_StatoSearch != null)
|
||||
{
|
||||
EA_StatoSearch?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string TipoSearch
|
||||
{
|
||||
get => tipoSearch;
|
||||
set
|
||||
{
|
||||
if (tipoSearch != value)
|
||||
{
|
||||
tipoSearch = value;
|
||||
if (EA_ShowSearch != null)
|
||||
{
|
||||
EA_ShowSearch?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int totalCount
|
||||
{
|
||||
get => _totalCount;
|
||||
set
|
||||
{
|
||||
if (_totalCount != value)
|
||||
{
|
||||
_totalCount = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void reportPaging()
|
||||
{
|
||||
if (EA_PageUpdated != null)
|
||||
{
|
||||
EA_PageUpdated?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
protected void reportSearch()
|
||||
{
|
||||
if (EA_SearchUpdated != null)
|
||||
{
|
||||
EA_SearchUpdated?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private string searchVal = "";
|
||||
private bool showSearch;
|
||||
private string stateSel = "*";
|
||||
private string tipoSearch = "";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int _currPage { get; set; } = 1;
|
||||
|
||||
private int _numRecord { get; set; } = 10;
|
||||
private int _totalCount { get; set; } = 0;
|
||||
|
||||
#endregion Private Properties
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user