Compare commits
287 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3066866c1e | |||
| 71ab37f101 | |||
| 6aed95aa68 | |||
| 8a8f9fd7e6 | |||
| 21bbcccf76 | |||
| 3c2370748e | |||
| 52819429cb | |||
| 9385a4a974 | |||
| 9c9e3df572 | |||
| 1c114905fc | |||
| 07464904a9 | |||
| 7f78fe8f31 | |||
| 5a2dc3e797 | |||
| 826b611e2e | |||
| 63cdf6d60a | |||
| f5b2480b82 | |||
| 101f36bcd4 | |||
| cc3b7ccfe6 | |||
| fae86288d0 | |||
| f5f0a790ee | |||
| 25d90f9967 | |||
| 107625a8b7 | |||
| 2a9e70fca4 | |||
| 6af19b8dd5 | |||
| 5c9b16a7a0 | |||
| 2ee76314af | |||
| aef2465d97 | |||
| 005c05818b | |||
| 24cb3d11ec | |||
| e1f960c0b0 | |||
| 55e1cbdbbf | |||
| 78d9779306 | |||
| 4e7e14cddc | |||
| b7bc89a49b | |||
| 00d27713b8 | |||
| 8983b3c7a5 | |||
| 1ae633c263 | |||
| b0804c78e7 | |||
| 5b1a067fc3 | |||
| 305f65180a | |||
| 3797cb8c83 | |||
| 85ceef1474 | |||
| c0cabb53dc | |||
| b290fc40bf | |||
| 0b94b3bb56 | |||
| 47a37075e7 | |||
| 0cebf0a1a8 | |||
| 46a0c55e29 | |||
| e8b97708b3 | |||
| 6bd3686f44 | |||
| 83ed7d9d96 | |||
| 9054d42c32 | |||
| 08e54ff364 | |||
| a775e90f6a | |||
| c145634ae2 | |||
| 3016ac6122 | |||
| 23eba38c9c | |||
| 3d45c158e1 | |||
| 4003530565 | |||
| 5f4e85df07 | |||
| 1319496e52 | |||
| a0e23f60d5 | |||
| 8c773a6d56 | |||
| 513212515b | |||
| b18403dc04 | |||
| 52b57cd118 | |||
| c872cc7a83 | |||
| 5fba356222 | |||
| 54292d6c1b | |||
| b9c1f92539 | |||
| 65ac2dad4e | |||
| 7cae4c7bd9 | |||
| 76758b14fe | |||
| f2d5f2d421 | |||
| 3e617bf253 | |||
| 55b2fcebdc | |||
| 5881c233bf | |||
| d53cb7335e | |||
| bd1b1b043b | |||
| 2805cdb99a | |||
| 04ff808eb4 | |||
| 929f5fc472 | |||
| 6d4d6d2c9f | |||
| b38b722140 | |||
| 865241f814 | |||
| 64d1d7a071 | |||
| 4adce530f9 | |||
| b64fed6dd2 | |||
| df305a15d6 | |||
| 3f699b6f5c | |||
| c23a8f69c5 | |||
| 79e9f9ddad | |||
| fa73d39171 | |||
| 792b679475 | |||
| 34307417e7 | |||
| 82cb2d7337 | |||
| ee2bdbb30e | |||
| 1d96bef8c6 | |||
| c9cd3889da | |||
| 627a9297f7 | |||
| faf8a83725 | |||
| 68d131bc84 | |||
| 815f81697e | |||
| 63746e43fa | |||
| c0cb268afa | |||
| 0dd5cc104c | |||
| 55f5ef6087 | |||
| 82e92a100b | |||
| ee7b93e547 | |||
| ffbdbfacc8 | |||
| f9084900dc | |||
| e980c2b26f | |||
| 178369a27e | |||
| 73ed092fbf | |||
| ed1db6975f | |||
| 789fba6059 | |||
| 6cad64847c | |||
| 71dda0d162 | |||
| 64ea545712 | |||
| c411f9ce37 | |||
| 7d7d610d54 | |||
| 64c55d4c93 | |||
| 0753fcf0ca | |||
| 852befac18 | |||
| 2b5bf3803c | |||
| 9979252361 | |||
| b1487a3f3e | |||
| 1b0ff7fd1d | |||
| 7df4d7e9de | |||
| d20bcd4a1a | |||
| 0d86cb099e | |||
| ffca896c5d | |||
| 748c5d32b0 | |||
| b4a789cc74 | |||
| 004858cdae | |||
| 031f2dc426 | |||
| 6341e02079 | |||
| f39e5802dd | |||
| 1851a06041 | |||
| b22a9d8f8d | |||
| 877f760de5 | |||
| e3883ba9c4 | |||
| eefc5bd65a | |||
| d8f462f9ec | |||
| 99851c7fda | |||
| ae6b6a46db | |||
| ad888921f8 | |||
| bf284a6cc9 | |||
| 695ac9f747 | |||
| 58c4ae1381 | |||
| bf958a0809 | |||
| 00fc2ec32e | |||
| 348cf90833 | |||
| 540f2a6fc6 | |||
| 2f6676d9ea | |||
| 89e5de94b7 | |||
| b088d712ca | |||
| 2684579b6c | |||
| c55fc7b214 | |||
| 4805a7916a | |||
| 07e10a3ca6 | |||
| ec71b70421 | |||
| bfa94f4eee | |||
| 448052028d | |||
| 1ad6abff63 | |||
| 33dbca043f | |||
| e73b0335e5 | |||
| acc5c989a1 | |||
| ba5541cbb9 | |||
| d11d91fcf1 | |||
| 3f85b48faa | |||
| 85cd73b169 | |||
| 60d4102881 | |||
| 2f652d1f0a | |||
| 0fce9bbe04 | |||
| fd9fa52d36 | |||
| 53972d0480 | |||
| 3998ff02ea | |||
| 05a88733ff | |||
| 6c0e54f761 | |||
| 9fa4e2da64 | |||
| c575266766 | |||
| d45892b279 | |||
| 03b34ff547 | |||
| 3c5c823fcf | |||
| 741f9c7794 | |||
| 291de6a80a | |||
| bc9748ec8e | |||
| a09b5495d9 | |||
| f51abc2f68 | |||
| 8a492e3c1b | |||
| b963c29ba3 | |||
| b35f90a878 | |||
| ba5263b9f4 | |||
| c901e5f1e9 | |||
| 53bdb75258 | |||
| 6d61eb57ac | |||
| 725115010c | |||
| b38d0bfea8 | |||
| dc699c6ba3 | |||
| e37a78392c | |||
| be50a43890 | |||
| d0e7afcd83 | |||
| 89a84223ba | |||
| 80f4c706ae | |||
| ecd693533e | |||
| fc822a9d69 | |||
| cd9640805b | |||
| c7790e3dfb | |||
| 05f7edfdc7 | |||
| d033910a9c | |||
| 8c2e1c659a | |||
| f8dbce0853 | |||
| 73ca1cadbd | |||
| 8e98a486a0 | |||
| 62c47e7b36 | |||
| e38c80da47 | |||
| 5eb34cef4e | |||
| df2e281744 | |||
| 8a8018a8cc | |||
| 78aa06508e | |||
| 5951693058 | |||
| d0e7b5724e | |||
| cc1f014587 | |||
| 664f6fec06 | |||
| 36678bd629 | |||
| 49f8032bbe | |||
| 5bed52e26e | |||
| 996d4d87c3 | |||
| 163cd16b6b | |||
| 948e777957 | |||
| 6739b18fd5 | |||
| d9e26de7ac | |||
| 930d9d7292 | |||
| 9f2e6c5151 | |||
| 3db5945b15 | |||
| 4eacd656f8 | |||
| 99a22f7f1e | |||
| bba2865f9f | |||
| de748bd486 | |||
| c480bb89d6 | |||
| cca56c8f62 | |||
| b29f96a233 | |||
| f8aee63cee | |||
| 623d115d6c | |||
| 8f2b190ad2 | |||
| bcb79ee551 | |||
| b6c3fffe5b | |||
| 9c026b0820 | |||
| 56bb1fcff1 | |||
| 134eb37a12 | |||
| b301ada72e | |||
| da3316f9cf | |||
| d7ffd3111d | |||
| 98cc38e338 | |||
| 0918f7c58f | |||
| 4d24877c3e | |||
| b0a61309ac | |||
| ad3abbee06 | |||
| 78dfc2b8eb | |||
| 7555b89438 | |||
| c52438d0a4 | |||
| e8b0e75f2e | |||
| 703ffdb7a3 | |||
| a87494d6f0 | |||
| bf12d27afb | |||
| 6b23b74917 | |||
| 752f902602 | |||
| 5abaf08cf0 | |||
| f09c5f9d77 | |||
| 4081b69aff | |||
| bf5dd58364 | |||
| 7bcb0a6c67 | |||
| 129cb545e8 | |||
| 14f2be3725 | |||
| 0d49a4de41 | |||
| 5408f0995a | |||
| dead2a06a3 | |||
| 6bbe30e831 | |||
| a920207ebe | |||
| 4512dace96 | |||
| 687b736a50 | |||
| fd097d1472 | |||
| 749c4b4cc7 | |||
| 6ea491284b | |||
| 35a6382f8a | |||
| 0785df95bf |
+8
-3
@@ -5,10 +5,9 @@
|
|||||||
.vs/*
|
.vs/*
|
||||||
|
|
||||||
#--------------------------------
|
#--------------------------------
|
||||||
# area MP.Stats
|
# area .temp
|
||||||
#--------------------------------
|
#--------------------------------
|
||||||
/Mp.FileData/temp/*.csv
|
.temp
|
||||||
*.bak
|
|
||||||
|
|
||||||
#--------------------------------
|
#--------------------------------
|
||||||
# Area VersGen
|
# Area VersGen
|
||||||
@@ -163,12 +162,18 @@ publish/
|
|||||||
|
|
||||||
# NuGet Packages
|
# NuGet Packages
|
||||||
*.nupkg
|
*.nupkg
|
||||||
|
# NuGet Symbol Packages
|
||||||
|
*.snupkg
|
||||||
# The packages folder can be ignored because of Package Restore
|
# The packages folder can be ignored because of Package Restore
|
||||||
|
**/[Pp]ackages/*
|
||||||
**/packages/*
|
**/packages/*
|
||||||
# except build/, which is used as an MSBuild target.
|
# except build/, which is used as an MSBuild target.
|
||||||
!**/packages/build/
|
!**/packages/build/
|
||||||
# Uncomment if necessary however generally it will be regenerated when needed
|
# Uncomment if necessary however generally it will be regenerated when needed
|
||||||
#!**/packages/repositories.config
|
#!**/packages/repositories.config
|
||||||
|
# NuGet v3's project.json files produces more ignorable files
|
||||||
|
*.nuget.props
|
||||||
|
*.nuget.targets
|
||||||
|
|
||||||
# Windows Azure Build Output
|
# Windows Azure Build Output
|
||||||
csx/
|
csx/
|
||||||
|
|||||||
+18
-15
@@ -9,13 +9,22 @@ variables:
|
|||||||
# helper x fix pacchetti nuget da repo locale nexus.steamware.net
|
# helper x fix pacchetti nuget da repo locale nexus.steamware.net
|
||||||
.nuget-fix: &nuget-fix
|
.nuget-fix: &nuget-fix
|
||||||
- |
|
- |
|
||||||
$hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C
|
echo "esecuzione Nuget FIX steps"
|
||||||
if ($hasSource -eq 0) {
|
dotnet nuget list source
|
||||||
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
|
$hasSource = dotnet nuget list source | Select-String -Pattern "Steamware Nexus Proxy"
|
||||||
} else {
|
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
|
||||||
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
|
dotnet nuget remove source "`"Steamware Nexus Proxy`""
|
||||||
}
|
}
|
||||||
echo $hasSource
|
$hasSource = dotnet nuget list source | Select-String -Pattern "Steamware Nexus"
|
||||||
|
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
|
||||||
|
dotnet nuget remove source "`"Steamware Nexus`""
|
||||||
|
}
|
||||||
|
$hasSource = dotnet nuget list source | Select-String -Pattern "nexus-proxy-v3"
|
||||||
|
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
|
||||||
|
dotnet nuget remove source nexus-proxy-v3
|
||||||
|
}
|
||||||
|
dotnet nuget add source https://nexus.steamware.net/repository/nuget-group-3/index.json -n "Steamware Nexus" -u nugetUser -p $NEXUS_PASSWD --store-password-in-clear-text
|
||||||
|
echo "Steamware Nexus Source added"
|
||||||
|
|
||||||
# helper creazione hash files
|
# helper creazione hash files
|
||||||
.hashBuild: &hashBuild
|
.hashBuild: &hashBuild
|
||||||
@@ -27,7 +36,6 @@ variables:
|
|||||||
New-Item $Target".sha1"
|
New-Item $Target".sha1"
|
||||||
$MD5.Hash | Set-Content -Path $Target".md5"
|
$MD5.Hash | Set-Content -Path $Target".md5"
|
||||||
$SHA1.Hash | Set-Content -Path $Target".sha1"
|
$SHA1.Hash | Set-Content -Path $Target".sha1"
|
||||||
|
|
||||||
echo "Created HASH files for $Target"
|
echo "Created HASH files for $Target"
|
||||||
|
|
||||||
# helper x send su NEXUS
|
# helper x send su NEXUS
|
||||||
@@ -56,8 +64,6 @@ variables:
|
|||||||
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\manifest.xml" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/manifest.xml
|
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\manifest.xml" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/manifest.xml
|
||||||
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\ChangeLog.html" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/ChangeLog.html
|
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\ChangeLog.html" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/ChangeLog.html
|
||||||
|
|
||||||
# mCurl -v -u $env:NEXUS_USER:$env:NEXUS_PASSWD --upload-file bin/release/$env:APP_NAME.zip $env:NEXUS_SERVER/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip
|
|
||||||
|
|
||||||
# helper x fix version number
|
# helper x fix version number
|
||||||
.version-fix: &version-fix
|
.version-fix: &version-fix
|
||||||
- |
|
- |
|
||||||
@@ -65,10 +71,6 @@ variables:
|
|||||||
$env:NUM_REL = $env:VERS_MAIN+"."+(get-date -format yyMM)+"."+(get-date -format dHH)
|
$env:NUM_REL = $env:VERS_MAIN+"."+(get-date -format yyMM)+"."+(get-date -format dHH)
|
||||||
$env:NUM_DEB = $env:VERS_MAIN+"."+(get-date -format yyMM)+"-beta."+(get-date -format dHH)
|
$env:NUM_DEB = $env:VERS_MAIN+"."+(get-date -format yyMM)+"-beta."+(get-date -format dHH)
|
||||||
$env:NEW_COPYRIGHT = "EgalWare @ 2021-" + (get-date -format yyyy)
|
$env:NEW_COPYRIGHT = "EgalWare @ 2021-" + (get-date -format yyyy)
|
||||||
$contenuto = Get-Content -path 'VersGen\VersGen.cs' -Raw
|
|
||||||
$newContenuto = $contenuto -replace '0.0.0.0', $env:NEW_REL
|
|
||||||
$newContenuto = $newContenuto -replace 'EgalWare © 2021', $env:NEW_COPYRIGHT
|
|
||||||
$newContenuto | Set-Content -Path 'VersGen\VersGen.cs'
|
|
||||||
# display versioni generate
|
# display versioni generate
|
||||||
$resoconto = "Effettuato fix file VersGen | release v: " + $env:NUM_REL + " | debug v: " + $env:NUM_DEB;
|
$resoconto = "Effettuato fix file VersGen | release v: " + $env:NUM_REL + " | debug v: " + $env:NUM_DEB;
|
||||||
Write-Output $resoconto;
|
Write-Output $resoconto;
|
||||||
@@ -98,7 +100,6 @@ variables:
|
|||||||
Set-Content -Path $fileNameDeb -Value $nuspDataDebUpd;
|
Set-Content -Path $fileNameDeb -Value $nuspDataDebUpd;
|
||||||
echo "replace completati"
|
echo "replace completati"
|
||||||
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
- staging
|
- staging
|
||||||
@@ -162,6 +163,9 @@ EgwProxy.MagMan:staging:
|
|||||||
- '& "$env:NUGET_PATH" push *$env:NUM_DEB.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted'
|
- '& "$env:NUGET_PATH" push *$env:NUM_DEB.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted'
|
||||||
|
|
||||||
|
|
||||||
|
# --------------------------------
|
||||||
|
# INSTALLER
|
||||||
|
# --------------------------------
|
||||||
installer:
|
installer:
|
||||||
stage: installer
|
stage: installer
|
||||||
tags:
|
tags:
|
||||||
@@ -184,7 +188,6 @@ installer:
|
|||||||
# --------------------------------
|
# --------------------------------
|
||||||
# RELEASE
|
# RELEASE
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
|
|
||||||
EgwProxy.MagMan:release:
|
EgwProxy.MagMan:release:
|
||||||
stage: release
|
stage: release
|
||||||
needs: ["EgwProxy.MagMan:build"]
|
needs: ["EgwProxy.MagMan:build"]
|
||||||
|
|||||||
@@ -0,0 +1,79 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<configSections>
|
||||||
|
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||||
|
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||||
|
</configSections>
|
||||||
|
<entityFramework>
|
||||||
|
<!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
|
||||||
|
<providers>
|
||||||
|
<!--<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />-->
|
||||||
|
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.3.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
|
||||||
|
</provider>
|
||||||
|
</providers>
|
||||||
|
</entityFramework>
|
||||||
|
<runtime>
|
||||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-1.8.6.0" newVersion="1.8.6.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.3" newVersion="7.0.0.3" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.1.3.0" newVersion="4.1.3.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-3.26.1.0" newVersion="3.26.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-8.3.0.0" newVersion="8.3.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="K4os.Compression.LZ4" publicKeyToken="2186fa9121ef231d" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-1.3.8.0" newVersion="1.3.8.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-1.3.8.0" newVersion="1.3.8.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-6.0.0.3" newVersion="6.0.0.3" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="ZstdSharp" publicKeyToken="8d151af33a4ad5cf" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-0.8.0.0" newVersion="0.8.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Renci.SshNet" publicKeyToken="1cee9f8bde3db106" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-2020.0.2.0" newVersion="2020.0.2.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
</configuration>
|
||||||
@@ -0,0 +1,144 @@
|
|||||||
|
using EgwProxy.DataLayer.DbModel;
|
||||||
|
using EgwProxy.MagMan.DTO;
|
||||||
|
using NLog;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using static System.Data.Entity.Infrastructure.Design.Executor;
|
||||||
|
|
||||||
|
namespace EgwProxy.DataLayer.Controllers
|
||||||
|
{
|
||||||
|
public class LogMachineController : IDisposable
|
||||||
|
{
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Init classe
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="connString"></param>
|
||||||
|
public LogMachineController()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversione a LogMachineDTO
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static LogMachineDTO ConvToItemDto(LogMachineModel currRec)
|
||||||
|
{
|
||||||
|
LogMachineDTO answ = new LogMachineDTO()
|
||||||
|
{
|
||||||
|
DtEvent = currRec.DtEvent,
|
||||||
|
EvType = (MagMan.MachLogTypes)currRec.EvType,
|
||||||
|
ProjCloudId = currRec.ProjCloudId,
|
||||||
|
SupervId = currRec.SupervId,
|
||||||
|
VarValue = currRec.VarValue
|
||||||
|
};
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recupero i dati in ordine crescente fino al num max indicato
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="numMax"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<LogMachineModel> GetUnsentAsc(int numMax)
|
||||||
|
{
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
// retrieve
|
||||||
|
return localDbCtx
|
||||||
|
.DbSetLogMac
|
||||||
|
.Where(x => (x.DtSent == null || x.DtSent < x.DtEvent) && x.ProjCloudId > 0)
|
||||||
|
.OrderBy(x => x.DtEvent)
|
||||||
|
.Take(numMax)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Aggiorna i record indicati inserendo dataora corrente x DtSent
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rec2upd"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool SetDtSent(List<LogMachineModel> rec2upd)
|
||||||
|
{
|
||||||
|
bool done = false;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
DateTime adesso = DateTime.Now;
|
||||||
|
foreach (var item in rec2upd)
|
||||||
|
{
|
||||||
|
var currRec = localDbCtx
|
||||||
|
.DbSetLogMac
|
||||||
|
.Where(x => (x.DtSent == null || x.DtSent < new DateTime(2000, 1, 1)) && x.LogDbId == item.LogDbId)
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (currRec != null)
|
||||||
|
{
|
||||||
|
currRec.DtSent = adesso;
|
||||||
|
}
|
||||||
|
|
||||||
|
// indico modificato
|
||||||
|
localDbCtx.Entry(currRec).State = System.Data.Entity.EntityState.Modified;
|
||||||
|
}
|
||||||
|
// Salvataggio finale
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
}
|
||||||
|
|
||||||
|
return done;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Cerca di sistemare gli ID di Prod e ProjCloud mancanti
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool TryFixProjCloudId()
|
||||||
|
{
|
||||||
|
// init vars
|
||||||
|
bool fatto = false;
|
||||||
|
List<List<LogMachineModel>> listBatch = new List<List<LogMachineModel>>();
|
||||||
|
// vado sul DB
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
// retrieve
|
||||||
|
var list2proc = localDbCtx
|
||||||
|
.DbSetLogMac
|
||||||
|
.Where(x => x.ProjCloudId == 0 && ((int)x.EvType == 1 || (int)x.EvType == 2))
|
||||||
|
.OrderBy(x => x.DtEvent)
|
||||||
|
.ToList();
|
||||||
|
// se ci sono...
|
||||||
|
if (list2proc != null && list2proc.Count > 0)
|
||||||
|
{
|
||||||
|
// chiamo stored...
|
||||||
|
localDbCtx.Database.ExecuteSqlCommand("call stp_LogMachineFixPid");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// risultato
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Istanza logger
|
||||||
|
/// </summary>
|
||||||
|
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
using EgwProxy.DataLayer.DbModel;
|
||||||
|
using EgwProxy.MagMan.DTO;
|
||||||
|
using NLog;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EgwProxy.DataLayer.Controllers
|
||||||
|
{
|
||||||
|
public class ProdController : IDisposable
|
||||||
|
{
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversione a ProjectDTO
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec">record in formato ProdModel</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static ProjectDTO ConvToDto(ProdModel currRec)
|
||||||
|
{
|
||||||
|
// ho valori mancanti che saranno calcolati dal cloud e valori messi a zero di default
|
||||||
|
ProjectDTO answ = new ProjectDTO()
|
||||||
|
{
|
||||||
|
ProjCloudId = currRec.ProjCloudId,
|
||||||
|
ProjLocalId = currRec.ProdDbId,
|
||||||
|
ProjExtId = currRec.ProdId,
|
||||||
|
// è calcolato sul cloud, da token --> machine ID
|
||||||
|
MachineCloudId = 0,
|
||||||
|
// è calcolato sul cloud, da token --> KeyNum
|
||||||
|
KeyNum = 0,
|
||||||
|
// disponibile solo su PROJ
|
||||||
|
BTLFileName = "",
|
||||||
|
PType = (EgwProxy.MagMan.BWType)currRec.PType,
|
||||||
|
Machine = currRec.Machine,
|
||||||
|
ProjDescription = currRec.Description,
|
||||||
|
DtCreated = currRec.DtCreated,
|
||||||
|
DtLastAction = DateTime.MinValue,
|
||||||
|
DtSchedule = DateTime.MinValue,
|
||||||
|
DtStartProd = DateTime.MinValue,
|
||||||
|
// disponibile solo su PROJ
|
||||||
|
ListName = "",
|
||||||
|
ProcTimeEst = 0,
|
||||||
|
ProcTimeReal = 0,
|
||||||
|
IsActive = currRec.IsActive,
|
||||||
|
IsArchived = currRec.IsArchived
|
||||||
|
};
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get record by ProdId
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ProdId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public ProdModel FindByProdId(int ProdId)
|
||||||
|
{
|
||||||
|
ProdModel answ;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
answ = localDbCtx
|
||||||
|
.DbSetProd
|
||||||
|
.Where(x => x.ProdId == ProdId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recupero i dati NON sincronizzati in ordine crescente fino al num max indicato
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dtStart"></param>
|
||||||
|
/// <param name="dtEnd"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<ProdModel> GetUnsentAsc()
|
||||||
|
{
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
// retrieve
|
||||||
|
return localDbCtx
|
||||||
|
.DbSetProd
|
||||||
|
.Where(x => x.ProjCloudId == 0)
|
||||||
|
.OrderBy(x => x.ProdDbId)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update record su DB x ProjectCloudId
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ProdId"></param>
|
||||||
|
/// <param name="Description"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public ProdModel UpdateCloudId(int ProdId, int ProjCloudId)
|
||||||
|
{
|
||||||
|
// cerco specifico Proj
|
||||||
|
ProdModel currData;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
currData = localDbCtx
|
||||||
|
.DbSetProd
|
||||||
|
.Where(x => x.ProdId == ProdId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
if (currData != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// aggiorno valore BTL
|
||||||
|
currData.ProjCloudId = ProjCloudId;
|
||||||
|
|
||||||
|
// salvo record PROD
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
|
||||||
|
// cerco se ci siano projects collegati ed aggiorno pure loro...
|
||||||
|
var projList = localDbCtx
|
||||||
|
.DbSetProj
|
||||||
|
.Where(x => x.ProdDbId == currData.ProdDbId)
|
||||||
|
.ToList();
|
||||||
|
if (projList != null)
|
||||||
|
{
|
||||||
|
foreach (var item in projList)
|
||||||
|
{
|
||||||
|
item.ProjCloudId = ProjCloudId;
|
||||||
|
}
|
||||||
|
// salvo modifihce ai PROJ
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on Prod.UpdateCloudId:{Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on Prod.UpdateCloudId: req item was not found | ProdId {ProdId} | ProjCloudId {ProjCloudId}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return currData;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Istanza logger
|
||||||
|
/// </summary>
|
||||||
|
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EgwProxy.DataLayer.Core
|
||||||
|
{
|
||||||
|
public class MachLog
|
||||||
|
{
|
||||||
|
public enum MachLogTypes
|
||||||
|
{
|
||||||
|
NULL = 0
|
||||||
|
, PART_STATUS = 1
|
||||||
|
, MACHGROUP_STATUS = 2
|
||||||
|
, MACHINE_MODE = 3
|
||||||
|
, MACHINE_STATUS = 4
|
||||||
|
, MACHINE_COMMAND = 5
|
||||||
|
, READ_VAR = 6
|
||||||
|
, WRITE_VAR = 7
|
||||||
|
, ALARM = 8
|
||||||
|
, OPERATOR_MSG = 9
|
||||||
|
, PROGRAM_SEND = 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
using EgwProxy.DataLayer.DbModel;
|
||||||
|
using MySql.Data.EntityFramework;
|
||||||
|
using NLog;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data.Entity;
|
||||||
|
using System.Data.Entity.Infrastructure;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EgwProxy.DataLayer
|
||||||
|
{
|
||||||
|
|
||||||
|
[DbConfigurationType(typeof(MySqlEFConfiguration))]
|
||||||
|
public partial class DatabaseContext : DbContext
|
||||||
|
{
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
public DatabaseContext(string currConnString) : base(currConnString)
|
||||||
|
{
|
||||||
|
connString = currConnString;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public virtual DbSet<LogMachineModel> DbSetLogMac { get; set; }
|
||||||
|
|
||||||
|
public DbSet<ProdModel> DbSetProd { get; set; }
|
||||||
|
public DbSet<ProjModel> DbSetProj { get; set; }
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
private string connString = "";
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EgwProxy.DataLayer
|
||||||
|
{
|
||||||
|
public static class DbConfig
|
||||||
|
{
|
||||||
|
public static string DATABASE_NAME = "EgtBwDb";
|
||||||
|
|
||||||
|
public static int DATABASE_PROCESS_TIMEOUT = 5;
|
||||||
|
public static string DATABASE_PWD = "viacremasca";
|
||||||
|
|
||||||
|
// Database config
|
||||||
|
public static string DATABASE_SERV = "127.0.0.1";
|
||||||
|
|
||||||
|
public static string DATABASE_USER = "EgtUser";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DB Connection string per azioni amministrative:
|
||||||
|
/// aggiunto parametro "allow user variables", da https://forums.mysql.com/read.php?38,609672,610320#msg-610320
|
||||||
|
/// </summary>
|
||||||
|
public static string ADMIN_CONNECTION_STRING { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DB Connection string, per effettuare migration riportare valore connessione admin cablato
|
||||||
|
/// DB Manu: server=localhost;port=3306;database=EgtBwDb_000102;uid=root;pwd=Egalware_24068!;
|
||||||
|
/// DB Sam: server=localhost;port=3306;database=EgtBwDb_000470;uid=root;pwd=Egalware_24068!;
|
||||||
|
/// DB Lovato: server=localhost;port=3306;database=EgtBwDb_000656;uid=root;pwd=Egalware_24068!;
|
||||||
|
/// </summary>
|
||||||
|
public static string CONNECTION_STRING { get; set; } = "server=localhost;port=3306;database=EgtBwDb_000656;uid=root;pwd=Egalware_24068!";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
namespace EgwProxy.DataLayer.DbModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Tabella dei LOG Macchina
|
||||||
|
/// </summary>
|
||||||
|
[Table("LogMachine")]
|
||||||
|
public class LogMachineModel
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Chiave primaria evento LOG
|
||||||
|
/// </summary>
|
||||||
|
[Key, Column("DbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public int LogDbId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stato da enum Core
|
||||||
|
/// </summary>
|
||||||
|
[Column("EvType")]
|
||||||
|
public Core.MachLog.MachLogTypes EvType { get; set; } = Core.MachLog.MachLogTypes.NULL;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Evento
|
||||||
|
/// </summary>
|
||||||
|
[Column("DtEvent")]
|
||||||
|
public DateTime DtEvent { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Key prod attivo (DB locale)
|
||||||
|
/// </summary>
|
||||||
|
[Column("ProdId")]
|
||||||
|
public int ProdId { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Key progetto (cloud)
|
||||||
|
/// </summary>
|
||||||
|
[Column("ProjCloudId")]
|
||||||
|
public int ProjCloudId { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ID Supervisore (Indirizzo VAR)
|
||||||
|
/// </summary>
|
||||||
|
[Column("SupervId")]
|
||||||
|
public string SupervId { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Valore VAR (oggetto del log da decodificare)
|
||||||
|
/// </summary>
|
||||||
|
[Column("VarValue")]
|
||||||
|
public string VarValue { get; set; } = "";
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data di invio evento (su cloud)
|
||||||
|
/// </summary>
|
||||||
|
[Column("DtSent")]
|
||||||
|
public DateTime? DtSent { get; set; } = null;
|
||||||
|
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
using EgwProxy.MagMan;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EgwProxy.DataLayer.DbModel
|
||||||
|
{
|
||||||
|
// <Auto-Generated>
|
||||||
|
// This is here so CodeMaid doesn't reorganize this document
|
||||||
|
// </Auto-Generated>
|
||||||
|
/// <summary>
|
||||||
|
/// Tabella deiu raggruppamenti PROJ in forma di PROD
|
||||||
|
/// </summary>
|
||||||
|
[Table("ProdList")]
|
||||||
|
public class ProdModel
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public ProdModel()
|
||||||
|
{
|
||||||
|
ProjListNav = new HashSet<ProjModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Chiave univoca DB
|
||||||
|
/// </summary>
|
||||||
|
[Key, Column("ProdDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public int ProdDbId { get; set; }
|
||||||
|
|
||||||
|
[Column("Description")]
|
||||||
|
public string Description { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Creazione
|
||||||
|
/// </summary>
|
||||||
|
[Index]
|
||||||
|
[Column("DtCreated")]
|
||||||
|
public DateTime DtCreated { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stato NEW = creato ma NON salvato
|
||||||
|
/// </summary>
|
||||||
|
[Column("IsNew")]
|
||||||
|
public bool IsNew { get; set; } = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stato locked, quando aperto da un dispositivo in rete
|
||||||
|
/// </summary>
|
||||||
|
[Column("Lock")]
|
||||||
|
public bool Locked { get; set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Chiave univoca per EgtBM
|
||||||
|
/// </summary>
|
||||||
|
[Column("Id")]
|
||||||
|
[Index]
|
||||||
|
public int ProdId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Codice Proj per sync info (Identificativo DB esterno del magazzino in sync)
|
||||||
|
/// </summary>
|
||||||
|
public int ProjCloudId { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tipologia del progetto (Travi, Pareti, ...)
|
||||||
|
/// </summary>
|
||||||
|
public BWType PType { get; set; } = BWType.NULL;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Macchina
|
||||||
|
/// </summary>
|
||||||
|
[Column("Machine")]
|
||||||
|
public string Machine { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ID utente che ha bloccato (NumKey), quando aperto da un dispositivo in rete
|
||||||
|
/// </summary>
|
||||||
|
[Column("LockedBy")]
|
||||||
|
public string LockedBy { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DataOra ultima operazione di Lock (o di rimozione di lock), quando aperto da un dispositivo in rete
|
||||||
|
/// </summary>
|
||||||
|
[Column("LockDate")]
|
||||||
|
public DateTime LockDate { get; set; } = DateTime.MinValue;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Record attivo (se false == cancellazione logica)
|
||||||
|
/// </summary>
|
||||||
|
[Index]
|
||||||
|
[Column("IsDeleted")]
|
||||||
|
public bool IsActive { get; set; } = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stato Prodotto = inviato ALMENO UNA VOLTA al supervisore --> NON eliminabile se non in modo logico
|
||||||
|
/// </summary>
|
||||||
|
[Index]
|
||||||
|
[Column("IsProduced")]
|
||||||
|
public bool IsProduced { get; set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stato Archiviato = NON visualizzabile normalmente, già prodotto
|
||||||
|
/// </summary>
|
||||||
|
[Index]
|
||||||
|
[Column("IsArchived")]
|
||||||
|
public bool IsArchived { get; set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Collezione oggetti Proj associati (almeno 1 by design)
|
||||||
|
/// </summary>
|
||||||
|
public virtual ICollection<ProjModel> ProjListNav { get; set; }
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
using EgwProxy.MagMan;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EgwProxy.DataLayer.DbModel
|
||||||
|
{
|
||||||
|
// <Auto-Generated>
|
||||||
|
// This is here so CodeMaid doesn't reorganize this document
|
||||||
|
// </Auto-Generated>
|
||||||
|
/// <summary>
|
||||||
|
/// Tabella dei PROJ caricati dal BTL
|
||||||
|
/// </summary>
|
||||||
|
[Table("ProjList")]
|
||||||
|
public class ProjModel
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
[Key, Column("ProjDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public int ProjDbId { get; set; }
|
||||||
|
|
||||||
|
[Column("BTLFileName")]
|
||||||
|
public string BTLFileName { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Creazione
|
||||||
|
/// </summary>
|
||||||
|
[Column("DtCreated")]
|
||||||
|
[Index]
|
||||||
|
public DateTime DtCreated { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Esportazione
|
||||||
|
/// </summary>
|
||||||
|
[Column("DtExported")]
|
||||||
|
[Index]
|
||||||
|
public DateTime DtExported { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stato NEW = creato ma NON salvato
|
||||||
|
/// </summary>
|
||||||
|
[Index]
|
||||||
|
[Column("IsNew")]
|
||||||
|
public bool IsNew { get; set; } = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ListName del BTL
|
||||||
|
/// </summary>
|
||||||
|
[Column("ListName")]
|
||||||
|
public string ListName { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stato locked (quando aperto da un dispositivo in rete)
|
||||||
|
/// </summary>
|
||||||
|
[Column("Lock")]
|
||||||
|
public bool Locked { get; set; } = false;
|
||||||
|
|
||||||
|
[Column("ProdDbId")]
|
||||||
|
public int? ProdDbId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ID da modello ext
|
||||||
|
/// </summary>
|
||||||
|
[Column("Id")]
|
||||||
|
[Index]
|
||||||
|
public int ProjId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Codice Proj per sync info (Identificativo DB esterno del magazzino in sync)
|
||||||
|
/// </summary>
|
||||||
|
public int ProjCloudId { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tipologia del progetto (Travi, Pareti, ...)
|
||||||
|
/// </summary>
|
||||||
|
public BWType PType { get; set; } = BWType.NULL;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Macchina
|
||||||
|
/// </summary>
|
||||||
|
[Column("Machine")]
|
||||||
|
public string Machine { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ID utente che ha bloccato (NumKey), quando aperto da un dispositivo in rete
|
||||||
|
/// </summary>
|
||||||
|
[Column("LockedBy")]
|
||||||
|
public string LockedBy { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DataOra ultima operazione di Lock (o di rimozione di lock), quando aperto da un
|
||||||
|
/// dispositivo in rete
|
||||||
|
/// </summary>
|
||||||
|
[Column("LockDate")]
|
||||||
|
public DateTime LockDate { get; set; } = DateTime.MinValue;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Record attivo (se false == cancellazione logica)
|
||||||
|
/// </summary>
|
||||||
|
[Index]
|
||||||
|
[Column("IsDeleted")]
|
||||||
|
public bool IsActive { get; set; } = true;
|
||||||
|
/// <summary>
|
||||||
|
/// Descrizione progetto (copiata da BTLFileName inizialmente)
|
||||||
|
/// </summary>
|
||||||
|
[Column("ProjDescription")]
|
||||||
|
public string ProjDescription { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stato Archiviato = NON visualizzabile normalmente, già prodotto
|
||||||
|
/// </summary>
|
||||||
|
[Index]
|
||||||
|
[Column("IsArchived")]
|
||||||
|
public bool IsArchived { get; set; } = false;
|
||||||
|
|
||||||
|
[ForeignKey("ProdDbId")]
|
||||||
|
public virtual ProdModel Prod { get; set; }
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.props" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{87935FC9-C1BC-4984-83CA-A9EDABBE2228}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>EgwProxy.DataLayer</RootNamespace>
|
||||||
|
<AssemblyName>EgwProxy.DataLayer</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
<NuGetPackageImportStamp>
|
||||||
|
</NuGetPackageImportStamp>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="BouncyCastle.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=072edcf4a5328938, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\BouncyCastle.Cryptography.2.3.0\lib\net461\BouncyCastle.Cryptography.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Google.Protobuf, Version=3.26.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Google.Protobuf.3.26.1\lib\net45\Google.Protobuf.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="K4os.Compression.LZ4, Version=1.3.8.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\K4os.Compression.LZ4.1.3.8\lib\net462\K4os.Compression.LZ4.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.8.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.8\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="MySql.Data, Version=8.3.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\MySql.Data.8.3.0\lib\net462\MySql.Data.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="MySql.Data.EntityFramework, Version=8.3.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\MySql.Data.EntityFramework.8.3.0\lib\net462\MySql.Data.EntityFramework.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\NLog.5.3.1\lib\net46\NLog.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Renci.SshNet, Version=2020.0.2.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\SSH.NET.2020.0.2\lib\net40\Renci.SshNet.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.ComponentModel" />
|
||||||
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
|
<Reference Include="System.Configuration" />
|
||||||
|
<Reference Include="System.Configuration.ConfigurationManager, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Configuration.ConfigurationManager.4.4.1\lib\net461\System.Configuration.ConfigurationManager.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Configuration.Install" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Diagnostics.DiagnosticSource, Version=7.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.7.0.2\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Drawing.Design" />
|
||||||
|
<Reference Include="System.IO.Compression" />
|
||||||
|
<Reference Include="System.IO.Pipelines, Version=6.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.IO.Pipelines.6.0.3\lib\net461\System.IO.Pipelines.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Management" />
|
||||||
|
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Numerics" />
|
||||||
|
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Security" />
|
||||||
|
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Transactions" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="ZstdSharp, Version=0.8.0.0, Culture=neutral, PublicKeyToken=8d151af33a4ad5cf, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\ZstdSharp.Port.0.8.0\lib\net462\ZstdSharp.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Controllers\LogMachineController.cs" />
|
||||||
|
<Compile Include="Controllers\ProdController.cs" />
|
||||||
|
<Compile Include="Core\MachLog.cs" />
|
||||||
|
<Compile Include="DatabaseContext.cs" />
|
||||||
|
<Compile Include="DbConfig.cs" />
|
||||||
|
<Compile Include="DbModel\LogMachineModel.cs" />
|
||||||
|
<Compile Include="DbModel\ProdModel.cs" />
|
||||||
|
<Compile Include="DbModel\ProjModel.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\EgwProxy.MagMan\EgwProxy.MagMan.csproj">
|
||||||
|
<Project>{1696d7a5-765a-4d25-8d29-ca7345023479}</Project>
|
||||||
|
<Name>EgwProxy.MagMan</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
|
||||||
|
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
|
||||||
|
</Target>
|
||||||
|
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("EgwProxy.DataLayer")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("EgwProxy.DataLayer")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("87935fc9-c1bc-4984-83ca-a9edabbe2228")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="BouncyCastle.Cryptography" version="2.3.0" targetFramework="net472" />
|
||||||
|
<package id="EntityFramework" version="6.4.4" targetFramework="net472" />
|
||||||
|
<package id="Google.Protobuf" version="3.26.1" targetFramework="net472" />
|
||||||
|
<package id="K4os.Compression.LZ4" version="1.3.8" targetFramework="net472" />
|
||||||
|
<package id="K4os.Compression.LZ4.Streams" version="1.3.8" targetFramework="net472" />
|
||||||
|
<package id="K4os.Hash.xxHash" version="1.0.8" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.Bcl.AsyncInterfaces" version="6.0.0" targetFramework="net472" />
|
||||||
|
<package id="MySql.Data" version="8.3.0" targetFramework="net472" />
|
||||||
|
<package id="MySql.Data.EntityFramework" version="8.3.0" targetFramework="net472" />
|
||||||
|
<package id="NLog" version="5.3.1" targetFramework="net472" />
|
||||||
|
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net472" />
|
||||||
|
<package id="SSH.NET" version="2020.0.2" targetFramework="net472" />
|
||||||
|
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
||||||
|
<package id="System.Configuration.ConfigurationManager" version="4.4.1" targetFramework="net472" />
|
||||||
|
<package id="System.Diagnostics.DiagnosticSource" version="7.0.2" targetFramework="net472" />
|
||||||
|
<package id="System.IO.Pipelines" version="6.0.3" targetFramework="net472" />
|
||||||
|
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
|
||||||
|
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
||||||
|
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
|
||||||
|
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
||||||
|
<package id="ZstdSharp.Port" version="0.8.0" targetFramework="net472" />
|
||||||
|
</packages>
|
||||||
@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.MagMan", "EgwProxy
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TestWinFormVB", "TestWinFormVB\TestWinFormVB.vbproj", "{665C94F5-27A6-4CD0-9487-036D199CDC47}"
|
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TestWinFormVB", "TestWinFormVB\TestWinFormVB.vbproj", "{665C94F5-27A6-4CD0-9487-036D199CDC47}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.DataLayer", "EgwProxy.DataLayer\EgwProxy.DataLayer.csproj", "{87935FC9-C1BC-4984-83CA-A9EDABBE2228}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -27,6 +29,10 @@ Global
|
|||||||
{665C94F5-27A6-4CD0-9487-036D199CDC47}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{665C94F5-27A6-4CD0-9487-036D199CDC47}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{665C94F5-27A6-4CD0-9487-036D199CDC47}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{665C94F5-27A6-4CD0-9487-036D199CDC47}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{665C94F5-27A6-4CD0-9487-036D199CDC47}.Release|Any CPU.Build.0 = Release|Any CPU
|
{665C94F5-27A6-4CD0-9487-036D199CDC47}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{87935FC9-C1BC-4984-83CA-A9EDABBE2228}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{87935FC9-C1BC-4984-83CA-A9EDABBE2228}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{87935FC9-C1BC-4984-83CA-A9EDABBE2228}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{87935FC9-C1BC-4984-83CA-A9EDABBE2228}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
@@ -17,5 +17,10 @@ namespace EgwProxy.MagMan.DTO
|
|||||||
/// Codice Alias in cui viene convertito
|
/// Codice Alias in cui viene convertito
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ValAlias { get; set; } = "";
|
public string ValAlias { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indica se il record sia attivo/valido (per cancellazione logica online e fisica in remoto)
|
||||||
|
/// </summary>
|
||||||
|
public bool IsActive { get; set; } = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,11 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int RawItemLocalId { get; set; } = 0;
|
public int RawItemLocalId { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Boolean for logical delete
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDeleted { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check if is a Remnant
|
/// Check if is a Remnant
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace EgwProxy.MagMan.DTO
|
||||||
|
{
|
||||||
|
// <Auto-Generated>
|
||||||
|
// This is here so CodeMaid doesn't reorganize this document
|
||||||
|
// </Auto-Generated>
|
||||||
|
public class LogMachineDTO
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Key progetto (DB) / CLOUD
|
||||||
|
/// </summary>
|
||||||
|
public int ProjCloudId { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stato da enum
|
||||||
|
/// </summary>
|
||||||
|
public MachLogTypes EvType { get; set; } = MachLogTypes.NULL;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Evento
|
||||||
|
/// </summary>
|
||||||
|
public DateTime DtEvent { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ID Supervisore (Indirizzo VAR)
|
||||||
|
/// </summary>
|
||||||
|
public string SupervId { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Valore VAR (oggetto del log da decodificare)
|
||||||
|
/// </summary>
|
||||||
|
public string VarValue { get; set; } = "";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -50,7 +50,13 @@ namespace EgwProxy.MagMan.DTO
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Quantità totale in giacenza
|
/// Quantità totale in giacenza
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int QtyTot { get; set; } = 0;
|
public decimal QtyTot { get; set; } = 0;
|
||||||
|
|
||||||
|
public string UM
|
||||||
|
{
|
||||||
|
get => IsBeam ? "m" : "m2";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Codice QR/Matrix materiale
|
/// Codice QR/Matrix materiale
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EgwProxy.MagMan.DTO
|
||||||
|
{
|
||||||
|
// <Auto-Generated>
|
||||||
|
// This is here so CodeMaid doesn't reorganize this document
|
||||||
|
// </Auto-Generated>
|
||||||
|
public class ProjectProgrDTO
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Key progetto (DB) / CLOUD
|
||||||
|
/// </summary>
|
||||||
|
public int ProjCloudId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Avanzamento (tipicamente barre fatte)
|
||||||
|
/// </summary>
|
||||||
|
public double ValAct { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Valore finale atteso (tipicamente barre da fare)
|
||||||
|
/// </summary>
|
||||||
|
public double ValMax { get; set; } = 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tempo lavorazione reale in minuti (parziale o totale se chiuso/completato/archiviato)
|
||||||
|
/// </summary>
|
||||||
|
public double ProcTimeReal { get; set; } = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -68,8 +68,8 @@ namespace EgwProxy.MagMan.DTO
|
|||||||
public DateTime DtRequest { get; set; }
|
public DateTime DtRequest { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Record attivo (se false == NON è il piano scelto per i casi "previsionali" = ReqState >0 )
|
/// record richiesto (me lo aspetto sempre a false se viene inviato/registrato...)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsActive { get; set; } = true;
|
public bool IsDeleted { get; set; } = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+439
-23
@@ -4,8 +4,10 @@ using NLog;
|
|||||||
using RestSharp;
|
using RestSharp;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.NetworkInformation;
|
using System.Net.NetworkInformation;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
|
|
||||||
@@ -25,7 +27,7 @@ namespace EgwProxy.MagMan
|
|||||||
RestToken = authToken;
|
RestToken = authToken;
|
||||||
servAddr = serverUrl;
|
servAddr = serverUrl;
|
||||||
apiUrl = $"https://{servAddr}/api/";
|
apiUrl = $"https://{servAddr}/api/";
|
||||||
rcOptions = new RestClientOptions { BaseUrl = new Uri(apiUrl), MaxTimeout = callTimeout };
|
rcOptions = new RestClientOptions { BaseUrl = new Uri(apiUrl), Timeout = TimeSpan.FromMilliseconds(callTimeout) };
|
||||||
Log.Info($"DataSyncro initialized | api: {apiUrl} | timeout: {callTimeout}");
|
Log.Info($"DataSyncro initialized | api: {apiUrl} | timeout: {callTimeout}");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,7 +43,7 @@ namespace EgwProxy.MagMan
|
|||||||
servAddr = serverUrl;
|
servAddr = serverUrl;
|
||||||
callTimeout = timeout;
|
callTimeout = timeout;
|
||||||
apiUrl = $"https://{servAddr}/api/";
|
apiUrl = $"https://{servAddr}/api/";
|
||||||
rcOptions = new RestClientOptions { BaseUrl = new Uri(apiUrl), MaxTimeout = callTimeout };
|
rcOptions = new RestClientOptions { BaseUrl = new Uri(apiUrl), Timeout = TimeSpan.FromMilliseconds(callTimeout) };
|
||||||
Log.Info($"DataSyncro initialized | api: {apiUrl} | timeout: {callTimeout}");
|
Log.Info($"DataSyncro initialized | api: {apiUrl} | timeout: {callTimeout}");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,7 +106,7 @@ namespace EgwProxy.MagMan
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// se != null --> uso tgtAddr...
|
// se != null --> uso tgtAddr...
|
||||||
if (address != null)
|
if (address != null && address != IPAddress.Loopback)
|
||||||
{
|
{
|
||||||
reply = pingSender.Send(address, pingMsTimeout);
|
reply = pingSender.Send(address, pingMsTimeout);
|
||||||
}
|
}
|
||||||
@@ -112,12 +114,13 @@ namespace EgwProxy.MagMan
|
|||||||
{
|
{
|
||||||
reply = pingSender.Send(tgtAddr, pingMsTimeout);
|
reply = pingSender.Send(tgtAddr, pingMsTimeout);
|
||||||
}
|
}
|
||||||
|
answ = reply.Status;
|
||||||
}
|
}
|
||||||
catch
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
reply = pingSender.Send(IPAddress.Loopback, pingMsTimeout);
|
answ = IPStatus.Unknown;
|
||||||
|
Log.Error($"Errore in ping:{Environment.NewLine}{exc}");
|
||||||
}
|
}
|
||||||
answ = reply.Status;
|
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
@@ -233,18 +236,37 @@ namespace EgwProxy.MagMan
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Effettua chiamata test sul server (ping)
|
/// Effettua chiamata test sul server (ping), se fallisse riprova fino a maxTry volte
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="maxTry">num tentativi in caso di KO</param>
|
||||||
|
/// <param name="waitTime">tempo di attesa medio tra tentativi in ms</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool CheckRemote()
|
public bool CheckRemote(int maxTry = 5, int waitTime = 200)
|
||||||
{
|
{
|
||||||
|
bool res = false;
|
||||||
|
int numTry = 0;
|
||||||
IPAddress address = IPAddress.Loopback;
|
IPAddress address = IPAddress.Loopback;
|
||||||
string srvIp = servAddr;
|
string srvName = servAddr;
|
||||||
|
// tolgo eventuale nome con ":"
|
||||||
if (servAddr.Contains(":"))
|
if (servAddr.Contains(":"))
|
||||||
{
|
{
|
||||||
srvIp = servAddr.Substring(0, servAddr.IndexOf(":"));
|
srvName = servAddr.Substring(0, servAddr.IndexOf(":"));
|
||||||
}
|
}
|
||||||
return pingAddress(srvIp, callTimeout) == IPStatus.Success;
|
// tolgo eventuale nome con "/"
|
||||||
|
if (servAddr.Contains("/"))
|
||||||
|
{
|
||||||
|
srvName = servAddr.Substring(0, servAddr.IndexOf("/"));
|
||||||
|
}
|
||||||
|
while (!res && numTry < maxTry)
|
||||||
|
{
|
||||||
|
res = pingAddress(srvName, callTimeout) == IPStatus.Success;
|
||||||
|
numTry++;
|
||||||
|
if (!res)
|
||||||
|
{
|
||||||
|
Thread.Sleep(waitTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -361,6 +383,134 @@ namespace EgwProxy.MagMan
|
|||||||
return await Task.FromResult(answ);
|
return await Task.FromResult(answ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Invio richiesta cancellazione set dati log macchina
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dtStart">Data inizio set da eliminare</param>
|
||||||
|
/// <param name="dtEnd">Data fine set da eliminare</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool LogMachineRemoveRange(DateTime dtStart, DateTime dtEnd)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// chiamo update online
|
||||||
|
using (RestClient client = new RestClient(rcOptions))
|
||||||
|
{
|
||||||
|
string MKeyEnc = HttpUtility.UrlEncode(RestToken);
|
||||||
|
// impacchetto dati x invio...
|
||||||
|
RestPayload.PeriodData newPayload = new RestPayload.PeriodData()
|
||||||
|
{
|
||||||
|
DtEnd = dtEnd,
|
||||||
|
DtStart = dtStart
|
||||||
|
};
|
||||||
|
var jsonBody = JsonConvert.SerializeObject(newPayload);
|
||||||
|
var request = new RestRequest($"LogMachine/remove/{MKeyEnc}", Method.Post).AddJsonBody(jsonBody);
|
||||||
|
var response = client.Post(request);
|
||||||
|
// controllo risposta
|
||||||
|
if (response.StatusCode == HttpStatusCode.OK)
|
||||||
|
{
|
||||||
|
Log.Debug($"LogMachineRemoveRange | Response StatusCode: {response.StatusCode} | content: {response.Content}");
|
||||||
|
answ = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.Error($"LogMachineRemoveRange | Response StatusCode: {response.StatusCode} | content: {response.Content}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"LogMachineRemoveRange | Eccezione {Environment.NewLine}{exc.Message}");
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Invio elenco LogMachine da tab locale
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rec2send">record da inviare</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool LogMachineSend(List<LogMachineDTO> rec2send)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
if (rec2send != null && rec2send.Count > 0)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// chiamo update online
|
||||||
|
using (RestClient client = new RestClient(rcOptions))
|
||||||
|
{
|
||||||
|
string MKeyEnc = HttpUtility.UrlEncode(RestToken);
|
||||||
|
// impacchetto dati x invio...
|
||||||
|
RestPayload.LogData newPayload = new RestPayload.LogData()
|
||||||
|
{
|
||||||
|
LogList = rec2send
|
||||||
|
};
|
||||||
|
var jsonBody = JsonConvert.SerializeObject(newPayload);
|
||||||
|
var request = new RestRequest($"LogMachine/upsert/{MKeyEnc}", Method.Post).AddJsonBody(jsonBody);
|
||||||
|
var response = client.Post(request);
|
||||||
|
// controllo risposta
|
||||||
|
if (response.StatusCode == HttpStatusCode.OK)
|
||||||
|
{
|
||||||
|
Log.Debug($"LogMachineSend | #rec: {rec2send.Count} | Response StatusCode: {response.StatusCode} | content: {response.Content}");
|
||||||
|
answ = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.Error($"LogMachineSend | #rec: {rec2send.Count} | Response StatusCode: {response.StatusCode} | content: {response.Content}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"LogMachineSend | Eccezione {Environment.NewLine}{exc.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Versione async Invio elenco LogMachine da tab locale
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rec2send">record da inviare, se consumo Qty deve essere negativa</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<bool> LogMachineSendAsync(List<LogMachineDTO> rec2send)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// chiamo update online
|
||||||
|
using (RestClient client = new RestClient(rcOptions))
|
||||||
|
{
|
||||||
|
string MKeyEnc = HttpUtility.UrlEncode(RestToken);
|
||||||
|
// impacchetto dati x invio...
|
||||||
|
RestPayload.LogData newPayload = new RestPayload.LogData()
|
||||||
|
{
|
||||||
|
LogList = rec2send
|
||||||
|
};
|
||||||
|
var jsonBody = JsonConvert.SerializeObject(newPayload);
|
||||||
|
var request = new RestRequest($"LogMachine/upsert/{MKeyEnc}", Method.Post).AddJsonBody(jsonBody);
|
||||||
|
var response = await client.PostAsync(request);
|
||||||
|
// controllo risposta
|
||||||
|
if (response.StatusCode == HttpStatusCode.OK)
|
||||||
|
{
|
||||||
|
Log.Debug($"LogMachineSendAsync | #rec: {rec2send.Count} | Response StatusCode: {response.StatusCode} | content: {response.Content}");
|
||||||
|
answ = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.Error($"LogMachineSendAsync | #rec: {rec2send.Count} | Response StatusCode: {response.StatusCode} | content: {response.Content}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"LogMachineSendAsync | Eccezione {Environment.NewLine}{exc.Message}");
|
||||||
|
}
|
||||||
|
return await Task.FromResult(answ);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco Materiali dato RestToken
|
/// Elenco Materiali dato RestToken
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -471,6 +621,130 @@ namespace EgwProxy.MagMan
|
|||||||
return await Task.FromResult(answ);
|
return await Task.FromResult(answ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Invio dizionario progetti con stato archiviato...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="DtLimit">Data limite x recupero record modificati</param>
|
||||||
|
/// <returns>Dizionario ProjCloudId / Stato archived</returns>
|
||||||
|
public Dictionary<int, bool> ProjectArchGet(DateTime DtLimit)
|
||||||
|
{
|
||||||
|
RestPayload.ProjStatusData answ = new RestPayload.ProjStatusData();
|
||||||
|
// cerco online
|
||||||
|
using (RestClient client = new RestClient(rcOptions))
|
||||||
|
{
|
||||||
|
string MKeyEnc = HttpUtility.UrlEncode(RestToken);
|
||||||
|
var request = new RestRequest($"Projects/proj-arch-get/{MKeyEnc}?DtLim={DtLimit:yyyyMMddHHmmss}", Method.Get);
|
||||||
|
var response = client.Get(request);
|
||||||
|
// controllo risposta
|
||||||
|
if (response.StatusCode == HttpStatusCode.OK)
|
||||||
|
{
|
||||||
|
// contenuto serializzato
|
||||||
|
string rawData = $"{response.Content}";
|
||||||
|
answ = JsonConvert.DeserializeObject<RestPayload.ProjStatusData>(rawData);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.Error($"ProjectArchGet | Response StatusCode: {response.StatusCode} | content: {response.Content}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return answ.ProjStatusList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Versione async Invio dizionario progetti con stato archiviato...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="DtLimit">Data limite x recupero record modificati</param>
|
||||||
|
/// <returns>Dizionario ProjCloudId / Stato archived</returns>
|
||||||
|
public async Task<Dictionary<int, bool>> ProjectArchGetAsync(DateTime DtLimit)
|
||||||
|
{
|
||||||
|
RestPayload.ProjStatusData answ = new RestPayload.ProjStatusData();
|
||||||
|
// cerco online
|
||||||
|
using (RestClient client = new RestClient(rcOptions))
|
||||||
|
{
|
||||||
|
string MKeyEnc = HttpUtility.UrlEncode(RestToken);
|
||||||
|
var request = new RestRequest($"Projects/proj-arch-get/{MKeyEnc}?DtLim={DtLimit:yyyyMMddHHmmss}", Method.Get);
|
||||||
|
var response = await client.GetAsync(request);
|
||||||
|
// controllo risposta
|
||||||
|
if (response.StatusCode == HttpStatusCode.OK)
|
||||||
|
{
|
||||||
|
// contenuto serializzato
|
||||||
|
string rawData = $"{response.Content}";
|
||||||
|
answ = JsonConvert.DeserializeObject<RestPayload.ProjStatusData>(rawData);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.Error($"ProjectArchGetAsync | Response StatusCode: {response.StatusCode} | content: {response.Content}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return await Task.FromResult(answ.ProjStatusList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Invio dizionario progetti con stato archiviato...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rec2send">record da inviare come dizionario ProjCloudId / Stato archived</param>
|
||||||
|
/// <returns>Esito esecuzione</returns>
|
||||||
|
public bool ProjectArchSend(Dictionary<int, bool> rec2send)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
// cerco online
|
||||||
|
using (RestClient client = new RestClient(rcOptions))
|
||||||
|
{
|
||||||
|
string MKeyEnc = HttpUtility.UrlEncode(RestToken);
|
||||||
|
// impacchetto dati x invio...
|
||||||
|
RestPayload.ProjStatusData newPayload = new RestPayload.ProjStatusData()
|
||||||
|
{
|
||||||
|
ProjStatusList = rec2send
|
||||||
|
};
|
||||||
|
var jsonBody = JsonConvert.SerializeObject(newPayload);
|
||||||
|
var request = new RestRequest($"Projects/proj-arch-send/{MKeyEnc}", Method.Post).AddJsonBody(jsonBody);
|
||||||
|
var response = client.Post(request);
|
||||||
|
// controllo risposta
|
||||||
|
if (response.StatusCode == HttpStatusCode.OK)
|
||||||
|
{
|
||||||
|
bool.TryParse(response.Content, out answ);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.Error($"ProjectArchSend | Response StatusCode: {response.StatusCode} | content: {response.Content}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Versione async Invio dizionario progetti con stato archiviato...
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rec2send">record da inviare come dizionario ProjCloudId / Stato archived</param>
|
||||||
|
/// <returns>Esito esecuzione</returns>
|
||||||
|
public async Task<bool> ProjectArchSendAsync(Dictionary<int, bool> rec2send)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
// cerco online
|
||||||
|
using (RestClient client = new RestClient(rcOptions))
|
||||||
|
{
|
||||||
|
string MKeyEnc = HttpUtility.UrlEncode(RestToken);
|
||||||
|
// impacchetto dati x invio...
|
||||||
|
RestPayload.ProjStatusData newPayload = new RestPayload.ProjStatusData()
|
||||||
|
{
|
||||||
|
ProjStatusList = rec2send
|
||||||
|
};
|
||||||
|
var jsonBody = JsonConvert.SerializeObject(newPayload);
|
||||||
|
var request = new RestRequest($"Projects/proj-arch-send/{MKeyEnc}", Method.Post).AddJsonBody(jsonBody);
|
||||||
|
var response = await client.PostAsync(request);
|
||||||
|
// controllo risposta
|
||||||
|
if (response.StatusCode == HttpStatusCode.OK)
|
||||||
|
{
|
||||||
|
bool.TryParse(response.Content, out answ);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.Error($"ProjectArchSendAsync | Response StatusCode: {response.StatusCode} | content: {response.Content}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return await Task.FromResult(answ);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco progetti associati a chiave
|
/// Elenco progetti associati a chiave
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -572,9 +846,74 @@ namespace EgwProxy.MagMan
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invio record Proj x upsert
|
/// Invio record ProjProg x aggiornamento stato
|
||||||
/// <param name="rec2send">record da inviare</param>
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="rec2send">record da inviare</param>
|
||||||
|
/// <returns>ProjCloudId (essitente o nuovo)</returns>
|
||||||
|
public bool ProjectProgrSend(ProjectProgrDTO rec2send)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
// cerco online
|
||||||
|
using (RestClient client = new RestClient(rcOptions))
|
||||||
|
{
|
||||||
|
string MKeyEnc = HttpUtility.UrlEncode(RestToken);
|
||||||
|
// impacchetto dati x invio...
|
||||||
|
RestPayload.ProdInfoData newPayload = new RestPayload.ProdInfoData()
|
||||||
|
{
|
||||||
|
ProjectProgress = rec2send
|
||||||
|
};
|
||||||
|
var jsonBody = JsonConvert.SerializeObject(newPayload);
|
||||||
|
var request = new RestRequest($"Projects/prod-update/{MKeyEnc}", Method.Post).AddJsonBody(jsonBody);
|
||||||
|
var response = client.Post(request);
|
||||||
|
// controllo risposta
|
||||||
|
if (response.StatusCode == HttpStatusCode.OK)
|
||||||
|
{
|
||||||
|
bool.TryParse(response.Content, out answ);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.Error($"ProjectProgrSend | Response StatusCode: {response.StatusCode} | content: {response.Content}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Versione async Invio record ProjProg x aggiornamento stato
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rec2send">record da inviare</param>
|
||||||
|
public async Task<bool> ProjectProgrSendAsync(ProjectProgrDTO rec2send)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
// cerco online
|
||||||
|
using (RestClient client = new RestClient(rcOptions))
|
||||||
|
{
|
||||||
|
string MKeyEnc = HttpUtility.UrlEncode(RestToken);
|
||||||
|
// impacchetto dati x invio...
|
||||||
|
RestPayload.ProdInfoData newPayload = new RestPayload.ProdInfoData()
|
||||||
|
{
|
||||||
|
ProjectProgress = rec2send
|
||||||
|
};
|
||||||
|
var jsonBody = JsonConvert.SerializeObject(newPayload);
|
||||||
|
var request = new RestRequest($"Projects/prod-update/{MKeyEnc}", Method.Post).AddJsonBody(jsonBody);
|
||||||
|
var response = await client.PostAsync(request);
|
||||||
|
// controllo risposta
|
||||||
|
if (response.StatusCode == HttpStatusCode.OK)
|
||||||
|
{
|
||||||
|
bool.TryParse(response.Content, out answ);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.Error($"ProjectProgrSendAsync | Response StatusCode: {response.StatusCode} | content: {response.Content}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return await Task.FromResult(answ);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Invio record Proj x upsert
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rec2send">record da inviare</param>
|
||||||
/// <returns>ProjCloudId (essitente o nuovo)</returns>
|
/// <returns>ProjCloudId (essitente o nuovo)</returns>
|
||||||
public int ProjectSend(ProjectDTO rec2send)
|
public int ProjectSend(ProjectDTO rec2send)
|
||||||
{
|
{
|
||||||
@@ -595,7 +934,6 @@ namespace EgwProxy.MagMan
|
|||||||
if (response.StatusCode == HttpStatusCode.OK)
|
if (response.StatusCode == HttpStatusCode.OK)
|
||||||
{
|
{
|
||||||
int.TryParse(response.Content, out answ);
|
int.TryParse(response.Content, out answ);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -606,9 +944,9 @@ namespace EgwProxy.MagMan
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Versione async Invio elenco di RawItems associati ad un singolo materiale, il server
|
/// Versione async Invio Proj x upsert
|
||||||
/// farà il merge <param name="rec2send">record da inviare</param>
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="rec2send">record da inviare</param>
|
||||||
public async Task<int> ProjectSendAsync(ProjectDTO rec2send)
|
public async Task<int> ProjectSendAsync(ProjectDTO rec2send)
|
||||||
{
|
{
|
||||||
int answ = 0;
|
int answ = 0;
|
||||||
@@ -637,6 +975,82 @@ namespace EgwProxy.MagMan
|
|||||||
return await Task.FromResult(answ);
|
return await Task.FromResult(answ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Verifica elenco di risorse associate ad un progetto
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idxProjDbId">DbId del progetto da inviare</param>
|
||||||
|
/// <param name="recType">tipo di registrazione da inviare (stima, consumo, ...)</param>
|
||||||
|
/// <param name="dtRif">DataOra di riferimento del record</param>
|
||||||
|
/// <param name="rec2send">record da inviare, se consumo Qty deve essere negativa</param>
|
||||||
|
/// <returns>0 = errore comunicazione / 1 = risorse invariate / 2 = risorse cambiate</returns>
|
||||||
|
public int ResourceCheck(int idxProjDbId, ProjResState recType, DateTime dtRif, List<ResourceDTO> rec2send)
|
||||||
|
{
|
||||||
|
int answ = 0;
|
||||||
|
// cerco online
|
||||||
|
using (RestClient client = new RestClient(rcOptions))
|
||||||
|
{
|
||||||
|
string MKeyEnc = HttpUtility.UrlEncode(RestToken);
|
||||||
|
// impacchetto dati x invio...
|
||||||
|
RestPayload.Resources newPayload = new RestPayload.Resources()
|
||||||
|
{
|
||||||
|
DtReq = dtRif,
|
||||||
|
ProjCloudId = idxProjDbId,
|
||||||
|
ReqState = recType,
|
||||||
|
ResourceList = rec2send
|
||||||
|
};
|
||||||
|
var jsonBody = JsonConvert.SerializeObject(newPayload);
|
||||||
|
var request = new RestRequest($"Resources/check/{MKeyEnc}", Method.Post).AddJsonBody(jsonBody);
|
||||||
|
var response = client.Post(request);
|
||||||
|
// controllo risposta
|
||||||
|
if (response.StatusCode == HttpStatusCode.OK)
|
||||||
|
{
|
||||||
|
answ = response.Content == "EQUAL" ? 1 : 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.Error($"ResourceCheck | Response StatusCode: {response.StatusCode} | content: {response.Content}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Versione async Verifica elenco di risorse associate ad un progetto
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idxProjDbId">DbId del progetto da inviare</param>
|
||||||
|
/// <param name="recType">tipo di registrazione da inviare (stima, consumo, ...)</param>
|
||||||
|
/// <param name="rec2send">record da inviare, se consumo Qty deve essere negativa</param>
|
||||||
|
/// <returns>0 = errore comunicazione / 1 = risorse invariate / 2 = risorse cambiate</returns>
|
||||||
|
public async Task<int> ResourceCheckAsync(int idxProjDbId, ProjResState recType, List<ResourceDTO> rec2send)
|
||||||
|
{
|
||||||
|
int answ = 0;
|
||||||
|
// cerco online
|
||||||
|
using (RestClient client = new RestClient(rcOptions))
|
||||||
|
{
|
||||||
|
string MKeyEnc = HttpUtility.UrlEncode(RestToken);
|
||||||
|
// impacchetto dati x invio...
|
||||||
|
RestPayload.Resources newPayload = new RestPayload.Resources()
|
||||||
|
{
|
||||||
|
ProjCloudId = idxProjDbId,
|
||||||
|
ReqState = recType,
|
||||||
|
ResourceList = rec2send
|
||||||
|
};
|
||||||
|
var jsonBody = JsonConvert.SerializeObject(newPayload);
|
||||||
|
var request = new RestRequest($"Resources/check/{MKeyEnc}", Method.Post).AddJsonBody(jsonBody);
|
||||||
|
var response = await client.PostAsync(request);
|
||||||
|
// controllo risposta
|
||||||
|
if (response.StatusCode == HttpStatusCode.OK)
|
||||||
|
{
|
||||||
|
answ = response.Content == "EQUAL" ? 1 : 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.Error($"ResourceCheckAsync | Response StatusCode: {response.StatusCode} | content: {response.Content}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return await Task.FromResult(answ);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco risorse associate a progetto
|
/// Elenco risorse associate a progetto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -694,9 +1108,10 @@ namespace EgwProxy.MagMan
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="idxProjDbId">DbId del progetto da inviare</param>
|
/// <param name="idxProjDbId">DbId del progetto da inviare</param>
|
||||||
/// <param name="recType">tipo di registrazione da inviare (stima, consumo, ...)</param>
|
/// <param name="recType">tipo di registrazione da inviare (stima, consumo, ...)</param>
|
||||||
|
/// <param name="dtRif">DataOra di riferimento del record</param>
|
||||||
/// <param name="rec2send">record da inviare, se consumo Qty deve essere negativa</param>
|
/// <param name="rec2send">record da inviare, se consumo Qty deve essere negativa</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool ResourceSend(int idxProjDbId, ProjResState recType, List<ResourceDTO> rec2send)
|
public bool ResourceSend(int idxProjDbId, ProjResState recType, DateTime dtRif, List<ResourceDTO> rec2send)
|
||||||
{
|
{
|
||||||
bool answ = false;
|
bool answ = false;
|
||||||
// cerco online
|
// cerco online
|
||||||
@@ -706,6 +1121,7 @@ namespace EgwProxy.MagMan
|
|||||||
// impacchetto dati x invio...
|
// impacchetto dati x invio...
|
||||||
RestPayload.Resources newPayload = new RestPayload.Resources()
|
RestPayload.Resources newPayload = new RestPayload.Resources()
|
||||||
{
|
{
|
||||||
|
DtReq = dtRif,
|
||||||
ProjCloudId = idxProjDbId,
|
ProjCloudId = idxProjDbId,
|
||||||
ReqState = recType,
|
ReqState = recType,
|
||||||
ResourceList = rec2send
|
ResourceList = rec2send
|
||||||
@@ -767,17 +1183,17 @@ namespace EgwProxy.MagMan
|
|||||||
|
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Istanza logger
|
||||||
|
/// </summary>
|
||||||
|
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// URL dell'API x chiamate gestione licenze
|
/// URL dell'API x chiamate gestione licenze
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private string apiUrl = $"";
|
private string apiUrl = $"";
|
||||||
|
|
||||||
private int callTimeout = 500;
|
private int callTimeout = 10000;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Istanza logger
|
|
||||||
/// </summary>
|
|
||||||
private Logger Log = LogManager.GetCurrentClassLogger();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Opzioni standard di chiamata
|
/// Opzioni standard di chiamata
|
||||||
|
|||||||
@@ -31,8 +31,8 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.7.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
@@ -40,8 +40,8 @@
|
|||||||
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NLog.5.0.1\lib\net46\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.5.0.1\lib\net46\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="RestSharp, Version=110.2.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
|
<Reference Include="RestSharp, Version=111.2.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\RestSharp.110.2.0\lib\net471\RestSharp.dll</HintPath>
|
<HintPath>..\packages\RestSharp.111.2.0\lib\net471\RestSharp.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
@@ -60,11 +60,11 @@
|
|||||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Text.Encodings.Web, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Text.Encodings.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Text.Encodings.Web.7.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
<HintPath>..\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Text.Json, Version=7.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Text.Json, Version=8.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Text.Json.7.0.3\lib\net462\System.Text.Json.dll</HintPath>
|
<HintPath>..\packages\System.Text.Json.8.0.3\lib\net462\System.Text.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||||
@@ -86,6 +86,8 @@
|
|||||||
<Compile Include="DTO\ItemDTO.cs" />
|
<Compile Include="DTO\ItemDTO.cs" />
|
||||||
<Compile Include="DTO\MaterialDTO.cs" />
|
<Compile Include="DTO\MaterialDTO.cs" />
|
||||||
<Compile Include="DTO\ProjectDTO.cs" />
|
<Compile Include="DTO\ProjectDTO.cs" />
|
||||||
|
<Compile Include="DTO\LogMachineDTO.cs" />
|
||||||
|
<Compile Include="DTO\ProjectProgrDTO.cs" />
|
||||||
<Compile Include="DTO\ResourceDTO.cs" />
|
<Compile Include="DTO\ResourceDTO.cs" />
|
||||||
<Compile Include="DTO\ResourceExpDTO.cs" />
|
<Compile Include="DTO\ResourceExpDTO.cs" />
|
||||||
<Compile Include="Enums.cs" />
|
<Compile Include="Enums.cs" />
|
||||||
|
|||||||
@@ -12,27 +12,47 @@ namespace EgwProxy.MagMan
|
|||||||
BEAM = 1,
|
BEAM = 1,
|
||||||
WALL = 2
|
WALL = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum MachLogTypes
|
||||||
|
{
|
||||||
|
NULL = 0
|
||||||
|
, PART_STATUS = 1
|
||||||
|
, MACHGROUP_STATUS = 2
|
||||||
|
, MACHINE_MODE = 3
|
||||||
|
, MACHINE_STATUS = 4
|
||||||
|
, MACHINE_COMMAND = 5
|
||||||
|
, READ_VAR = 6
|
||||||
|
, WRITE_VAR = 7
|
||||||
|
, ALARM = 8
|
||||||
|
, OPERATOR_MSG = 9
|
||||||
|
, PROGRAM_SEND = 10
|
||||||
|
}
|
||||||
|
|
||||||
public enum ProjResState
|
public enum ProjResState
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Registrazione consumo effettivo (update giacenza su tab RawItemList)
|
/// Registrazione consumo effettivo (update giacenza su tab RawItemList)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Consumed = -1,
|
Consumed = -1,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Non definito
|
/// Non definito
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ND = 0,
|
ND = 0,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Consumo stimato da nesting (solo simulazione)
|
/// Consumo stimato da nesting (solo simulazione)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Estimated,
|
Estimated,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Consumo confermato (da ordinare)
|
/// Consumo confermato (da ordinare)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Confirmed,
|
Confirmed,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Riservato (utile x calcolo quantità da ordinare)
|
/// Riservato (utile x calcolo quantità da ordinare)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Reserved
|
Reserved
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -35,6 +35,18 @@ namespace EgwProxy.MagMan
|
|||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class LogData
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco record log x invio POST
|
||||||
|
/// </summary>
|
||||||
|
public List<LogMachineDTO> LogList { get; set; }
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
|
||||||
public class Materials
|
public class Materials
|
||||||
{
|
{
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
@@ -47,6 +59,25 @@ namespace EgwProxy.MagMan
|
|||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class PeriodData
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public DateTime DtEnd { get; set; } = DateTime.Now;
|
||||||
|
public DateTime DtStart { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ProdInfoData
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public ProjectProgrDTO ProjectProgress { get; set; }
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
|
||||||
public class Projects
|
public class Projects
|
||||||
{
|
{
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
@@ -56,10 +87,24 @@ namespace EgwProxy.MagMan
|
|||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ProjStatusData
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public Dictionary<int, bool> ProjStatusList { get; set; }
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
|
||||||
public class Resources
|
public class Resources
|
||||||
{
|
{
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DataOra richiesta (data-ora del client)
|
||||||
|
/// </summary>
|
||||||
|
public DateTime DtReq { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ID progetto univoco su Cloud
|
/// ID progetto univoco su Cloud
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="7.0.0" targetFramework="net472" />
|
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net472" />
|
||||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
||||||
<package id="NLog" version="5.0.1" targetFramework="net472" />
|
<package id="NLog" version="5.0.1" targetFramework="net472" />
|
||||||
<package id="RestSharp" version="110.2.0" targetFramework="net472" />
|
<package id="RestSharp" version="111.2.0" targetFramework="net472" />
|
||||||
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
||||||
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
|
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
|
||||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
||||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
|
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
|
||||||
<package id="System.Text.Encodings.Web" version="7.0.0" targetFramework="net472" />
|
<package id="System.Text.Encodings.Web" version="8.0.0" targetFramework="net472" />
|
||||||
<package id="System.Text.Json" version="7.0.3" targetFramework="net472" />
|
<package id="System.Text.Json" version="8.0.3" targetFramework="net472" />
|
||||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
||||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
|
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
|
||||||
</packages>
|
</packages>
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
# Note ed utility per GIT
|
||||||
|
|
||||||
|
Comandi utili x GIT.
|
||||||
|
|
||||||
|
|
||||||
|
Ad esempio per semplificare il processo di creazione del changelog (allegato al file readme del progetto e in versione ridotta nel sw)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git log --branches --remotes --full-history --date-order --format='%ai%d %an <%ae> | %h | %f' > .temp/CommitLogHistory.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
Questo produrrà un file come il seguente
|
||||||
|
|
||||||
|
```csv
|
||||||
|
2024-07-30 15:02:15 +0200 (HEAD -> develop, origin/develop) Samuele Locatelli <samuele@steamware.net> | 0cebf0a | Merge-tag-FixRedisMasterFlush01-into-develop
|
||||||
|
2024-07-30 15:02:08 +0200 (tag: FixRedisMasterFlush01, origin/main, origin/HEAD, main) Samuele Locatelli <samuele@steamware.net> | 46a0c55 | Merge-branch-release-FixRedisMasterFlush01
|
||||||
|
2024-07-30 15:01:41 +0200 Samuele Locatelli <samuele@steamware.net> | e8b9770 | Completato-review-gestione-cache-redis-x-MagMan
|
||||||
|
2024-07-30 14:44:38 +0200 Samuele Locatelli <samuele@steamware.net> | 6bd3686 | Continuo-riscrittura-metodi-gestione-redis-cache-su-classi-separate
|
||||||
|
2024-07-29 09:41:05 +0200 Samuele Locatelli <samuele@steamware.net> | 83ed7d9 | Merge-tag-TestSentinelGalera01-into-develop
|
||||||
|
2024-07-29 09:40:00 +0200 (tag: TestSentinelGalera01) Samuele Locatelli <samuele@steamware.net> | 9054d42 | Merge-branch-release-TestSentinelGalera01
|
||||||
|
2024-07-29 09:39:26 +0200 Samuele Locatelli <samuele@steamware.net> | 08e54ff | Update-conf-x-usare-sentinel-localhost-e-db-locale-galera-cluster
|
||||||
|
```
|
||||||
|
|
||||||
|
Che poi si può usare x generare un chagnelog accurato
|
||||||
|
|
||||||
|
PS: il file è escluso da gitignore come tutti quelli in folder .temp
|
||||||
BIN
Binary file not shown.
@@ -20,5 +20,13 @@ namespace MagMan.Core
|
|||||||
public const string redisBaseAddr = "MagManUi";
|
public const string redisBaseAddr = "MagManUi";
|
||||||
public const string rKeyConfig = $"{redisBaseAddr}:Cache";
|
public const string rKeyConfig = $"{redisBaseAddr}:Cache";
|
||||||
|
|
||||||
|
// REDIS Channels messaggi x QueueMan
|
||||||
|
public static readonly string Q_MMAN_GEN = $"MagManGeneral";
|
||||||
|
public static readonly string Q_MMAN_ALIAS_MAT = $"MagManAliasMaterial";
|
||||||
|
public static readonly string Q_MMAN_INVE = $"MagManInve";
|
||||||
|
public static readonly string Q_MMAN_LOG = $"MagManLog";
|
||||||
|
public static readonly string Q_MMAN_PROJ = $"MagManProj";
|
||||||
|
public static readonly string Q_MMAN_RES = $"MagManRes";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,10 @@ namespace MagMan.Core.DTO
|
|||||||
/// Codice Alias in cui viene convertito
|
/// Codice Alias in cui viene convertito
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ValAlias { get; set; } = "";
|
public string ValAlias { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indica se il record sia attivo/valido (per cancellazione logica online e fisica in remoto)
|
||||||
|
/// </summary>
|
||||||
|
public bool IsActive { get; set; } = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ namespace MagMan.Core.DTO
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int RawItemLocalId { get; set; } = 0;
|
public int RawItemLocalId { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Boolean for logical delete
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDeleted { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check if is a Remnant
|
/// Check if is a Remnant
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagMan.Core.DTO
|
||||||
|
{
|
||||||
|
// <Auto-Generated>
|
||||||
|
// This is here so CodeMaid doesn't reorganize this document
|
||||||
|
// </Auto-Generated>
|
||||||
|
public class LogMachineDTO
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Key progetto (DB) / CLOUD
|
||||||
|
/// </summary>
|
||||||
|
public int ProjCloudId { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stato da enum
|
||||||
|
/// </summary>
|
||||||
|
public Enums.MachLogTypes EvType { get; set; } = Enums.MachLogTypes.NULL;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Evento
|
||||||
|
/// </summary>
|
||||||
|
public DateTime DtEvent { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ID Supervisore (Indirizzo VAR)
|
||||||
|
/// </summary>
|
||||||
|
public string SupervId { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Valore VAR (oggetto del log) da decodificare
|
||||||
|
/// </summary>
|
||||||
|
public string VarValue { get; set; } = "";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -48,9 +48,14 @@ namespace MagMan.Core.DTO
|
|||||||
public int SizeNum { get; set; } = 0;
|
public int SizeNum { get; set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Quantità totale in giacenza
|
/// Quantità totale in giacenza, come lunghezza (m) se barre o area (m2) se pareti
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int QtyTot { get; set; } = 0;
|
public decimal QtyTot { get; set; } = 0;
|
||||||
|
|
||||||
|
public string UM
|
||||||
|
{
|
||||||
|
get => IsBeam ? "m" : "m2";
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Codice materiale x QR/Datamatrix
|
/// Codice materiale x QR/Datamatrix
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
using static MagMan.Core.Enums;
|
||||||
|
|
||||||
|
namespace MagMan.Core.DTO
|
||||||
|
{
|
||||||
|
// <Auto-Generated>
|
||||||
|
// This is here so CodeMaid doesn't reorganize this document
|
||||||
|
// </Auto-Generated>
|
||||||
|
public class ProjectProgrDTO
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Key progetto (DB) / CLOUD
|
||||||
|
/// </summary>
|
||||||
|
public int ProjCloudId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Avanzamento (tipicamente barre fatte)
|
||||||
|
/// </summary>
|
||||||
|
public double ValAct { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Valore finale atteso (tipicamente barre da fare)
|
||||||
|
/// </summary>
|
||||||
|
public double ValMax { get; set; } = 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tempo lavorazione reale in minuti (parziale o totale se chiuso/completato/archiviato)
|
||||||
|
/// </summary>
|
||||||
|
public double ProcTimeReal { get; set; } = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -66,8 +66,8 @@
|
|||||||
public DateTime DtRequest { get; set; }
|
public DateTime DtRequest { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Richiesta attiva (se false == NON è il piano scelto per i casi "previsionali" = ReqState >0 )
|
/// record richiesto (me lo aspetto sempre a false se viene inviato/registrato...)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsActive { get; set; } = true;
|
public bool IsDeleted { get; set; } = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-2
@@ -22,37 +22,57 @@ namespace MagMan.Core
|
|||||||
Request,
|
Request,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum MachLogTypes
|
||||||
|
{
|
||||||
|
NULL = 0
|
||||||
|
, PART_STATUS = 1
|
||||||
|
, MACHGROUP_STATUS = 2
|
||||||
|
, MACHINE_MODE = 3
|
||||||
|
, MACHINE_STATUS = 4
|
||||||
|
, MACHINE_COMMAND = 5
|
||||||
|
, READ_VAR = 6
|
||||||
|
, WRITE_VAR = 7
|
||||||
|
, ALARM = 8
|
||||||
|
, OPERATOR_MSG = 9
|
||||||
|
, PROGRAM_SEND = 10
|
||||||
|
}
|
||||||
|
|
||||||
public enum ProjResState
|
public enum ProjResState
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Registrazione consumo effettivo (update giacenza su tab RawItemList)
|
/// Registrazione consumo effettivo (update giacenza su tab RawItemList)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Consumed = -1,
|
Consumed = -1,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Non definito
|
/// Non definito
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ND = 0,
|
ND = 0,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Consumo stimato da nesting (solo simulazione)
|
/// Consumo stimato da nesting (solo simulazione)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Estimated,
|
Estimated,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Consumo confermato (da ordinare)
|
/// Consumo confermato (da ordinare)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Confirmed,
|
Confirmed,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Riservato (utile x calcolo quantità da ordinare)
|
/// Riservato (utile x calcolo quantità da ordinare)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Reserved
|
Reserved
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if false
|
||||||
public enum ResultTypes
|
public enum ResultTypes
|
||||||
{
|
{
|
||||||
NULL = 0,
|
NULL = 0,
|
||||||
EXECUTED = 1,
|
EXECUTED = 1,
|
||||||
RESULT = 2
|
RESULT = 2
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endregion Public Enums
|
#endregion Public Enums
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,17 @@
|
|||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
<Configurations>Debug;Release</Configurations>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Blazored.LocalStorage" Version="4.3.0" />
|
<PackageReference Include="Blazored.LocalStorage" Version="4.3.0" />
|
||||||
<PackageReference Include="Blazored.SessionStorage" Version="2.4.0" />
|
<PackageReference Include="Blazored.SessionStorage" Version="2.4.0" />
|
||||||
<PackageReference Include="MailKit" Version="4.2.0" />
|
<PackageReference Include="MailKit" Version="4.2.0" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
|
||||||
<PackageReference Include="NLog" Version="5.2.7" />
|
<PackageReference Include="NLog" Version="5.2.8" />
|
||||||
<PackageReference Include="StackExchange.Redis" Version="2.7.10" />
|
<PackageReference Include="StackExchange.Redis" Version="2.7.33" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -0,0 +1,152 @@
|
|||||||
|
using NLog;
|
||||||
|
using StackExchange.Redis;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagMan.Core
|
||||||
|
{
|
||||||
|
public class MessagePipe
|
||||||
|
{
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
public MessagePipe(IConnectionMultiplexer redisConn, string channelName, bool enableLog = false)
|
||||||
|
{
|
||||||
|
_channel = new RedisChannel(channelName, RedisChannel.PatternMode.Literal); ;
|
||||||
|
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
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Invio messaggio sul canale + salvataggio in cache REDIS
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="memKey">Chiave REDIS x salvare valore</param>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
public bool saveAndSendMessage(string memKey, string message)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
Stopwatch stopWatch = new Stopwatch();
|
||||||
|
stopWatch.Start();
|
||||||
|
|
||||||
|
// invio notifica tramite il canale richiesto
|
||||||
|
answ = sendMessage(message);
|
||||||
|
if (redisDb != null)
|
||||||
|
{
|
||||||
|
redisDb.StringSetAsync(memKey, message);
|
||||||
|
}
|
||||||
|
stopWatch.Stop();
|
||||||
|
TimeSpan ts = stopWatch.Elapsed;
|
||||||
|
if (numSent.ContainsKey(memKey))
|
||||||
|
{
|
||||||
|
numSent[memKey]++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
numSent.Add(memKey, 1);
|
||||||
|
}
|
||||||
|
if (enableLog || numSent[memKey] > 30)
|
||||||
|
{
|
||||||
|
Log.Info($"saveAndSendMessage| mKey {memKey} x {numSent[memKey]} | {message.Length} size | {ts.TotalMilliseconds} ms");
|
||||||
|
|
||||||
|
numSent[memKey] = 0;
|
||||||
|
}
|
||||||
|
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 Dictionary<string, int> numSent = new Dictionary<string, int>();
|
||||||
|
private IConnectionMultiplexer redis;
|
||||||
|
private IDatabase? redisDb;
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
|
#region Private Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Canale associato al gestore pipeline messaggi
|
||||||
|
/// </summary>
|
||||||
|
private RedisChannel _channel { get; set; } = new RedisChannel("Default", RedisChannel.PatternMode.Literal);
|
||||||
|
|
||||||
|
#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
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,6 +36,18 @@ namespace MagMan.Core
|
|||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class LogData
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco record log x invio POST
|
||||||
|
/// </summary>
|
||||||
|
public List<LogMachineDTO> LogList { get; set; } = new List<LogMachineDTO>();
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
|
||||||
public class Materials
|
public class Materials
|
||||||
{
|
{
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
@@ -48,6 +60,25 @@ namespace MagMan.Core
|
|||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class PeriodData
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public DateTime DtEnd { get; set; } = DateTime.Now;
|
||||||
|
public DateTime DtStart { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ProdInfoData
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public ProjectProgrDTO? ProjectProgress { get; set; }
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
|
||||||
public class Projects
|
public class Projects
|
||||||
{
|
{
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
@@ -57,10 +88,24 @@ namespace MagMan.Core
|
|||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ProjStatusData
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public Dictionary<int, bool>? ProjStatusList { get; set; }
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
|
||||||
public class Resources
|
public class Resources
|
||||||
{
|
{
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DataOra richiesta (data-ora del client)
|
||||||
|
/// </summary>
|
||||||
|
public DateTime DtReq { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ID progetto univoco su cloud
|
/// ID progetto univoco su cloud
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using MagMan.Core;
|
using NLog;
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using NLog;
|
|
||||||
using NLog.Fluent;
|
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
@@ -10,27 +8,42 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace MagMan.Data.Tenant.Services
|
namespace MagMan.Core.Services
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Classe di partenza x costruzione servizi di accesso dati + cache
|
/// Classe di partenza x costruzione servizi di accesso dati + cache
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class BaseServ
|
public class BaseServ
|
||||||
{
|
{
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Refresh globale cache redis
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<bool> FlushRedisCache()
|
||||||
|
{
|
||||||
|
Stopwatch stopWatch = new Stopwatch();
|
||||||
|
stopWatch.Start();
|
||||||
|
await Task.Delay(1);
|
||||||
|
RedisValue pattern = new RedisValue($"{Const.rKeyConfig}:*");
|
||||||
|
bool answ = await ExecFlushRedisPattern(pattern);
|
||||||
|
stopWatch.Stop();
|
||||||
|
Log.Debug($"FlushRedisCache in {stopWatch.Elapsed.TotalMilliseconds} ms");
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
|
||||||
#region Protected Fields
|
#region Protected Fields
|
||||||
|
|
||||||
|
protected static IConfiguration _configuration = null!;
|
||||||
protected static Logger Log = LogManager.GetCurrentClassLogger();
|
protected static Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
protected IConfiguration _configuration = null!;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Durata cache lunga IN SECONDI
|
/// Numero di operazioni parallele che si possono svolgere... (se 0 NON usa cicli paralleli)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected int cacheTtlLong = 60 * 5;
|
protected int numPar = 0;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Durata cache breve IN SECONDI
|
|
||||||
/// </summary>
|
|
||||||
protected int cacheTtlShort = 60 * 1;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Oggetto per connessione a REDIS
|
/// Oggetto per connessione a REDIS
|
||||||
@@ -42,12 +55,12 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected IDatabase redisDb = null!;
|
protected IDatabase redisDb = null!;
|
||||||
|
|
||||||
protected Random rnd = new Random();
|
|
||||||
|
|
||||||
#endregion Protected Fields
|
#endregion Protected Fields
|
||||||
|
|
||||||
#region Protected Properties
|
#region Protected Properties
|
||||||
|
|
||||||
|
protected string CodApp { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Durata cache breve (1 min circa + perturbazione percentuale +/-10%)
|
/// Durata cache breve (1 min circa + perturbazione percentuale +/-10%)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -92,41 +105,69 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
protected async Task<bool> ExecFlushRedisPattern(RedisValue pattern)
|
protected async Task<bool> ExecFlushRedisPattern(RedisValue pattern)
|
||||||
{
|
{
|
||||||
bool answ = false;
|
bool answ = false;
|
||||||
var listEndpoints = redisConn.GetEndPoints();
|
/*******************************
|
||||||
foreach (var endPoint in listEndpoints)
|
* Recupero elenco dei server da cui cancellare le chaivi:
|
||||||
|
* - prendo solo i server connessi
|
||||||
|
* - prendo solo NON repliche (= master)
|
||||||
|
* - me ne aspetto 1 in uscita cmq
|
||||||
|
*******************************/
|
||||||
|
var connServ = redisConn.GetEndPoints()
|
||||||
|
.Select(endpoint =>
|
||||||
|
{
|
||||||
|
var server = redisConn.GetServer(endpoint);
|
||||||
|
return server;
|
||||||
|
})
|
||||||
|
.Where(x => x.IsConnected && !x.IsReplica)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
// ciclo (anche se me ne aspetto 1 solo)
|
||||||
|
foreach (var mServer in connServ)
|
||||||
{
|
{
|
||||||
//var server = redisConnAdmin.GetServer(listEndpoints[0]);
|
try
|
||||||
var server = redisConn.GetServer(endPoint);
|
|
||||||
if (server != null)
|
|
||||||
{
|
{
|
||||||
var keyList = server.Keys(redisDb.Database, pattern);
|
var keyList = mServer.Keys(redisDb.Database, pattern);
|
||||||
foreach (var item in keyList)
|
if (numPar > 0)
|
||||||
{
|
{
|
||||||
await redisDb.KeyDeleteAsync(item);
|
var options = new ParallelOptions { MaxDegreeOfParallelism = numPar };
|
||||||
|
await Parallel.ForEachAsync(keyList, async (item, token) =>
|
||||||
|
{
|
||||||
|
// cancello
|
||||||
|
await redisDb.KeyDeleteAsync(item);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (var item in keyList)
|
||||||
|
{
|
||||||
|
await redisDb.KeyDeleteAsync(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
answ = true;
|
answ = true;
|
||||||
}
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione durante ExecFlushRedisPattern | pattern: {pattern}{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Refresh globale cache redis
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected async Task<bool> FlushRedisCache()
|
|
||||||
{
|
|
||||||
Stopwatch stopWatch = new Stopwatch();
|
|
||||||
stopWatch.Start();
|
|
||||||
await Task.Delay(1);
|
|
||||||
RedisValue pattern = new RedisValue($"{Const.rKeyConfig}:*");
|
|
||||||
bool answ = await ExecFlushRedisPattern(pattern);
|
|
||||||
stopWatch.Stop();
|
|
||||||
Log.Debug($"FlushRedisCache in {stopWatch.Elapsed.TotalMilliseconds} ms");
|
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Protected Methods
|
#endregion Protected Methods
|
||||||
|
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Durata cache lunga IN SECONDI
|
||||||
|
/// </summary>
|
||||||
|
private int cacheTtlLong = 60 * 5;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Durata cache breve IN SECONDI
|
||||||
|
/// </summary>
|
||||||
|
private int cacheTtlShort = 60 * 1;
|
||||||
|
|
||||||
|
private Random rnd = new Random();
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using Blazored.LocalStorage;
|
using Blazored.LocalStorage;
|
||||||
using Blazored.SessionStorage;
|
using Blazored.SessionStorage;
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using Microsoft.VisualBasic;
|
||||||
using NLog;
|
using NLog;
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
@@ -19,27 +20,71 @@ namespace MagMan.Core.Services
|
|||||||
// setup componenti REDIS
|
// setup componenti REDIS
|
||||||
redisConn = RedConn;
|
redisConn = RedConn;
|
||||||
redisDb = redisConn.GetDatabase();
|
redisDb = redisConn.GetDatabase();
|
||||||
|
|
||||||
|
// setup canali pub/sub
|
||||||
|
QueUpdGen = new MessagePipe(redisConn, Const.Q_MMAN_GEN);
|
||||||
|
QueUpdAliasMat = new MessagePipe(redisConn, Const.Q_MMAN_ALIAS_MAT);
|
||||||
|
QueUpdInve= new MessagePipe(redisConn, Const.Q_MMAN_LOG);
|
||||||
|
QueUpdLog = new MessagePipe(redisConn, Const.Q_MMAN_LOG);
|
||||||
|
QueUpdProj = new MessagePipe(redisConn, Const.Q_MMAN_PROJ);
|
||||||
|
QueUpdRes = new MessagePipe(redisConn, Const.Q_MMAN_RES);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
|
|
||||||
#region Public Events
|
#region Public Events
|
||||||
|
|
||||||
public event Action EA_FilterUpdated = null!;
|
|
||||||
public event Action EA_HideSearch = null!;
|
|
||||||
public event Action EA_PageUpdated = null!;
|
|
||||||
public event Action EA_SearchUpdated = null!;
|
|
||||||
public event Action EA_ShowSearch = null!;
|
|
||||||
public event Action EA_CustomerSel = null!;
|
public event Action EA_CustomerSel = null!;
|
||||||
|
|
||||||
|
public event Action EA_FilterUpdated = null!;
|
||||||
|
|
||||||
|
public event Action EA_HideSearch = null!;
|
||||||
|
|
||||||
public event Action EA_KeySel = null!;
|
public event Action EA_KeySel = null!;
|
||||||
|
|
||||||
|
public event Action EA_PageUpdated = null!;
|
||||||
|
|
||||||
|
public event Action EA_SearchUpdated = null!;
|
||||||
|
|
||||||
public event Action<bool> EA_ShowCustomers = null!;
|
public event Action<bool> EA_ShowCustomers = null!;
|
||||||
|
|
||||||
|
public event Action EA_ShowSearch = null!;
|
||||||
|
|
||||||
#endregion Public Events
|
#endregion Public Events
|
||||||
|
|
||||||
|
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
public string UserName { get; set; } = "NA";
|
public int CustomerID
|
||||||
|
{
|
||||||
|
get => _customerID;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_customerID != value)
|
||||||
|
{
|
||||||
|
_customerID = value;
|
||||||
|
if (EA_CustomerSel != null)
|
||||||
|
{
|
||||||
|
EA_CustomerSel?.Invoke();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int KeyNum
|
||||||
|
{
|
||||||
|
get => _keyNum;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_keyNum != value)
|
||||||
|
{
|
||||||
|
_keyNum = value;
|
||||||
|
if (EA_KeySel != null)
|
||||||
|
{
|
||||||
|
EA_KeySel?.Invoke();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string PageIcon
|
public string PageIcon
|
||||||
{
|
{
|
||||||
@@ -82,41 +127,24 @@ namespace MagMan.Core.Services
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public int CustomerID
|
|
||||||
{
|
|
||||||
get => _customerID;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_customerID != value)
|
|
||||||
{
|
|
||||||
_customerID = value;
|
|
||||||
if (EA_CustomerSel != null)
|
|
||||||
{
|
|
||||||
EA_CustomerSel?.Invoke();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int KeyNum
|
|
||||||
{
|
|
||||||
get => _keyNum;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_keyNum != value)
|
|
||||||
{
|
|
||||||
_keyNum = value;
|
|
||||||
if (EA_KeySel != null)
|
|
||||||
{
|
|
||||||
EA_KeySel?.Invoke();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string SelOrderCode { get; set; } = "";
|
public string SelOrderCode { get; set; } = "";
|
||||||
|
|
||||||
public string SelPlantId { get; set; } = "0";
|
public string SelPlantId { get; set; } = "0";
|
||||||
|
|
||||||
|
public bool ShowCustomers
|
||||||
|
{
|
||||||
|
get => _showCustomers;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_showCustomers = value;
|
||||||
|
if (EA_ShowCustomers != null)
|
||||||
|
{
|
||||||
|
EA_ShowCustomers?.Invoke(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool ShowSearch
|
public bool ShowSearch
|
||||||
{
|
{
|
||||||
get => _showSearch;
|
get => _showSearch;
|
||||||
@@ -143,18 +171,41 @@ namespace MagMan.Core.Services
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ShowCustomers
|
/// <summary>
|
||||||
{
|
/// Message pipe ricezione dati da EgtBW relativi a info Alias/Materials
|
||||||
get => _showCustomers;
|
/// </summary>
|
||||||
set
|
public MessagePipe QueUpdAliasMat { get; set; } = null!;
|
||||||
{
|
|
||||||
_showCustomers = value;
|
/// <summary>
|
||||||
if (EA_ShowCustomers != null)
|
/// Message pipe ricezione dati da EgtBW (General/Generics)
|
||||||
{
|
/// </summary>
|
||||||
EA_ShowCustomers?.Invoke(value);
|
public MessagePipe QueUpdGen { get; set; } = null!;
|
||||||
}
|
|
||||||
}
|
/// <summary>
|
||||||
}
|
/// Message pipe ricezione dati da EgtBW relativi a info LogMachine
|
||||||
|
/// </summary>
|
||||||
|
public MessagePipe QueUpdLog { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Message pipe ricezione dati da EgtBW relativi a info Projects
|
||||||
|
/// </summary>
|
||||||
|
public MessagePipe QueUpdProj { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Message pipe ricezione dati da EgtBW relativi a info Resources
|
||||||
|
/// </summary>
|
||||||
|
public MessagePipe QueUpdRes { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Message pipe ricezione dati da EgtBW relativi a info Inventario (aggiunta/consumi)
|
||||||
|
/// </summary>
|
||||||
|
public MessagePipe QueUpdInve { get; set; } = null!;
|
||||||
|
|
||||||
|
public string UserName { get; set; } = "NA";
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Cliente selezionato (da browser data cache)
|
/// Cliente selezionato (da browser data cache)
|
||||||
@@ -173,28 +224,24 @@ namespace MagMan.Core.Services
|
|||||||
await localStore.SetItemAsync("ClientID", newVal);
|
await localStore.SetItemAsync("ClientID", newVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// KeyNum da cliente selezionato (da browser data cache)
|
/// Num record x la pagina corrente
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public async Task<int> KeyNumGet()
|
public async Task<int> NumRowGridGet(string gridName)
|
||||||
{
|
{
|
||||||
var answ = await localStore.GetItemAsync<int>("KeyNum");
|
var answ = await localStore.GetItemAsync<int>($"{gridName}_nRow");
|
||||||
|
answ = answ > 0 ? answ : 10;
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Imposta KeyNum da cliente selezionato (browser data cache)
|
/// Imposta num record x la pagina corrente
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public async Task KeyNumSet(int newVal)
|
public async Task NumRowGridSet(string gridName, int newVal)
|
||||||
{
|
{
|
||||||
await localStore.SetItemAsync("KeyNum", newVal);
|
await localStore.SetItemAsync($"{gridName}_nRow", newVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Properties
|
|
||||||
|
|
||||||
#region Public Methods
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Recupera CustomerID dal dizionario dei token noti o cercando sul DB
|
/// Recupera CustomerID dal dizionario dei token noti o cercando sul DB
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -220,6 +267,23 @@ namespace MagMan.Core.Services
|
|||||||
return fatto;
|
return fatto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// KeyNum da cliente selezionato (da browser data cache)
|
||||||
|
/// </summary>
|
||||||
|
public async Task<int> KeyNumGet()
|
||||||
|
{
|
||||||
|
var answ = await localStore.GetItemAsync<int>("KeyNum");
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Imposta KeyNum da cliente selezionato (browser data cache)
|
||||||
|
/// </summary>
|
||||||
|
public async Task KeyNumSet(int newVal)
|
||||||
|
{
|
||||||
|
await localStore.SetItemAsync("KeyNum", newVal);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Recupera CustomerID dal dizionario dei token noti o cercando sul DB
|
/// Recupera CustomerID dal dizionario dei token noti o cercando sul DB
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -528,13 +592,13 @@ namespace MagMan.Core.Services
|
|||||||
|
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
|
private int _customerID = -1;
|
||||||
|
private int _keyNum = -1;
|
||||||
private string _pageIcon = "";
|
private string _pageIcon = "";
|
||||||
private string _pageName = "";
|
private string _pageName = "";
|
||||||
private string _searchVal = "";
|
private string _searchVal = "";
|
||||||
private int _customerID = -1;
|
|
||||||
private int _keyNum = -1;
|
|
||||||
private bool _showSearch = false;
|
|
||||||
private bool _showCustomers = true;
|
private bool _showCustomers = true;
|
||||||
|
private bool _showSearch = false;
|
||||||
private Logger Log = LogManager.GetCurrentClassLogger();
|
private Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
|
|||||||
@@ -35,14 +35,15 @@ namespace MagMan.Data.Admin
|
|||||||
public static bool CheckCreateUser(string username, string pwd, string dbName)
|
public static bool CheckCreateUser(string username, string pwd, string dbName)
|
||||||
{
|
{
|
||||||
bool answ = false;
|
bool answ = false;
|
||||||
|
int numUser = 0;
|
||||||
using (ServerAdminContext adbCtx = new ServerAdminContext())
|
using (ServerAdminContext adbCtx = new ServerAdminContext())
|
||||||
{
|
{
|
||||||
// ricerca utente...
|
// ricerca utente...
|
||||||
var numUser = adbCtx
|
numUser = adbCtx
|
||||||
.UserList
|
.UserList
|
||||||
.Where(x => x.User == username)
|
.Where(x => x.User == username)
|
||||||
.ToList()
|
.ToList()
|
||||||
.Count;
|
.Count;
|
||||||
if (numUser > 0)
|
if (numUser > 0)
|
||||||
{
|
{
|
||||||
answ = true;
|
answ = true;
|
||||||
@@ -54,7 +55,7 @@ namespace MagMan.Data.Admin
|
|||||||
adbCtx.Database.ExecuteSqlRaw(sqlCommand);
|
adbCtx.Database.ExecuteSqlRaw(sqlCommand);
|
||||||
sqlCommand = $"CREATE USER '{username}'@'localhost' IDENTIFIED BY '{pwd}';";
|
sqlCommand = $"CREATE USER '{username}'@'localhost' IDENTIFIED BY '{pwd}';";
|
||||||
adbCtx.Database.ExecuteSqlRaw(sqlCommand);
|
adbCtx.Database.ExecuteSqlRaw(sqlCommand);
|
||||||
sqlCommand = $"GRANT ALL ON *.* TO '{username}'@'localhost';";
|
sqlCommand = $"GRANT ALL PRIVILEGES ON {dbName}.* TO '{username}'@'localhost';";
|
||||||
adbCtx.Database.ExecuteSqlRaw(sqlCommand);
|
adbCtx.Database.ExecuteSqlRaw(sqlCommand);
|
||||||
sqlCommand = "FLUSH PRIVILEGES;";
|
sqlCommand = "FLUSH PRIVILEGES;";
|
||||||
adbCtx.Database.ExecuteSqlRaw(sqlCommand);
|
adbCtx.Database.ExecuteSqlRaw(sqlCommand);
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using MySqlConnector;
|
||||||
|
using NLog;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -47,6 +49,23 @@ namespace MagMan.Data.Admin
|
|||||||
return DbAdmin.CheckCreateUser(DATABASE_USER, DATABASE_PWD, DATABASE_NAME);
|
return DbAdmin.CheckCreateUser(DATABASE_USER, DATABASE_PWD, DATABASE_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ServerVersion CustomAutoDetect(string connectionString)
|
||||||
|
{
|
||||||
|
#if false
|
||||||
|
using var connection = new MySqlConnection(
|
||||||
|
new MySqlConnectionStringBuilder(connectionString)
|
||||||
|
{
|
||||||
|
Database = string.Empty,
|
||||||
|
// AutoEnlist = false, Pooling = false,
|
||||||
|
}.ConnectionString);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using var connection = new MySqlConnection(connectionString);
|
||||||
|
connection.Open();
|
||||||
|
ServerVersion currVers = ServerVersion.Parse(connection.ServerVersion);
|
||||||
|
return currVers;
|
||||||
|
}
|
||||||
|
|
||||||
public static bool ExecMigrationIdentity()
|
public static bool ExecMigrationIdentity()
|
||||||
{
|
{
|
||||||
// esecuzione migrazione
|
// esecuzione migrazione
|
||||||
@@ -67,17 +86,48 @@ namespace MagMan.Data.Admin
|
|||||||
{
|
{
|
||||||
DATABASE_SERV = server;
|
DATABASE_SERV = server;
|
||||||
// tutto fisso x gestione utenti
|
// tutto fisso x gestione utenti
|
||||||
CONNECTION_STRING = $"Server={DATABASE_SERV};port=3306;database={DATABASE_NAME};uid={DATABASE_USER};pwd={DATABASE_PWD};sslmode=None;";
|
CONNECTION_STRING = $"Server={DATABASE_SERV};port=3306;database={DATABASE_NAME};uid={DATABASE_USER};pwd={DATABASE_PWD};sslmode=None;Connection Lifetime=60;Connection Timeout=15;DefaultCommandTimeout=30;ConnectionIdleTimeout=30;ConnectionLifeTime=300;";
|
||||||
// stringa admin con utente admin dell'applicazione (già creato)...
|
// stringa admin con utente admin dell'applicazione (già creato)...
|
||||||
ADMIN_CONNECTION_STRING = $"Server={DATABASE_SERV};port=3306;database=mysql;uid={DATABASE_USER};pwd={DATABASE_PWD};sslmode=None;";
|
ADMIN_CONNECTION_STRING = $"Server={DATABASE_SERV};port=3306;database=mysql;uid=egalware;pwd=Egalware_24068!;sslmode=None;Connection Lifetime=60;Connection Timeout=15;DefaultCommandTimeout=30;ConnectionIdleTimeout=30;ConnectionLifeTime=300;";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ServerVersion MysqlServerVersion(string connString)
|
public static ServerVersion MysqlServerVersion(string connString)
|
||||||
{
|
{
|
||||||
ServerVersion serverVersion = ServerVersion.AutoDetect(connString);
|
// fix come da https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/1859
|
||||||
|
//Log.Info($"MysqlServerVersion | {connString}");
|
||||||
|
//ServerVersion serverVersion = ServerVersion.Parse("10.11.13-MariaDB");
|
||||||
|
ServerVersion serverVersion = ServerVersion.Parse("10.5.25-mysql");
|
||||||
|
bool versOk = false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
serverVersion = ServerVersion.AutoDetect(connString);
|
||||||
|
versOk = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione in verifica versione server ServerVersion.AutoDetect: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
if (!versOk)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
serverVersion = CustomAutoDetect(connString);
|
||||||
|
versOk = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione in verifica versione server CustomAutoDetect: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
return serverVersion;
|
return serverVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace MagMan.Data.Admin
|
|||||||
string connString = DbConfig.CONNECTION_STRING;
|
string connString = DbConfig.CONNECTION_STRING;
|
||||||
if (!optionsBuilder.IsConfigured)
|
if (!optionsBuilder.IsConfigured)
|
||||||
{
|
{
|
||||||
var serverVersion = ServerVersion.AutoDetect(connString);
|
var serverVersion = DbConfig.MysqlServerVersion(connString);
|
||||||
optionsBuilder.UseMySql(connString, serverVersion);
|
optionsBuilder.UseMySql(connString, serverVersion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -47,6 +47,9 @@ namespace MagMan.Data.Admin
|
|||||||
|
|
||||||
// Gestione in blocco user/permessi di base (salvata con migrazione AddUserAndRoles) come in GWMS + https://stackoverflow.com/questions/34343599/how-to-seed-users-and-roles-with-code-first-migration-using-identity-asp-net-cor
|
// Gestione in blocco user/permessi di base (salvata con migrazione AddUserAndRoles) come in GWMS + https://stackoverflow.com/questions/34343599/how-to-seed-users-and-roles-with-code-first-migration-using-identity-asp-net-cor
|
||||||
|
|
||||||
|
// disattivo riferimento view x avere oggetto davvero fittizio
|
||||||
|
builder.Entity<TableCount>().ToView(null);
|
||||||
|
|
||||||
builder.Seed();
|
builder.Seed();
|
||||||
base.OnModelCreating(builder);
|
base.OnModelCreating(builder);
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
<Configurations>Debug;Release</Configurations>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -18,22 +19,22 @@
|
|||||||
<PackageReference Include="Blazored.LocalStorage" Version="4.3.0" />
|
<PackageReference Include="Blazored.LocalStorage" Version="4.3.0" />
|
||||||
<PackageReference Include="Blazored.SessionStorage" Version="2.4.0" />
|
<PackageReference Include="Blazored.SessionStorage" Version="2.4.0" />
|
||||||
<PackageReference Include="MailKit" Version="4.2.0" />
|
<PackageReference Include="MailKit" Version="4.2.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.25" />
|
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.28" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.25" />
|
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.28" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.25" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.28" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.25">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.28">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.25" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.28" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.25">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.28">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
<PackageReference Include="NLog" Version="5.2.7" />
|
<PackageReference Include="NLog" Version="5.2.8" />
|
||||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.1" />
|
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.3" />
|
||||||
<PackageReference Include="StackExchange.Redis" Version="2.7.10" />
|
<PackageReference Include="StackExchange.Redis" Version="2.7.33" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
+391
@@ -0,0 +1,391 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using MagMan.Data.Admin;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Admin.Migrations.UserIdentityDb
|
||||||
|
{
|
||||||
|
[DbContext(typeof(IdentityContext))]
|
||||||
|
[Migration("20240412061834_RemoveDbSetCounts")]
|
||||||
|
partial class RemoveDbSetCounts
|
||||||
|
{
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "6.0.25")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<string>("ConcurrencyStamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("varchar(256)");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("varchar(256)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedName")
|
||||||
|
.IsUnique()
|
||||||
|
.HasDatabaseName("RoleNameIndex");
|
||||||
|
|
||||||
|
b.ToTable("AspNetRoles", (string)null);
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "e8456657-70cc-4d00-89e5-d7a8336451d5",
|
||||||
|
ConcurrencyStamp = "04a20b6f-64ae-40d7-81d8-4a52722193ec",
|
||||||
|
Name = "Undef",
|
||||||
|
NormalizedName = "UNDEF"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "dcc6b28b-b0cb-4eb3-a8ce-2dd24ab95037",
|
||||||
|
ConcurrencyStamp = "5f90e86b-f714-4f88-a975-636d43863e08",
|
||||||
|
Name = "User",
|
||||||
|
NormalizedName = "USER"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "487f1bcc-1278-479a-a8bf-ca31e36be138",
|
||||||
|
ConcurrencyStamp = "36019e5f-e9ee-4451-bf13-c4f563e5bb99",
|
||||||
|
Name = "Admin",
|
||||||
|
NormalizedName = "ADMIN"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "c2a01f68-6720-48e9-87c2-433aa44d230e",
|
||||||
|
ConcurrencyStamp = "cbb91441-0a5b-4d7a-88f7-739b5339365c",
|
||||||
|
Name = "SuperAdmin",
|
||||||
|
NormalizedName = "SUPERADMIN"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimType")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimValue")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("RoleId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("RoleId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetRoleClaims", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<int>("AccessFailedCount")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ConcurrencyStamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("varchar(256)");
|
||||||
|
|
||||||
|
b.Property<bool>("EmailConfirmed")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<bool>("LockoutEnabled")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedEmail")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("varchar(256)");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedUserName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("varchar(256)");
|
||||||
|
|
||||||
|
b.Property<string>("PasswordHash")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("PhoneNumber")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<bool>("PhoneNumberConfirmed")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<string>("SecurityStamp")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<bool>("TwoFactorEnabled")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<string>("UserName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("varchar(256)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedEmail")
|
||||||
|
.HasDatabaseName("EmailIndex");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedUserName")
|
||||||
|
.IsUnique()
|
||||||
|
.HasDatabaseName("UserNameIndex");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUsers", (string)null);
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "655b49ee-4e4f-467e-b5b1-927d8cf4fd36",
|
||||||
|
AccessFailedCount = 0,
|
||||||
|
ConcurrencyStamp = "25f371d7-c9fc-4b7a-bedc-fc02fb9402b0",
|
||||||
|
Email = "samuele.locatelli@egalware.com",
|
||||||
|
EmailConfirmed = true,
|
||||||
|
LockoutEnabled = false,
|
||||||
|
NormalizedEmail = "SAMUELE.LOCATELLI@EGALWARE.COM",
|
||||||
|
NormalizedUserName = "SAMUELE.LOCATELLI@EGALWARE.COM",
|
||||||
|
PasswordHash = "AQAAAAEAACcQAAAAEFTIbK5uhgIKXFvdYGv8QhefFh4kG9sHX1EPcpPrCmqf2xpfwm6qaUCHSKxvR8EfLw==",
|
||||||
|
PhoneNumberConfirmed = false,
|
||||||
|
SecurityStamp = "8200bcdd-2b13-4cd3-a81c-3c5598d6b5f6",
|
||||||
|
TwoFactorEnabled = false,
|
||||||
|
UserName = "samuele.locatelli@egalware.com"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "75122e30-0933-4538-aee5-a4193b60fc91",
|
||||||
|
AccessFailedCount = 0,
|
||||||
|
ConcurrencyStamp = "1be7030f-bb4d-41ae-ae10-0fb3e8e11804",
|
||||||
|
Email = "emmanuele.sassi@egalware.com",
|
||||||
|
EmailConfirmed = true,
|
||||||
|
LockoutEnabled = false,
|
||||||
|
NormalizedEmail = "EMMANUELE.SASSI@EGALWARE.COM",
|
||||||
|
NormalizedUserName = "EMMANUELE.SASSI@EGALWARE.COM",
|
||||||
|
PasswordHash = "AQAAAAEAACcQAAAAEANSSGEvLhSbYhJevBDO/Aoq0brwvn1KU5Sv/PJdNCE0+9ZyzGXXyQ+qTJR9gzWS1w==",
|
||||||
|
PhoneNumberConfirmed = false,
|
||||||
|
SecurityStamp = "62ed1518-5c7a-4d22-85e9-8bdd54a086ff",
|
||||||
|
TwoFactorEnabled = false,
|
||||||
|
UserName = "emmanuele.sassi@egalware.com"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "5d532138-4470-466c-9d89-0c968e6bde1e",
|
||||||
|
AccessFailedCount = 0,
|
||||||
|
ConcurrencyStamp = "bf75f82a-4fc5-4bfd-8244-9e03f606387b",
|
||||||
|
Email = "luca.mazzoleni@egalware.com",
|
||||||
|
EmailConfirmed = true,
|
||||||
|
LockoutEnabled = false,
|
||||||
|
NormalizedEmail = "LUCA.MAZZOLENI@EGALWARE.COM",
|
||||||
|
NormalizedUserName = "LUCA.MAZZOLENI@EGALWARE.COM",
|
||||||
|
PasswordHash = "AQAAAAEAACcQAAAAEMXSnNBKQhXsCw+CDzgYLKnYk6hsS/sHzOu0kk9C7buY/B9lIQf8dH7F8AXnOp25mA==",
|
||||||
|
PhoneNumberConfirmed = false,
|
||||||
|
SecurityStamp = "c974de3d-d0d5-45c4-b685-02b935ada41c",
|
||||||
|
TwoFactorEnabled = false,
|
||||||
|
UserName = "luca.mazzoleni@egalware.com"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "ed350b67-b800-4800-9d4e-f2726d836eb5",
|
||||||
|
AccessFailedCount = 0,
|
||||||
|
ConcurrencyStamp = "bd182360-ce6a-400a-b295-f42bb5e5abf2",
|
||||||
|
Email = "info@egalware.com",
|
||||||
|
EmailConfirmed = true,
|
||||||
|
LockoutEnabled = false,
|
||||||
|
NormalizedEmail = "INFO@EGALWARE.COM",
|
||||||
|
NormalizedUserName = "INFO@EGALWARE.COM",
|
||||||
|
PasswordHash = "AQAAAAEAACcQAAAAEEqp3H7Tbc/HpqkAJuuZH85PLTWxx0x1vrZI9qpDRLSbSowBKlQqmrc1whRPledpbg==",
|
||||||
|
PhoneNumberConfirmed = false,
|
||||||
|
SecurityStamp = "7aa1ab48-a654-42ec-b7ba-8f34d90edde7",
|
||||||
|
TwoFactorEnabled = false,
|
||||||
|
UserName = "info@egalware.com"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimType")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimValue")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserClaims", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("LoginProvider")
|
||||||
|
.HasMaxLength(128)
|
||||||
|
.HasColumnType("varchar(128)");
|
||||||
|
|
||||||
|
b.Property<string>("ProviderKey")
|
||||||
|
.HasMaxLength(128)
|
||||||
|
.HasColumnType("varchar(128)");
|
||||||
|
|
||||||
|
b.Property<string>("ProviderDisplayName")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.HasKey("LoginProvider", "ProviderKey");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserLogins", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<string>("RoleId")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RoleId");
|
||||||
|
|
||||||
|
b.HasIndex("RoleId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserRoles", (string)null);
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = "655b49ee-4e4f-467e-b5b1-927d8cf4fd36",
|
||||||
|
RoleId = "c2a01f68-6720-48e9-87c2-433aa44d230e"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = "75122e30-0933-4538-aee5-a4193b60fc91",
|
||||||
|
RoleId = "c2a01f68-6720-48e9-87c2-433aa44d230e"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = "5d532138-4470-466c-9d89-0c968e6bde1e",
|
||||||
|
RoleId = "dcc6b28b-b0cb-4eb3-a8ce-2dd24ab95037"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = "ed350b67-b800-4800-9d4e-f2726d836eb5",
|
||||||
|
RoleId = "dcc6b28b-b0cb-4eb3-a8ce-2dd24ab95037"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<string>("LoginProvider")
|
||||||
|
.HasMaxLength(128)
|
||||||
|
.HasColumnType("varchar(128)");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasMaxLength(128)
|
||||||
|
.HasColumnType("varchar(128)");
|
||||||
|
|
||||||
|
b.Property<string>("Value")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "LoginProvider", "Name");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserTokens", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RoleId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RoleId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Admin.Migrations.UserIdentityDb
|
||||||
|
{
|
||||||
|
public partial class RemoveDbSetCounts : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "DbSetCounts");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "DbSetCounts",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Count = table.Column<int>(type: "int", nullable: false),
|
||||||
|
TableName = table.Column<string>(type: "longtext", nullable: false)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4")
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+398
@@ -0,0 +1,398 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using MagMan.Data.Admin;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Admin.Migrations.UserIdentityDb
|
||||||
|
{
|
||||||
|
[DbContext(typeof(IdentityContext))]
|
||||||
|
[Migration("20240705134830_AddSuperUser")]
|
||||||
|
partial class AddSuperUser
|
||||||
|
{
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "6.0.28")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<string>("ConcurrencyStamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("varchar(256)");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("varchar(256)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedName")
|
||||||
|
.IsUnique()
|
||||||
|
.HasDatabaseName("RoleNameIndex");
|
||||||
|
|
||||||
|
b.ToTable("AspNetRoles", (string)null);
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "61898d91-a58c-4fcb-8da2-5078e32bb1eb",
|
||||||
|
ConcurrencyStamp = "f280c659-3676-4661-b66d-dcb5c6963fd1",
|
||||||
|
Name = "Undef",
|
||||||
|
NormalizedName = "UNDEF"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "ef658f55-424b-4a45-a8bc-a2a6297e9e10",
|
||||||
|
ConcurrencyStamp = "9d095d39-178a-4471-a037-a13b3ab4f101",
|
||||||
|
Name = "User",
|
||||||
|
NormalizedName = "USER"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "aa2e0987-62fd-4048-9deb-6e3c7f671865",
|
||||||
|
ConcurrencyStamp = "2609bd9d-b405-4a8c-bfa7-2bcab3ad38aa",
|
||||||
|
Name = "SuperUser",
|
||||||
|
NormalizedName = "SUPERUSER"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "e63dae22-57dc-4dc6-bef5-be0928d98dd3",
|
||||||
|
ConcurrencyStamp = "3975cad2-c02b-4c93-86e2-86b29f596dd3",
|
||||||
|
Name = "Admin",
|
||||||
|
NormalizedName = "ADMIN"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "9be32f20-0eee-4fac-97ab-00485b01b9d9",
|
||||||
|
ConcurrencyStamp = "2a080580-37cd-4b9e-8a99-ce9d99fe3b4f",
|
||||||
|
Name = "SuperAdmin",
|
||||||
|
NormalizedName = "SUPERADMIN"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimType")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimValue")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("RoleId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("RoleId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetRoleClaims", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<int>("AccessFailedCount")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ConcurrencyStamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("varchar(256)");
|
||||||
|
|
||||||
|
b.Property<bool>("EmailConfirmed")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<bool>("LockoutEnabled")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedEmail")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("varchar(256)");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedUserName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("varchar(256)");
|
||||||
|
|
||||||
|
b.Property<string>("PasswordHash")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("PhoneNumber")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<bool>("PhoneNumberConfirmed")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<string>("SecurityStamp")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<bool>("TwoFactorEnabled")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<string>("UserName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("varchar(256)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedEmail")
|
||||||
|
.HasDatabaseName("EmailIndex");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedUserName")
|
||||||
|
.IsUnique()
|
||||||
|
.HasDatabaseName("UserNameIndex");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUsers", (string)null);
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "0a01453d-17db-4c3a-87dd-33ce18974aac",
|
||||||
|
AccessFailedCount = 0,
|
||||||
|
ConcurrencyStamp = "775cec82-a98f-4575-bb6c-743b6c1fc79e",
|
||||||
|
Email = "samuele.locatelli@egalware.com",
|
||||||
|
EmailConfirmed = true,
|
||||||
|
LockoutEnabled = false,
|
||||||
|
NormalizedEmail = "SAMUELE.LOCATELLI@EGALWARE.COM",
|
||||||
|
NormalizedUserName = "SAMUELE.LOCATELLI@EGALWARE.COM",
|
||||||
|
PasswordHash = "AQAAAAEAACcQAAAAEBLzPhI6ILF8fuQrEgkH8+rFWDFWviVTf+DnWoDutRb5LOt5LnuDmya/Wbmh/5FoBw==",
|
||||||
|
PhoneNumberConfirmed = false,
|
||||||
|
SecurityStamp = "7108c3f4-99b2-4901-b056-aba4a0cdb304",
|
||||||
|
TwoFactorEnabled = false,
|
||||||
|
UserName = "samuele.locatelli@egalware.com"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "bba018ae-56c2-43d6-babd-50616c1fe826",
|
||||||
|
AccessFailedCount = 0,
|
||||||
|
ConcurrencyStamp = "f96737d1-b63d-4e98-a55d-b3205971df78",
|
||||||
|
Email = "emmanuele.sassi@egalware.com",
|
||||||
|
EmailConfirmed = true,
|
||||||
|
LockoutEnabled = false,
|
||||||
|
NormalizedEmail = "EMMANUELE.SASSI@EGALWARE.COM",
|
||||||
|
NormalizedUserName = "EMMANUELE.SASSI@EGALWARE.COM",
|
||||||
|
PasswordHash = "AQAAAAEAACcQAAAAEOBoFtuiYZGMpUltyIepbFz9bI9LLoAEo8fnjPVsnShl73RHlLZNJjBG+Oh2GgGxFg==",
|
||||||
|
PhoneNumberConfirmed = false,
|
||||||
|
SecurityStamp = "74bc6030-02e8-4237-aac4-d0062277dfc8",
|
||||||
|
TwoFactorEnabled = false,
|
||||||
|
UserName = "emmanuele.sassi@egalware.com"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "be99d5c7-f8c3-4429-b6de-ecb2032b0658",
|
||||||
|
AccessFailedCount = 0,
|
||||||
|
ConcurrencyStamp = "f7babbe0-0ab9-4428-bbb4-0cac6f4ee404",
|
||||||
|
Email = "luca.mazzoleni@egalware.com",
|
||||||
|
EmailConfirmed = true,
|
||||||
|
LockoutEnabled = false,
|
||||||
|
NormalizedEmail = "LUCA.MAZZOLENI@EGALWARE.COM",
|
||||||
|
NormalizedUserName = "LUCA.MAZZOLENI@EGALWARE.COM",
|
||||||
|
PasswordHash = "AQAAAAEAACcQAAAAENL3XhLx/+KxlDD3wJPCnj/BTJTNTP0hIuspu2Xlj/TLxDZ1yz6im0V9eqUwzjhJyw==",
|
||||||
|
PhoneNumberConfirmed = false,
|
||||||
|
SecurityStamp = "f7779584-e160-4c37-ba19-4d2702412da5",
|
||||||
|
TwoFactorEnabled = false,
|
||||||
|
UserName = "luca.mazzoleni@egalware.com"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "aca6c684-1cb3-4cc8-ab59-ce27d6879a8c",
|
||||||
|
AccessFailedCount = 0,
|
||||||
|
ConcurrencyStamp = "e2eca078-1adf-45a2-ba6a-c39497107845",
|
||||||
|
Email = "info@egalware.com",
|
||||||
|
EmailConfirmed = true,
|
||||||
|
LockoutEnabled = false,
|
||||||
|
NormalizedEmail = "INFO@EGALWARE.COM",
|
||||||
|
NormalizedUserName = "INFO@EGALWARE.COM",
|
||||||
|
PasswordHash = "AQAAAAEAACcQAAAAELj8C6+r2T6zDvEFiDcDkW78l0oeO8aE51Y3WFeEiXUeCoPO2WjBY3MW1VRwpmF8aQ==",
|
||||||
|
PhoneNumberConfirmed = false,
|
||||||
|
SecurityStamp = "7e1ff0bc-c55c-413f-9721-56ce3aa6c687",
|
||||||
|
TwoFactorEnabled = false,
|
||||||
|
UserName = "info@egalware.com"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimType")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimValue")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserClaims", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("LoginProvider")
|
||||||
|
.HasMaxLength(128)
|
||||||
|
.HasColumnType("varchar(128)");
|
||||||
|
|
||||||
|
b.Property<string>("ProviderKey")
|
||||||
|
.HasMaxLength(128)
|
||||||
|
.HasColumnType("varchar(128)");
|
||||||
|
|
||||||
|
b.Property<string>("ProviderDisplayName")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.HasKey("LoginProvider", "ProviderKey");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserLogins", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<string>("RoleId")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RoleId");
|
||||||
|
|
||||||
|
b.HasIndex("RoleId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserRoles", (string)null);
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = "0a01453d-17db-4c3a-87dd-33ce18974aac",
|
||||||
|
RoleId = "9be32f20-0eee-4fac-97ab-00485b01b9d9"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = "bba018ae-56c2-43d6-babd-50616c1fe826",
|
||||||
|
RoleId = "9be32f20-0eee-4fac-97ab-00485b01b9d9"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = "be99d5c7-f8c3-4429-b6de-ecb2032b0658",
|
||||||
|
RoleId = "ef658f55-424b-4a45-a8bc-a2a6297e9e10"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
UserId = "aca6c684-1cb3-4cc8-ab59-ce27d6879a8c",
|
||||||
|
RoleId = "ef658f55-424b-4a45-a8bc-a2a6297e9e10"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<string>("LoginProvider")
|
||||||
|
.HasMaxLength(128)
|
||||||
|
.HasColumnType("varchar(128)");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasMaxLength(128)
|
||||||
|
.HasColumnType("varchar(128)");
|
||||||
|
|
||||||
|
b.Property<string>("Value")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "LoginProvider", "Name");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserTokens", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RoleId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RoleId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Admin.Migrations.UserIdentityDb
|
||||||
|
{
|
||||||
|
public partial class AddSuperUser : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
migrationBuilder.InsertData(
|
||||||
|
table: "AspNetRoles",
|
||||||
|
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||||
|
values: new object[,]
|
||||||
|
{
|
||||||
|
{ "aa2e0987-62fd-4048-9deb-6e3c7f671865", "2609bd9d-b405-4a8c-bfa7-2bcab3ad38aa", "SuperUser", "SUPERUSER" }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
migrationBuilder.DeleteData(
|
||||||
|
table: "AspNetRoles",
|
||||||
|
keyColumn: "Id",
|
||||||
|
keyValue: "aa2e0987-62fd-4048-9deb-6e3c7f671865");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,21 +16,9 @@ namespace MagMan.Data.Admin.Migrations.UserIdentityDb
|
|||||||
{
|
{
|
||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("ProductVersion", "6.0.25")
|
.HasAnnotation("ProductVersion", "6.0.28")
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
modelBuilder.Entity("MagMan.Data.Admin.DbModels.TableCount", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Count")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("TableName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.ToTable("DbSetCounts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("Id")
|
b.Property<string>("Id")
|
||||||
@@ -59,29 +47,36 @@ namespace MagMan.Data.Admin.Migrations.UserIdentityDb
|
|||||||
b.HasData(
|
b.HasData(
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = "82b54f2b-4da8-4e46-83bf-57ffc17cf8ed",
|
Id = "61898d91-a58c-4fcb-8da2-5078e32bb1eb",
|
||||||
ConcurrencyStamp = "763dedf1-0868-424e-bc0a-1572a548c1d7",
|
ConcurrencyStamp = "f280c659-3676-4661-b66d-dcb5c6963fd1",
|
||||||
Name = "Undef",
|
Name = "Undef",
|
||||||
NormalizedName = "UNDEF"
|
NormalizedName = "UNDEF"
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = "34ae910e-acaf-46d1-aaa8-279a74c5bc61",
|
Id = "ef658f55-424b-4a45-a8bc-a2a6297e9e10",
|
||||||
ConcurrencyStamp = "8b90b548-3d22-40c6-95ba-c3fb0ea032a7",
|
ConcurrencyStamp = "9d095d39-178a-4471-a037-a13b3ab4f101",
|
||||||
Name = "User",
|
Name = "User",
|
||||||
NormalizedName = "USER"
|
NormalizedName = "USER"
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = "8352aca0-c5e8-4a2d-be76-f6cde5f963a1",
|
Id = "aa2e0987-62fd-4048-9deb-6e3c7f671865",
|
||||||
ConcurrencyStamp = "63d84be1-17ac-4e8c-9bd7-35e0ed056533",
|
ConcurrencyStamp = "2609bd9d-b405-4a8c-bfa7-2bcab3ad38aa",
|
||||||
|
Name = "SuperUser",
|
||||||
|
NormalizedName = "SUPERUSER"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = "e63dae22-57dc-4dc6-bef5-be0928d98dd3",
|
||||||
|
ConcurrencyStamp = "3975cad2-c02b-4c93-86e2-86b29f596dd3",
|
||||||
Name = "Admin",
|
Name = "Admin",
|
||||||
NormalizedName = "ADMIN"
|
NormalizedName = "ADMIN"
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = "285df363-706d-498e-b1ad-4680e141ad01",
|
Id = "9be32f20-0eee-4fac-97ab-00485b01b9d9",
|
||||||
ConcurrencyStamp = "365f0dc5-81c1-4deb-945b-58dd8fc9d18a",
|
ConcurrencyStamp = "2a080580-37cd-4b9e-8a99-ce9d99fe3b4f",
|
||||||
Name = "SuperAdmin",
|
Name = "SuperAdmin",
|
||||||
NormalizedName = "SUPERADMIN"
|
NormalizedName = "SUPERADMIN"
|
||||||
});
|
});
|
||||||
@@ -176,65 +171,65 @@ namespace MagMan.Data.Admin.Migrations.UserIdentityDb
|
|||||||
b.HasData(
|
b.HasData(
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = "3fac0523-697f-4b42-ac39-82026839ba2c",
|
Id = "0a01453d-17db-4c3a-87dd-33ce18974aac",
|
||||||
AccessFailedCount = 0,
|
AccessFailedCount = 0,
|
||||||
ConcurrencyStamp = "b23608ab-d50a-464d-8db2-8274f088b0ad",
|
ConcurrencyStamp = "775cec82-a98f-4575-bb6c-743b6c1fc79e",
|
||||||
Email = "samuele.locatelli@egalware.com",
|
Email = "samuele.locatelli@egalware.com",
|
||||||
EmailConfirmed = true,
|
EmailConfirmed = true,
|
||||||
LockoutEnabled = false,
|
LockoutEnabled = false,
|
||||||
NormalizedEmail = "SAMUELE.LOCATELLI@EGALWARE.COM",
|
NormalizedEmail = "SAMUELE.LOCATELLI@EGALWARE.COM",
|
||||||
NormalizedUserName = "SAMUELE.LOCATELLI@EGALWARE.COM",
|
NormalizedUserName = "SAMUELE.LOCATELLI@EGALWARE.COM",
|
||||||
PasswordHash = "AQAAAAEAACcQAAAAEAQsxwpx5DzxcFhzIhUciCtBEHZo/GLlB4HtG49I3gTh/WtXSg9VVl0e5KBmopG9VQ==",
|
PasswordHash = "AQAAAAEAACcQAAAAEBLzPhI6ILF8fuQrEgkH8+rFWDFWviVTf+DnWoDutRb5LOt5LnuDmya/Wbmh/5FoBw==",
|
||||||
PhoneNumberConfirmed = false,
|
PhoneNumberConfirmed = false,
|
||||||
SecurityStamp = "8f4ecdd7-9078-4345-82bc-7c1570e71387",
|
SecurityStamp = "7108c3f4-99b2-4901-b056-aba4a0cdb304",
|
||||||
TwoFactorEnabled = false,
|
TwoFactorEnabled = false,
|
||||||
UserName = "samuele.locatelli@egalware.com"
|
UserName = "samuele.locatelli@egalware.com"
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = "238a34e8-7a80-4307-bfcc-41bdc4a39c1f",
|
Id = "bba018ae-56c2-43d6-babd-50616c1fe826",
|
||||||
AccessFailedCount = 0,
|
AccessFailedCount = 0,
|
||||||
ConcurrencyStamp = "f62ab486-c4e0-450a-8fb4-6905d2e3da64",
|
ConcurrencyStamp = "f96737d1-b63d-4e98-a55d-b3205971df78",
|
||||||
Email = "emmanuele.sassi@egalware.com",
|
Email = "emmanuele.sassi@egalware.com",
|
||||||
EmailConfirmed = true,
|
EmailConfirmed = true,
|
||||||
LockoutEnabled = false,
|
LockoutEnabled = false,
|
||||||
NormalizedEmail = "EMMANUELE.SASSI@EGALWARE.COM",
|
NormalizedEmail = "EMMANUELE.SASSI@EGALWARE.COM",
|
||||||
NormalizedUserName = "EMMANUELE.SASSI@EGALWARE.COM",
|
NormalizedUserName = "EMMANUELE.SASSI@EGALWARE.COM",
|
||||||
PasswordHash = "AQAAAAEAACcQAAAAECZ2BzJe3VOrXIgdmjBrD+JP/HqsV/eFwMO4DaGzAmFPvHG+xxkRFbwRkI2sYoWt8Q==",
|
PasswordHash = "AQAAAAEAACcQAAAAEOBoFtuiYZGMpUltyIepbFz9bI9LLoAEo8fnjPVsnShl73RHlLZNJjBG+Oh2GgGxFg==",
|
||||||
PhoneNumberConfirmed = false,
|
PhoneNumberConfirmed = false,
|
||||||
SecurityStamp = "1be739d4-3aed-4a9a-a5c0-80c45a1474a6",
|
SecurityStamp = "74bc6030-02e8-4237-aac4-d0062277dfc8",
|
||||||
TwoFactorEnabled = false,
|
TwoFactorEnabled = false,
|
||||||
UserName = "emmanuele.sassi@egalware.com"
|
UserName = "emmanuele.sassi@egalware.com"
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = "be261afb-580a-4cb6-a040-c4a335f9ff3a",
|
Id = "be99d5c7-f8c3-4429-b6de-ecb2032b0658",
|
||||||
AccessFailedCount = 0,
|
AccessFailedCount = 0,
|
||||||
ConcurrencyStamp = "9c306ce8-ec94-49b9-ad24-87b3d9937188",
|
ConcurrencyStamp = "f7babbe0-0ab9-4428-bbb4-0cac6f4ee404",
|
||||||
Email = "luca.mazzoleni@egalware.com",
|
Email = "luca.mazzoleni@egalware.com",
|
||||||
EmailConfirmed = true,
|
EmailConfirmed = true,
|
||||||
LockoutEnabled = false,
|
LockoutEnabled = false,
|
||||||
NormalizedEmail = "LUCA.MAZZOLENI@EGALWARE.COM",
|
NormalizedEmail = "LUCA.MAZZOLENI@EGALWARE.COM",
|
||||||
NormalizedUserName = "LUCA.MAZZOLENI@EGALWARE.COM",
|
NormalizedUserName = "LUCA.MAZZOLENI@EGALWARE.COM",
|
||||||
PasswordHash = "AQAAAAEAACcQAAAAEHdDRZVkzBW4qlCF+vvpURb/4bj/b2/kl4+HSEjhbHRAekqX5WMnfJfWMPuyjKrgUg==",
|
PasswordHash = "AQAAAAEAACcQAAAAENL3XhLx/+KxlDD3wJPCnj/BTJTNTP0hIuspu2Xlj/TLxDZ1yz6im0V9eqUwzjhJyw==",
|
||||||
PhoneNumberConfirmed = false,
|
PhoneNumberConfirmed = false,
|
||||||
SecurityStamp = "121bb662-adf9-4cba-bbc8-12bf1d2bc693",
|
SecurityStamp = "f7779584-e160-4c37-ba19-4d2702412da5",
|
||||||
TwoFactorEnabled = false,
|
TwoFactorEnabled = false,
|
||||||
UserName = "luca.mazzoleni@egalware.com"
|
UserName = "luca.mazzoleni@egalware.com"
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = "3282b9f4-5240-4946-a8d0-5570df880642",
|
Id = "aca6c684-1cb3-4cc8-ab59-ce27d6879a8c",
|
||||||
AccessFailedCount = 0,
|
AccessFailedCount = 0,
|
||||||
ConcurrencyStamp = "20720e13-89b3-4660-8c6e-1f11e1e730b4",
|
ConcurrencyStamp = "e2eca078-1adf-45a2-ba6a-c39497107845",
|
||||||
Email = "info@egalware.com",
|
Email = "info@egalware.com",
|
||||||
EmailConfirmed = true,
|
EmailConfirmed = true,
|
||||||
LockoutEnabled = false,
|
LockoutEnabled = false,
|
||||||
NormalizedEmail = "INFO@EGALWARE.COM",
|
NormalizedEmail = "INFO@EGALWARE.COM",
|
||||||
NormalizedUserName = "INFO@EGALWARE.COM",
|
NormalizedUserName = "INFO@EGALWARE.COM",
|
||||||
PasswordHash = "AQAAAAEAACcQAAAAEDEuPnbPPl/9vc6xg/mvOmyEfvirN5ZNDWu21im+PjvtNQcqvqfc9k3KQxtJKBs5EQ==",
|
PasswordHash = "AQAAAAEAACcQAAAAELj8C6+r2T6zDvEFiDcDkW78l0oeO8aE51Y3WFeEiXUeCoPO2WjBY3MW1VRwpmF8aQ==",
|
||||||
PhoneNumberConfirmed = false,
|
PhoneNumberConfirmed = false,
|
||||||
SecurityStamp = "3bd9e353-ab86-47b2-85da-d857e618f44e",
|
SecurityStamp = "7e1ff0bc-c55c-413f-9721-56ce3aa6c687",
|
||||||
TwoFactorEnabled = false,
|
TwoFactorEnabled = false,
|
||||||
UserName = "info@egalware.com"
|
UserName = "info@egalware.com"
|
||||||
});
|
});
|
||||||
@@ -304,58 +299,23 @@ namespace MagMan.Data.Admin.Migrations.UserIdentityDb
|
|||||||
b.HasData(
|
b.HasData(
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
UserId = "3fac0523-697f-4b42-ac39-82026839ba2c",
|
UserId = "0a01453d-17db-4c3a-87dd-33ce18974aac",
|
||||||
RoleId = "34ae910e-acaf-46d1-aaa8-279a74c5bc61"
|
RoleId = "9be32f20-0eee-4fac-97ab-00485b01b9d9"
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
UserId = "3fac0523-697f-4b42-ac39-82026839ba2c",
|
UserId = "bba018ae-56c2-43d6-babd-50616c1fe826",
|
||||||
RoleId = "8352aca0-c5e8-4a2d-be76-f6cde5f963a1"
|
RoleId = "9be32f20-0eee-4fac-97ab-00485b01b9d9"
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
UserId = "3fac0523-697f-4b42-ac39-82026839ba2c",
|
UserId = "be99d5c7-f8c3-4429-b6de-ecb2032b0658",
|
||||||
RoleId = "285df363-706d-498e-b1ad-4680e141ad01"
|
RoleId = "ef658f55-424b-4a45-a8bc-a2a6297e9e10"
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
UserId = "238a34e8-7a80-4307-bfcc-41bdc4a39c1f",
|
UserId = "aca6c684-1cb3-4cc8-ab59-ce27d6879a8c",
|
||||||
RoleId = "34ae910e-acaf-46d1-aaa8-279a74c5bc61"
|
RoleId = "ef658f55-424b-4a45-a8bc-a2a6297e9e10"
|
||||||
},
|
|
||||||
new
|
|
||||||
{
|
|
||||||
UserId = "238a34e8-7a80-4307-bfcc-41bdc4a39c1f",
|
|
||||||
RoleId = "8352aca0-c5e8-4a2d-be76-f6cde5f963a1"
|
|
||||||
},
|
|
||||||
new
|
|
||||||
{
|
|
||||||
UserId = "238a34e8-7a80-4307-bfcc-41bdc4a39c1f",
|
|
||||||
RoleId = "285df363-706d-498e-b1ad-4680e141ad01"
|
|
||||||
},
|
|
||||||
new
|
|
||||||
{
|
|
||||||
UserId = "be261afb-580a-4cb6-a040-c4a335f9ff3a",
|
|
||||||
RoleId = "34ae910e-acaf-46d1-aaa8-279a74c5bc61"
|
|
||||||
},
|
|
||||||
new
|
|
||||||
{
|
|
||||||
UserId = "be261afb-580a-4cb6-a040-c4a335f9ff3a",
|
|
||||||
RoleId = "8352aca0-c5e8-4a2d-be76-f6cde5f963a1"
|
|
||||||
},
|
|
||||||
new
|
|
||||||
{
|
|
||||||
UserId = "be261afb-580a-4cb6-a040-c4a335f9ff3a",
|
|
||||||
RoleId = "285df363-706d-498e-b1ad-4680e141ad01"
|
|
||||||
},
|
|
||||||
new
|
|
||||||
{
|
|
||||||
UserId = "3282b9f4-5240-4946-a8d0-5570df880642",
|
|
||||||
RoleId = "34ae910e-acaf-46d1-aaa8-279a74c5bc61"
|
|
||||||
},
|
|
||||||
new
|
|
||||||
{
|
|
||||||
UserId = "3282b9f4-5240-4946-a8d0-5570df880642",
|
|
||||||
RoleId = "8352aca0-c5e8-4a2d-be76-f6cde5f963a1"
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ namespace MagMan.Data.Admin
|
|||||||
{
|
{
|
||||||
new IdentityRole { Name = "Undef", NormalizedName = "UNDEF" },
|
new IdentityRole { Name = "Undef", NormalizedName = "UNDEF" },
|
||||||
new IdentityRole { Name = "User", NormalizedName = "USER" },
|
new IdentityRole { Name = "User", NormalizedName = "USER" },
|
||||||
|
new IdentityRole { Name = "SuperUser", NormalizedName = "SUPERUSER" },
|
||||||
new IdentityRole { Name = "Admin", NormalizedName = "ADMIN" },
|
new IdentityRole { Name = "Admin", NormalizedName = "ADMIN" },
|
||||||
new IdentityRole { Name = "SuperAdmin", NormalizedName = "SUPERADMIN" }
|
new IdentityRole { Name = "SuperAdmin", NormalizedName = "SUPERADMIN" }
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -48,10 +48,13 @@ namespace MagMan.Data.Admin
|
|||||||
string connString = DbConfig.CONNECTION_STRING;
|
string connString = DbConfig.CONNECTION_STRING;
|
||||||
if (!optionsBuilder.IsConfigured)
|
if (!optionsBuilder.IsConfigured)
|
||||||
{
|
{
|
||||||
#if DEBUG
|
// commentato x test su cluster in ufficio
|
||||||
connString = "Server=localhost;port=3306;database=MagMan_Admin;uid=MagMan_DbUser;pwd=viad@nte16!;sslmode=None;";
|
#if DEBUG
|
||||||
#endif
|
//connString = "Server=localhost;port=3306;database=MagMan_Admin;uid=MagMan_DbUser;pwd=viad@nte16!;sslmode=None;";
|
||||||
var serverVersion = ServerVersion.AutoDetect(connString);
|
//connString = "Server=mdb03.ufficio;port=3306;database=MagMan_Admin;uid=MagMan_DbUser;pwd=viad@nte16!;sslmode=None;";
|
||||||
|
connString = "Server=mdb.ufficio;port=3306;database=MagMan_Admin;uid=MagMan_DbUser;pwd=viad@nte16!;sslmode=None;Connection Lifetime=60;Connection Timeout=15;DefaultCommandTimeout=30;ConnectionIdleTimeout=30;ConnectionLifeTime=300;";
|
||||||
|
#endif
|
||||||
|
var serverVersion = DbConfig.MysqlServerVersion(connString);
|
||||||
optionsBuilder.UseMySql(connString, serverVersion);
|
optionsBuilder.UseMySql(connString, serverVersion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using MagMan.Data.Admin.DbModels;
|
using MagMan.Data.Admin.DbModels;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using MySqlConnector;
|
||||||
|
using NLog;
|
||||||
|
|
||||||
|
|
||||||
namespace MagMan.Data.Admin
|
namespace MagMan.Data.Admin
|
||||||
@@ -16,18 +18,22 @@ namespace MagMan.Data.Admin
|
|||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
|
|
||||||
|
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public ServerAdminContext()
|
public ServerAdminContext()
|
||||||
{
|
{
|
||||||
|
Log.Info("Calling ServerAdminContext()");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerAdminContext(IConfiguration configuration)
|
public ServerAdminContext(IConfiguration configuration)
|
||||||
{
|
{
|
||||||
|
Log.Info("Calling ServerAdminContext(IConfiguration configuration)");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerAdminContext(DbContextOptions<ServerAdminContext> options) : base(options)
|
public ServerAdminContext(DbContextOptions<ServerAdminContext> options) : base(options)
|
||||||
{
|
{
|
||||||
|
Log.Info("Calling ServerAdminContext(DbContextOptions<ServerAdminContext> options)");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
@@ -49,14 +55,42 @@ namespace MagMan.Data.Admin
|
|||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
{
|
{
|
||||||
string connString = "";
|
Log.Info("Calling OnConfiguring");
|
||||||
|
string connString = DbConfig.ADMIN_CONNECTION_STRING;
|
||||||
if (!optionsBuilder.IsConfigured)
|
if (!optionsBuilder.IsConfigured)
|
||||||
{
|
{
|
||||||
// chiave cablata x gestione Server
|
// chiave cablata x gestione Server se fosse vuota...
|
||||||
connString = "Server=localhost;port=3306;database=mysql;user=root;pwd=Egalware_24068!;sslmode=None;";
|
if (string.IsNullOrEmpty(connString))
|
||||||
var serverVersion = ServerVersion.AutoDetect(connString);
|
{
|
||||||
|
connString = "Server=localhost;port=3306;database=mysql;user=egalware;pwd=Egalware_24068!;sslmode=None;Connection Lifetime=60;Connection Timeout=15;DefaultCommandTimeout=30;";
|
||||||
|
}
|
||||||
|
ServerVersion serverVersion = DbConfig.MysqlServerVersion(connString);
|
||||||
optionsBuilder.UseMySql(connString, serverVersion);
|
optionsBuilder.UseMySql(connString, serverVersion);
|
||||||
|
|
||||||
|
Log.Info("NOT Configured | connString forced to default!");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.Info("optionsBuilder.IsConfigured");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ServerVersion CustomAutoDetect(string connectionString)
|
||||||
|
{
|
||||||
|
#if false
|
||||||
|
using var connection = new MySqlConnection(
|
||||||
|
new MySqlConnectionStringBuilder(connectionString)
|
||||||
|
{
|
||||||
|
Database = string.Empty,
|
||||||
|
// AutoEnlist = false,
|
||||||
|
// Pooling = false,
|
||||||
|
}.ConnectionString);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using var connection = new MySqlConnection(connectionString);
|
||||||
|
connection.Open();
|
||||||
|
ServerVersion currVers = ServerVersion.Parse(connection.ServerVersion);
|
||||||
|
return currVers;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
|
|||||||
@@ -1,70 +0,0 @@
|
|||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace MagMan.Data.Admin.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Classe di partenza x costruzione servizi di accesso dati + cache
|
|
||||||
/// </summary>
|
|
||||||
public class BaseServ
|
|
||||||
{
|
|
||||||
#region Protected Properties
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Durata cache breve (1 min circa + perturbazione percentuale +/-10%)
|
|
||||||
/// </summary>
|
|
||||||
protected TimeSpan FastCache
|
|
||||||
{
|
|
||||||
get => TimeSpan.FromSeconds(cacheTtlShort * rnd.Next(900, 1100) / 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Durata cache lunga (+ perturbazione percentuale +/-10%)
|
|
||||||
/// </summary>
|
|
||||||
protected TimeSpan LongCache
|
|
||||||
{
|
|
||||||
get => TimeSpan.FromSeconds(cacheTtlLong * rnd.Next(900, 1100) / 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Durata cache MOLTO breve (10 sec circa + perturbazione percentuale +/-10%)
|
|
||||||
/// </summary>
|
|
||||||
protected TimeSpan UltraFastCache
|
|
||||||
{
|
|
||||||
get => TimeSpan.FromSeconds(cacheTtlShort / 6 * rnd.Next(900, 1100) / 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Durata cache MOLTO lunga (+ perturbazione percentuale +/-10%)
|
|
||||||
/// </summary>
|
|
||||||
protected TimeSpan UltraLongCache
|
|
||||||
{
|
|
||||||
get => TimeSpan.FromSeconds(cacheTtlLong * 10 * rnd.Next(900, 1100) / 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Protected Properties
|
|
||||||
|
|
||||||
|
|
||||||
protected static IConfiguration _configuration = null!;
|
|
||||||
|
|
||||||
#region Private Fields
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Durata cache lunga IN SECONDI
|
|
||||||
/// </summary>
|
|
||||||
private int cacheTtlLong = 60 * 5;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Durata cache breve IN SECONDI
|
|
||||||
/// </summary>
|
|
||||||
private int cacheTtlShort = 60 * 1;
|
|
||||||
|
|
||||||
private Random rnd = new Random();
|
|
||||||
|
|
||||||
#endregion Private Fields
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,17 +4,14 @@ using MagMan.Data.Admin.Controllers;
|
|||||||
using MagMan.Data.Admin.DbModels;
|
using MagMan.Data.Admin.DbModels;
|
||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
using Microsoft.AspNetCore.Identity.UI.Services;
|
using Microsoft.AspNetCore.Identity.UI.Services;
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.VisualBasic;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using NLog;
|
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace MagMan.Data.Admin.Services
|
namespace MagMan.Data.Admin.Services
|
||||||
{
|
{
|
||||||
public class MTAdminService : BaseServ
|
public class MTAdminService : BaseServ, IDisposable
|
||||||
{
|
{
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
@@ -24,6 +21,7 @@ namespace MagMan.Data.Admin.Services
|
|||||||
_configuration = configuration;
|
_configuration = configuration;
|
||||||
_emailSender = emailSender;
|
_emailSender = emailSender;
|
||||||
_userManager = userManager;
|
_userManager = userManager;
|
||||||
|
|
||||||
// Conf cache
|
// Conf cache
|
||||||
redisConn = redisConnMult;
|
redisConn = redisConnMult;
|
||||||
redisDb = this.redisConn.GetDatabase();
|
redisDb = this.redisConn.GetDatabase();
|
||||||
@@ -35,22 +33,20 @@ namespace MagMan.Data.Admin.Services
|
|||||||
};
|
};
|
||||||
|
|
||||||
// cod app
|
// cod app
|
||||||
CodApp = _configuration["CodApp"];
|
CodApp = _configuration.GetValue<string>("OptConf:CodApp");
|
||||||
|
|
||||||
|
// gestione parallelismo...
|
||||||
|
numPar = _configuration.GetValue<int>("OptConf:NumPar");
|
||||||
|
|
||||||
|
// DB
|
||||||
dbController = new MTAdminController(configuration);
|
dbController = new MTAdminController(configuration);
|
||||||
|
|
||||||
// chiudo log
|
// chiudo log
|
||||||
Log.Info("MTAdminService started!");
|
Log.Info("MTAdminService started!");
|
||||||
_userManager = userManager;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
|
|
||||||
#region Public Properties
|
|
||||||
|
|
||||||
public string CodApp { get; set; } = "";
|
|
||||||
|
|
||||||
#endregion Public Properties
|
|
||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -68,7 +64,7 @@ namespace MagMan.Data.Admin.Services
|
|||||||
Stopwatch stopWatch = new Stopwatch();
|
Stopwatch stopWatch = new Stopwatch();
|
||||||
stopWatch.Start();
|
stopWatch.Start();
|
||||||
string? rawData = await redisDb.StringGetAsync(currKey);
|
string? rawData = await redisDb.StringGetAsync(currKey);
|
||||||
if (!string.IsNullOrEmpty(rawData))
|
if (!string.IsNullOrEmpty(rawData) && rawData.Length > 2)
|
||||||
{
|
{
|
||||||
source = "REDIS";
|
source = "REDIS";
|
||||||
var tempResult = JsonConvert.DeserializeObject<List<AuthKeyModel>>(rawData);
|
var tempResult = JsonConvert.DeserializeObject<List<AuthKeyModel>>(rawData);
|
||||||
@@ -285,20 +281,9 @@ namespace MagMan.Data.Admin.Services
|
|||||||
return fatto;
|
return fatto;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
public void Dispose()
|
||||||
/// Refresh globale cache redis
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<bool> FlushRedisCache()
|
|
||||||
{
|
{
|
||||||
Stopwatch stopWatch = new Stopwatch();
|
dbController.Dispose();
|
||||||
stopWatch.Start();
|
|
||||||
await Task.Delay(1);
|
|
||||||
RedisValue pattern = new RedisValue($"{Const.rKeyConfig}:*");
|
|
||||||
bool answ = await ExecFlushRedisPattern(pattern);
|
|
||||||
stopWatch.Stop();
|
|
||||||
Log.Debug($"FlushRedisCache in {stopWatch.Elapsed.TotalMilliseconds} ms");
|
|
||||||
return answ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -481,7 +466,6 @@ namespace MagMan.Data.Admin.Services
|
|||||||
await ExecFlushRedisPattern((RedisValue)currKey);
|
await ExecFlushRedisPattern((RedisValue)currKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly UserManager<IdentityUser> _userManager;
|
|
||||||
public async Task<List<UserData>> UserDataGetFilt(string searchVal)
|
public async Task<List<UserData>> UserDataGetFilt(string searchVal)
|
||||||
{
|
{
|
||||||
// Collezione utenti
|
// Collezione utenti
|
||||||
@@ -573,67 +557,13 @@ namespace MagMan.Data.Admin.Services
|
|||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
private static JsonSerializerSettings? JSSettings;
|
private static JsonSerializerSettings? JSSettings;
|
||||||
|
|
||||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
|
||||||
|
|
||||||
private readonly IEmailSender _emailSender;
|
private readonly IEmailSender _emailSender;
|
||||||
|
private readonly UserManager<IdentityUser> _userManager;
|
||||||
/// <summary>
|
|
||||||
/// Durata cache lunga IN SECONDI
|
|
||||||
/// </summary>
|
|
||||||
private int cacheTtlLong = 60 * 5;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Durata cache breve IN SECONDI
|
|
||||||
/// </summary>
|
|
||||||
private int cacheTtlShort = 60 * 1;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Oggetto per connessione a REDIS
|
|
||||||
/// </summary>
|
|
||||||
private IConnectionMultiplexer redisConn;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Oggetto DB redis da impiegare x chiamate R/W
|
|
||||||
/// </summary>
|
|
||||||
private IDatabase redisDb = null!;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Generatore random
|
|
||||||
/// </summary>
|
|
||||||
private Random rnd = new Random();
|
|
||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Esegue flush memoria redis dato pattern
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pattern"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
private async Task<bool> ExecFlushRedisPattern(RedisValue pattern)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
var listEndpoints = redisConn.GetEndPoints();
|
|
||||||
foreach (var endPoint in listEndpoints)
|
|
||||||
{
|
|
||||||
//var server = redisConnAdmin.GetServer(listEndpoints[0]);
|
|
||||||
var server = redisConn.GetServer(endPoint);
|
|
||||||
if (server != null)
|
|
||||||
{
|
|
||||||
var keyList = server.Keys(redisDb.Database, pattern);
|
|
||||||
foreach (var item in keyList)
|
|
||||||
{
|
|
||||||
await redisDb.KeyDeleteAsync(item);
|
|
||||||
}
|
|
||||||
answ = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Recupera UN SINGOLO VALORE dalla hash per un dato field
|
/// Recupera UN SINGOLO VALORE dalla hash per un dato field
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -4,13 +4,18 @@ using MagMan.Data.Tenant.DbModels;
|
|||||||
using MagMan.Data.Tenant.Services;
|
using MagMan.Data.Tenant.Services;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using MySqlConnector;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NLog.LayoutRenderers;
|
using NLog.LayoutRenderers;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.ConstrainedExecution;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml;
|
||||||
|
using static MagMan.Core.Enums;
|
||||||
|
using static MagMan.Core.RestPayload;
|
||||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
||||||
|
|
||||||
namespace MagMan.Data.Tenant.Controllers
|
namespace MagMan.Data.Tenant.Controllers
|
||||||
@@ -46,9 +51,12 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
if (currData != null)
|
if (currData != null)
|
||||||
{
|
{
|
||||||
dbCtx
|
// 2024.04.04: cancellazione logica al posto di delete!
|
||||||
.DbSetAlias
|
//dbCtx
|
||||||
.Remove(currData);
|
// .DbSetAlias
|
||||||
|
// .Remove(currData);
|
||||||
|
currData.IsActive = false;
|
||||||
|
dbCtx.Entry(currData).State = EntityState.Modified;
|
||||||
|
|
||||||
dbCtx.SaveChanges();
|
dbCtx.SaveChanges();
|
||||||
done = true;
|
done = true;
|
||||||
@@ -104,11 +112,9 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
if (currData != null)
|
if (currData != null)
|
||||||
{
|
{
|
||||||
if (currData.ValueAlias != rec2upd.ValueAlias)
|
currData.ValueAlias = rec2upd.ValueAlias;
|
||||||
{
|
currData.IsActive = rec2upd.IsActive;
|
||||||
currData.ValueAlias = rec2upd.ValueAlias;
|
dbCtx.Entry(currData).State = EntityState.Modified;
|
||||||
dbCtx.Entry(currData).State = EntityState.Modified;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -148,9 +154,10 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
if (currData != null)
|
if (currData != null)
|
||||||
{
|
{
|
||||||
if (currData.ValueAlias != rec2upd.ValueAlias)
|
if (currData.ValueAlias != rec2upd.ValueAlias || currData.IsActive != rec2upd.IsActive)
|
||||||
{
|
{
|
||||||
currData.ValueAlias = rec2upd.ValueAlias;
|
currData.ValueAlias = rec2upd.ValueAlias;
|
||||||
|
currData.IsActive = rec2upd.IsActive;
|
||||||
dbCtx.Entry(currData).State = EntityState.Modified;
|
dbCtx.Entry(currData).State = EntityState.Modified;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -212,8 +219,8 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
// .DbSetItems
|
// .DbSetItems
|
||||||
// .Remove(currData);
|
// .Remove(currData);
|
||||||
|
|
||||||
// non vera eliminazione ma logica...
|
// eliminazione logica...
|
||||||
currData.IsActive = false;
|
currData.IsDeleted = true;
|
||||||
// registro modifica RawItem
|
// registro modifica RawItem
|
||||||
dbCtx.Entry(currData).State = EntityState.Modified;
|
dbCtx.Entry(currData).State = EntityState.Modified;
|
||||||
|
|
||||||
@@ -235,19 +242,19 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
/// <param name="origItem">DTO di partenza</param>
|
/// <param name="origItem">DTO di partenza</param>
|
||||||
/// <param name="isActive">Parametro active da impostare</param>
|
/// <param name="isActive">Parametro active da impostare</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public RawItemModel ItemFromDto(ItemDTO origItem, bool isActive)
|
public RawItemModel ItemFromDto(ItemDTO origItem)
|
||||||
{
|
{
|
||||||
RawItemModel answ = new RawItemModel()
|
RawItemModel answ = new RawItemModel()
|
||||||
{
|
{
|
||||||
MatId = origItem.MatCloudId,
|
MatId = origItem.MatCloudId,
|
||||||
|
IsDeleted = origItem.IsDeleted,
|
||||||
IsRemn = origItem.IsRemn,
|
IsRemn = origItem.IsRemn,
|
||||||
Location = origItem.Location,
|
Location = origItem.Location,
|
||||||
QtyAvail = origItem.QtyAvail,
|
QtyAvail = origItem.QtyAvail,
|
||||||
HMm = origItem.HMm,
|
HMm = origItem.HMm,
|
||||||
LMm = origItem.LMm,
|
LMm = origItem.LMm,
|
||||||
WMm = origItem.WMm,
|
WMm = origItem.WMm,
|
||||||
Note = origItem.Note,
|
Note = origItem.Note
|
||||||
IsActive = isActive
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return answ;
|
return answ;
|
||||||
@@ -266,7 +273,7 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
{
|
{
|
||||||
dbResult = dbCtx
|
dbResult = dbCtx
|
||||||
.DbSetItems
|
.DbSetItems
|
||||||
.Where(x => x.IsActive || !onlyActive)
|
.Where(x => !x.IsDeleted || !onlyActive)
|
||||||
.Include(c => c.MaterialNav)
|
.Include(c => c.MaterialNav)
|
||||||
.OrderBy(x => x.MatId)
|
.OrderBy(x => x.MatId)
|
||||||
.ToList();
|
.ToList();
|
||||||
@@ -288,7 +295,7 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
{
|
{
|
||||||
dbResult = dbCtx
|
dbResult = dbCtx
|
||||||
.DbSetItems
|
.DbSetItems
|
||||||
.Where(x => (matID == 0 || x.MatId == matID) && (x.IsActive || !onlyActive))
|
.Where(x => (matID == 0 || x.MatId == matID) && (!x.IsDeleted || !onlyActive))
|
||||||
.Include(c => c.MaterialNav)
|
.Include(c => c.MaterialNav)
|
||||||
.OrderBy(x => x.WMm)
|
.OrderBy(x => x.WMm)
|
||||||
.ThenBy(x => x.HMm)
|
.ThenBy(x => x.HMm)
|
||||||
@@ -380,6 +387,42 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Riattiva Item da magazzino
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="connString">Stringa connessione (variabile x cliente)</param>
|
||||||
|
/// <param name="rec2del">Item da riattivare</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool ItemReactiv(string connString, RawItemModel rec2del)
|
||||||
|
{
|
||||||
|
bool done = false;
|
||||||
|
using (MagManContext dbCtx = new MagManContext(connString))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var currData = dbCtx
|
||||||
|
.DbSetItems
|
||||||
|
.Where(x => x.RawItemId == rec2del.RawItemId)
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (currData != null)
|
||||||
|
{
|
||||||
|
// riattivazione logica...
|
||||||
|
currData.IsDeleted = false;
|
||||||
|
// registro modifica RawItem
|
||||||
|
dbCtx.Entry(currData).State = EntityState.Modified;
|
||||||
|
|
||||||
|
dbCtx.SaveChanges();
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione in ItemReactiv{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return done;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converte lista ItemModel in DTO
|
/// Converte lista ItemModel in DTO
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -402,6 +445,7 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
{
|
{
|
||||||
MatCloudId = origItem.MatId,
|
MatCloudId = origItem.MatId,
|
||||||
RawItemCloudId = origItem.RawItemId,
|
RawItemCloudId = origItem.RawItemId,
|
||||||
|
IsDeleted = origItem.IsDeleted,
|
||||||
IsRemn = origItem.IsRemn,
|
IsRemn = origItem.IsRemn,
|
||||||
Location = origItem.Location,
|
Location = origItem.Location,
|
||||||
QtyAvail = origItem.QtyAvail,
|
QtyAvail = origItem.QtyAvail,
|
||||||
@@ -422,8 +466,9 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
/// <param name="rec2upd">Record da aggiungere/aggiornare</param>
|
/// <param name="rec2upd">Record da aggiungere/aggiornare</param>
|
||||||
/// <param name="userId">User corrente (SE applicabile)</param>
|
/// <param name="userId">User corrente (SE applicabile)</param>
|
||||||
/// <param name="forceQty">Se true aggiorna giacenze quantita correnti</param>
|
/// <param name="forceQty">Se true aggiorna giacenze quantita correnti</param>
|
||||||
|
/// <param name="ignoreRemn">Se true ignora aggiornamento remnant in cloud</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool ItemUpdate(string connString, RawItemModel rec2upd, string userId, bool forceQty)
|
public bool ItemUpdate(string connString, RawItemModel rec2upd, string userId, bool forceQty, bool ignoreRemn)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (MagManContext dbCtx = new MagManContext(connString))
|
using (MagManContext dbCtx = new MagManContext(connString))
|
||||||
@@ -466,8 +511,11 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
|
|
||||||
// sistemo record...
|
// sistemo record...
|
||||||
currData.MatId = rec2upd.MatId;
|
currData.MatId = rec2upd.MatId;
|
||||||
currData.IsActive = rec2upd.IsActive;
|
currData.IsDeleted = rec2upd.IsDeleted;
|
||||||
currData.IsRemn = rec2upd.IsRemn;
|
if (!ignoreRemn)
|
||||||
|
{
|
||||||
|
currData.IsRemn = rec2upd.IsRemn;
|
||||||
|
}
|
||||||
currData.Location = rec2upd.Location;
|
currData.Location = rec2upd.Location;
|
||||||
currData.LMm = rec2upd.LMm;
|
currData.LMm = rec2upd.LMm;
|
||||||
currData.HMm = rec2upd.HMm;
|
currData.HMm = rec2upd.HMm;
|
||||||
@@ -519,6 +567,109 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco Materiali gestiti a magazzino formato DTO
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="connString">Stringa connessione (variabile x cliente)</param>
|
||||||
|
/// <param name="machineId">idMacchina di cui si vuole log</param>
|
||||||
|
/// <param name="numRec">num rec max da recuperare</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<LogMachineModel> LogMacGetLast(string connString, int machineId, int numRec)
|
||||||
|
{
|
||||||
|
List<LogMachineModel> dbResult = new List<LogMachineModel>();
|
||||||
|
using (MagManContext dbCtx = new MagManContext(connString))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetLogMac
|
||||||
|
.Where(x => x.MachineID == machineId)
|
||||||
|
.OrderByDescending(x => x.DtEvent)
|
||||||
|
.Take(numRec)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elimina un range di dati dal DB per poter inserire in blocco
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="connString"></param>
|
||||||
|
/// <param name="keyNum">Key di riferimento</param>
|
||||||
|
/// <param name="machineId">Id Macchina</param>
|
||||||
|
/// <param name="dtStart">Data inizio set da eliminare</param>
|
||||||
|
/// <param name="dtEnd">Data fine set da eliminare</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public int LogMacRemoveRange(string connString, int keyNum, int machineId, DateTime dtStart, DateTime dtEnd)
|
||||||
|
{
|
||||||
|
int numMod = 0;
|
||||||
|
using (MagManContext dbCtx = new MagManContext(connString))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// eseguo stored
|
||||||
|
string sqlCommand = $"CALL stp_removeLogMachine ({keyNum}, {machineId}, '{dtStart:yyyy-MM-dd HH:mm:ss.fff}', '{dtEnd:yyyy-MM-dd HH:mm:ss.fff}');";
|
||||||
|
dbCtx.Database.ExecuteSqlRaw(sqlCommand);
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione in LogMacRemoveRange{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return numMod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int LogMacUpdate(string connString, List<LogMachineModel> recList)
|
||||||
|
{
|
||||||
|
bool useStored = true;
|
||||||
|
int numMod = 0;
|
||||||
|
using (MagManContext dbCtx = new MagManContext(connString))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (useStored)
|
||||||
|
{
|
||||||
|
// eseguo stored x ogni record...
|
||||||
|
foreach (var item in recList)
|
||||||
|
{
|
||||||
|
string sqlCommand = $"CALL stp_mergeLogMachine ({item.KeyNum}, {item.MachineID}, {item.ProjDbId}, '{item.DtEvent:yyyy-MM-dd HH:mm:ss.fff}', {(int)item.EvType}, '{item.SupervId}', '{item.VarValue}');";
|
||||||
|
dbCtx.Database.ExecuteSqlRaw(sqlCommand);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// verifico record x data/progetto...
|
||||||
|
foreach (var item in recList)
|
||||||
|
{
|
||||||
|
// cerco
|
||||||
|
var recOld = dbCtx
|
||||||
|
.DbSetLogMac
|
||||||
|
.Where(x => x.KeyNum == item.KeyNum
|
||||||
|
&& x.MachineID == item.MachineID
|
||||||
|
&& x.ProjDbId == item.ProjDbId
|
||||||
|
&& x.DtEvent == item.DtEvent
|
||||||
|
&& x.EvType == item.EvType
|
||||||
|
&& x.SupervId == item.SupervId
|
||||||
|
&& x.VarValue == item.VarValue)
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (recOld == null)
|
||||||
|
{
|
||||||
|
dbCtx
|
||||||
|
.DbSetLogMac
|
||||||
|
.Add(item);
|
||||||
|
numMod++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// salvo su DB
|
||||||
|
dbCtx.SaveChanges();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione in LogMacUpdate{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return numMod;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elimina Materiale da magazzino
|
/// Elimina Materiale da magazzino
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -558,8 +709,9 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="connString">Stringa connessione (variabile x cliente)</param>
|
/// <param name="connString">Stringa connessione (variabile x cliente)</param>
|
||||||
/// <param name="withChild">Se true allora include record child (Items)</param>
|
/// <param name="withChild">Se true allora include record child (Items)</param>
|
||||||
|
/// <param name="withRemn">Se true allora include record remnants (Items) nei conteggi qty</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<MaterialDTO> MaterialDtoGetAll(string connString, bool withChild)
|
public List<MaterialDTO> MaterialDtoGetAll(string connString, bool withChild, bool withRemn)
|
||||||
{
|
{
|
||||||
List<MaterialDTO> dbResult = new List<MaterialDTO>();
|
List<MaterialDTO> dbResult = new List<MaterialDTO>();
|
||||||
using (MagManContext dbCtx = new MagManContext(connString))
|
using (MagManContext dbCtx = new MagManContext(connString))
|
||||||
@@ -578,8 +730,8 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
HMm = x.HMm,
|
HMm = x.HMm,
|
||||||
LMm = x.LMm,
|
LMm = x.LMm,
|
||||||
WMm = x.WMm,
|
WMm = x.WMm,
|
||||||
SizeNum = x.RawItemList == null ? 0 : x.RawItemList.Where(x => x.IsActive).Count(),
|
SizeNum = x.RawItemList == null ? 0 : x.RawItemList.Where(x => !x.IsDeleted).Count(),
|
||||||
QtyTot = x.RawItemList == null ? 0 : x.RawItemList.Where(x => x.IsActive).Sum(r => r.QtyAvail),
|
QtyTot = x.RawItemList == null ? 0 : calcQty(x.IsBeam, x.RawItemList.Where(x => !x.IsDeleted && (withRemn || !x.IsRemn)).ToList()),
|
||||||
MatDtmx = x.MatDtmx,
|
MatDtmx = x.MatDtmx,
|
||||||
IsBeam = x.IsBeam,
|
IsBeam = x.IsBeam,
|
||||||
IsWall = x.IsWall,
|
IsWall = x.IsWall,
|
||||||
@@ -595,6 +747,20 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected decimal calcQty(bool isBeam, List<RawItemModel> items)
|
||||||
|
{
|
||||||
|
decimal answ = 0;
|
||||||
|
if (isBeam)
|
||||||
|
{
|
||||||
|
answ = items.Sum(x => x.QtyAvail * x.LMm / 1000);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
answ = items.Sum(x => x.QtyAvail * x.LMm / 1000 * x.WMm / 1000);
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco Materiali gestiti a magazzino formato DTO
|
/// Elenco Materiali gestiti a magazzino formato DTO
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -860,6 +1026,31 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
}
|
}
|
||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco progetti modificati dopo data
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="connString">Stringa connessione (variabile x cliente)</param>
|
||||||
|
/// <param name="DtRif">Data rispetto cui cercare modifiche successive</param>
|
||||||
|
/// <returns>Elenco records progetti</returns>
|
||||||
|
public List<ProjModel> ProjectGetModAfter(string connString, DateTime DtRif)
|
||||||
|
{
|
||||||
|
List<ProjModel> dbResult = new List<ProjModel>();
|
||||||
|
using (MagManContext dbCtx = new MagManContext(connString))
|
||||||
|
{
|
||||||
|
dbResult = dbCtx
|
||||||
|
.DbSetProjects
|
||||||
|
.Where(x => x.DtLastAction >= DtRif)
|
||||||
|
.ToList();
|
||||||
|
if (dbResult == null)
|
||||||
|
{
|
||||||
|
dbResult = new List<ProjModel>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco progetti dato cliente e macchina
|
/// Elenco progetti dato cliente e macchina
|
||||||
@@ -907,7 +1098,55 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///Upsert di un record Project
|
/// Upsert di un record Project
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="connString">Stringa connessione (variabile x cliente)</param>
|
||||||
|
/// <param name="projDbId">ID Record progetto da aggiornare</param>
|
||||||
|
/// <param name="procTime">Durata progetto (cumulata)</param>
|
||||||
|
/// <param name="valAct">Valore Progresso attuale (tipicamente num barre/pezzi)</param>
|
||||||
|
/// <param name="valMax">Valore Progresso max atteso (tipicamente num barre/pezzi)</param>
|
||||||
|
/// <returns>Esito update</returns>
|
||||||
|
public bool ProjectSetProgr(string connString, int projDbId, double procTime, double valAct, double valMax)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
using (MagManContext dbCtx = new MagManContext(connString))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Ricerca:
|
||||||
|
* - DbId corrisponde e > 0...
|
||||||
|
* */
|
||||||
|
var currData = dbCtx
|
||||||
|
.DbSetProjects
|
||||||
|
.Where(x => (projDbId > 0 && x.ProjDbId == projDbId))
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (currData != null)
|
||||||
|
{
|
||||||
|
// aggiorno solo se > 0...
|
||||||
|
if (procTime > 0)
|
||||||
|
{
|
||||||
|
currData.ProcTimeReal = procTime;
|
||||||
|
}
|
||||||
|
currData.ValAct = valAct;
|
||||||
|
currData.ValMax = valMax;
|
||||||
|
currData.DtLastAction = DateTime.Now;
|
||||||
|
dbCtx.Entry(currData).State = EntityState.Modified;
|
||||||
|
}
|
||||||
|
var done = dbCtx.SaveChanges();
|
||||||
|
// registro esito ok
|
||||||
|
fatto = done > 0;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione in ProjectSetProgr{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Upsert di un record Project
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="connString">Stringa connessione (variabile x cliente)</param>
|
/// <param name="connString">Stringa connessione (variabile x cliente)</param>
|
||||||
/// <param name="rec2upd">Record da aggiungere/aggiornare</param>
|
/// <param name="rec2upd">Record da aggiungere/aggiornare</param>
|
||||||
@@ -921,15 +1160,15 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Ricerca:
|
* Ricerca:
|
||||||
* - DbId corrisponde e > 0...
|
* - DbId (cloud) corrisponde e > 0...
|
||||||
* [[ RIMOSSO - Key + Id remoti corrispondono]]
|
* [[ RIMOSSO - Key + Id remoti corrispondono]]
|
||||||
* */
|
* */
|
||||||
var currData = dbCtx
|
var currData = dbCtx
|
||||||
.DbSetProjects
|
.DbSetProjects
|
||||||
.Where(x => (rec2upd.ProjDbId > 0 && x.ProjDbId == rec2upd.ProjDbId))
|
.Where(x => (rec2upd.ProjDbId > 0 && x.ProjDbId == rec2upd.ProjDbId))
|
||||||
//.Where(x => (rec2upd.ProjDbId > 0 && x.ProjDbId == rec2upd.ProjDbId) ||
|
|
||||||
// ((x.ProjExtDbId == rec2upd.ProjExtDbId && x.KeyNum == rec2upd.KeyNum) && (x.ProjExtId == rec2upd.ProjExtId && x.KeyNum == rec2upd.KeyNum)))
|
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
//.Where(x => (rec2upd.projDbId > 0 && x.projDbId == rec2upd.projDbId) ||
|
||||||
|
// ((x.ProjExtDbId == rec2upd.ProjExtDbId && x.KeyNum == rec2upd.KeyNum) && (x.ProjExtId == rec2upd.ProjExtId && x.KeyNum == rec2upd.KeyNum)))
|
||||||
if (currData != null)
|
if (currData != null)
|
||||||
{
|
{
|
||||||
currData.MachineID = rec2upd.MachineID;
|
currData.MachineID = rec2upd.MachineID;
|
||||||
@@ -941,7 +1180,9 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
currData.Machine = rec2upd.Machine;
|
currData.Machine = rec2upd.Machine;
|
||||||
currData.ProjDescription = rec2upd.ProjDescription;
|
currData.ProjDescription = rec2upd.ProjDescription;
|
||||||
currData.DtCreated = rec2upd.DtCreated;
|
currData.DtCreated = rec2upd.DtCreated;
|
||||||
currData.DtLastAction = rec2upd.DtLastAction;
|
// imposto comunque adesso come aggiornamento
|
||||||
|
//currData.DtLastAction = rec2upd.DtLastAction;
|
||||||
|
currData.DtLastAction = DateTime.Now;
|
||||||
currData.DtSchedule = rec2upd.DtSchedule;
|
currData.DtSchedule = rec2upd.DtSchedule;
|
||||||
currData.DtStartProd = rec2upd.DtStartProd;
|
currData.DtStartProd = rec2upd.DtStartProd;
|
||||||
currData.ListName = rec2upd.ListName;
|
currData.ListName = rec2upd.ListName;
|
||||||
@@ -969,6 +1210,39 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
return newId;
|
return newId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recupera ultimo record attivo di un progetto/stato indicato
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="connString">Stringa connessione (variabile x cliente)</param>
|
||||||
|
/// <param name="ProjCloudId">ID del progetto da cercare</param>
|
||||||
|
/// <param name="ResState">Stato richiesta da cercare</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public RequestPlanModel ReqPlanGetLast(string connString, int ProjCloudId, ProjResState ResState)
|
||||||
|
{
|
||||||
|
RequestPlanModel dbResult = new RequestPlanModel(); ;
|
||||||
|
using (MagManContext dbCtx = new MagManContext(connString))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Ricerca x Id corrispondente
|
||||||
|
* */
|
||||||
|
var currData = dbCtx
|
||||||
|
.DbSetReqPlan
|
||||||
|
.Where(x => x.ProjDbId == ProjCloudId && x.ReqState == ResState && x.IsActive)
|
||||||
|
.OrderByDescending(x => x.DtRequest)
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
dbResult = currData ?? new RequestPlanModel();
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione in ReqPlanGetLast{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Aggiunge/Modifica un record ReqPlan
|
/// Aggiunge/Modifica un record ReqPlan
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -982,8 +1256,20 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
DateTime adesso = DateTime.Now;
|
||||||
|
// imposto data update Proj relativo ad adesso...
|
||||||
|
var recProj = dbCtx
|
||||||
|
.DbSetProjects
|
||||||
|
.Where(x => x.ProjDbId == rec2upd.ProjDbId)
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (recProj != null)
|
||||||
|
{
|
||||||
|
recProj.DtLastAction = adesso;
|
||||||
|
dbCtx.Entry(recProj).State = EntityState.Modified;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ricerca x Id corrispondente
|
* Ricerca ReqPlan x Id corrispondente
|
||||||
* */
|
* */
|
||||||
var currData = dbCtx
|
var currData = dbCtx
|
||||||
.DbSetReqPlan
|
.DbSetReqPlan
|
||||||
@@ -1001,12 +1287,12 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// se NON di consumo prima rendo disattivi altri....
|
// se NON di consumo prima rendo disattivi altri PRECEDENTI...
|
||||||
if (rec2upd.ReqState > Enums.ProjResState.Consumed)
|
if (rec2upd.ReqState > Enums.ProjResState.Consumed)
|
||||||
{
|
{
|
||||||
var rec2disable = dbCtx
|
var rec2disable = dbCtx
|
||||||
.DbSetReqPlan
|
.DbSetReqPlan
|
||||||
.Where(x => x.IsActive && x.ProjDbId == rec2upd.ProjDbId && x.ReqState > Enums.ProjResState.Consumed)
|
.Where(x => x.IsActive && x.ProjDbId == rec2upd.ProjDbId && x.ReqState > Enums.ProjResState.Consumed && x.DtRequest <= rec2upd.DtRequest)
|
||||||
.ToList();
|
.ToList();
|
||||||
if (rec2disable != null)
|
if (rec2disable != null)
|
||||||
{
|
{
|
||||||
@@ -1017,6 +1303,17 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// verifico se ho richieste successive così da disattivare la corrente...
|
||||||
|
var recActive = dbCtx
|
||||||
|
.DbSetReqPlan
|
||||||
|
.Where(x => x.IsActive && x.ProjDbId == rec2upd.ProjDbId && x.ReqState > Enums.ProjResState.Consumed && x.DtRequest > rec2upd.DtRequest)
|
||||||
|
.ToList();
|
||||||
|
// se ci fossero...
|
||||||
|
if (recActive != null && recActive.Count > 0)
|
||||||
|
{
|
||||||
|
// disattivo richiesta corrente
|
||||||
|
rec2upd.IsActive = false;
|
||||||
|
}
|
||||||
// aggiungo record
|
// aggiungo record
|
||||||
dbCtx
|
dbCtx
|
||||||
.DbSetReqPlan
|
.DbSetReqPlan
|
||||||
@@ -1033,6 +1330,23 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
return newId;
|
return newId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Converte il DTO in ResourceModel
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="origItem">DTO di partenza</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public ResourceModel ResourceFromDto(ResourceDTO origItem, int reqId)
|
||||||
|
{
|
||||||
|
ResourceModel answ = new ResourceModel()
|
||||||
|
{
|
||||||
|
Qty = origItem.Qty,
|
||||||
|
RawItemId = origItem.RawItemCloudId,
|
||||||
|
RequestId = reqId,
|
||||||
|
ResourceId = 0
|
||||||
|
};
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco risorse dato progetto e stato
|
/// Elenco risorse dato progetto e stato
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1077,7 +1391,7 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
HMm = x.ItemNav.HMm,
|
HMm = x.ItemNav.HMm,
|
||||||
LMm = x.ItemNav.LMm,
|
LMm = x.ItemNav.LMm,
|
||||||
WMm = x.ItemNav.WMm,
|
WMm = x.ItemNav.WMm,
|
||||||
IsActive = x.RequestNav.IsActive,
|
IsDeleted = x.ItemNav.IsDeleted,
|
||||||
IsRemn = x.ItemNav.IsRemn,
|
IsRemn = x.ItemNav.IsRemn,
|
||||||
MatCloudId = x.ItemNav.MatId,
|
MatCloudId = x.ItemNav.MatId,
|
||||||
RequestId = x.RequestId
|
RequestId = x.RequestId
|
||||||
@@ -1125,22 +1439,6 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
}
|
}
|
||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
/// <summary>
|
|
||||||
/// Converte il DTO in ResourceModel
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="origItem">DTO di partenza</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public ResourceModel ResourceFromDto(ResourceDTO origItem, int reqId)
|
|
||||||
{
|
|
||||||
ResourceModel answ = new ResourceModel()
|
|
||||||
{
|
|
||||||
Qty = origItem.Qty,
|
|
||||||
RawItemId = origItem.RawItemCloudId,
|
|
||||||
RequestId = reqId,
|
|
||||||
ResourceId = 0
|
|
||||||
};
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Aggiunge/Modifica un elenco di Resource (+ eventuali update giacenze)
|
/// Aggiunge/Modifica un elenco di Resource (+ eventuali update giacenze)
|
||||||
@@ -1207,6 +1505,49 @@ namespace MagMan.Data.Tenant.Controllers
|
|||||||
return numMod;
|
return numMod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update record Project + refresh cache x info archived
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="connString">Stringa connessione (variabile x cliente)</param>
|
||||||
|
/// <param name="newData">IDizionario ProdId / IsArchived da impostare</param>
|
||||||
|
/// <returns>Esito update</returns>
|
||||||
|
public bool ProjectUpdArchived(string connString, Dictionary<int, bool> newData)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
using (MagManContext dbCtx = new MagManContext(connString))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DateTime adesso = DateTime.Now;
|
||||||
|
foreach (var item in newData)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Ricerca:
|
||||||
|
* - DbId corrisponde e > 0...
|
||||||
|
* */
|
||||||
|
var currData = dbCtx
|
||||||
|
.DbSetProjects
|
||||||
|
.Where(x => (item.Key > 0 && x.ProjDbId == item.Key))
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (currData != null)
|
||||||
|
{
|
||||||
|
currData.IsArchived = item.Value;
|
||||||
|
currData.DtLastAction = adesso;
|
||||||
|
dbCtx.Entry(currData).State = EntityState.Modified;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var done = dbCtx.SaveChanges();
|
||||||
|
// registro esito ok
|
||||||
|
fatto = done > 0;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione in ProjectUpdArchived{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using MySqlConnector;
|
||||||
|
using NLog;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -30,10 +32,27 @@ namespace MagMan.Data.Tenant
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
public static ServerVersion CustomAutoDetect(string connectionString)
|
||||||
|
{
|
||||||
|
#if false
|
||||||
|
using var connection = new MySqlConnection(
|
||||||
|
new MySqlConnectionStringBuilder(connectionString)
|
||||||
|
{
|
||||||
|
Database = string.Empty,
|
||||||
|
// AutoEnlist = false, Pooling = false,
|
||||||
|
}.ConnectionString);
|
||||||
|
#endif
|
||||||
|
using var connection = new MySqlConnection(connectionString);
|
||||||
|
connection.Open();
|
||||||
|
ServerVersion currVers = ServerVersion.Parse(connection.ServerVersion);
|
||||||
|
return currVers;
|
||||||
|
}
|
||||||
|
|
||||||
public static string CustomerConnString(string server, int nKey)
|
public static string CustomerConnString(string server, int nKey)
|
||||||
{
|
{
|
||||||
string dbName = $"MagMan_{nKey:000000}";
|
string dbName = $"MagMan_{nKey:000000}";
|
||||||
return $"server={server};port=3306;database={dbName};uid={DATABASE_USER};pwd={DATABASE_PWD};sslmode=None";
|
return $"server={server};port=3306;database={dbName};uid={DATABASE_USER};pwd={DATABASE_PWD};sslmode=None;Connection Lifetime=60;Connection Timeout=15;DefaultCommandTimeout=30;ConnectionIdleTimeout=30;ConnectionLifeTime=300;";
|
||||||
|
//LoadBalance=RoundRobin;Pooling=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool ExecMigrationMain(string connString)
|
public static bool ExecMigrationMain(string connString)
|
||||||
@@ -48,9 +67,47 @@ namespace MagMan.Data.Tenant
|
|||||||
{
|
{
|
||||||
DATABASE_SERV = server;
|
DATABASE_SERV = server;
|
||||||
DATABASE_NAME = $"MagMan_{nKey:000000}";
|
DATABASE_NAME = $"MagMan_{nKey:000000}";
|
||||||
CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database={DATABASE_NAME};uid={DATABASE_USER};pwd={DATABASE_PWD};sslmode=None";
|
CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database={DATABASE_NAME};uid={DATABASE_USER};pwd={DATABASE_PWD};sslmode=None;Connection Lifetime=60;Connection Timeout=15;DefaultCommandTimeout=30;ConnectionIdleTimeout=30;ConnectionLifeTime=300;";
|
||||||
|
//LoadBalance=RoundRobin;Pooling=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ServerVersion MysqlServerVersion(string connString)
|
||||||
|
{
|
||||||
|
// fix come da https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/1859
|
||||||
|
//Log.Info($"MysqlServerVersion | {connString}");
|
||||||
|
//ServerVersion serverVersion = ServerVersion.Parse("10.11.13-MariaDB");
|
||||||
|
ServerVersion serverVersion = ServerVersion.Parse("10.5.25-mysql");
|
||||||
|
bool versOk = false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
serverVersion = ServerVersion.AutoDetect(connString);
|
||||||
|
versOk = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione in verifica versione server ServerVersion.AutoDetect: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
if (!versOk)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
serverVersion = CustomAutoDetect(connString);
|
||||||
|
versOk = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione in verifica versione server CustomAutoDetect: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return serverVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -30,6 +30,11 @@ namespace MagMan.Data.Tenant.DbModels
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string ValueAlias { get; set; } = "";
|
public string ValueAlias { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indica se il record sia attivo/valido (per cancellazione logica online e fisica in remoto)
|
||||||
|
/// </summary>
|
||||||
|
public bool IsActive { get; set; } = true;
|
||||||
|
|
||||||
public override bool Equals(object? obj)
|
public override bool Equals(object? obj)
|
||||||
{
|
{
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.DbModels
|
||||||
|
{
|
||||||
|
[Table("DayStat")]
|
||||||
|
public class DayStatModel
|
||||||
|
{
|
||||||
|
[Key, Column("DayId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public int DayId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id macchina (diMagMan)
|
||||||
|
/// </summary>
|
||||||
|
public int MachineID { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data di riferimento
|
||||||
|
/// </summary>
|
||||||
|
public DateTime DtRif { get; set; } = DateTime.MinValue;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ope apertura disponibili
|
||||||
|
/// </summary>
|
||||||
|
public double OreDis { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ore lavorate effettive
|
||||||
|
/// </summary>
|
||||||
|
public double OreLav { get; set; } = 0;
|
||||||
|
|
||||||
|
[NotMapped]
|
||||||
|
public double OEE
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
double denom = OreDis > 0 ? OreDis : 1;
|
||||||
|
return OreLav / denom;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.DbModels
|
||||||
|
{
|
||||||
|
[Table("AnagEventi")]
|
||||||
|
public class EventModel
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
public int IdxEv { get; set; } = 0;
|
||||||
|
|
||||||
|
public string Nome { get; set; } = "";
|
||||||
|
public string TabAzione { get; set; } = "";
|
||||||
|
public string Azione { get; set; } = "";
|
||||||
|
public string KeyEvento { get; set; } = "";
|
||||||
|
public bool EventoTablet { get; set; } = false;
|
||||||
|
public string NoteEvento { get; set; } = "";
|
||||||
|
public string CssClass { get; set; } = "";
|
||||||
|
public string Icon { get; set; } = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,91 +24,38 @@ namespace MagMan.Data.Tenant.DbModels
|
|||||||
[Key, Column("DbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[Key, Column("DbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public int LogDbId { get; set; }
|
public int LogDbId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Key di riferimento per il progetto
|
||||||
|
/// </summary>
|
||||||
|
public int KeyNum { get; set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Id macchina (diMagMan)
|
/// Id macchina (diMagMan)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int MachineID { get; set; } = 0;
|
public int MachineID { get; set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Key di riferimento per il progetto
|
/// Progetto di riferimento (CloudId)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int KeyNum { get; set; } = 0;
|
public int ProjDbId { get; set; }
|
||||||
|
|
||||||
#if false
|
|
||||||
/// <summary>
|
|
||||||
/// Codice Allarme
|
|
||||||
/// </summary>
|
|
||||||
[Column("AlarmCode")]
|
|
||||||
public string AlarmCode { get; set; } = "";
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data Evento
|
/// Data Registrazione
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Column("AlarmDtEvent")]
|
[Column("DtEvent")]
|
||||||
public DateTime AlarmDatetime { get; set; } = DateTime.Now;
|
public DateTime DtEvent { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Messaggio Allarme
|
|
||||||
/// </summary>
|
|
||||||
[Column("AlarmMessage")]
|
|
||||||
public string AlarmMessage { get; set; } = "";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Alarm Operation
|
|
||||||
/// </summary>
|
|
||||||
[Column("AlarmOperation")]
|
|
||||||
public int AlarmOperation { get; set; } = 0;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Alarm Type
|
|
||||||
/// </summary>
|
|
||||||
[Column("AlarmType")]
|
|
||||||
public int AlarmType { get; set; } = 0;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Esaecuzione comando corretta
|
|
||||||
/// </summary>
|
|
||||||
[Column("CommExecuted")]
|
|
||||||
public bool CommandExecutedCorrectly { get; set; } = false;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stato da enum Core
|
/// Stato da enum Core
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Column("CommandState")]
|
[Column("EvType")]
|
||||||
public Core.ConstMachComm.CommandStates CommandState { get; set; } = Core.ConstMachComm.CommandStates.NULL;
|
public MachLogTypes EvType { get; set; } = MachLogTypes.NULL;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Tipo Comando da enum Core
|
|
||||||
/// </summary>
|
|
||||||
[Column("CommandType")]
|
|
||||||
public Core.ConstMachComm.LogCommandTypes CommandType { get; set; } = Core.ConstMachComm.LogCommandTypes.NULL;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Descrizione
|
|
||||||
/// </summary>
|
|
||||||
[Column("Description")]
|
|
||||||
public string Description { get; set; } = "";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// New OP State
|
|
||||||
/// </summary>
|
|
||||||
[Column("NewOpState")]
|
|
||||||
public int NewOpState { get; set; } = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Stato da enum Core
|
|
||||||
/// </summary>
|
|
||||||
[Column("ResultType")]
|
|
||||||
public ResultTypes ResultType { get; set; } = ResultTypes.NULL;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indirizzo VAR
|
/// Indirizzo VAR
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Column("VarAddress")]
|
[Column("SupervId")]
|
||||||
public string VarAddress { get; set; } = "";
|
public string SupervId { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Valore VAR
|
/// Valore VAR
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.DbModels
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Tabella dei grezzi
|
||||||
|
/// </summary>
|
||||||
|
[Table("MachGroupList")]
|
||||||
|
public class MachGroupModel
|
||||||
|
{
|
||||||
|
[Key, Column("DbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public int MachGroupDbId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id geometrico Grezzo (barra intera)
|
||||||
|
/// </summary>
|
||||||
|
[Column("MachGroupId")]
|
||||||
|
public int MachGroupId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Proj di appartenenza
|
||||||
|
/// </summary>
|
||||||
|
public int ProjDbId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Start
|
||||||
|
/// </summary>
|
||||||
|
[Column("DtStart")]
|
||||||
|
public DateTime DtStart { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data End
|
||||||
|
/// </summary>
|
||||||
|
[Column("DtEnd")]
|
||||||
|
public DateTime DtEnd { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.DbModels
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Tabella delle singole istanze prodotte
|
||||||
|
/// </summary>
|
||||||
|
[Table("PartList")]
|
||||||
|
public class PartModel
|
||||||
|
{
|
||||||
|
[Key, Column("DbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public int PartDbId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id geometrico Barra Lavorata
|
||||||
|
/// </summary>
|
||||||
|
[Column("PartId")]
|
||||||
|
public int PartId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// MachGroup di appartenenza
|
||||||
|
/// </summary>
|
||||||
|
[Column("MachGroupId")]
|
||||||
|
public int MachGroupId { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Proj di appartenenza
|
||||||
|
/// </summary>
|
||||||
|
public int ProjDbId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Start
|
||||||
|
/// </summary>
|
||||||
|
[Column("DtStart")]
|
||||||
|
public DateTime DtStart { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data End
|
||||||
|
/// </summary>
|
||||||
|
[Column("DtEnd")]
|
||||||
|
public DateTime DtEnd { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
#if false
|
||||||
|
[ForeignKey("MachGroupId")]
|
||||||
|
public virtual MachGroupModel MachGroupNav { get; set; }
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -108,6 +108,32 @@ namespace MagMan.Data.Tenant.DbModels
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public double ProcTimeReal { get; set; } = 0;
|
public double ProcTimeReal { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Avanzamento in percentuale (tipicamente barre fatte / da fare)
|
||||||
|
/// </summary>
|
||||||
|
public double ProgPerc
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
double answ = 0;
|
||||||
|
if (ValMax > 0)
|
||||||
|
{
|
||||||
|
answ = ValAct / ValMax;
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Avanzamento (tipicamente barre fatte)
|
||||||
|
/// </summary>
|
||||||
|
public double ValAct { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Valore finale atteso (tipicamente barre da fare)
|
||||||
|
/// </summary>
|
||||||
|
public double ValMax { get; set; } = 1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Record attivo (se false == cancellazione logica)
|
/// Record attivo (se false == cancellazione logica)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -32,14 +32,14 @@ namespace MagMan.Data.Tenant.DbModels
|
|||||||
public int QtyAvail { get; set; } = 0;
|
public int QtyAvail { get; set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Active, for logical delete...
|
/// Bool for logical delete (cloud and on PC...)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsActive { get; set; } = false;
|
public bool IsDeleted { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check if is a Remnant
|
/// Check if is a Remnant
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsRemn { get; set; } = false;
|
public bool IsRemn { get; set; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Location
|
/// Location
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.DbModels
|
||||||
|
{
|
||||||
|
[Table("AnagStati")]
|
||||||
|
public class StatusModel
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
public int IdxStato { get; set; } = 0;
|
||||||
|
|
||||||
|
public string Descrizione { get; set; } = "";
|
||||||
|
public string Semaforo { get; set; } = "";
|
||||||
|
public int Priorita { get; set; } = 0;
|
||||||
|
public string ClasseTempo { get; set; } = "";
|
||||||
|
public bool ShowArticolo { get; set; } = false;
|
||||||
|
public string KeyStato { get; set; } = "";
|
||||||
|
public string NoteStato { get; set; } = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -10,7 +11,7 @@ namespace MagMan.Data.Tenant.DbModels
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Classe fake x il conteggio tabelle e check preliminari
|
/// Classe fake x il conteggio tabelle e check preliminari
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Keyless]
|
[NotMapped]
|
||||||
public class TableCount
|
public class TableCount
|
||||||
{
|
{
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
<Configurations>Debug;Release</Configurations>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -20,20 +21,21 @@
|
|||||||
<PackageReference Include="Blazored.LocalStorage" Version="4.3.0" />
|
<PackageReference Include="Blazored.LocalStorage" Version="4.3.0" />
|
||||||
<PackageReference Include="Blazored.SessionStorage" Version="2.4.0" />
|
<PackageReference Include="Blazored.SessionStorage" Version="2.4.0" />
|
||||||
<PackageReference Include="MailKit" Version="4.2.0" />
|
<PackageReference Include="MailKit" Version="4.2.0" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.25" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.28" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.25">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.28">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.25" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.28" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.25">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.28">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
<PackageReference Include="NLog" Version="5.2.7" />
|
<PackageReference Include="NLog" Version="5.2.8" />
|
||||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.1" />
|
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.3" />
|
||||||
<PackageReference Include="StackExchange.Redis" Version="2.7.10" />
|
<PackageReference Include="StackExchange.Redis" Version="2.7.33" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -45,4 +47,16 @@
|
|||||||
<Folder Include="Migrations\" />
|
<Folder Include="Migrations\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Update="SqlScripts\Stored\stp_removeLogMachine.sql">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Update="SqlScripts\Stored\stp_mergeLogMachine.sql">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Update="SqlScripts\Stored\stp_recalcDailyMGP.sql">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -14,13 +14,6 @@ namespace MagMan.Data.Tenant
|
|||||||
{
|
{
|
||||||
public partial class MagManContext : DbContext
|
public partial class MagManContext : DbContext
|
||||||
{
|
{
|
||||||
#region Private Fields
|
|
||||||
|
|
||||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
|
||||||
|
|
||||||
|
|
||||||
#endregion Private Fields
|
|
||||||
|
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public MagManContext()
|
public MagManContext()
|
||||||
@@ -28,6 +21,7 @@ namespace MagMan.Data.Tenant
|
|||||||
// default
|
// default
|
||||||
connString = DbConfig.CONNECTION_STRING;
|
connString = DbConfig.CONNECTION_STRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MagManContext(string currConnString)
|
public MagManContext(string currConnString)
|
||||||
{
|
{
|
||||||
connString = currConnString;
|
connString = currConnString;
|
||||||
@@ -37,29 +31,40 @@ namespace MagMan.Data.Tenant
|
|||||||
|
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
public virtual DbSet<ConfigModel> DbSetConfig { get; set; } = null!;
|
|
||||||
|
|
||||||
public virtual DbSet<RawItemModel> DbSetItems { get; set; } = null!;
|
|
||||||
public virtual DbSet<MaterialModel> DbSetMaterials { get; set; } = null!;
|
|
||||||
public virtual DbSet<RawItemModel> DbSetRawItem { get; set; } = null!;
|
|
||||||
public virtual DbSet<AliasModel> DbSetAlias { get; set; } = null!;
|
public virtual DbSet<AliasModel> DbSetAlias { get; set; } = null!;
|
||||||
|
public virtual DbSet<ConfigModel> DbSetConfig { get; set; } = null!;
|
||||||
|
public virtual DbSet<DayStatModel> DbSetDayStat { get; set; } = null!;
|
||||||
|
public virtual DbSet<EventModel> DbSetEventList { get; set; } = null!;
|
||||||
|
public virtual DbSet<RawItemModel> DbSetItems { get; set; } = null!;
|
||||||
|
public virtual DbSet<LogMachineModel> DbSetLogMac { get; set; } = null!;
|
||||||
|
public virtual DbSet<MachGroupModel> DbSetMachGrp { get; set; } = null!;
|
||||||
|
public virtual DbSet<MaterialModel> DbSetMaterials { get; set; } = null!;
|
||||||
|
public virtual DbSet<MovMagModel> DbSetMovMag { get; set; } = null!;
|
||||||
|
public virtual DbSet<PartModel> DbSetPart { get; set; } = null!;
|
||||||
public virtual DbSet<ProjModel> DbSetProjects { get; set; } = null!;
|
public virtual DbSet<ProjModel> DbSetProjects { get; set; } = null!;
|
||||||
public virtual DbSet<RequestPlanModel> DbSetReqPlan { get; set; } = null!;
|
public virtual DbSet<RequestPlanModel> DbSetReqPlan { get; set; } = null!;
|
||||||
public virtual DbSet<ResourceModel> DbSetResources { get; set; } = null!;
|
public virtual DbSet<ResourceModel> DbSetResources { get; set; } = null!;
|
||||||
public virtual DbSet<MovMagModel> DbSetMovMag { get; set; } = null!;
|
public virtual DbSet<StatusModel> DbSetStatusList { get; set; } = null!;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private string connString = "";
|
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
|
|
||||||
#region Private Methods
|
#region Public Methods
|
||||||
|
|
||||||
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
public void DbForceMigrate()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// se non ci fosse... crea o migra!
|
||||||
|
Database.Migrate();
|
||||||
|
Log.Info("DbForceMigrate: done!");
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error(exc, "DbForceMigrate: Exception during context initialization 01");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Private Methods
|
#endregion Public Methods
|
||||||
|
|
||||||
#region Protected Methods
|
#region Protected Methods
|
||||||
|
|
||||||
@@ -67,8 +72,18 @@ namespace MagMan.Data.Tenant
|
|||||||
{
|
{
|
||||||
if (!optionsBuilder.IsConfigured)
|
if (!optionsBuilder.IsConfigured)
|
||||||
{
|
{
|
||||||
var serverVersion = ServerVersion.AutoDetect(connString);
|
// commentato x test su cluster in ufficio
|
||||||
optionsBuilder.UseMySql(connString, serverVersion);
|
#if DEBUG
|
||||||
|
//connString = "Server=localhost;port=3306;database=MagMan_000470;uid=MagMan_DbUser;pwd=viad@nte16!;sslmode=None;";
|
||||||
|
////connString = "Server=mdb03.ufficio;port=3306;database=MagMan_000470;uid=MagMan_DbUser;pwd=viad@nte16!;sslmode=None;";
|
||||||
|
connString = "Server=mdb.ufficio;port=3306;database=MagMan_000470;uid=MagMan_DbUser;pwd=viad@nte16!;sslmode=None;Connection Lifetime=60;Connection Timeout=15;DefaultCommandTimeout=30;ConnectionIdleTimeout=30;ConnectionLifeTime=300;";
|
||||||
|
#endif
|
||||||
|
var serverVersion = DbConfig.MysqlServerVersion(connString);
|
||||||
|
optionsBuilder.UseMySql(connString, serverVersion, options => options.EnableRetryOnFailure(
|
||||||
|
maxRetryCount: 5,
|
||||||
|
maxRetryDelay: TimeSpan.FromSeconds(10),
|
||||||
|
errorNumbersToAdd: null)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,22 +110,17 @@ namespace MagMan.Data.Tenant
|
|||||||
|
|
||||||
#endregion Protected Methods
|
#endregion Protected Methods
|
||||||
|
|
||||||
#region Public Methods
|
#region Private Fields
|
||||||
|
|
||||||
public void DbForceMigrate()
|
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
{
|
private string connString = "";
|
||||||
try
|
|
||||||
{
|
|
||||||
// se non ci fosse... crea o migra!
|
|
||||||
Database.Migrate();
|
|
||||||
Log.Info("DbForceMigrate: done!");
|
|
||||||
}
|
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
Log.Error(exc, "DbForceMigrate: Exception during context initialization 01");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Private Fields
|
||||||
|
|
||||||
|
#region Private Methods
|
||||||
|
|
||||||
|
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
||||||
|
|
||||||
|
#endregion Private Methods
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+351
@@ -0,0 +1,351 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using MagMan.Data.Tenant;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(MagManContext))]
|
||||||
|
[Migration("20240404092207_AddAliasLogicalDelete")]
|
||||||
|
partial class AddAliasLogicalDelete
|
||||||
|
{
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "6.0.25")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.AliasModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Family")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<string>("ValueOriginal")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<string>("ValueAlias")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("Family", "ValueOriginal");
|
||||||
|
|
||||||
|
b.ToTable("AliasList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ConfigModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("KeyName")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(0);
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)")
|
||||||
|
.HasColumnOrder(3);
|
||||||
|
|
||||||
|
b.Property<string>("Val")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(1);
|
||||||
|
|
||||||
|
b.Property<string>("ValStd")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(2)
|
||||||
|
.HasComment("Valore di default/riferimento per la variabile");
|
||||||
|
|
||||||
|
b.HasKey("KeyName");
|
||||||
|
|
||||||
|
b.ToTable("Config");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MaterialModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MatId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("HMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<decimal>("LMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<string>("MatCode")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("MatDesc")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<decimal>("WMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.HasKey("MatId");
|
||||||
|
|
||||||
|
b.ToTable("MaterialsList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MovMagModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MovID")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRec")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("QtyRec")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("MovID");
|
||||||
|
|
||||||
|
b.HasIndex("RawItemId");
|
||||||
|
|
||||||
|
b.ToTable("MovMag");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ProjModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("BTLFileName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtCreated")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtLastAction")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtSchedule")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStartProd")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsArchived")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<int>("KeyNum")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ListName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Machine")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("PType")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("ProcTimeEst")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("ProcTimeReal")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<string>("ProjDescription")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("ProjExtDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProjExtId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("ProjDbId");
|
||||||
|
|
||||||
|
b.HasIndex("IsActive");
|
||||||
|
|
||||||
|
b.HasIndex("IsArchived");
|
||||||
|
|
||||||
|
b.HasIndex("KeyNum");
|
||||||
|
|
||||||
|
b.HasIndex("MachineID");
|
||||||
|
|
||||||
|
b.HasIndex("ProjExtDbId");
|
||||||
|
|
||||||
|
b.ToTable("ProjList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RawItemModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("HMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRemn")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<decimal>("LMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<string>("Location")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("MatId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("QtyAvail")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("WMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.HasKey("RawItemId");
|
||||||
|
|
||||||
|
b.HasIndex("MatId");
|
||||||
|
|
||||||
|
b.ToTable("RawItemList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RequestPlanModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("RequestId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRequest")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ReqState")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("RequestId");
|
||||||
|
|
||||||
|
b.ToTable("RequestPlan");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ResourceModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("ResourceId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Qty")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RequestId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("ResourceId");
|
||||||
|
|
||||||
|
b.HasIndex("RawItemId");
|
||||||
|
|
||||||
|
b.HasIndex("RequestId");
|
||||||
|
|
||||||
|
b.ToTable("ResourceList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MovMagModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RawItemModel", "ItemNav")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RawItemId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ItemNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RawItemModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.MaterialModel", "MaterialNav")
|
||||||
|
.WithMany("RawItemList")
|
||||||
|
.HasForeignKey("MatId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("MaterialNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ResourceModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RawItemModel", "ItemNav")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RawItemId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RequestPlanModel", "RequestNav")
|
||||||
|
.WithMany("ResourcesList")
|
||||||
|
.HasForeignKey("RequestId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ItemNav");
|
||||||
|
|
||||||
|
b.Navigation("RequestNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MaterialModel", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("RawItemList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RequestPlanModel", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("ResourcesList");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.Migrations
|
||||||
|
{
|
||||||
|
public partial class AddAliasLogicalDelete : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "IsActive",
|
||||||
|
table: "AliasList",
|
||||||
|
type: "tinyint(1)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "IsActive",
|
||||||
|
table: "AliasList");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,394 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using MagMan.Data.Tenant;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(MagManContext))]
|
||||||
|
[Migration("20240427093933_AddLogMachine")]
|
||||||
|
partial class AddLogMachine
|
||||||
|
{
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "6.0.25")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.AliasModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Family")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<string>("ValueOriginal")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<string>("ValueAlias")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("Family", "ValueOriginal");
|
||||||
|
|
||||||
|
b.ToTable("AliasList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ConfigModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("KeyName")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(0);
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)")
|
||||||
|
.HasColumnOrder(3);
|
||||||
|
|
||||||
|
b.Property<string>("Val")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(1);
|
||||||
|
|
||||||
|
b.Property<string>("ValStd")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(2)
|
||||||
|
.HasComment("Valore di default/riferimento per la variabile");
|
||||||
|
|
||||||
|
b.HasKey("KeyName");
|
||||||
|
|
||||||
|
b.ToTable("Config");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.LogMachineModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("LogDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEvent")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEvent");
|
||||||
|
|
||||||
|
b.Property<int>("EvType")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("EvType");
|
||||||
|
|
||||||
|
b.Property<int>("KeyNum")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("SupervId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasColumnName("SupervId");
|
||||||
|
|
||||||
|
b.Property<string>("VarValue")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasColumnName("VarValue");
|
||||||
|
|
||||||
|
b.HasKey("LogDbId");
|
||||||
|
|
||||||
|
b.HasIndex("KeyNum");
|
||||||
|
|
||||||
|
b.HasIndex("MachineID");
|
||||||
|
|
||||||
|
b.ToTable("LogMachine");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MaterialModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MatId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("HMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<decimal>("LMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<string>("MatCode")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("MatDesc")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<decimal>("WMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.HasKey("MatId");
|
||||||
|
|
||||||
|
b.ToTable("MaterialsList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MovMagModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MovID")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRec")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("QtyRec")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("MovID");
|
||||||
|
|
||||||
|
b.HasIndex("RawItemId");
|
||||||
|
|
||||||
|
b.ToTable("MovMag");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ProjModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("BTLFileName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtCreated")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtLastAction")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtSchedule")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStartProd")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsArchived")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<int>("KeyNum")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ListName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Machine")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("PType")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("ProcTimeEst")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("ProcTimeReal")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<string>("ProjDescription")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("ProjExtDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProjExtId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("ProjDbId");
|
||||||
|
|
||||||
|
b.HasIndex("IsActive");
|
||||||
|
|
||||||
|
b.HasIndex("IsArchived");
|
||||||
|
|
||||||
|
b.HasIndex("KeyNum");
|
||||||
|
|
||||||
|
b.HasIndex("MachineID");
|
||||||
|
|
||||||
|
b.HasIndex("ProjExtDbId");
|
||||||
|
|
||||||
|
b.ToTable("ProjList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RawItemModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("HMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRemn")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<decimal>("LMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<string>("Location")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("MatId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("QtyAvail")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("WMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.HasKey("RawItemId");
|
||||||
|
|
||||||
|
b.HasIndex("MatId");
|
||||||
|
|
||||||
|
b.ToTable("RawItemList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RequestPlanModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("RequestId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRequest")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ReqState")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("RequestId");
|
||||||
|
|
||||||
|
b.ToTable("RequestPlan");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ResourceModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("ResourceId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Qty")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RequestId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("ResourceId");
|
||||||
|
|
||||||
|
b.HasIndex("RawItemId");
|
||||||
|
|
||||||
|
b.HasIndex("RequestId");
|
||||||
|
|
||||||
|
b.ToTable("ResourceList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MovMagModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RawItemModel", "ItemNav")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RawItemId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ItemNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RawItemModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.MaterialModel", "MaterialNav")
|
||||||
|
.WithMany("RawItemList")
|
||||||
|
.HasForeignKey("MatId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("MaterialNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ResourceModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RawItemModel", "ItemNav")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RawItemId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RequestPlanModel", "RequestNav")
|
||||||
|
.WithMany("ResourcesList")
|
||||||
|
.HasForeignKey("RequestId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ItemNav");
|
||||||
|
|
||||||
|
b.Navigation("RequestNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MaterialModel", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("RawItemList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RequestPlanModel", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("ResourcesList");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.Migrations
|
||||||
|
{
|
||||||
|
public partial class AddLogMachine : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "LogMachine",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
DbId = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
|
KeyNum = table.Column<int>(type: "int", nullable: false),
|
||||||
|
MachineID = table.Column<int>(type: "int", nullable: false),
|
||||||
|
ProjDbId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
DtEvent = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||||
|
EvType = table.Column<int>(type: "int", nullable: false),
|
||||||
|
SupervId = table.Column<string>(type: "longtext", nullable: false)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
VarValue = table.Column<string>(type: "longtext", nullable: false)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4")
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_LogMachine", x => x.DbId);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_LogMachine_KeyNum",
|
||||||
|
table: "LogMachine",
|
||||||
|
column: "KeyNum");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_LogMachine_MachineID",
|
||||||
|
table: "LogMachine",
|
||||||
|
column: "MachineID");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "LogMachine");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,476 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using MagMan.Data.Tenant;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(MagManContext))]
|
||||||
|
[Migration("20240502075440_AddDailyStat")]
|
||||||
|
partial class AddDailyStat
|
||||||
|
{
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "6.0.25")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.AliasModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Family")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<string>("ValueOriginal")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<string>("ValueAlias")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("Family", "ValueOriginal");
|
||||||
|
|
||||||
|
b.ToTable("AliasList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ConfigModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("KeyName")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(0);
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)")
|
||||||
|
.HasColumnOrder(3);
|
||||||
|
|
||||||
|
b.Property<string>("Val")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(1);
|
||||||
|
|
||||||
|
b.Property<string>("ValStd")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(2)
|
||||||
|
.HasComment("Valore di default/riferimento per la variabile");
|
||||||
|
|
||||||
|
b.HasKey("KeyName");
|
||||||
|
|
||||||
|
b.ToTable("Config");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.DayStatModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("DayId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DayId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRif")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("OreDis")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("OreLav")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.HasKey("DayId");
|
||||||
|
|
||||||
|
b.ToTable("DayStat");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.LogMachineModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("LogDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEvent")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEvent");
|
||||||
|
|
||||||
|
b.Property<int>("EvType")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("EvType");
|
||||||
|
|
||||||
|
b.Property<int>("KeyNum")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("SupervId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasColumnName("SupervId");
|
||||||
|
|
||||||
|
b.Property<string>("VarValue")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasColumnName("VarValue");
|
||||||
|
|
||||||
|
b.HasKey("LogDbId");
|
||||||
|
|
||||||
|
b.HasIndex("KeyNum");
|
||||||
|
|
||||||
|
b.HasIndex("MachineID");
|
||||||
|
|
||||||
|
b.ToTable("LogMachine");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MachGroupModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MachGroupDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEnd")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEnd");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStart")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtStart");
|
||||||
|
|
||||||
|
b.Property<int>("MachGroupId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("MachGroupId");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("MachGroupDbId");
|
||||||
|
|
||||||
|
b.ToTable("MachGroupList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MaterialModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MatId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("HMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<decimal>("LMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<string>("MatCode")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("MatDesc")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<decimal>("WMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.HasKey("MatId");
|
||||||
|
|
||||||
|
b.ToTable("MaterialsList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MovMagModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MovID")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRec")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("QtyRec")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("MovID");
|
||||||
|
|
||||||
|
b.HasIndex("RawItemId");
|
||||||
|
|
||||||
|
b.ToTable("MovMag");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.PartModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("PartDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEnd")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEnd");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStart")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtStart");
|
||||||
|
|
||||||
|
b.Property<int>("MachGroupId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("MachGroupId");
|
||||||
|
|
||||||
|
b.Property<int>("PartId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("PartId");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("PartDbId");
|
||||||
|
|
||||||
|
b.ToTable("PartList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ProjModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("BTLFileName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtCreated")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtLastAction")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtSchedule")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStartProd")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsArchived")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<int>("KeyNum")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ListName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Machine")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("PType")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("ProcTimeEst")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("ProcTimeReal")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<string>("ProjDescription")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("ProjExtDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProjExtId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("ProjDbId");
|
||||||
|
|
||||||
|
b.HasIndex("IsActive");
|
||||||
|
|
||||||
|
b.HasIndex("IsArchived");
|
||||||
|
|
||||||
|
b.HasIndex("KeyNum");
|
||||||
|
|
||||||
|
b.HasIndex("MachineID");
|
||||||
|
|
||||||
|
b.HasIndex("ProjExtDbId");
|
||||||
|
|
||||||
|
b.ToTable("ProjList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RawItemModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("HMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRemn")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<decimal>("LMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<string>("Location")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("MatId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("QtyAvail")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("WMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.HasKey("RawItemId");
|
||||||
|
|
||||||
|
b.HasIndex("MatId");
|
||||||
|
|
||||||
|
b.ToTable("RawItemList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RequestPlanModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("RequestId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRequest")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ReqState")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("RequestId");
|
||||||
|
|
||||||
|
b.ToTable("RequestPlan");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ResourceModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("ResourceId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Qty")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RequestId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("ResourceId");
|
||||||
|
|
||||||
|
b.HasIndex("RawItemId");
|
||||||
|
|
||||||
|
b.HasIndex("RequestId");
|
||||||
|
|
||||||
|
b.ToTable("ResourceList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MovMagModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RawItemModel", "ItemNav")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RawItemId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ItemNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RawItemModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.MaterialModel", "MaterialNav")
|
||||||
|
.WithMany("RawItemList")
|
||||||
|
.HasForeignKey("MatId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("MaterialNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ResourceModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RawItemModel", "ItemNav")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RawItemId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RequestPlanModel", "RequestNav")
|
||||||
|
.WithMany("ResourcesList")
|
||||||
|
.HasForeignKey("RequestId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ItemNav");
|
||||||
|
|
||||||
|
b.Navigation("RequestNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MaterialModel", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("RawItemList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RequestPlanModel", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("ResourcesList");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.Migrations
|
||||||
|
{
|
||||||
|
public partial class AddDailyStat : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "DayStat",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
DayId = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
|
MachineID = table.Column<int>(type: "int", nullable: false),
|
||||||
|
DtRif = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||||
|
OreDis = table.Column<double>(type: "double", nullable: false),
|
||||||
|
OreLav = table.Column<double>(type: "double", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_DayStat", x => x.DayId);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "MachGroupList",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
DbId = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
|
MachGroupId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
ProjDbId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
DtStart = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||||
|
DtEnd = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_MachGroupList", x => x.DbId);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "PartList",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
DbId = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
|
PartId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
MachGroupId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
ProjDbId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
DtStart = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||||
|
DtEnd = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_PartList", x => x.DbId);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "DayStat");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "MachGroupList");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "PartList");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,476 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using MagMan.Data.Tenant;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(MagManContext))]
|
||||||
|
[Migration("20240502115056_AddStoredProc01")]
|
||||||
|
partial class AddStoredProc01
|
||||||
|
{
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "6.0.25")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.AliasModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Family")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<string>("ValueOriginal")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<string>("ValueAlias")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("Family", "ValueOriginal");
|
||||||
|
|
||||||
|
b.ToTable("AliasList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ConfigModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("KeyName")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(0);
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)")
|
||||||
|
.HasColumnOrder(3);
|
||||||
|
|
||||||
|
b.Property<string>("Val")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(1);
|
||||||
|
|
||||||
|
b.Property<string>("ValStd")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(2)
|
||||||
|
.HasComment("Valore di default/riferimento per la variabile");
|
||||||
|
|
||||||
|
b.HasKey("KeyName");
|
||||||
|
|
||||||
|
b.ToTable("Config");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.DayStatModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("DayId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DayId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRif")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("OreDis")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("OreLav")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.HasKey("DayId");
|
||||||
|
|
||||||
|
b.ToTable("DayStat");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.LogMachineModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("LogDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEvent")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEvent");
|
||||||
|
|
||||||
|
b.Property<int>("EvType")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("EvType");
|
||||||
|
|
||||||
|
b.Property<int>("KeyNum")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("SupervId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasColumnName("SupervId");
|
||||||
|
|
||||||
|
b.Property<string>("VarValue")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasColumnName("VarValue");
|
||||||
|
|
||||||
|
b.HasKey("LogDbId");
|
||||||
|
|
||||||
|
b.HasIndex("KeyNum");
|
||||||
|
|
||||||
|
b.HasIndex("MachineID");
|
||||||
|
|
||||||
|
b.ToTable("LogMachine");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MachGroupModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MachGroupDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEnd")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEnd");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStart")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtStart");
|
||||||
|
|
||||||
|
b.Property<int>("MachGroupId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("MachGroupId");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("MachGroupDbId");
|
||||||
|
|
||||||
|
b.ToTable("MachGroupList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MaterialModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MatId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("HMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<decimal>("LMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<string>("MatCode")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("MatDesc")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<decimal>("WMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.HasKey("MatId");
|
||||||
|
|
||||||
|
b.ToTable("MaterialsList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MovMagModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MovID")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRec")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("QtyRec")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("MovID");
|
||||||
|
|
||||||
|
b.HasIndex("RawItemId");
|
||||||
|
|
||||||
|
b.ToTable("MovMag");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.PartModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("PartDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEnd")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEnd");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStart")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtStart");
|
||||||
|
|
||||||
|
b.Property<int>("MachGroupId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("MachGroupId");
|
||||||
|
|
||||||
|
b.Property<int>("PartId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("PartId");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("PartDbId");
|
||||||
|
|
||||||
|
b.ToTable("PartList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ProjModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("BTLFileName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtCreated")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtLastAction")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtSchedule")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStartProd")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsArchived")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<int>("KeyNum")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ListName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Machine")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("PType")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("ProcTimeEst")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("ProcTimeReal")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<string>("ProjDescription")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("ProjExtDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProjExtId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("ProjDbId");
|
||||||
|
|
||||||
|
b.HasIndex("IsActive");
|
||||||
|
|
||||||
|
b.HasIndex("IsArchived");
|
||||||
|
|
||||||
|
b.HasIndex("KeyNum");
|
||||||
|
|
||||||
|
b.HasIndex("MachineID");
|
||||||
|
|
||||||
|
b.HasIndex("ProjExtDbId");
|
||||||
|
|
||||||
|
b.ToTable("ProjList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RawItemModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("HMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRemn")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<decimal>("LMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<string>("Location")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("MatId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("QtyAvail")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("WMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.HasKey("RawItemId");
|
||||||
|
|
||||||
|
b.HasIndex("MatId");
|
||||||
|
|
||||||
|
b.ToTable("RawItemList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RequestPlanModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("RequestId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRequest")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ReqState")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("RequestId");
|
||||||
|
|
||||||
|
b.ToTable("RequestPlan");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ResourceModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("ResourceId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Qty")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RequestId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("ResourceId");
|
||||||
|
|
||||||
|
b.HasIndex("RawItemId");
|
||||||
|
|
||||||
|
b.HasIndex("RequestId");
|
||||||
|
|
||||||
|
b.ToTable("ResourceList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MovMagModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RawItemModel", "ItemNav")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RawItemId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ItemNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RawItemModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.MaterialModel", "MaterialNav")
|
||||||
|
.WithMany("RawItemList")
|
||||||
|
.HasForeignKey("MatId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("MaterialNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ResourceModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RawItemModel", "ItemNav")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RawItemId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RequestPlanModel", "RequestNav")
|
||||||
|
.WithMany("ResourcesList")
|
||||||
|
.HasForeignKey("RequestId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ItemNav");
|
||||||
|
|
||||||
|
b.Navigation("RequestNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MaterialModel", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("RawItemList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RequestPlanModel", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("ResourcesList");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.Migrations
|
||||||
|
{
|
||||||
|
public partial class AddStoredProc01 : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
// aggiunta stored
|
||||||
|
addStored(migrationBuilder, "stp_recalcDailyMGP");
|
||||||
|
addStored(migrationBuilder, "stp_mergeLogMachine");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
// rimozione stored
|
||||||
|
remStored(migrationBuilder, "stp_recalcDailyMGP");
|
||||||
|
remStored(migrationBuilder, "stp_mergeLogMachine");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addView(MigrationBuilder migrationBuilder, string objName)
|
||||||
|
{
|
||||||
|
string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "SqlScripts", "View", $"{objName}.sql");
|
||||||
|
string viewBody = File.ReadAllText(path);
|
||||||
|
migrationBuilder.Sql(viewBody);
|
||||||
|
}
|
||||||
|
private void addStored(MigrationBuilder migrationBuilder, string objName)
|
||||||
|
{
|
||||||
|
string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "SqlScripts", "Stored", $"{objName}.sql");
|
||||||
|
string viewBody = File.ReadAllText(path);
|
||||||
|
migrationBuilder.Sql(viewBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void remView(MigrationBuilder migrationBuilder, string objName)
|
||||||
|
{
|
||||||
|
migrationBuilder.Sql($"DROP VIEW IF EXISTS {objName};");
|
||||||
|
}
|
||||||
|
private void remStored(MigrationBuilder migrationBuilder, string objName)
|
||||||
|
{
|
||||||
|
migrationBuilder.Sql($"DROP PROCEDURE IF EXISTS {objName};");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,555 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using MagMan.Data.Tenant;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(MagManContext))]
|
||||||
|
[Migration("20240502175352_AddEvStateList")]
|
||||||
|
partial class AddEvStateList
|
||||||
|
{
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "6.0.25")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.AliasModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Family")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<string>("ValueOriginal")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<string>("ValueAlias")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("Family", "ValueOriginal");
|
||||||
|
|
||||||
|
b.ToTable("AliasList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ConfigModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("KeyName")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(0);
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)")
|
||||||
|
.HasColumnOrder(3);
|
||||||
|
|
||||||
|
b.Property<string>("Val")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(1);
|
||||||
|
|
||||||
|
b.Property<string>("ValStd")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(2)
|
||||||
|
.HasComment("Valore di default/riferimento per la variabile");
|
||||||
|
|
||||||
|
b.HasKey("KeyName");
|
||||||
|
|
||||||
|
b.ToTable("Config");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.DayStatModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("DayId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DayId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRif")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("OreDis")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("OreLav")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.HasKey("DayId");
|
||||||
|
|
||||||
|
b.ToTable("DayStat");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.EventModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("IdxEv")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Azione")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("CssClass")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<bool>("EventoTablet")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<string>("Icon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("KeyEvento")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Nome")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("NoteEvento")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("TabAzione")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("IdxEv");
|
||||||
|
|
||||||
|
b.ToTable("AnagEventi");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.LogMachineModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("LogDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEvent")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEvent");
|
||||||
|
|
||||||
|
b.Property<int>("EvType")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("EvType");
|
||||||
|
|
||||||
|
b.Property<int>("KeyNum")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("SupervId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasColumnName("SupervId");
|
||||||
|
|
||||||
|
b.Property<string>("VarValue")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasColumnName("VarValue");
|
||||||
|
|
||||||
|
b.HasKey("LogDbId");
|
||||||
|
|
||||||
|
b.HasIndex("KeyNum");
|
||||||
|
|
||||||
|
b.HasIndex("MachineID");
|
||||||
|
|
||||||
|
b.ToTable("LogMachine");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MachGroupModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MachGroupDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEnd")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEnd");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStart")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtStart");
|
||||||
|
|
||||||
|
b.Property<int>("MachGroupId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("MachGroupId");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("MachGroupDbId");
|
||||||
|
|
||||||
|
b.ToTable("MachGroupList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MaterialModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MatId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("HMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<decimal>("LMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<string>("MatCode")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("MatDesc")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<decimal>("WMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.HasKey("MatId");
|
||||||
|
|
||||||
|
b.ToTable("MaterialsList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MovMagModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MovID")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRec")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("QtyRec")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("MovID");
|
||||||
|
|
||||||
|
b.HasIndex("RawItemId");
|
||||||
|
|
||||||
|
b.ToTable("MovMag");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.PartModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("PartDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEnd")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEnd");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStart")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtStart");
|
||||||
|
|
||||||
|
b.Property<int>("MachGroupId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("MachGroupId");
|
||||||
|
|
||||||
|
b.Property<int>("PartId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("PartId");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("PartDbId");
|
||||||
|
|
||||||
|
b.ToTable("PartList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ProjModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("BTLFileName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtCreated")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtLastAction")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtSchedule")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStartProd")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsArchived")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<int>("KeyNum")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ListName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Machine")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("PType")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("ProcTimeEst")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("ProcTimeReal")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<string>("ProjDescription")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("ProjExtDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProjExtId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("ProjDbId");
|
||||||
|
|
||||||
|
b.HasIndex("IsActive");
|
||||||
|
|
||||||
|
b.HasIndex("IsArchived");
|
||||||
|
|
||||||
|
b.HasIndex("KeyNum");
|
||||||
|
|
||||||
|
b.HasIndex("MachineID");
|
||||||
|
|
||||||
|
b.HasIndex("ProjExtDbId");
|
||||||
|
|
||||||
|
b.ToTable("ProjList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RawItemModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("HMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRemn")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<decimal>("LMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<string>("Location")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("MatId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("QtyAvail")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("WMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.HasKey("RawItemId");
|
||||||
|
|
||||||
|
b.HasIndex("MatId");
|
||||||
|
|
||||||
|
b.ToTable("RawItemList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RequestPlanModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("RequestId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRequest")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ReqState")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("RequestId");
|
||||||
|
|
||||||
|
b.ToTable("RequestPlan");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ResourceModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("ResourceId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Qty")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RequestId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("ResourceId");
|
||||||
|
|
||||||
|
b.HasIndex("RawItemId");
|
||||||
|
|
||||||
|
b.HasIndex("RequestId");
|
||||||
|
|
||||||
|
b.ToTable("ResourceList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.StatusModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("IdxStato")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ClasseTempo")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Descrizione")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("KeyStato")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("NoteStato")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("Priorita")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Semaforo")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<bool>("ShowArticolo")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.HasKey("IdxStato");
|
||||||
|
|
||||||
|
b.ToTable("AnagStati");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MovMagModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RawItemModel", "ItemNav")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RawItemId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ItemNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RawItemModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.MaterialModel", "MaterialNav")
|
||||||
|
.WithMany("RawItemList")
|
||||||
|
.HasForeignKey("MatId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("MaterialNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ResourceModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RawItemModel", "ItemNav")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RawItemId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RequestPlanModel", "RequestNav")
|
||||||
|
.WithMany("ResourcesList")
|
||||||
|
.HasForeignKey("RequestId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ItemNav");
|
||||||
|
|
||||||
|
b.Navigation("RequestNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MaterialModel", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("RawItemList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RequestPlanModel", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("ResourcesList");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.Migrations
|
||||||
|
{
|
||||||
|
public partial class AddEvStateList : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "AnagEventi",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
IdxEv = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
|
Nome = table.Column<string>(type: "longtext", nullable: false)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
TabAzione = table.Column<string>(type: "longtext", nullable: false)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
Azione = table.Column<string>(type: "longtext", nullable: false)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
KeyEvento = table.Column<string>(type: "longtext", nullable: false)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
EventoTablet = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||||
|
NoteEvento = table.Column<string>(type: "longtext", nullable: false)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
CssClass = table.Column<string>(type: "longtext", nullable: false)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
Icon = table.Column<string>(type: "longtext", nullable: false)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4")
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_AnagEventi", x => x.IdxEv);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "AnagStati",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
IdxStato = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||||
|
Descrizione = table.Column<string>(type: "longtext", nullable: false)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
Semaforo = table.Column<string>(type: "longtext", nullable: false)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
Priorita = table.Column<int>(type: "int", nullable: false),
|
||||||
|
ClasseTempo = table.Column<string>(type: "longtext", nullable: false)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
ShowArticolo = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||||
|
KeyStato = table.Column<string>(type: "longtext", nullable: false)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||||
|
NoteStato = table.Column<string>(type: "longtext", nullable: false)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4")
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_AnagStati", x => x.IdxStato);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "AnagEventi");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "AnagStati");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,561 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using MagMan.Data.Tenant;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(MagManContext))]
|
||||||
|
[Migration("20240629092727_AddProjProgress01")]
|
||||||
|
partial class AddProjProgress01
|
||||||
|
{
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "6.0.28")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.AliasModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Family")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<string>("ValueOriginal")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<string>("ValueAlias")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("Family", "ValueOriginal");
|
||||||
|
|
||||||
|
b.ToTable("AliasList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ConfigModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("KeyName")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(0);
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)")
|
||||||
|
.HasColumnOrder(3);
|
||||||
|
|
||||||
|
b.Property<string>("Val")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(1);
|
||||||
|
|
||||||
|
b.Property<string>("ValStd")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(2)
|
||||||
|
.HasComment("Valore di default/riferimento per la variabile");
|
||||||
|
|
||||||
|
b.HasKey("KeyName");
|
||||||
|
|
||||||
|
b.ToTable("Config");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.DayStatModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("DayId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DayId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRif")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("OreDis")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("OreLav")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.HasKey("DayId");
|
||||||
|
|
||||||
|
b.ToTable("DayStat");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.EventModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("IdxEv")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Azione")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("CssClass")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<bool>("EventoTablet")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<string>("Icon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("KeyEvento")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Nome")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("NoteEvento")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("TabAzione")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("IdxEv");
|
||||||
|
|
||||||
|
b.ToTable("AnagEventi");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.LogMachineModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("LogDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEvent")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEvent");
|
||||||
|
|
||||||
|
b.Property<int>("EvType")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("EvType");
|
||||||
|
|
||||||
|
b.Property<int>("KeyNum")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("SupervId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasColumnName("SupervId");
|
||||||
|
|
||||||
|
b.Property<string>("VarValue")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasColumnName("VarValue");
|
||||||
|
|
||||||
|
b.HasKey("LogDbId");
|
||||||
|
|
||||||
|
b.HasIndex("KeyNum");
|
||||||
|
|
||||||
|
b.HasIndex("MachineID");
|
||||||
|
|
||||||
|
b.ToTable("LogMachine");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MachGroupModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MachGroupDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEnd")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEnd");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStart")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtStart");
|
||||||
|
|
||||||
|
b.Property<int>("MachGroupId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("MachGroupId");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("MachGroupDbId");
|
||||||
|
|
||||||
|
b.ToTable("MachGroupList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MaterialModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MatId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("HMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<decimal>("LMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<string>("MatCode")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("MatDesc")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<decimal>("WMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.HasKey("MatId");
|
||||||
|
|
||||||
|
b.ToTable("MaterialsList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MovMagModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MovID")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRec")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("QtyRec")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("MovID");
|
||||||
|
|
||||||
|
b.HasIndex("RawItemId");
|
||||||
|
|
||||||
|
b.ToTable("MovMag");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.PartModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("PartDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEnd")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEnd");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStart")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtStart");
|
||||||
|
|
||||||
|
b.Property<int>("MachGroupId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("MachGroupId");
|
||||||
|
|
||||||
|
b.Property<int>("PartId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("PartId");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("PartDbId");
|
||||||
|
|
||||||
|
b.ToTable("PartList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ProjModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("BTLFileName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtCreated")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtLastAction")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtSchedule")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStartProd")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsArchived")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<int>("KeyNum")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ListName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Machine")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("PType")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("ProcTimeEst")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("ProcTimeReal")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<string>("ProjDescription")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("ProjExtDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProjExtId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("ValAct")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("ValMax")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.HasKey("ProjDbId");
|
||||||
|
|
||||||
|
b.HasIndex("IsActive");
|
||||||
|
|
||||||
|
b.HasIndex("IsArchived");
|
||||||
|
|
||||||
|
b.HasIndex("KeyNum");
|
||||||
|
|
||||||
|
b.HasIndex("MachineID");
|
||||||
|
|
||||||
|
b.HasIndex("ProjExtDbId");
|
||||||
|
|
||||||
|
b.ToTable("ProjList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RawItemModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("HMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRemn")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<decimal>("LMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<string>("Location")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("MatId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("QtyAvail")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("WMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.HasKey("RawItemId");
|
||||||
|
|
||||||
|
b.HasIndex("MatId");
|
||||||
|
|
||||||
|
b.ToTable("RawItemList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RequestPlanModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("RequestId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRequest")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ReqState")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("RequestId");
|
||||||
|
|
||||||
|
b.ToTable("RequestPlan");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ResourceModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("ResourceId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Qty")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RequestId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("ResourceId");
|
||||||
|
|
||||||
|
b.HasIndex("RawItemId");
|
||||||
|
|
||||||
|
b.HasIndex("RequestId");
|
||||||
|
|
||||||
|
b.ToTable("ResourceList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.StatusModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("IdxStato")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ClasseTempo")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Descrizione")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("KeyStato")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("NoteStato")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("Priorita")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Semaforo")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<bool>("ShowArticolo")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.HasKey("IdxStato");
|
||||||
|
|
||||||
|
b.ToTable("AnagStati");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MovMagModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RawItemModel", "ItemNav")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RawItemId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ItemNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RawItemModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.MaterialModel", "MaterialNav")
|
||||||
|
.WithMany("RawItemList")
|
||||||
|
.HasForeignKey("MatId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("MaterialNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ResourceModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RawItemModel", "ItemNav")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RawItemId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RequestPlanModel", "RequestNav")
|
||||||
|
.WithMany("ResourcesList")
|
||||||
|
.HasForeignKey("RequestId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ItemNav");
|
||||||
|
|
||||||
|
b.Navigation("RequestNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MaterialModel", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("RawItemList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RequestPlanModel", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("ResourcesList");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.Migrations
|
||||||
|
{
|
||||||
|
public partial class AddProjProgress01 : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<double>(
|
||||||
|
name: "ValAct",
|
||||||
|
table: "ProjList",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0.0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<double>(
|
||||||
|
name: "ValMax",
|
||||||
|
table: "ProjList",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ValAct",
|
||||||
|
table: "ProjList");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ValMax",
|
||||||
|
table: "ProjList");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+561
@@ -0,0 +1,561 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using MagMan.Data.Tenant;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(MagManContext))]
|
||||||
|
[Migration("20240805122833_RawItemRenActiveToDelete")]
|
||||||
|
partial class RawItemRenActiveToDelete
|
||||||
|
{
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "6.0.28")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.AliasModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Family")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<string>("ValueOriginal")
|
||||||
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<string>("ValueAlias")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("Family", "ValueOriginal");
|
||||||
|
|
||||||
|
b.ToTable("AliasList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ConfigModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("KeyName")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(0);
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(250)
|
||||||
|
.HasColumnType("varchar(250)")
|
||||||
|
.HasColumnOrder(3);
|
||||||
|
|
||||||
|
b.Property<string>("Val")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(1);
|
||||||
|
|
||||||
|
b.Property<string>("ValStd")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasColumnOrder(2)
|
||||||
|
.HasComment("Valore di default/riferimento per la variabile");
|
||||||
|
|
||||||
|
b.HasKey("KeyName");
|
||||||
|
|
||||||
|
b.ToTable("Config");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.DayStatModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("DayId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DayId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRif")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("OreDis")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("OreLav")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.HasKey("DayId");
|
||||||
|
|
||||||
|
b.ToTable("DayStat");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.EventModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("IdxEv")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Azione")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("CssClass")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<bool>("EventoTablet")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<string>("Icon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("KeyEvento")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Nome")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("NoteEvento")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("TabAzione")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("IdxEv");
|
||||||
|
|
||||||
|
b.ToTable("AnagEventi");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.LogMachineModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("LogDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEvent")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEvent");
|
||||||
|
|
||||||
|
b.Property<int>("EvType")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("EvType");
|
||||||
|
|
||||||
|
b.Property<int>("KeyNum")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("SupervId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasColumnName("SupervId");
|
||||||
|
|
||||||
|
b.Property<string>("VarValue")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasColumnName("VarValue");
|
||||||
|
|
||||||
|
b.HasKey("LogDbId");
|
||||||
|
|
||||||
|
b.HasIndex("KeyNum");
|
||||||
|
|
||||||
|
b.HasIndex("MachineID");
|
||||||
|
|
||||||
|
b.ToTable("LogMachine");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MachGroupModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MachGroupDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEnd")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEnd");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStart")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtStart");
|
||||||
|
|
||||||
|
b.Property<int>("MachGroupId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("MachGroupId");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("MachGroupDbId");
|
||||||
|
|
||||||
|
b.ToTable("MachGroupList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MaterialModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MatId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("HMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<decimal>("LMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<string>("MatCode")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("MatDesc")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<decimal>("WMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.HasKey("MatId");
|
||||||
|
|
||||||
|
b.ToTable("MaterialsList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MovMagModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MovID")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRec")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("QtyRec")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("UserId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("MovID");
|
||||||
|
|
||||||
|
b.HasIndex("RawItemId");
|
||||||
|
|
||||||
|
b.ToTable("MovMag");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.PartModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("PartDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEnd")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEnd");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStart")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtStart");
|
||||||
|
|
||||||
|
b.Property<int>("MachGroupId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("MachGroupId");
|
||||||
|
|
||||||
|
b.Property<int>("PartId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("PartId");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("PartDbId");
|
||||||
|
|
||||||
|
b.ToTable("PartList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ProjModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("BTLFileName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtCreated")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtLastAction")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtSchedule")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStartProd")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsArchived")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<int>("KeyNum")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ListName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Machine")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("PType")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("ProcTimeEst")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("ProcTimeReal")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<string>("ProjDescription")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("ProjExtDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProjExtId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("ValAct")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("ValMax")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.HasKey("ProjDbId");
|
||||||
|
|
||||||
|
b.HasIndex("IsActive");
|
||||||
|
|
||||||
|
b.HasIndex("IsArchived");
|
||||||
|
|
||||||
|
b.HasIndex("KeyNum");
|
||||||
|
|
||||||
|
b.HasIndex("MachineID");
|
||||||
|
|
||||||
|
b.HasIndex("ProjExtDbId");
|
||||||
|
|
||||||
|
b.ToTable("ProjList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RawItemModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("HMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsDeleted")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRemn")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<decimal>("LMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.Property<string>("Location")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("MatId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Note")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("QtyAvail")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<decimal>("WMm")
|
||||||
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
|
b.HasKey("RawItemId");
|
||||||
|
|
||||||
|
b.HasIndex("MatId");
|
||||||
|
|
||||||
|
b.ToTable("RawItemList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RequestPlanModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("RequestId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRequest")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ReqState")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("RequestId");
|
||||||
|
|
||||||
|
b.ToTable("RequestPlan");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ResourceModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("ResourceId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("Qty")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RawItemId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("RequestId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("ResourceId");
|
||||||
|
|
||||||
|
b.HasIndex("RawItemId");
|
||||||
|
|
||||||
|
b.HasIndex("RequestId");
|
||||||
|
|
||||||
|
b.ToTable("ResourceList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.StatusModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("IdxStato")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ClasseTempo")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Descrizione")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("KeyStato")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("NoteStato")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("Priorita")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Semaforo")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<bool>("ShowArticolo")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.HasKey("IdxStato");
|
||||||
|
|
||||||
|
b.ToTable("AnagStati");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MovMagModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RawItemModel", "ItemNav")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RawItemId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ItemNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RawItemModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.MaterialModel", "MaterialNav")
|
||||||
|
.WithMany("RawItemList")
|
||||||
|
.HasForeignKey("MatId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("MaterialNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ResourceModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RawItemModel", "ItemNav")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RawItemId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("MagMan.Data.Tenant.DbModels.RequestPlanModel", "RequestNav")
|
||||||
|
.WithMany("ResourcesList")
|
||||||
|
.HasForeignKey("RequestId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ItemNav");
|
||||||
|
|
||||||
|
b.Navigation("RequestNav");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MaterialModel", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("RawItemList");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.RequestPlanModel", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("ResourcesList");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MagMan.Data.Tenant.Migrations
|
||||||
|
{
|
||||||
|
public partial class RawItemRenActiveToDelete : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.RenameColumn(
|
||||||
|
name: "IsActive",
|
||||||
|
table: "RawItemList",
|
||||||
|
newName: "IsDeleted");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.RenameColumn(
|
||||||
|
name: "IsDeleted",
|
||||||
|
table: "RawItemList",
|
||||||
|
newName: "IsActive");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,7 +16,7 @@ namespace MagMan.Data.Tenant.Migrations
|
|||||||
{
|
{
|
||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("ProductVersion", "6.0.25")
|
.HasAnnotation("ProductVersion", "6.0.28")
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||||
|
|
||||||
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.AliasModel", b =>
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.AliasModel", b =>
|
||||||
@@ -27,6 +27,9 @@ namespace MagMan.Data.Tenant.Migrations
|
|||||||
b.Property<string>("ValueOriginal")
|
b.Property<string>("ValueOriginal")
|
||||||
.HasColumnType("varchar(255)");
|
.HasColumnType("varchar(255)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
b.Property<string>("ValueAlias")
|
b.Property<string>("ValueAlias")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("longtext");
|
.HasColumnType("longtext");
|
||||||
@@ -67,6 +70,142 @@ namespace MagMan.Data.Tenant.Migrations
|
|||||||
b.ToTable("Config");
|
b.ToTable("Config");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.DayStatModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("DayId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DayId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtRif")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("OreDis")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("OreLav")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.HasKey("DayId");
|
||||||
|
|
||||||
|
b.ToTable("DayStat");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.EventModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("IdxEv")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Azione")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("CssClass")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<bool>("EventoTablet")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<string>("Icon")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("KeyEvento")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Nome")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("NoteEvento")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("TabAzione")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.HasKey("IdxEv");
|
||||||
|
|
||||||
|
b.ToTable("AnagEventi");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.LogMachineModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("LogDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEvent")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEvent");
|
||||||
|
|
||||||
|
b.Property<int>("EvType")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("EvType");
|
||||||
|
|
||||||
|
b.Property<int>("KeyNum")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("MachineID")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("SupervId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasColumnName("SupervId");
|
||||||
|
|
||||||
|
b.Property<string>("VarValue")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasColumnName("VarValue");
|
||||||
|
|
||||||
|
b.HasKey("LogDbId");
|
||||||
|
|
||||||
|
b.HasIndex("KeyNum");
|
||||||
|
|
||||||
|
b.HasIndex("MachineID");
|
||||||
|
|
||||||
|
b.ToTable("LogMachine");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MachGroupModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("MachGroupDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEnd")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEnd");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStart")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtStart");
|
||||||
|
|
||||||
|
b.Property<int>("MachGroupId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("MachGroupId");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("MachGroupDbId");
|
||||||
|
|
||||||
|
b.ToTable("MachGroupList");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MaterialModel", b =>
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MaterialModel", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("MatId")
|
b.Property<int>("MatId")
|
||||||
@@ -125,6 +264,37 @@ namespace MagMan.Data.Tenant.Migrations
|
|||||||
b.ToTable("MovMag");
|
b.ToTable("MovMag");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.PartModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("PartDbId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("DbId");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtEnd")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtEnd");
|
||||||
|
|
||||||
|
b.Property<DateTime>("DtStart")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnName("DtStart");
|
||||||
|
|
||||||
|
b.Property<int>("MachGroupId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("MachGroupId");
|
||||||
|
|
||||||
|
b.Property<int>("PartId")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasColumnName("PartId");
|
||||||
|
|
||||||
|
b.Property<int>("ProjDbId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("PartDbId");
|
||||||
|
|
||||||
|
b.ToTable("PartList");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ProjModel", b =>
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.ProjModel", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("ProjDbId")
|
b.Property<int>("ProjDbId")
|
||||||
@@ -186,6 +356,12 @@ namespace MagMan.Data.Tenant.Migrations
|
|||||||
b.Property<int>("ProjExtId")
|
b.Property<int>("ProjExtId")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<double>("ValAct")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
b.Property<double>("ValMax")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
b.HasKey("ProjDbId");
|
b.HasKey("ProjDbId");
|
||||||
|
|
||||||
b.HasIndex("IsActive");
|
b.HasIndex("IsActive");
|
||||||
@@ -210,7 +386,7 @@ namespace MagMan.Data.Tenant.Migrations
|
|||||||
b.Property<decimal>("HMm")
|
b.Property<decimal>("HMm")
|
||||||
.HasColumnType("decimal(65,30)");
|
.HasColumnType("decimal(65,30)");
|
||||||
|
|
||||||
b.Property<bool>("IsActive")
|
b.Property<bool>("IsDeleted")
|
||||||
.HasColumnType("tinyint(1)");
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
b.Property<bool>("IsRemn")
|
b.Property<bool>("IsRemn")
|
||||||
@@ -290,6 +466,43 @@ namespace MagMan.Data.Tenant.Migrations
|
|||||||
b.ToTable("ResourceList");
|
b.ToTable("ResourceList");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.StatusModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("IdxStato")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("ClasseTempo")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("Descrizione")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("KeyStato")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("NoteStato")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<int>("Priorita")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Semaforo")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<bool>("ShowArticolo")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.HasKey("IdxStato");
|
||||||
|
|
||||||
|
b.ToTable("AnagStati");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MovMagModel", b =>
|
modelBuilder.Entity("MagMan.Data.Tenant.DbModels.MovMagModel", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("MagMan.Data.Tenant.DbModels.RawItemModel", "ItemNav")
|
b.HasOne("MagMan.Data.Tenant.DbModels.RawItemModel", "ItemNav")
|
||||||
|
|||||||
@@ -1,39 +1,25 @@
|
|||||||
using MagMan.Core;
|
using MagMan.Core;
|
||||||
using MagMan.Core.DTO;
|
using MagMan.Core.DTO;
|
||||||
|
using MagMan.Core.Services;
|
||||||
using MagMan.Data.Tenant.Controllers;
|
using MagMan.Data.Tenant.Controllers;
|
||||||
using MagMan.Data.Tenant.DbModels;
|
using MagMan.Data.Tenant.DbModels;
|
||||||
using Microsoft.Extensions.Caching.Distributed;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using NLog;
|
|
||||||
using NLog.Fluent;
|
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using static MagMan.Core.Enums;
|
||||||
using System.Reflection.PortableExecutable;
|
|
||||||
using System.Runtime;
|
|
||||||
using System.Text;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace MagMan.Data.Tenant.Services
|
namespace MagMan.Data.Tenant.Services
|
||||||
{
|
{
|
||||||
public class TenantService : BaseServ
|
public class TenantService : BaseServ, IDisposable
|
||||||
{
|
{
|
||||||
#region Public Fields
|
|
||||||
|
|
||||||
public TenantController dbController = null!;
|
|
||||||
|
|
||||||
#endregion Public Fields
|
|
||||||
|
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public TenantService(IConfiguration configuration, IConnectionMultiplexer redisConnMult)
|
public TenantService(IConfiguration configuration, IConnectionMultiplexer redisConnMult)
|
||||||
{
|
{
|
||||||
Log.Info("TenantService starting...");
|
Log.Info("TenantService starting...");
|
||||||
_configuration = configuration;
|
_configuration = configuration;
|
||||||
|
|
||||||
// Conf cache
|
// Conf cache
|
||||||
redisConn = redisConnMult;
|
redisConn = redisConnMult;
|
||||||
redisDb = this.redisConn.GetDatabase();
|
redisDb = this.redisConn.GetDatabase();
|
||||||
@@ -45,7 +31,12 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
};
|
};
|
||||||
|
|
||||||
// cod app
|
// cod app
|
||||||
CodApp = _configuration["CodApp"];
|
CodApp = _configuration.GetValue<string>("OptConf:CodApp");
|
||||||
|
|
||||||
|
// gestione parallelismo...
|
||||||
|
numPar = _configuration.GetValue<int>("OptConf:NumPar");
|
||||||
|
|
||||||
|
// DB
|
||||||
DbServerAddr = _configuration["DbConfig:Server"];
|
DbServerAddr = _configuration["DbConfig:Server"];
|
||||||
dbController = new TenantController();
|
dbController = new TenantController();
|
||||||
|
|
||||||
@@ -57,6 +48,11 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
public static bool hasDecimal(decimal num)
|
||||||
|
{
|
||||||
|
return (num - Math.Round(num) != 0);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elimina Alias da magazzino + refresh cache
|
/// Elimina Alias da magazzino + refresh cache
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -93,7 +89,8 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
{
|
{
|
||||||
Family = family,
|
Family = family,
|
||||||
ValueOriginal = origItem.ValOrig,
|
ValueOriginal = origItem.ValOrig,
|
||||||
ValueAlias = origItem.ValAlias
|
ValueAlias = origItem.ValAlias,
|
||||||
|
IsActive = origItem.IsActive
|
||||||
};
|
};
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
@@ -206,6 +203,11 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
return fatto;
|
return fatto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
dbController.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elimina Item da magazzino + refresh cache
|
/// Elimina Item da magazzino + refresh cache
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -235,13 +237,12 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
/// Converte il DTO in ItemModel, colmando eventuale mancante nelle note dell'item
|
/// Converte il DTO in ItemModel, colmando eventuale mancante nelle note dell'item
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="origItem">DTO di partenza</param>
|
/// <param name="origItem">DTO di partenza</param>
|
||||||
/// <param name="isActive">Parametro active da impostare</param>
|
|
||||||
/// <param name="nKey">Key di riferimento</param>
|
/// <param name="nKey">Key di riferimento</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public RawItemModel ItemFromDto(ItemDTO origItem, bool isActive, int nKey)
|
public RawItemModel ItemFromDto(ItemDTO origItem, int nKey)
|
||||||
{
|
{
|
||||||
RawItemModel answ = ItemFromDto(origItem, isActive);
|
RawItemModel answ = ItemFromDto(origItem);
|
||||||
if(string.IsNullOrEmpty(answ.Note))
|
if (string.IsNullOrEmpty(answ.Note))
|
||||||
{
|
{
|
||||||
string cString = ConnString(nKey);
|
string cString = ConnString(nKey);
|
||||||
var matRec = dbController.MaterialGetFilt(cString, origItem.MatCloudId, false).FirstOrDefault();
|
var matRec = dbController.MaterialGetFilt(cString, origItem.MatCloudId, false).FirstOrDefault();
|
||||||
@@ -252,13 +253,14 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converte il DTO in ItemModel
|
/// Converte il DTO in ItemModel
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="origItem">DTO di partenza</param>
|
/// <param name="origItem">DTO di partenza</param>
|
||||||
/// <param name="isActive">Parametro active da impostare</param>
|
/// <param name="isActive">Parametro active da impostare</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public RawItemModel ItemFromDto(ItemDTO origItem, bool isActive)
|
public RawItemModel ItemFromDto(ItemDTO origItem)
|
||||||
{
|
{
|
||||||
RawItemModel answ = new RawItemModel()
|
RawItemModel answ = new RawItemModel()
|
||||||
{
|
{
|
||||||
@@ -267,10 +269,10 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
LMm = origItem.LMm,
|
LMm = origItem.LMm,
|
||||||
WMm = origItem.WMm,
|
WMm = origItem.WMm,
|
||||||
HMm = origItem.HMm,
|
HMm = origItem.HMm,
|
||||||
|
IsDeleted = origItem.IsDeleted,
|
||||||
IsRemn = origItem.IsRemn,
|
IsRemn = origItem.IsRemn,
|
||||||
Location = origItem.Location,
|
Location = origItem.Location,
|
||||||
QtyAvail = origItem.QtyAvail,
|
QtyAvail = origItem.QtyAvail
|
||||||
IsActive = isActive
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return answ;
|
return answ;
|
||||||
@@ -466,6 +468,31 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
return fatto;
|
return fatto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Riattiva Item da magazzino + refresh cache
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="nKey">Key di riferimento</param>
|
||||||
|
/// <param name="rec2react">Item da riattivare</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<bool> ItemReactiv(int nKey, RawItemModel rec2react)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
string cString = ConnString(nKey);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
fatto = dbController.ItemReactiv(cString, rec2react);
|
||||||
|
if (fatto)
|
||||||
|
{
|
||||||
|
await FlushRedisCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Error during ItemReactiv:{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update record Item + refresh cache
|
/// Update record Item + refresh cache
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -473,14 +500,15 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
/// <param name="currItem">Item interesato</param>
|
/// <param name="currItem">Item interesato</param>
|
||||||
/// <param name="userId">User corrente (SE applicabile)</param>
|
/// <param name="userId">User corrente (SE applicabile)</param>
|
||||||
/// <param name="forceQty">Se true aggiorna giacenze quantita correnti</param>
|
/// <param name="forceQty">Se true aggiorna giacenze quantita correnti</param>
|
||||||
|
/// <param name="ignoreRemn">Se true ignora aggiornamento remnant in cloud</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<bool> ItemUpdate(int nKey, RawItemModel currItem, string userId, bool forceQty)
|
public async Task<bool> ItemUpdate(int nKey, RawItemModel currItem, string userId, bool forceQty, bool ignoreRemn)
|
||||||
{
|
{
|
||||||
bool fatto = false;
|
bool fatto = false;
|
||||||
string cString = ConnString(nKey);
|
string cString = ConnString(nKey);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
fatto = dbController.ItemUpdate(cString, currItem, userId, forceQty);
|
fatto = dbController.ItemUpdate(cString, currItem, userId, forceQty, ignoreRemn);
|
||||||
if (fatto)
|
if (fatto)
|
||||||
{
|
{
|
||||||
await FlushRedisCache();
|
await FlushRedisCache();
|
||||||
@@ -493,6 +521,134 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
return fatto;
|
return fatto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Converte il DTO in ItemModel
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="origItem">DTO di partenza</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public LogMachineModel LogMacFromDto(LogMachineDTO origItem, int machineCloudId, int keyNum)
|
||||||
|
{
|
||||||
|
LogMachineModel answ = new LogMachineModel()
|
||||||
|
{
|
||||||
|
ProjDbId = origItem.ProjCloudId,
|
||||||
|
DtEvent = origItem.DtEvent,
|
||||||
|
EvType = origItem.EvType,
|
||||||
|
MachineID = machineCloudId,
|
||||||
|
KeyNum = keyNum,
|
||||||
|
SupervId = origItem.SupervId,
|
||||||
|
VarValue = origItem.VarValue
|
||||||
|
};
|
||||||
|
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Lista Projects gestiti a magazzino
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="nKey">Key di riferimento</param>
|
||||||
|
/// <param name="machineId">idMacchina di cui si vuole log</param>
|
||||||
|
/// <param name="numRec">num rec max da recuperare</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<List<LogMachineModel>> LogMacGetLast(int nKey, int machineId, int numRec)
|
||||||
|
{
|
||||||
|
string source = "DB";
|
||||||
|
string cString = ConnString(nKey);
|
||||||
|
List<LogMachineModel>? dbResult = new List<LogMachineModel>();
|
||||||
|
DateTime adesso = DateTime.Now;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// cache al minuto...
|
||||||
|
string currKey = $"{Const.rKeyConfig}:{nKey}:LogMacLast:{machineId}:{adesso:yyMMdd}::{adesso:HHmm}:{numRec}";
|
||||||
|
Stopwatch stopWatch = new Stopwatch();
|
||||||
|
stopWatch.Start();
|
||||||
|
string? rawData = await redisDb.StringGetAsync(currKey);
|
||||||
|
if (!string.IsNullOrEmpty(rawData))
|
||||||
|
{
|
||||||
|
source = "REDIS";
|
||||||
|
var tempResult = JsonConvert.DeserializeObject<List<LogMachineModel>>(rawData);
|
||||||
|
if (tempResult == null)
|
||||||
|
{
|
||||||
|
dbResult = new List<LogMachineModel>();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dbResult = tempResult;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dbResult = dbController.LogMacGetLast(cString, machineId, numRec);
|
||||||
|
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
|
||||||
|
await redisDb.StringSetAsync(currKey, rawData, FastCache);
|
||||||
|
}
|
||||||
|
if (dbResult == null)
|
||||||
|
{
|
||||||
|
dbResult = new List<LogMachineModel>();
|
||||||
|
}
|
||||||
|
stopWatch.Stop();
|
||||||
|
TimeSpan ts = stopWatch.Elapsed;
|
||||||
|
Log.Debug($"LogMacGetLast | {source} in: {ts.TotalMilliseconds} ms");
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Error during LogMacGetLast:{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Aggiunge/Modifica un record Resource
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="nKey">Key di riferimento</param>
|
||||||
|
/// <param name="KeyNum">Num Chiave record</param>
|
||||||
|
/// <param name="machineId">Id Macchina</param>
|
||||||
|
/// <param name="dtStart">Data inizio set da eliminare</param>
|
||||||
|
/// <param name="dtEnd">Data fine set da eliminare</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<int> LogMacRemoveRange(int nKey, int machineId, DateTime dtStart, DateTime dtEnd)
|
||||||
|
{
|
||||||
|
int nUpdated = 0;
|
||||||
|
string cString = ConnString(nKey);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
nUpdated = dbController.LogMacRemoveRange(cString, nKey, machineId, dtStart, dtEnd);
|
||||||
|
if (nUpdated > 0)
|
||||||
|
{
|
||||||
|
await FlushRedisCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Error during LogMacRemoveRange:{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
return nUpdated;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Aggiunge/Modifica un record Resource
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="nKey">Key di riferimento</param>
|
||||||
|
/// <param name="recList">Elenco record da aggiungere/aggiornare</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<int> LogMacUpdate(int nKey, List<LogMachineModel> recList)
|
||||||
|
{
|
||||||
|
int nUpdated = 0;
|
||||||
|
string cString = ConnString(nKey);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
nUpdated = dbController.LogMacUpdate(cString, recList);
|
||||||
|
if (nUpdated > 0)
|
||||||
|
{
|
||||||
|
await FlushRedisCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Error during LogMacUpdate:{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
return nUpdated;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elimina Materiale da magazzino + refresh cache
|
/// Elimina Materiale da magazzino + refresh cache
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -523,16 +679,18 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="nKey">Key di riferimento</param>
|
/// <param name="nKey">Key di riferimento</param>
|
||||||
/// <param name="withChild">Se true allora include record child (Items)</param>
|
/// <param name="withChild">Se true allora include record child (Items)</param>
|
||||||
|
/// <param name="withRemn">Se true allora include record remnants (Items) nei conteggi qty</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<MaterialDTO>> MaterialDtoGetAll(int nKey, bool withChild)
|
public async Task<List<MaterialDTO>> MaterialDtoGetAll(int nKey, bool withChild, bool withRemn)
|
||||||
{
|
{
|
||||||
string source = "DB";
|
string source = "DB";
|
||||||
string cString = ConnString(nKey);
|
string cString = ConnString(nKey);
|
||||||
List<MaterialDTO>? dbResult = new List<MaterialDTO>();
|
List<MaterialDTO>? dbResult = new List<MaterialDTO>();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string dType = withChild ? "MaterialsDtoFull" : "MaterialsDto";
|
string dType = withChild ? "MatDtoFull" : "MatDto";
|
||||||
string currKey = $"{Const.rKeyConfig}:{nKey}:{dType}";
|
string remn = withRemn ? "All" : "Buy";
|
||||||
|
string currKey = $"{Const.rKeyConfig}:{nKey}:{remn}:{dType}";
|
||||||
Stopwatch stopWatch = new Stopwatch();
|
Stopwatch stopWatch = new Stopwatch();
|
||||||
stopWatch.Start();
|
stopWatch.Start();
|
||||||
string? rawData = await redisDb.StringGetAsync(currKey);
|
string? rawData = await redisDb.StringGetAsync(currKey);
|
||||||
@@ -551,7 +709,7 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dbResult = dbController.MaterialDtoGetAll(cString, withChild);
|
dbResult = dbController.MaterialDtoGetAll(cString, withChild, withRemn);
|
||||||
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
|
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
|
||||||
await redisDb.StringSetAsync(currKey, rawData, LongCache);
|
await redisDb.StringSetAsync(currKey, rawData, LongCache);
|
||||||
// per evitare loopback uso deserialize...
|
// per evitare loopback uso deserialize...
|
||||||
@@ -650,9 +808,23 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
matDescr = origItem.MatCode;
|
matDescr = origItem.MatCode;
|
||||||
if (origItem.WMm > 0)
|
if (origItem.WMm > 0)
|
||||||
{
|
{
|
||||||
matDescr += $" {origItem.WMm}";
|
if (hasDecimal(origItem.WMm))
|
||||||
|
{
|
||||||
|
matDescr += $" {origItem.WMm:N2}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
matDescr += $" {origItem.WMm:N0}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (hasDecimal(origItem.HMm))
|
||||||
|
{
|
||||||
|
matDescr += $"x{origItem.HMm:N2}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
matDescr += $"x{origItem.HMm:N0}";
|
||||||
}
|
}
|
||||||
matDescr += $"x{origItem.HMm}";
|
|
||||||
}
|
}
|
||||||
if (origItem != null)
|
if (origItem != null)
|
||||||
{
|
{
|
||||||
@@ -1090,6 +1262,62 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
return dbResult;
|
return dbResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco record progetti dato Key + data ultima modifica registrata
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="nKey">Key di riferimento</param>
|
||||||
|
/// <param name="DtRif">Data rispetto cui cercare modifiche successive</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<ProjModel> ProjectGetModAfter(int nKey, DateTime DtRif)
|
||||||
|
{
|
||||||
|
string source = "DB";
|
||||||
|
string cString = ConnString(nKey);
|
||||||
|
List<ProjModel> dbResult = new List<ProjModel>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// NON Usa la cache poiché voglio sync DB-DB in realtime
|
||||||
|
Stopwatch stopWatch = new Stopwatch();
|
||||||
|
stopWatch.Start();
|
||||||
|
dbResult = dbController.ProjectGetModAfter(cString, DtRif);
|
||||||
|
stopWatch.Stop();
|
||||||
|
TimeSpan ts = stopWatch.Elapsed;
|
||||||
|
Log.Debug($"ProjectGetModAfter | {source} in: {ts.TotalMilliseconds} ms");
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Error during ProjectGetModAfter:{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Upsert record Project + refresh cache
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="nKey">Key di riferimento</param>
|
||||||
|
/// <param name="projDbId">ID Record progetto da aggiornare</param>
|
||||||
|
/// <param name="procTime">Durata progetto (cumulata)</param>
|
||||||
|
/// <param name="valAct">Valore Progresso attuale (tipicamente num barre/pezzi)</param>
|
||||||
|
/// <param name="valMax">Valore Progresso max atteso (tipicamente num barre/pezzi)</param>
|
||||||
|
/// <returns>Bool aggiornamento</returns>
|
||||||
|
public async Task<bool> ProjectSetProgr(int nKey, int projDbId, double procTime, double valAct, double valMax)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
string cString = ConnString(nKey);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
fatto = dbController.ProjectSetProgr(cString, projDbId, procTime, valAct, valMax);
|
||||||
|
if (fatto)
|
||||||
|
{
|
||||||
|
await FlushRedisCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Error during ProjectSetProgr:{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converte il DTO in ItemModel
|
/// Converte il DTO in ItemModel
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1123,7 +1351,32 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Upsert record Item + refresh cache
|
/// Update record Project + refresh cache x info archived
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="nKey">Key di riferimento</param>
|
||||||
|
/// <param name="newData">IDizionario ProdId / IsArchived da impostare</param>
|
||||||
|
/// <returns>Bool aggiornamento</returns>
|
||||||
|
public async Task<bool> ProjectUpdArchived(int nKey, Dictionary<int, bool> newData)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
string cString = ConnString(nKey);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
fatto = dbController.ProjectUpdArchived(cString, newData);
|
||||||
|
if (fatto)
|
||||||
|
{
|
||||||
|
await FlushRedisCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Error during ProjectUpdArchived:{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Upsert record Project + refresh cache
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="nKey">Key di riferimento</param>
|
/// <param name="nKey">Key di riferimento</param>
|
||||||
/// <param name="currItem">Item interesato</param>
|
/// <param name="currItem">Item interesato</param>
|
||||||
@@ -1147,6 +1400,29 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
return prjCloudId;
|
return prjCloudId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recupera ultimo record attivo ReqPlan x tipo richiesto
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="nKey">Key di riferimento</param>
|
||||||
|
/// <param name="ProjCloudId">ID del progetto da cercare</param>
|
||||||
|
/// <param name="ResState">Stato richiesta da cercare</param>
|
||||||
|
/// <returns>Record cercato o default se non trovato</returns>
|
||||||
|
public RequestPlanModel ReqPlanGetLast(int nKey, int ProjCloudId, ProjResState ResState)
|
||||||
|
{
|
||||||
|
RequestPlanModel lastRec = new RequestPlanModel();
|
||||||
|
string cString = ConnString(nKey);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// cerco record (se fosse con valori "ini" p non trovata
|
||||||
|
lastRec = dbController.ReqPlanGetLast(cString, ProjCloudId, ResState);
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Error during ReqPlanGetLast:{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
return lastRec;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Aggiunge/Modifica un record ReqPlan
|
/// Aggiunge/Modifica un record ReqPlan
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1330,6 +1606,12 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|
||||||
|
#region Protected Fields
|
||||||
|
|
||||||
|
protected static TenantController dbController = null!;
|
||||||
|
|
||||||
|
#endregion Protected Fields
|
||||||
|
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
private static JsonSerializerSettings? JSSettings;
|
private static JsonSerializerSettings? JSSettings;
|
||||||
@@ -1339,7 +1621,9 @@ namespace MagMan.Data.Tenant.Services
|
|||||||
#region Private Properties
|
#region Private Properties
|
||||||
|
|
||||||
private string CodApp { get; set; } = "";
|
private string CodApp { get; set; } = "";
|
||||||
|
|
||||||
private Dictionary<int, string> ConnStringLUT { get; set; } = new Dictionary<int, string>();
|
private Dictionary<int, string> ConnStringLUT { get; set; } = new Dictionary<int, string>();
|
||||||
|
|
||||||
private string DbServerAddr { get; set; } = "";
|
private string DbServerAddr { get; set; } = "";
|
||||||
|
|
||||||
#endregion Private Properties
|
#endregion Private Properties
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
DROP PROCEDURE IF EXISTS `stp_mergeLogMachine`;
|
||||||
|
|
||||||
|
CREATE DEFINER=`steamware`@`10.74.%` PROCEDURE `stp_mergeLogMachine`(
|
||||||
|
IN `pKeyNum` INT,
|
||||||
|
IN `pMachineID` INT,
|
||||||
|
IN `pProjDbId` INT,
|
||||||
|
IN `pDtEvent` DATETIME,
|
||||||
|
IN `pEvType` INT,
|
||||||
|
IN `pSupervId` VARCHAR(250),
|
||||||
|
IN `pVarValue` VARCHAR(250)
|
||||||
|
)
|
||||||
|
LANGUAGE SQL
|
||||||
|
NOT DETERMINISTIC
|
||||||
|
CONTAINS SQL
|
||||||
|
SQL SECURITY DEFINER
|
||||||
|
COMMENT 'Inserimento record in table LogMachine qualora non esistesse'
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
# do x scontata cancellazione, creo nuovo record!
|
||||||
|
INSERT INTO LogMachine(KeyNum, MachineID, ProjDbId, DtEvent, EvType, SupervId, VarValue)
|
||||||
|
VALUES (pKeyNum, pMachineID, pProjDbId, pDtEvent, pEvType, pSupervId, pVarValue);
|
||||||
|
|
||||||
|
## creo record se non fosse già presente
|
||||||
|
#INSERT INTO LogMachine(KeyNum, MachineID, ProjDbId, DtEvent, EvType, SupervId, VarValue)
|
||||||
|
#SELECT src.* FROM
|
||||||
|
#(SELECT pKeyNum AS KeyNum , pMachineID AS MachineID, pProjDbId AS ProjDbId, pDtEvent AS DtEvent, pEvType AS EvType, pSupervId AS SupervId, pVarValue AS VarValue) as src
|
||||||
|
# LEFT OUTER JOIN LogMachine tgt ON
|
||||||
|
# tgt.KeyNum = src.KeyNum
|
||||||
|
# AND tgt.MachineID = src.MachineID
|
||||||
|
# AND tgt.ProjDbId = src.ProjDbId
|
||||||
|
# AND tgt.DtEvent = src.DtEvent
|
||||||
|
# AND tgt.EvType = src.EvType
|
||||||
|
# AND tgt.SupervId = src.SupervId
|
||||||
|
# AND tgt.VarValue = src.VarValue
|
||||||
|
#WHERE tgt.DbId IS NULL;
|
||||||
|
##ON DUPLICATE KEY UPDATE DbId = DbId;
|
||||||
|
|
||||||
|
END
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
DROP PROCEDURE IF EXISTS `stp_recalcDailyMGP`;
|
||||||
|
|
||||||
|
CREATE PROCEDURE `stp_recalcDailyMGP`(
|
||||||
|
IN `pDateStart` DATETIME,
|
||||||
|
IN `pDateEnd` DATETIME,
|
||||||
|
IN `pMachineId` INT
|
||||||
|
)
|
||||||
|
LANGUAGE SQL
|
||||||
|
NOT DETERMINISTIC
|
||||||
|
CONTAINS SQL
|
||||||
|
SQL SECURITY DEFINER
|
||||||
|
COMMENT 'Ricalcolo statistiche giornaliere x MachGroup + Part da LogMachine'
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
# Elimino dati eventualmente presenti nel periodo indicato
|
||||||
|
DELETE
|
||||||
|
FROM PartList
|
||||||
|
WHERE (DtStart >= pDateStart AND DtStart < pDateEnd)
|
||||||
|
OR (DtEnd >= pDateStart AND DtEnd < pDateEnd);
|
||||||
|
|
||||||
|
DELETE
|
||||||
|
FROM MachGroupList
|
||||||
|
WHERE (DtStart >= pDateStart AND DtStart < pDateEnd)
|
||||||
|
OR (DtEnd >= pDateStart AND DtEnd < pDateEnd);
|
||||||
|
|
||||||
|
DELETE
|
||||||
|
FROM DayStat
|
||||||
|
WHERE DtRif>= pDateStart AND dtRif < pDateEnd;
|
||||||
|
|
||||||
|
# creo record MachGroup con inizio e fine
|
||||||
|
INSERT INTO MachGroupList(MachGroupId, ProjDbId, DtStart, DtEnd)
|
||||||
|
SELECT tab_s.MachGroupId, tab_s.ProjDbId, tab_s.DtStart, tab_e.DtEnd
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT *
|
||||||
|
,@rownum := IF(GroupKey = @prev_col1, @rownum + 1, 1) AS numriga
|
||||||
|
,@prev_col1 := GroupKey
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';',-2),';',1) AS INT) AS MachGroupId
|
||||||
|
, SUBSTRING_INDEX(VarValue, ';',-2) AS GroupKey
|
||||||
|
, ProjDbId
|
||||||
|
, DtEvent AS DtStart
|
||||||
|
FROM LogMachine
|
||||||
|
WHERE MachineID = pMachineId
|
||||||
|
AND (DtEvent >= pDateStart AND DtEvent < pDateEnd)
|
||||||
|
AND EvType = 2
|
||||||
|
AND RIGHT(VarValue,1) = 1
|
||||||
|
) t , (SELECT @rownum := 0, @prev_col1 := NULL) r
|
||||||
|
ORDER BY GroupKey
|
||||||
|
) as tab_s
|
||||||
|
JOIN
|
||||||
|
(
|
||||||
|
SELECT *
|
||||||
|
,@rownum := IF(GroupKey = @prev_col1, @rownum + 1, 1) AS numriga
|
||||||
|
,@prev_col1 := GroupKey
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';',-2),';',1) AS INT) AS MachGroupId
|
||||||
|
, SUBSTRING_INDEX(VarValue, ';',-2) AS GroupKey
|
||||||
|
, ProjDbId
|
||||||
|
, DtEvent AS DtEnd
|
||||||
|
FROM LogMachine
|
||||||
|
WHERE MachineID = pMachineId
|
||||||
|
AND (DtEvent >= pDateStart AND DtEvent < pDateEnd)
|
||||||
|
AND EvType = 2
|
||||||
|
AND RIGHT(VarValue,1) = 2
|
||||||
|
) t , (SELECT @rownum := 0, @prev_col1 := NULL) r
|
||||||
|
ORDER BY GroupKey
|
||||||
|
) AS tab_e
|
||||||
|
ON tab_s.MachGroupId = tab_e.MachGroupId AND tab_s.ProjDbId = tab_e.ProjDbId AND tab_s.numriga = tab_e.numriga;
|
||||||
|
|
||||||
|
|
||||||
|
# creo record Part con inizio e fine
|
||||||
|
INSERT INTO PartList(PartId, MachGroupId, ProjDbId, DtStart, DtEnd)
|
||||||
|
SELECT tab_s.Id, tab_s.MachGroupId, tab_s.ProjDbId, tab_s.DtStart, tab_e.DtEnd
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT *
|
||||||
|
,@rownum := IF(GroupKey = @prev_col1, @rownum + 1, 1) AS numriga
|
||||||
|
,@prev_col1 := GroupKey
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';',-2),';',1) AS INT) AS Id
|
||||||
|
, CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';',-3),';',1) AS INT) AS MachGroupId
|
||||||
|
, SUBSTRING_INDEX(VarValue, ';',-3) AS GroupKey
|
||||||
|
, ProjDbId
|
||||||
|
, DtEvent AS DtStart
|
||||||
|
FROM LogMachine
|
||||||
|
WHERE MachineID = pMachineId
|
||||||
|
AND (DtEvent >= pDateStart AND DtEvent < pDateEnd)
|
||||||
|
AND EvType = 1
|
||||||
|
AND RIGHT(VarValue,1) = 1
|
||||||
|
) t , (SELECT @rownum := 0, @prev_col1 := NULL) r
|
||||||
|
ORDER BY GroupKey
|
||||||
|
) as tab_s
|
||||||
|
JOIN
|
||||||
|
(
|
||||||
|
SELECT *
|
||||||
|
,@rownum := IF(GroupKey = @prev_col1, @rownum + 1, 1) AS numriga
|
||||||
|
,@prev_col1 := GroupKey
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';',-2),';',1) AS INT) AS Id
|
||||||
|
, CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';',-3),';',1) AS INT) AS MachGroupId
|
||||||
|
, SUBSTRING_INDEX(VarValue, ';',-3) AS GroupKey
|
||||||
|
, ProjDbId
|
||||||
|
, DtEvent AS DtEnd
|
||||||
|
FROM LogMachine
|
||||||
|
WHERE MachineID = pMachineId
|
||||||
|
AND (DtEvent >= pDateStart AND DtEvent < pDateEnd)
|
||||||
|
AND EvType = 1
|
||||||
|
AND RIGHT(VarValue,1) = 2
|
||||||
|
) t , (SELECT @rownum := 0, @prev_col1 := NULL) r
|
||||||
|
ORDER BY GroupKey
|
||||||
|
) AS tab_e
|
||||||
|
ON tab_s.id = tab_e.id AND tab_s.MachGroupId = tab_e.MachGroupId AND tab_s.ProjDbId = tab_e.ProjDbId AND tab_s.numriga = tab_e.numriga;
|
||||||
|
|
||||||
|
# per giancarlo: verificare la procedura che crei correttamente part e machGroup, controllando che le date siano coerenti (eventi inizio/fine sequenziali), lasciando eventualmente fuori i dati "incompleti"; verificare con EMmanuele se evento inizio da prendere sia "il primo o il precedente" considerato che POTREMMO avere + record inizio che fine
|
||||||
|
|
||||||
|
|
||||||
|
#SELECT *
|
||||||
|
#FROM MachGroupList;
|
||||||
|
|
||||||
|
#SELECT *
|
||||||
|
#FROM PartList;
|
||||||
|
|
||||||
|
|
||||||
|
END;
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
DROP PROCEDURE IF EXISTS `stp_removeLogMachine`;
|
||||||
|
|
||||||
|
CREATE DEFINER=`steamware`@`10.74.%` PROCEDURE `stp_removeLogMachine`(
|
||||||
|
IN `pKeyNum` INT,
|
||||||
|
IN `pMachineID` INT,
|
||||||
|
IN `pDtMin` DATETIME,
|
||||||
|
IN `pDtMax` DATETIME
|
||||||
|
)
|
||||||
|
LANGUAGE SQL
|
||||||
|
NOT DETERMINISTIC
|
||||||
|
CONTAINS SQL
|
||||||
|
SQL SECURITY DEFINER
|
||||||
|
COMMENT 'Rimozione in blocco record da Key+Macchina+Periodo table LogMachine'
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
# elimino intervallo
|
||||||
|
DELETE
|
||||||
|
FROM LogMachine
|
||||||
|
WHERE KeyNum = pKeyNum
|
||||||
|
AND MachineID = pMachineID
|
||||||
|
AND (DtEvent >= pDtMin AND DtEvent <= pDtMax);
|
||||||
|
END
|
||||||
@@ -1,26 +1,71 @@
|
|||||||
@page
|
@page
|
||||||
@model ForgotPasswordModel
|
@model ForgotPasswordModel
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Forgot your password?";
|
ViewData["Title"] = "Password dimenticata?";
|
||||||
}
|
}
|
||||||
|
|
||||||
<h1>@ViewData["Title"]</h1>
|
|
||||||
<h2>Enter your email.</h2>
|
<div class="d-flex justify-content-center">
|
||||||
<hr />
|
<h1>@ViewData["Title"]</h1>
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-4">
|
|
||||||
<form method="post">
|
|
||||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
|
||||||
<div class="form-floating">
|
|
||||||
<input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" />
|
|
||||||
<label asp-for="Input.Email" class="form-label"></label>
|
|
||||||
<span asp-validation-for="Input.Email" class="text-danger"></span>
|
|
||||||
</div>
|
|
||||||
<button type="submit" class="w-100 btn btn-lg btn-primary">Reset Password</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div style="
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
">
|
||||||
|
<div class="row p-3 w-100" style="border-radius: 2rem; min-height:500px; height: auto; box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;">
|
||||||
|
<div class="col py-3 d-flex justify-content-center align-content-center flex-wrap">
|
||||||
|
<div>
|
||||||
|
<div class="d-flex justify-content-center fw-bold fs-2">
|
||||||
|
EgtBeam&Wall
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-center mb-4">
|
||||||
|
Powered by
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-center">
|
||||||
|
<img src="~/images/LogoEgw.png" style="height: 10rem; width: 10rem;" />
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-center fw-bold fs-3">
|
||||||
|
EgalWare
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col" style="border-radius: 2rem; background-color: #f3f3f8; box-shadow: rgba(62, 39, 35, 0.2) 0px 8px 24px;">
|
||||||
|
<div class="cardRightHeader"></div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="py-3 px-5 d-flex justify-content-center align-content-center2 flex-wrap">
|
||||||
|
<form method="post" class="w-100">
|
||||||
|
<h2>Inserisci email.</h2>
|
||||||
|
<hr />
|
||||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||||
|
<div class="form-floating mb-2">
|
||||||
|
<input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" />
|
||||||
|
<label asp-for="Input.Email" class="form-label"></label>
|
||||||
|
<span asp-validation-for="Input.Email" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="mb-4">
|
||||||
|
<button type="submit" class="w-100 btn btn-lg btn-dark">Reset Password</button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
<a id="already-register" asp-page="./Login" class="text-decoration-none text-dark">Hai già un profilo? <b>Clicca qui</b></a>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a asp-page="./Register" class="text-decoration-none text-dark">Registra <b>nuovo utente</b></a>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a id="resend-confirmation" asp-page="./ResendEmailConfirmation" class="text-decoration-none text-dark"><b>Reinvia email</b> di conferma</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@section Scripts {
|
@section Scripts {
|
||||||
<partial name="_ValidationScriptsPartial" />
|
<partial name="_ValidationScriptsPartial" />
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,83 +2,75 @@
|
|||||||
@model LoginModel
|
@model LoginModel
|
||||||
|
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Log in";
|
ViewData["Title"] = "MagMan";
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="row shadow">
|
<div class="d-flex justify-content-center">
|
||||||
<h1>@ViewData["Title"]</h1>
|
<h1>@ViewData["Title"]</h1>
|
||||||
<div class="offset-3 col-md-6">
|
</div>
|
||||||
<section>
|
<div style="display: flex; justify-content: center;">
|
||||||
<form id="account" method="post">
|
<div class="row p-3 w-100" style="border-radius: 2rem; min-height:500px; height: auto; box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;">
|
||||||
<h2>Use a local account to log in.</h2>
|
<div class="col py-3 d-flex justify-content-center align-content-center flex-wrap">
|
||||||
<hr />
|
<div>
|
||||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
<div class="d-flex justify-content-center fw-bold fs-2">
|
||||||
<div class="form-floating">
|
EgtBeam&Wall
|
||||||
<input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" />
|
|
||||||
<label asp-for="Input.Email" class="form-label"></label>
|
|
||||||
<span asp-validation-for="Input.Email" class="text-danger"></span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating">
|
<div class="d-flex justify-content-center mb-4">
|
||||||
<input asp-for="Input.Password" class="form-control" autocomplete="current-password" aria-required="true" />
|
Powered by
|
||||||
<label asp-for="Input.Password" class="form-label"></label>
|
|
||||||
<span asp-validation-for="Input.Password" class="text-danger"></span>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="d-flex justify-content-center">
|
||||||
<div class="checkbox">
|
<img src="~/images/LogoEgw.png" style="height: 10rem; width: 10rem;" />
|
||||||
<label asp-for="Input.RememberMe" class="form-label">
|
|
||||||
<input class="form-check-input" asp-for="Input.RememberMe" />
|
|
||||||
@Html.DisplayNameFor(m => m.Input.RememberMe)
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="d-flex justify-content-center fw-bold fs-3">
|
||||||
<button id="login-submit" type="submit" class="w-100 btn btn-lg btn-primary">Log in</button>
|
EgalWare
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
</div>
|
||||||
<div>
|
</div>
|
||||||
<p>
|
<div class="col" style="border-radius: 2rem; background-color: #f3f3f8;box-shadow: rgba(41, 128, 185, 0.2) 0px 8px 24px;">
|
||||||
<a id="forgot-password" asp-page="./ForgotPassword">Forgot your password?</a>
|
<div class="cardRightHeader"></div>
|
||||||
</p>
|
<div class="row">
|
||||||
<p>
|
<div class="py-3 px-5 d-flex justify-content-center align-content-center flex-wrap">
|
||||||
<a asp-page="./Register" asp-route-returnUrl="@Model.ReturnUrl">Register as a new user</a>
|
<form id="account" method="post" class="w-100">
|
||||||
</p>
|
<h2 class="text-dark">Login Utente</h2>
|
||||||
<p>
|
<hr />
|
||||||
<a id="resend-confirmation" asp-page="./ResendEmailConfirmation">Resend email confirmation</a>
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||||
</p>
|
<div class="form-floating mb-1">
|
||||||
</div>
|
<input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" />
|
||||||
</form>
|
<label asp-for="Input.Email" class="form-label"></label>
|
||||||
</section>
|
<span asp-validation-for="Input.Email" class="text-danger"></span>
|
||||||
</div>
|
</div>
|
||||||
@* <div class="col-md-6 col-md-offset-2">
|
<div class="form-floating mb-1">
|
||||||
<section>
|
<input asp-for="Input.Password" class="form-control" autocomplete="current-password" aria-required="true" />
|
||||||
<h3>Use another service to log in.</h3>
|
<label asp-for="Input.Password" class="form-label"></label>
|
||||||
<hr />
|
<span asp-validation-for="Input.Password" class="text-danger"></span>
|
||||||
@{
|
</div>
|
||||||
if ((Model.ExternalLogins?.Count ?? 0) == 0)
|
<div>
|
||||||
{
|
<div class="checkbox text-dark text-start">
|
||||||
<div>
|
<label asp-for="Input.RememberMe" class="form-label">
|
||||||
<p>
|
<input class="form-check-input" asp-for="Input.RememberMe" />
|
||||||
There are no external authentication services configured. See this <a href="https://go.microsoft.com/fwlink/?LinkID=532715">article
|
@Html.DisplayNameFor(m => m.Input.RememberMe)
|
||||||
about setting up this ASP.NET application to support logging in via external services</a>.
|
</label>
|
||||||
</p>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
<div class="mb-4">
|
||||||
else
|
<button id="login-submit" type="submit" class="w-100 btn btn-lg btn-dark">Log in</button>
|
||||||
{
|
</div>
|
||||||
<form id="external-account" asp-page="./ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" method="post" class="form-horizontal">
|
|
||||||
<div>
|
<div>
|
||||||
<p>
|
<p>
|
||||||
@foreach (var provider in Model.ExternalLogins!)
|
<a id="forgot-password" asp-page="./ForgotPassword" class="text-decoration-none text-dark">Password <b>dimenticata</b>?</a>
|
||||||
{
|
</p>
|
||||||
<button type="submit" class="btn btn-primary" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">@provider.DisplayName</button>
|
<p>
|
||||||
}
|
<a asp-page="./Register" asp-route-returnUrl="@Model.ReturnUrl" class="text-decoration-none text-dark">Registra <b>nuovo utente</b></a>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a id="resend-confirmation" asp-page="./ResendEmailConfirmation" class="text-decoration-none text-dark"><b>Reinvia email</b> di conferma</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
}
|
</div>
|
||||||
}
|
</div>
|
||||||
</section>
|
</div>
|
||||||
</div> *@
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@section Scripts {
|
@section Scripts {
|
||||||
|
|||||||
@@ -92,6 +92,11 @@ namespace MagMan.UI.Areas.Identity.Pages.Account
|
|||||||
public async Task<IActionResult> OnPostAsync(string returnUrl = null)
|
public async Task<IActionResult> OnPostAsync(string returnUrl = null)
|
||||||
{
|
{
|
||||||
returnUrl ??= Url.Content("~/");
|
returnUrl ??= Url.Content("~/");
|
||||||
|
// se fosse logout --> rimanda a home!
|
||||||
|
if(returnUrl.Contains("Logout"))
|
||||||
|
{
|
||||||
|
returnUrl = Url.Content("~/");
|
||||||
|
}
|
||||||
|
|
||||||
ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
|
ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
|
||||||
|
|
||||||
@@ -160,7 +165,7 @@ namespace MagMan.UI.Areas.Identity.Pages.Account
|
|||||||
/// intended to be used directly from your code. This API may change or be removed in
|
/// intended to be used directly from your code. This API may change or be removed in
|
||||||
/// future releases.
|
/// future releases.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "Remember me?")]
|
[Display(Name = "Ricordami")]
|
||||||
public bool RememberMe { get; set; }
|
public bool RememberMe { get; set; }
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<h3>@ViewData["Title"]</h3>
|
<h3>@ViewData["Title"]</h3>
|
||||||
<partial name="_StatusMessage" for="StatusMessage" />
|
<partial name="_StatusMessage" for="StatusMessage" />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-12">
|
||||||
<form id="change-password-form" method="post">
|
<form id="change-password-form" method="post">
|
||||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<h3>@ViewData["Title"]</h3>
|
<h3>@ViewData["Title"]</h3>
|
||||||
<partial name="_StatusMessage" for="StatusMessage" />
|
<partial name="_StatusMessage" for="StatusMessage" />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-12">
|
||||||
<form id="email-form" method="post">
|
<form id="email-form" method="post">
|
||||||
<div asp-validation-summary="All" class="text-danger"></div>
|
<div asp-validation-summary="All" class="text-danger"></div>
|
||||||
@if (Model.IsEmailConfirmed)
|
@if (Model.IsEmailConfirmed)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<h3>@ViewData["Title"]</h3>
|
<h3>@ViewData["Title"]</h3>
|
||||||
<partial name="_StatusMessage" for="StatusMessage" />
|
<partial name="_StatusMessage" for="StatusMessage" />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-12">
|
||||||
<form id="profile-form" method="post">
|
<form id="profile-form" method="post">
|
||||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<label asp-for="Input.PhoneNumber" class="form-label"></label>
|
<label asp-for="Input.PhoneNumber" class="form-label"></label>
|
||||||
<span asp-validation-for="Input.PhoneNumber" class="text-danger"></span>
|
<span asp-validation-for="Input.PhoneNumber" class="text-danger"></span>
|
||||||
</div>
|
</div>
|
||||||
<button id="update-profile-button" type="submit" class="w-100 btn btn-lg btn-primary">Save</button>
|
<button id="update-profile-button" type="submit" class="w-100 btn btn-lg btn-primary">Salva</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,16 +8,17 @@
|
|||||||
<h3>@ViewData["Title"]</h3>
|
<h3>@ViewData["Title"]</h3>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-12">
|
||||||
<p>Your account contains personal data that you have given us. This page allows you to download or delete that data.</p>
|
<p>Your account contains personal data that you have given us. This page allows you to download or delete that data.</p>
|
||||||
<p>
|
<form id="download-data" asp-page="DownloadPersonalData" method="post">
|
||||||
|
<button class="btn btn-primary w-100" type="submit">Download</button>
|
||||||
|
</form>
|
||||||
|
<hr />
|
||||||
|
<p class="mt-5">
|
||||||
<strong>Deleting this data will permanently remove your account, and this cannot be recovered.</strong>
|
<strong>Deleting this data will permanently remove your account, and this cannot be recovered.</strong>
|
||||||
</p>
|
</p>
|
||||||
<form id="download-data" asp-page="DownloadPersonalData" method="post">
|
|
||||||
<button class="btn btn-primary" type="submit">Download</button>
|
|
||||||
</form>
|
|
||||||
<p>
|
<p>
|
||||||
<a id="delete" asp-page="DeletePersonalData" class="btn btn-danger">Delete</a>
|
<a id="delete" asp-page="DeletePersonalData" class="btn btn-danger w-100">Delete</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
account so you can log in without an external login.
|
account so you can log in without an external login.
|
||||||
</p>
|
</p>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-12">
|
||||||
<form id="set-password-form" method="post">
|
<form id="set-password-form" method="post">
|
||||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||||
<div class="form-floating">
|
<div class="form-floating">
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
@{
|
@{
|
||||||
if (ViewData.TryGetValue("ParentLayout", out var parentLayout) && parentLayout != null)
|
if (ViewData.TryGetValue("ParentLayout", out var parentLayout) && parentLayout != null)
|
||||||
{
|
{
|
||||||
Layout = parentLayout.ToString();
|
Layout = parentLayout.ToString();
|
||||||
}
|
}
|
||||||
@@ -9,21 +9,41 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
<h1>Manage your account</h1>
|
<div class="d-flex justify-content-center">
|
||||||
|
<h1>Gestione account</h1>
|
||||||
<div>
|
<h5></h5>
|
||||||
<h2>Change your account settings</h2>
|
</div>
|
||||||
<hr />
|
<div style="display: flex; justify-content: center;" class="w-100">
|
||||||
<div class="row">
|
<div class="row p-3 w-100" style="border-radius: 2rem; min-height:500px; height: auto; box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;">
|
||||||
<div class="col-md-3">
|
<div class="col-4 py-3 d-flex justify-content-center align-content-center flex-wrap">
|
||||||
<partial name="_ManageNav" />
|
<div>
|
||||||
|
<div class="d-flex justify-content-center fw-bold fs-2">
|
||||||
|
EgtBeam&Wall
|
||||||
|
</div>
|
||||||
|
<partial name="_ManageNav" />
|
||||||
|
<hr />
|
||||||
|
<div class="d-flex justify-content-center mb-4">
|
||||||
|
Powered by
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-center">
|
||||||
|
<img src="~/images/LogoEgw.png" style="height: 10rem; width: 10rem;" />
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-center fw-bold fs-3">
|
||||||
|
EgalWare
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-9">
|
<div class="col-8" style="border-radius: 2rem; background-color: #f3f3f8;box-shadow: rgba(41, 128, 185, 0.2) 0px 8px 24px;">
|
||||||
@RenderBody()
|
<div class="cardRightHeader"></div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="py-3 px-5 w-100">
|
||||||
|
@RenderBody()
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@section Scripts {
|
@section Scripts {
|
||||||
@RenderSection("Scripts", required: false)
|
@RenderSection("Scripts", required: false)
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,6 @@
|
|||||||
{
|
{
|
||||||
<li id="external-logins" class="nav-item"><a id="external-login" class="nav-link @ManageNavPages.ExternalLoginsNavClass(ViewContext)" asp-page="./ExternalLogins">External logins</a></li>
|
<li id="external-logins" class="nav-item"><a id="external-login" class="nav-link @ManageNavPages.ExternalLoginsNavClass(ViewContext)" asp-page="./ExternalLogins">External logins</a></li>
|
||||||
}
|
}
|
||||||
<li class="nav-item"><a class="nav-link @ManageNavPages.TwoFactorAuthenticationNavClass(ViewContext)" id="two-factor" asp-page="./TwoFactorAuthentication">Two-factor authentication</a></li>
|
@* <li class="nav-item"><a class="nav-link @ManageNavPages.TwoFactorAuthenticationNavClass(ViewContext)" id="two-factor" asp-page="./TwoFactorAuthentication">Two-factor authentication</a></li> *@
|
||||||
<li class="nav-item"><a class="nav-link @ManageNavPages.PersonalDataNavClass(ViewContext)" id="personal-data" asp-page="./PersonalData">Personal data</a></li>
|
<li class="nav-item"><a class="nav-link @ManageNavPages.PersonalDataNavClass(ViewContext)" id="personal-data" asp-page="./PersonalData">Personal data</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -1,67 +1,74 @@
|
|||||||
@page
|
@page
|
||||||
@model RegisterModel
|
@model RegisterModel
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Register";
|
ViewData["Title"] = "Registrazione";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-center">
|
||||||
<h1>@ViewData["Title"]</h1>
|
<h1>@ViewData["Title"]</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-4">
|
<div style="display: flex; justify-content: center;">
|
||||||
<form id="registerForm" asp-route-returnUrl="@Model.ReturnUrl" method="post">
|
<div class="row p-3 w-100" style="border-radius: 2rem; height: auto; min-height:500px;box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;">
|
||||||
<h2>Create a new account.</h2>
|
<div class="col py-3 d-flex justify-content-center align-content-center flex-wrap">
|
||||||
<hr />
|
<div>
|
||||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
<div class="d-flex justify-content-center fw-bold fs-2">
|
||||||
<div class="form-floating">
|
EgtBeam&Wall
|
||||||
<input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" />
|
</div>
|
||||||
<label asp-for="Input.Email"></label>
|
<div class="d-flex justify-content-center mb-4">
|
||||||
<span asp-validation-for="Input.Email" class="text-danger"></span>
|
Powered by
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-center">
|
||||||
|
<img src="~/images/LogoEgw.png" style="height: 10rem; width: 10rem;" />
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-center fw-bold fs-3">
|
||||||
|
EgalWare
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating">
|
</div>
|
||||||
<input asp-for="Input.Password" class="form-control" autocomplete="new-password" aria-required="true" />
|
<div class="col" style="border-radius: 2rem; background-color: #f3f3f8; box-shadow: rgba(62, 39, 35, 0.2) 0px 8px 24px;">
|
||||||
<label asp-for="Input.Password"></label>
|
<div class="cardRightHeader"></div>
|
||||||
<span asp-validation-for="Input.Password" class="text-danger"></span>
|
<div class="row">
|
||||||
</div>
|
<div class="py-3 px-5 d-flex justify-content-center align-content-center flex-wrap">
|
||||||
<div class="form-floating">
|
<form id="+Form" asp-route-returnUrl="@Model.ReturnUrl" method="post" class="w-100">
|
||||||
<input asp-for="Input.ConfirmPassword" class="form-control" autocomplete="new-password" aria-required="true" />
|
<h2 class="text-dark">Nuovo Account</h2>
|
||||||
<label asp-for="Input.ConfirmPassword"></label>
|
<hr />
|
||||||
<span asp-validation-for="Input.ConfirmPassword" class="text-danger"></span>
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||||
</div>
|
<div class="form-floating mb-1">
|
||||||
<button id="registerSubmit" type="submit" class="w-100 btn btn-lg btn-primary">Register</button>
|
<input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" />
|
||||||
</form>
|
<label asp-for="Input.Email"></label>
|
||||||
</div>
|
<span asp-validation-for="Input.Email" class="text-danger"></span>
|
||||||
<div class="col-md-6 col-md-offset-2">
|
</div>
|
||||||
<section>
|
<div class="form-floating mb-1">
|
||||||
<h3>Use another service to register.</h3>
|
<input asp-for="Input.Password" class="form-control" autocomplete="new-password" aria-required="true" />
|
||||||
<hr />
|
<label asp-for="Input.Password"></label>
|
||||||
@{
|
<span asp-validation-for="Input.Password" class="text-danger"></span>
|
||||||
if ((Model.ExternalLogins?.Count ?? 0) == 0)
|
</div>
|
||||||
{
|
<div class="form-floating mb-1">
|
||||||
<div>
|
<input asp-for="Input.ConfirmPassword" class="form-control" autocomplete="new-password" aria-required="true" />
|
||||||
<p>
|
<label asp-for="Input.ConfirmPassword"></label>
|
||||||
There are no external authentication services configured. See this <a href="https://go.microsoft.com/fwlink/?LinkID=532715">article
|
<span asp-validation-for="Input.ConfirmPassword" class="text-danger"></span>
|
||||||
about setting up this ASP.NET application to support logging in via external services</a>.
|
</div>
|
||||||
</p>
|
<button id="registerSubmit" type="submit" class="w-100 btn btn-lg btn-dark mb-3">Registra</button>
|
||||||
</div>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<form id="external-account" asp-page="./ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" method="post" class="form-horizontal">
|
|
||||||
<div>
|
<div>
|
||||||
<p>
|
<p>
|
||||||
@foreach (var provider in Model.ExternalLogins!)
|
<a id="already-register" asp-page="./Login" class="text-decoration-none text-dark">Hai già un profilo? <b>Clicca qui</b></a>
|
||||||
{
|
</p>
|
||||||
<button type="submit" class="btn btn-primary" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">@provider.DisplayName</button>
|
<p>
|
||||||
}
|
<a id="forgot-password" asp-page="./ForgotPassword" class="text-decoration-none text-dark">Password <b>dimenticata</b>?</a>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a id="resend-confirmation" asp-page="./ResendEmailConfirmation" class="text-decoration-none text-dark"><b>Reinvia email</b> di conferma</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
}
|
</div>
|
||||||
}
|
</div>
|
||||||
</section>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
</div>
|
||||||
@section Scripts {
|
@section Scripts {
|
||||||
<partial name="_ValidationScriptsPartial" />
|
<partial name="_ValidationScriptsPartial" />
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user