Compare commits
344 Commits
feature-re
...
JpaTest
| Author | SHA1 | Date | |
|---|---|---|---|
| 8781b406ff | |||
| c9325674d9 | |||
| 99ca1731b1 | |||
| af6f465c0e | |||
| d981e59a7d | |||
| 6d7212ce97 | |||
| 5103830369 | |||
| 5056d7e0c8 | |||
| 4b5e46de7b | |||
| 4d686ee145 | |||
| e842326f5b | |||
| 63ad11086f | |||
| 21f6fc6717 | |||
| 8c2789b5f3 | |||
| 8f3ef405cf | |||
| 76e76dfcf4 | |||
| 1df5ad7137 | |||
| a43ca46395 | |||
| a63eba544b | |||
| ce912bf103 | |||
| ababbf6142 | |||
| e97fd0aacb | |||
| 51c1ed1d23 | |||
| a9be8f7003 | |||
| 7522092a12 | |||
| 4dc0174800 | |||
| a04b2fa4a1 | |||
| 04317470c6 | |||
| 187216dd9f | |||
| e11172a90f | |||
| 51d5b05bd3 | |||
| 3a2ceaf217 | |||
| c783f69a49 | |||
| 1c8695095b | |||
| fc28af761c | |||
| fd4db5ab3b | |||
| f7e1d1f6ca | |||
| 0b8f82f041 | |||
| 99680dccd8 | |||
| e948855fc0 | |||
| 0854acacfb | |||
| 1aba141c9f | |||
| 741cb960d4 | |||
| 82d7efc00c | |||
| c6c2739525 | |||
| 313bfc21ff | |||
| 36f50ad846 | |||
| 798e5b532e | |||
| c27c96c3d9 | |||
| 4e3d15ebd8 | |||
| 0ba9297f39 | |||
| 7c036172d8 | |||
| 8afa01d8ef | |||
| db1949b5b6 | |||
| bb47dd458e | |||
| 530b6af4ef | |||
| 92cd4b1af5 | |||
| 6b71d6b784 | |||
| de4d8d225f | |||
| 671c2e99d0 | |||
| 755e7394b4 | |||
| ce06683722 | |||
| e8a1a8ca0b | |||
| 7a5c024005 | |||
| c82f2a57d8 | |||
| 78dbf9f7e3 | |||
| b9e863a563 | |||
| 60e4429c3f | |||
| d7012d4e1f | |||
| 1d52f79337 | |||
| 0e1adccb7c | |||
| fa76a8e92d | |||
| 9b34a51bd9 | |||
| b75f7e3810 | |||
| 4aeccdfa76 | |||
| 39db8e6e1b | |||
| 1b87cacca2 | |||
| 326bd4294e | |||
| 6a237ce4d9 | |||
| a64932d918 | |||
| e887aceaaf | |||
| a15d009f76 | |||
| a62f37d930 | |||
| 55f23b2dfc | |||
| a4a2b34379 | |||
| 1ef49b87e8 | |||
| f2d67ea89d | |||
| fda162d867 | |||
| 2008ef0e8f | |||
| 6d8e0e747f | |||
| 5417e28630 | |||
| 4ac4686645 | |||
| 1594154639 | |||
| 3a4a954b91 | |||
| 744f92c881 | |||
| 6e5f099fc2 | |||
| 697cd58e39 | |||
| 4bf1f6021f | |||
| 118d2d83d5 | |||
| 149bdc36b3 | |||
| 89c69bc0d2 | |||
| 240f18d19d | |||
| 9a8a144705 | |||
| 2f412f1ad6 | |||
| 8e8b03889a | |||
| dd4ace59bd | |||
| 52c0e0ca61 | |||
| e2f2b9bde9 | |||
| 4ea9be84db | |||
| 11e4b1cf20 | |||
| a66cfa16d8 | |||
| 9f628973e9 | |||
| 9fa7f9628c | |||
| 1a5156d53c | |||
| ba667fd28e | |||
| cddc7f8979 | |||
| 60c436256e | |||
| 46449c47b9 | |||
| f8b6d3ebe0 | |||
| b3d29219ee | |||
| 2c81a6566b | |||
| f697a122b6 | |||
| 3f4ed16f20 | |||
| cbbfbb16b8 | |||
| 585a04ffba | |||
| b025be1bd9 | |||
| 5453826156 | |||
| 8312d48970 | |||
| b50c348528 | |||
| 64aeff7bf6 | |||
| 2a8cf16ce0 | |||
| 3539e82849 | |||
| f4faa20652 | |||
| e7f5959e27 | |||
| 1d897f1461 | |||
| f3e48b9a3e | |||
| f0e41c6554 | |||
| 3d76dec03a | |||
| 754b58fd37 | |||
| 0627fd59c9 | |||
| 31480b8fbe | |||
| c1efdf48a6 | |||
| e1de9f4db9 | |||
| ce2ec669ba | |||
| c9658954aa | |||
| 5011aa271d | |||
| af4a5511a3 | |||
| fa996c210c | |||
| c5b5fb62a1 | |||
| 3b007c061e | |||
| 8ee9e2fe57 | |||
| 4ddcc6228e | |||
| 7cf9df3549 | |||
| 8e8d6cf2c3 | |||
| 2a5314fd1e | |||
| 9363e674b5 | |||
| e7252f7fea | |||
| b5e1d2e1ce | |||
| 53ef2539f5 | |||
| 6136d9b848 | |||
| fe2be9b926 | |||
| 1b113999b2 | |||
| 4ebcae77ca | |||
| 8d35f9284a | |||
| b953349afc | |||
| 6c2eaaa37a | |||
| 9b8824e681 | |||
| fb03aa1ea7 | |||
| c16e23d3bf | |||
| 27055f8e5e | |||
| b8ac769ffd | |||
| 0216bc5d53 | |||
| db3973637d | |||
| 7dab29e8c2 | |||
| 809ffe73b9 | |||
| 4d13d17095 | |||
| f749356735 | |||
| b2d24ab6b4 | |||
| 6bb7b55618 | |||
| 920257812c | |||
| 00efbe6fcf | |||
| cacb24a563 | |||
| 5da098e058 | |||
| 3e0c443ce3 | |||
| b4442bc251 | |||
| eec353c6a5 | |||
| 8b50f54881 | |||
| 42f50e0d80 | |||
| cbeae87d23 | |||
| 71cb1db5ef | |||
| bb642d92db | |||
| ddd3b95d17 | |||
| ff5428f8bd | |||
| d3b39ad878 | |||
| 99a366d875 | |||
| abc4f1c966 | |||
| fc1c2f192e | |||
| ac4afa9a2b | |||
| c5a315e070 | |||
| 1d0fd3341d | |||
| b44685335a | |||
| e5689da13d | |||
| f57710cb32 | |||
| ceb5dc817c | |||
| 3a934813d8 | |||
| d56fe38e2c | |||
| 5555a40731 | |||
| acf5daf673 | |||
| 939c4ab236 | |||
| 49237b9585 | |||
| abbf298b4f | |||
| 34985c9fd3 | |||
| 401f0330de | |||
| 7815fb72f1 | |||
| 0e8cc5b2de | |||
| 9a18dd6ebd | |||
| 3f0b9315a2 | |||
| 32a15a4f3e | |||
| 932f99c147 | |||
| 1fc7d01b9c | |||
| 46e47a9549 | |||
| ba1bbbafe0 | |||
| fa54de3d76 | |||
| 1550de37e6 | |||
| 450f9f4dd4 | |||
| f1da5057d6 | |||
| a3d15aeb32 | |||
| c933c02727 | |||
| 28b94b228a | |||
| c291db3e34 | |||
| 3f9a451a70 | |||
| 9f39c5bc2d | |||
| 6a455db664 | |||
| c33c1da199 | |||
| d0769ea1bd | |||
| f3f768380a | |||
| cb2cf06200 | |||
| a81fc6813c | |||
| 5c03b928b6 | |||
| 16b478a511 | |||
| c2ef09a604 | |||
| f2de64de75 | |||
| b877347a77 | |||
| 2d43952d96 | |||
| ee171374c8 | |||
| f0d1cdc81a | |||
| 1758dcabbb | |||
| 8231716e97 | |||
| 2603cda317 | |||
| 77c79c6247 | |||
| 532a9cc3f4 | |||
| c26f7feb35 | |||
| 15a63cff14 | |||
| b53d76358b | |||
| f9ded1153a | |||
| 81ddb42e5c | |||
| 5ac4d4be63 | |||
| 0b432960ec | |||
| 159436247d | |||
| 2a2435f64d | |||
| fba5e331b5 | |||
| 21cc88f295 | |||
| de21ce7cb8 | |||
| 33f24290a9 | |||
| dc83e89392 | |||
| d525048bb3 | |||
| f5d46be57d | |||
| ca4c3c3412 | |||
| e5c16c6e4e | |||
| 42bef35d5f | |||
| 44e3de6a0f | |||
| 9942f92440 | |||
| e34bb01aea | |||
| 6f11e08807 | |||
| aa9529f551 | |||
| bcb8f4475d | |||
| 8a83213384 | |||
| 2433c98ab1 | |||
| 595fe77472 | |||
| 29f9335876 | |||
| e975964f53 | |||
| 9d82cbc610 | |||
| 0a12dc23f2 | |||
| 1719f2ba37 | |||
| ddd9c73f49 | |||
| 1b0f5d5d29 | |||
| 6991e60ec5 | |||
| 8a87d428ae | |||
| 0058373710 | |||
| d9f93b14e1 | |||
| dea6b14323 | |||
| d01b4aef8f | |||
| b2c3008464 | |||
| d02f44237e | |||
| 675e919652 | |||
| 9d9d4e3d87 | |||
| 19e17f76d4 | |||
| df18330a01 | |||
| da61cb5439 | |||
| 975e4f2be4 | |||
| e31b0bc1a0 | |||
| 84ccdafd90 | |||
| 97de2f0e71 | |||
| 1ee321b253 | |||
| 7912d29f00 | |||
| ecd8bca2aa | |||
| 1a64179099 | |||
| 54588d20bd | |||
| 84f3823597 | |||
| 0022e620da | |||
| 62a1f5a85f | |||
| cd389dc83f | |||
| 974b5f61af | |||
| a10876effc | |||
| 4385520480 | |||
| a1b892a75e | |||
| 92dcc45638 | |||
| a178ec5017 | |||
| 1456e094a2 | |||
| 58b89777bb | |||
| f4da09eacc | |||
| 6f47434d6f | |||
| d18ac96cc4 | |||
| fcbee627b0 | |||
| 5b017fdad1 | |||
| 85e59e577f | |||
| f60c3337b1 | |||
| b587e38cc8 | |||
| d419c38220 | |||
| f00f0cf975 | |||
| 19e8949d86 | |||
| bee29e357e | |||
| 461b949581 | |||
| c6e2230052 | |||
| f9794850c4 | |||
| ee18ecb15e | |||
| 2aa6384f69 | |||
| e4de8e4287 | |||
| 96993755da | |||
| 30db0f9182 | |||
| 8064e87017 | |||
| ef399668c4 | |||
| ee4bf3d501 | |||
| 3bff9a6fdc |
18
.idea/copilotDiffState.xml
generated
Normal file
18
.idea/copilotDiffState.xml
generated
Normal file
File diff suppressed because one or more lines are too long
33
.idea/dataSources.xml
generated
33
.idea/dataSources.xml
generated
@@ -1,11 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||
<data-source source="LOCAL" name="@SERVERDB2019" uuid="ff4f0bad-7271-429e-a4e1-bae28629efc8">
|
||||
<data-source source="LOCAL" name="Biolevante@SERVERDB2019" uuid="ff4f0bad-7271-429e-a4e1-bae28629efc8">
|
||||
<driver-ref>sqlserver.ms</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbc-driver>
|
||||
<jdbc-url>jdbc:sqlserver://SERVERDB2019</jdbc-url>
|
||||
<jdbc-url>jdbc:sqlserver://SERVERDB2019\MSSQLSERVER;database=Biolevante</jdbc-url>
|
||||
<jdbc-additional-properties>
|
||||
<property name="com.intellij.clouds.kubernetes.db.host.port" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.container.port" />
|
||||
</jdbc-additional-properties>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
</data-source>
|
||||
<data-source source="LOCAL" name="Gramm@SERVERDB2019" uuid="02282d62-6d2a-4b83-bdcf-b558fa6db140">
|
||||
<driver-ref>sqlserver.ms</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbc-driver>
|
||||
<jdbc-url>jdbc:sqlserver://SERVERDB2019\MSSQLSERVER;database=Gramm</jdbc-url>
|
||||
<jdbc-additional-properties>
|
||||
<property name="com.intellij.clouds.kubernetes.db.host.port" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.container.port" />
|
||||
</jdbc-additional-properties>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
</data-source>
|
||||
<data-source source="LOCAL" name="vgalimenti@SERVERDB" uuid="eaf0bcaf-4620-478b-b63c-42e77902813f">
|
||||
<driver-ref>sqlserver.ms</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbc-driver>
|
||||
<jdbc-url>jdbc:sqlserver://SERVERDB\MSSQLSERVER;database=vgalimenti</jdbc-url>
|
||||
<jdbc-additional-properties>
|
||||
<property name="com.intellij.clouds.kubernetes.db.host.port" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.container.port" />
|
||||
</jdbc-additional-properties>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
</data-source>
|
||||
</component>
|
||||
|
||||
8
.idea/data_source_mapping.xml
generated
Normal file
8
.idea/data_source_mapping.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DataSourcePerFileMappings">
|
||||
<file url="file://$PROJECT_DIR$/.idea/queries/Query.sql" value="ff4f0bad-7271-429e-a4e1-bae28629efc8" />
|
||||
<file url="file://$PROJECT_DIR$/.idea/queries/Query_1.sql" value="02282d62-6d2a-4b83-bdcf-b558fa6db140" />
|
||||
<file url="file://$PROJECT_DIR$/.idea/queries/Query_2.sql" value="eaf0bcaf-4620-478b-b63c-42e77902813f" />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/db-forest-config.xml
generated
Normal file
6
.idea/db-forest-config.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="db-tree-configuration">
|
||||
<option name="data" value="---------------------------------------- 1:0:ff4f0bad-7271-429e-a4e1-bae28629efc8 2:0:02282d62-6d2a-4b83-bdcf-b558fa6db140 3:0:eaf0bcaf-4620-478b-b63c-42e77902813f " />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,9 +1,14 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="LocalDate passato a SimpleDate" />
|
||||
<option name="myName" value="LocalDate Checks" />
|
||||
<inspection_tool class="2b489e84-a2d7-30b2-9eff-e1ae310a3021" enabled="true" level="ERROR" enabled_by_default="true" />
|
||||
<inspection_tool class="3ba9f580-3fdd-3896-b2c5-a57a36bbdc46" enabled="true" level="ERROR" enabled_by_default="true" />
|
||||
<inspection_tool class="68d10b55-8d01-38ad-9579-a3dca4cd32a8" enabled="true" level="ERROR" enabled_by_default="true" editorAttributes="ERRORS_ATTRIBUTES" />
|
||||
<inspection_tool class="731e1524-8144-3953-9fa9-9ef0eb4affb5" enabled="true" level="ERROR" enabled_by_default="true" />
|
||||
<inspection_tool class="AbstractBeanReferencesInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="AccessStaticViaInstance" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ActionIsNotPreviewFriendly" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ActionPresentationInstantiatedInCtor" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="AddExplicitTargetToParameterAnnotation" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="AddOperatorModifier" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="AmbiguousNonLocalJump" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
@@ -44,6 +49,7 @@
|
||||
<inspection_tool class="AnonymousHasLambdaAlternative" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="AnonymousInnerClass" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="AopLanguageInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="ApplicationServiceAsStaticFinalFieldOrProperty" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ArgNamesErrorsInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="ArgNamesWarningsInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="AroundAdviceStyleInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@@ -69,6 +75,8 @@
|
||||
<option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,java.lang.foreign.Arena,ofAuto,java.lang.foreign.Arena,global,com.annimon.stream.Stream,of" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="BadExpressionStatementJS" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="BatchJobDomInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="BatchXmlDomInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="BigDecimalLegacyMethod" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="BigDecimalMethodWithoutRoundingCalled" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="BintrayPublishingPlugin" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@@ -143,12 +151,18 @@
|
||||
<inspection_tool class="CollectionAddedToSelf" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="CommaExpressionJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="CommentedOutCode" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="CompanionObjectInExtension" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ComparatorCombinators" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ComparatorMethodParameterNotUsed" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ComparatorResultComparison" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ComparisonOfShortAndChar" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ComparisonToNaN" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ComplexRedundantLet" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ComponentNotRegistered" enabled="false" level="WARNING" enabled_by_default="false">
|
||||
<option name="CHECK_ACTIONS" value="true" />
|
||||
<option name="IGNORE_NON_PUBLIC" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ComponentRegistrationProblems" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="ComposeErroneousRelation" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ComposeMissingKeys" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="ComposeUnknownKeys" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
@@ -229,6 +243,7 @@
|
||||
<inspection_tool class="CssUnresolvedClassInComposesRule" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="CssUnresolvedCustomProperty" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="CssUnusedSymbol" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="CsvValidation" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="CustomRegExpInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="CyclicJobDependency" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="DanglingJavadoc" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@@ -253,9 +268,11 @@
|
||||
<inspection_tool class="DeprecatedIsStillUsed" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="DeprecatedLombok" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="DeprecatedMavenDependency" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="DeprecatedStaplerJellyCustomTagAttribute" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="Deprecation" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="DestructuringWrongName" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="DevContainerIdeSettings" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="DevKitPropertiesMessageValidation" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="DevcontainerFolder" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="DialogTitleCapitalization" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="DiamondCanBeReplacedWithExplicitTypeArguments" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
@@ -349,6 +366,7 @@
|
||||
</inspection_tool>
|
||||
<inspection_tool class="EmptySynchronizedStatement" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="EmptyTryBlock" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="EmptyWebServiceClass" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="EndlessStream" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="EnhancedSwitchBackwardMigration" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="EnhancedSwitchMigration" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@@ -376,11 +394,13 @@
|
||||
<inspection_tool class="ExpressionMayBeFactorized" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="ExtendsAnnotation" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ExtendsObject" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ExtensionRegisteredAsServiceOrComponent" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="ExternalizableWithoutPublicNoArgConstructor" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ExtractMethodRecommender" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="FallThroughInSwitchStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="FieldCanBeLocal" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="FieldMayBeFinal" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="FileEqualsUsage" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="FillPermitsList" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="FilterIsInstanceCallWithClassLiteralArgument" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="FilterIsInstanceResultIsAlwaysEmpty" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@@ -403,6 +423,7 @@
|
||||
<inspection_tool class="ForLoopReplaceableByWhile" enabled="false" level="WARNING" enabled_by_default="false">
|
||||
<option name="m_ignoreLoopsWithoutConditions" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ForbiddenInSuspectContextMethod" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ForeignDelegate" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ForwardCompatibility" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="FrequentlyUsedInheritorInspection" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
@@ -578,16 +599,20 @@
|
||||
<option name="FLAG_EXPLICIT_CONVERSION" value="true" />
|
||||
<option name="IGNORE_NODESET_TO_BOOLEAN_VIA_STRING" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ImplicitlyExposedWebServiceMethods" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="IncompatibleMask" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="IncompatibleMaskJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="IncompleteDestructuring" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="InconsistentCommentForJavaParameter" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="InconsistentResourceBundle" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="InconsistentTextBlockIndent" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="IncorrectCancellationExceptionHandling" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="IncorrectDateTimeFormat" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="IncorrectHttpHeaderInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="IncorrectMessageFormat" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="IncorrectParentDisposable" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="IncorrectPluginDslStructure" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="IncorrectServiceRetrieving" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="IndexOfReplaceableByContains" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="IndexZeroUsage" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="InfiniteLoopJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@@ -600,19 +625,24 @@
|
||||
<inspection_tool class="InjectionValueTypeInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="InnerClassMayBeStatic" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="InsertLiteralUnderscores" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="InspectionDescriptionNotFoundInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="InspectionUsingGrayColors" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="InstantiatingObjectToGetClassObject" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="InstantiationOfUtilityClass" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="IntegerDivisionInFloatingPointContext" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="IntegerMultiplicationImplicitCastToLong" enabled="false" level="WARNING" enabled_by_default="false">
|
||||
<option name="ignoreNonOverflowingCompileTimeConstants" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="IntentionDescriptionNotFoundInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="InterfaceMethodClashesWithObject" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="IntroduceWhenSubject" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="InvalidComparatorMethodReference" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="InvalidIconSrc" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="IterableUsedAsVararg" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="IteratorHasNextCallsIteratorNext" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="JBoss" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="JCenterRepository" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="JComponentDataProvider" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="JSAccessibilityCheck" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="JSAnnotator" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="JSArrowFunctionBracesCanBeRemoved" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
@@ -727,6 +757,7 @@
|
||||
<inspection_tool class="JavadocReference" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="JavaeeApplicationDomInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="JdkProxiedBeanTypeInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="Jexl" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="JoinDeclarationAndAssignment" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="JoinDeclarationAndAssignmentJava" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="JpaAttributeMemberSignatureInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
@@ -763,6 +794,7 @@
|
||||
<inspection_tool class="JvmCoverageInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="KDocUnresolvedReference" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="KarmaConfigFile" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="KeymapXmlDom" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="KotlinAmbiguousActuals" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="KotlinConstantConditions" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="KotlinDoubleNegation" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
@@ -770,6 +802,8 @@
|
||||
<inspection_tool class="KotlinInvalidBundleOrProperty" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="KotlinMavenPluginPhase" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="KotlinNoActualForExpect" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="KotlinObjectExtensionRegistration" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="KotlinObjectRegisteredAsExtension" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="KotlinOptionsToCompilerOptions" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="KotlinRedundantOverride" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="KotlinTestJUnit" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@@ -795,15 +829,21 @@
|
||||
<option name="CHECK_NON_ANNOTATED_REFERENCES" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="LateinitVarOverridesLateinitVar" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="LeakableMapKey" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="LengthOneStringsInConcatenation" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="LessResolvedByNameOnly" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="LessUnresolvedMixin" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="LessUnresolvedVariable" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="LiftReturnOrAssignment" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="LightServiceMigrationCode" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="LightServiceMigrationXML" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="LightServiceMustBeFinal" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="LimitedScopeInnerClass" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="LiquibaseXmlUnresolvedProperty" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="ListIndexOfReplaceableByContains" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ListRemoveInLoop" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ListenerImplementationMustNotBeDisposable" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="LiveTemplateI18n" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="LocalVariableName" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="LogStatementNotGuardedByLogCondition" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WEAK WARNING" enabled_by_default="false">
|
||||
@@ -877,6 +917,7 @@
|
||||
<inspection_tool class="MicronautDataRepositoryMethodReturnType" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="MigrateFromJavaLangIo" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="MigrateToJavaLangIo" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="MigrateToOptControl" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="MimeType" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="MinMaxValuesInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="MismatchedArrayReadWrite" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@@ -892,9 +933,12 @@
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="MismatchedJavadocCode" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="MismatchedLightServiceLevelAndCtor" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="MismatchedStringBuilderQueryUpdate" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="MismatchedStringCase" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="MisorderedAssertEqualsArguments" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="MissingAccessibleContext" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="MissingActionUpdateThread" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="MissingAspectjAutoproxyInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="MissingDeprecatedAnnotationOnScheduledForRemovalApi" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="MissingFinalNewline" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
@@ -902,6 +946,7 @@
|
||||
<option name="ignoreObjectMethods" value="true" />
|
||||
<option name="ignoreAnonymousClassMethods" value="false" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="MissingRecentApi" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="MissingSerialAnnotation" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="MissortedModifiers" enabled="false" level="INFORMATION" enabled_by_default="false">
|
||||
<option name="m_requireAnnotationsFirst" value="true" />
|
||||
@@ -945,8 +990,10 @@
|
||||
<inspection_tool class="NodeCoreCodingAssistance" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="NonAsciiCharacters" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="NonAtomicOperationOnVolatileField" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="NonDefaultConstructor" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="NonExtendableApiUsage" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="NonFinalFieldInEnum" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="NonJaxWsWebServices" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="NonSerializableWithSerialVersionUIDField" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="NonStrictComparisonCanBeEquality" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="NotNullFieldNotInitialized" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@@ -980,6 +1027,7 @@
|
||||
<inspection_tool class="ObviousNullCheck" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="OctalLiteral" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="OneToOneWithLazy" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="OneWayWebMethod" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="OnlyOneElementUsed" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="OpenRewriteYamlRecipe" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="OptionalAssignedToNull" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@@ -994,6 +1042,7 @@
|
||||
<inspection_tool class="OverflowingLoopIndex" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="OverrideOnly" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="OverwrittenKey" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PSScriptAnalyzer" enabled="false" level="SERVER PROBLEM" enabled_by_default="false" />
|
||||
<inspection_tool class="PackageDirectoryMismatch" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PackageInfoWithoutPackage" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PackageJsonMismatchedDependency" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@@ -1010,6 +1059,12 @@
|
||||
<inspection_tool class="PatternVariablesCanBeReplacedWithCast" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="PbDuplicatedImports" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PgSelectFromProcedureInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PluginXmlCapitalization" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PluginXmlDynamicPlugin" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PluginXmlExtensionRegistration" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PluginXmlI18n" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PluginXmlPluginLogo" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PluginXmlValidity" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="PointcutMethodStyleInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PointlessArithmeticExpression" enabled="false" level="WARNING" enabled_by_default="false">
|
||||
<option name="m_ignoreExpressionsContainingConstants" value="true" />
|
||||
@@ -1027,22 +1082,27 @@
|
||||
<inspection_tool class="PostCssCustomSelector" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="PostCssMediaRange" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="PostCssUnresolvedModuleValueReference" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="PostfixTemplateDescriptionNotFound" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="PreferCurrentCoroutineContextToCoroutineContext" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PresentationAnnotation" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="PreviewFeature" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PrimitiveArrayArgumentToVariableArgMethod" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PrivatePropertyName" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PropertyName" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ProtectedInFinal" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ProtectedMemberInFinalClass" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PsiElementConcatenation" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PublicField" enabled="false" level="INFORMATION" enabled_by_default="false">
|
||||
<option name="ignoreEnums" value="false" />
|
||||
<option name="ignorableAnnotations">
|
||||
<value />
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PublicTestExtensionFunction" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="QsPrivateBeanMembersInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="QsProperties" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="QsYaml" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="QuickFixGetFamilyNameViolation" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="RawUseOfParameterizedType" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ReactiveStreamsNullableInLambdaInTransform" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ReactiveStreamsPublisherImplementation" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@@ -1189,6 +1249,7 @@
|
||||
<inspection_tool class="ReplaceWithIgnoreCaseEquals" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ReplaceWithJavadoc" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="ReplaceWithOperatorAssignment" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="RequiredArtifactTypeInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="RequiredAttributes" enabled="false" level="WARNING" enabled_by_default="false">
|
||||
<option name="myAdditionalRequiredHtmlAttributes" value="" />
|
||||
</inspection_tool>
|
||||
@@ -1203,11 +1264,31 @@
|
||||
<inspection_tool class="RunBlocking" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="RunBlockingInSuspendFunction" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="SSBasedInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<searchConfiguration name="Date equals LocalDate inspection" text="$d1$.equals($d2$)" recursive="true" caseInsensitive="false" type="JAVA" pattern_context="default">
|
||||
<constraint name="__context__" within="" contains="" />
|
||||
<constraint name="d1" nameOfExprType="java\.util\.Date" within="" contains="" />
|
||||
<constraint name="d2" nameOfExprType="java\.time\.LocalDate" within="" contains="" />
|
||||
</searchConfiguration>
|
||||
<searchConfiguration name="Date equals LocalDateTime inspection" text="$d1$.equals($d2$)" recursive="true" caseInsensitive="false" type="JAVA" pattern_context="default">
|
||||
<constraint name="__context__" within="" contains="" />
|
||||
<constraint name="d1" nameOfExprType="java\.util\.Date" within="" contains="" />
|
||||
<constraint name="d2" nameOfExprType="java\.time\.LocalDateTime" within="" contains="" />
|
||||
</searchConfiguration>
|
||||
<searchConfiguration name="LocalDate equals Date inspection" text="$d1$.equals($d2$)" recursive="true" caseInsensitive="false" type="JAVA" pattern_context="default">
|
||||
<constraint name="__context__" within="" contains="" />
|
||||
<constraint name="d1" nameOfExprType="java\.time\.LocalDate" within="" contains="" />
|
||||
<constraint name="d2" nameOfExprType="java\.util\.Date" within="" contains="" />
|
||||
</searchConfiguration>
|
||||
<searchConfiguration name="LocalDate passato a SimpleDateFormat" text="$formatter$.format($date$)" recursive="true" caseInsensitive="true" type="JAVA" pattern_context="default">
|
||||
<constraint name="__context__" within="" contains="" />
|
||||
<constraint name="formatter" nameOfExprType="java\.text\.SimpleDateFormat" within="" contains="" />
|
||||
<constraint name="date" nameOfExprType="java\.time\.LocalDate" within="" contains="" />
|
||||
</searchConfiguration>
|
||||
<searchConfiguration name="LocalDateTime equals Date inspection" text="$d1$.equals($d2$)" recursive="true" caseInsensitive="false" type="JAVA" pattern_context="default">
|
||||
<constraint name="__context__" within="" contains="" />
|
||||
<constraint name="d1" nameOfExprType="java\.time\.LocalDateTime" within="" contains="" />
|
||||
<constraint name="d2" nameOfExprType="java\.util\.Date" within="" contains="" />
|
||||
</searchConfiguration>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="SafeCastWithReturn" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="SafeVarargsDetector" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@@ -1242,6 +1323,7 @@
|
||||
<inspection_tool class="SimplifiableCallChain" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="SimplifiableConditionalExpression" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="SimplifiableIfStatement" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="SimplifiableServiceRetrieving" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="SimplifyAssertNotNull" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="SimplifyBooleanWithConstants" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="SimplifyCollector" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@@ -1391,7 +1473,9 @@
|
||||
<inspection_tool class="SqlUnusedSubqueryItemInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="SqlUnusedVariableInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="SqlWithoutWhereInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="StatefulEp" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="StaticImportCanBeUsed" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="StaticInitializationInExtensions" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="StaticInitializerReferencesSubClass" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="StaticMethodImportLombok" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="StreamToLoop" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
@@ -1477,6 +1561,7 @@
|
||||
<inspection_tool class="ThymeleafMessagesResolveInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="ThymeleafVariablesResolveInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ToArrayCallWithZeroLengthArrayArgument" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="TokenSetInParserDefinition" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="TomlUnresolvedReference" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="TooBroadScope" enabled="false" level="INFORMATION" enabled_by_default="false">
|
||||
<option name="m_allowConstructorAsInitializer" value="false" />
|
||||
@@ -1513,8 +1598,10 @@
|
||||
<inspection_tool class="TypeScriptUnresolvedReference" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="TypeScriptValidateGenericTypes" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="TypeScriptValidateTypes" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="UElementAsPsi" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UNCHECKED_WARNING" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UNUSED_IMPORT" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UastHintedVisitorAdapterHints" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UastIncorrectHttpHeaderInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UastIncorrectMimeTypeInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="UnaryPlus" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@@ -1524,8 +1611,10 @@
|
||||
<inspection_tool class="UndefinedJob" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="UndefinedParamsPresent" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UndefinedStage" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="UndesirableClassUsage" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UnfinishedStepVerifier" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UnhandledExceptionInJSP" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UnknownIdInMetaInformation" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="UnknownLanguage" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="UnnecessarilyQualifiedInnerClassAccess" enabled="false" level="INFORMATION" enabled_by_default="false">
|
||||
<option name="ignoreReferencesNeedingImport" value="false" />
|
||||
@@ -1585,10 +1674,14 @@
|
||||
<inspection_tool class="UnreachableCatch" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UnreachableCodeJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UnresolvedMessageChannel" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UnresolvedPluginConfigReference" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="UnresolvedPropertyKey" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="UnresolvedReference" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="UnresolvedRestParam" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="UnsafeReturnStatementVisitor" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UnsafeVfsRecursion" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UnsatisfiedRange" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UnspecifiedActionsPlace" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UnstableApiUsage" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UnsupportedCharacter" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UnsupportedChronoFieldUnitCall" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@@ -1615,12 +1708,20 @@
|
||||
<inspection_tool class="UsagesOfObsoleteApi" enabled="false" level="TEXT ATTRIBUTES" enabled_by_default="false" />
|
||||
<inspection_tool class="UseBulkOperation" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UseCompareMethod" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UseDPIAwareBorders" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UseDPIAwareInsets" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UseExpressionBody" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="UseHashCodeMethodInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UseJBColor" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UsePlatformProcessAwaitExit" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="UsePluginIdEquals" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UsePrimitiveTypes" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UsePropertyAccessSyntax" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UseVirtualFileEquals" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UselessCallOnCollection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UselessCallOnNotNull" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="UtilSchemaInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="ValidExternallyBoundObject" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="VarargParameter" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="VariableInitializerIsRedundant" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="VariableNeverRead" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@@ -1640,6 +1741,7 @@
|
||||
<inspection_tool class="VulnerableCodeUsages" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="VulnerableLibrariesGlobal" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="VulnerableLibrariesLocal" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="WSReferenceInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="WadlDomInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="WaitWhileHoldingTwoLocks" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="WebProperties" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
@@ -1651,11 +1753,15 @@
|
||||
<option name="ignoreNonEmtpyLoops" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="WithStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="WorkspaceEntityMutableField" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="WorkspaceImplAbsent" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="WorkspaceImplObsolete" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="WrapUnaryOperator" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="WrapperTypeMayBePrimitive" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="WriteOnlyObject" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="WrongPackageStatement" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="WrongPropertyKeyValueDelimiter" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="WsdlHighlightingInspection" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="XmlDefaultAttributeValue" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="XmlDeprecatedElement" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="XmlDuplicatedId" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
@@ -1677,6 +1783,21 @@
|
||||
<inspection_tool class="YAMLSchemaValidation" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="YAMLUnresolvedAlias" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="YAMLUnusedAnchor" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="checkReturnValue" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="checkedExceptions" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="com.intellij.jpa.jpb.model.DataClassEqualsAndHashCodeInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="com.intellij.jpb.CompositeIdClassSerializable" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="com.intellij.jpb.ConverterSpecifiedIncorrectlyInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="com.intellij.jpb.DuplicateVersionAnnotationInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="com.intellij.jpb.EntityIdMissingInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="com.intellij.jpb.IncompatibleTableAnnotationInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="com.intellij.jpb.LombokDataInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="com.intellij.jpb.LombokEqualsAndHashCodeInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="com.intellij.jpb.LombokToStringIncludeInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="com.intellij.jpb.LombokToStringInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="com.intellij.jpb.NoArgsConstructorInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="com.intellij.jpb.UnsupportedTypeWithoutConverterInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="d539a2c0-2ebf-35d7-921f-25a581173971" enabled="true" level="ERROR" enabled_by_default="true" />
|
||||
<inspection_tool class="dependsOnMethodTestNG" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="groupsTestNG" enabled="false" level="WARNING" enabled_by_default="false">
|
||||
<option name="groups">
|
||||
2485
.idea/inspectionProfiles/Project_Default.xml
generated
2485
.idea/inspectionProfiles/Project_Default.xml
generated
File diff suppressed because it is too large
Load Diff
6
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
6
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="PROJECT_PROFILE" value="LocalDate Checks" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
5
.idea/jarRepositories.xml
generated
5
.idea/jarRepositories.xml
generated
@@ -1,6 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="central" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
|
||||
8
.idea/sqldialects.xml
generated
Normal file
8
.idea/sqldialects.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="SqlDialectMappings">
|
||||
<file url="file://$PROJECT_DIR$/.idea/queries/Query.sql" dialect="TSQL" />
|
||||
<file url="file://$PROJECT_DIR$/.idea/queries/Query_1.sql" dialect="TSQL" />
|
||||
<file url="file://$PROJECT_DIR$/.idea/queries/Query_2.sql" dialect="TSQL" />
|
||||
</component>
|
||||
</project>
|
||||
20
.idea/structuralSearch.xml
generated
20
.idea/structuralSearch.xml
generated
@@ -6,5 +6,25 @@
|
||||
<constraint name="formatter" nameOfExprType="java\.text\.SimpleDateFormat" within="" contains="" />
|
||||
<constraint name="date" nameOfExprType="java\.time\.LocalDate" within="" contains="" />
|
||||
</searchConfiguration>
|
||||
<searchConfiguration name="LocalDate equals java.util.Date inspection" text="$d1$.equals($d2$)" recursive="true" caseInsensitive="false" type="JAVA" pattern_context="default">
|
||||
<constraint name="__context__" within="" contains="" />
|
||||
<constraint name="d1" nameOfExprType="java\.time\.LocalDate" within="" contains="" />
|
||||
<constraint name="d2" nameOfExprType="java\.util\.Date" within="" contains="" />
|
||||
</searchConfiguration>
|
||||
<searchConfiguration name="java.util.Date equals LocalDate inspection" text="$d1$.equals($d2$)" recursive="true" caseInsensitive="false" type="JAVA" pattern_context="default">
|
||||
<constraint name="__context__" within="" contains="" />
|
||||
<constraint name="d1" nameOfExprType="java\.util\.Date" within="" contains="" />
|
||||
<constraint name="d2" nameOfExprType="java\.time\.LocalDate" within="" contains="" />
|
||||
</searchConfiguration>
|
||||
<searchConfiguration name="java.util.Date equals LocalDateTime inspection" text="$d1$.equals($d2$)" recursive="true" caseInsensitive="false" type="JAVA" pattern_context="default">
|
||||
<constraint name="__context__" within="" contains="" />
|
||||
<constraint name="d1" nameOfExprType="java\.util\.Date" within="" contains="" />
|
||||
<constraint name="d2" nameOfExprType="java\.time\.LocalDateTime" within="" contains="" />
|
||||
</searchConfiguration>
|
||||
<searchConfiguration name="LocalDateTime equals java.util.Date inspection" text="$d1$.equals($d2$)" recursive="true" caseInsensitive="false" type="JAVA" pattern_context="default">
|
||||
<constraint name="__context__" within="" contains="" />
|
||||
<constraint name="d1" nameOfExprType="java\.time\.LocalDateTime" within="" contains="" />
|
||||
<constraint name="d2" nameOfExprType="java\.util\.Date" within="" contains="" />
|
||||
</searchConfiguration>
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,18 +0,0 @@
|
||||
FROM tomcat:9-jre8-alpine
|
||||
|
||||
RUN apk add --no-cache fontconfig ttf-dejavu
|
||||
|
||||
ENV TZ="Europe/Rome"
|
||||
ENV JAVA_OPTS="-DDISABLE_DROOLS_COMPILE=TRUE -Xms512M -Xmx1G -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
|
||||
ENV USERDOMAIN="STUDIO-ML"
|
||||
|
||||
COPY docker/tomcat/conf/integry/ems.properties /usr/local/tomcat/conf/integry/
|
||||
COPY docker/tomcat/conf/integry/ems_automated_operations.json /usr/local/tomcat/conf/integry/
|
||||
COPY docker/tomcat/conf/integry/ems_settings.json /usr/local/tomcat/conf/integry/
|
||||
COPY ems-engine/target/ems-api.war /usr/local/tomcat/webapps/
|
||||
|
||||
#COPY docker/FontTest.class .
|
||||
#ENTRYPOINT ["java","FontTest"]
|
||||
|
||||
EXPOSE 8080
|
||||
EXPOSE 5005
|
||||
42
Dockerfile
42
Dockerfile
@@ -1,11 +1,45 @@
|
||||
FROM tomcat:9-jre8-alpine
|
||||
|
||||
RUN apk add --no-cache fontconfig ttf-dejavu
|
||||
FROM tomcat:9-jre8
|
||||
|
||||
ENV TZ="Europe/Rome"
|
||||
ENV JAVA_OPTS="-DDISABLE_DROOLS_COMPILE=TRUE -Xms512M -Xmx1G -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
|
||||
ENV JAVA_OPTS="-DDISABLE_DROOLS_COMPILE=TRUE -Xms512M -Xmx2G -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
|
||||
ENV USERDOMAIN="STUDIO-ML"
|
||||
|
||||
# Install Samba
|
||||
RUN apt-get update && \
|
||||
apt-get install -y samba samba-common-bin && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Ensure log directory exists and is readable
|
||||
RUN mkdir -p /usr/local/tomcat/logs && \
|
||||
chmod -R 755 /usr/local/tomcat/logs
|
||||
|
||||
# Create samba user (no login) and add to root group
|
||||
RUN useradd -M -s /usr/sbin/nologin sambauser && \
|
||||
printf "sambapass\nsambapass\n" | smbpasswd -a -s sambauser && \
|
||||
usermod -aG root sambauser
|
||||
|
||||
# Samba configuration
|
||||
RUN printf "\
|
||||
[global]\n\
|
||||
workgroup = STUDIO-ML\n\
|
||||
security = user\n\
|
||||
map to guest = never\n\
|
||||
server role = standalone server\n\
|
||||
unix extensions = no\n\
|
||||
client min protocol = NT1\n\
|
||||
\n\
|
||||
[tomcat-logs]\n\
|
||||
comment = Tomcat logs (read-only)\n\
|
||||
path = /usr/local/tomcat/logs\n\
|
||||
browseable = yes\n\
|
||||
read only = yes\n\
|
||||
guest ok = no\n\
|
||||
valid users = sambauser\n\
|
||||
force user = root\n\
|
||||
create mask = 0644\n\
|
||||
directory mask = 0755\n\
|
||||
" > /etc/samba/smb.conf
|
||||
|
||||
COPY docker/tomcat/conf/integry/ems.properties /usr/local/tomcat/conf/integry/
|
||||
COPY docker/tomcat/conf/integry/ems_automated_operations.json /usr/local/tomcat/conf/integry/
|
||||
COPY docker/tomcat/conf/integry/ems_settings.json /usr/local/tomcat/conf/integry/
|
||||
|
||||
@@ -42,7 +42,7 @@ pipeline {
|
||||
bat(script: 'mvn clean install -t toolchains-jenkins.xml', returnStdout: true)
|
||||
archiveArtifacts(artifacts: 'ems-engine/target/ems-api.war', onlyIfSuccessful: true)
|
||||
}
|
||||
stash includes: 'ems-engine/target/ems-api.war,docker/**,Containerfile', name: 'container-files'
|
||||
stash includes: 'ems-engine/target/ems-api.war,docker/**,Dockerfile', name: 'container-files'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ sleep 10''', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaul
|
||||
}
|
||||
|
||||
// bat "docker buildx build --platform linux/amd64,linux/arm64 --push -t \"git.studioml.it/integry/ems-api${branchVersion}:latest\" ."
|
||||
bat "podman build -f .\\Containerfile -t \"git.studioml.it/integry/ems-api${branchVersion}:latest\" ."
|
||||
bat "podman build -t \"git.studioml.it/integry/ems-api${branchVersion}:latest\" ."
|
||||
bat "podman push \"git.studioml.it/integry/ems-api${branchVersion}:latest\""
|
||||
|
||||
//containerImageLink "git.studioml.it/integry/ems-api-${env.GIT_BRANCH.toLowerCase().replace('/', '-')}:latest}"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -229,6 +229,11 @@
|
||||
<artifactId>arial-rounded</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>it.integry.font</groupId>
|
||||
<artifactId>NotoSerif</artifactId>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.groovy</groupId>
|
||||
@@ -399,6 +404,17 @@
|
||||
<artifactId>spring-orm</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-jpa</artifactId>
|
||||
<version>2.7.18</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
<version>5.6.15.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context-support</artifactId>
|
||||
|
||||
@@ -11,6 +11,7 @@ public class CommonConstants {
|
||||
|
||||
public static final String INTEGRY = "integry";
|
||||
public static final String PROFILE_DB = "profileDb";
|
||||
public static final String COD_MDEP = "codMdep";
|
||||
public static final String WHERE_COND = "whereCond";
|
||||
public static final String EMPTY_STRING = "";
|
||||
|
||||
@@ -20,6 +21,7 @@ public class CommonConstants {
|
||||
public static final String TIMESTAMP = "timestamp";
|
||||
|
||||
|
||||
public static final String DATE_FORMAT_YMD_SLASHED = "yyyy/MM/dd";
|
||||
public static final String DATE_FORMAT_YMD = "yyyy-MM-dd";
|
||||
public static final String DATE_FORMAT_DMY = "dd/MM/yyyy";
|
||||
public static final String DATE_FORMAT_DMY_DASHED = "dd-MM-yyyy";
|
||||
@@ -27,7 +29,7 @@ public class CommonConstants {
|
||||
|
||||
public static final String TIME_FORMAT = "HH:mm:ss";
|
||||
|
||||
public static final String DATETIME_FORMAT_YMD = String.format("%s %s", DATE_FORMAT_YMD, TIME_FORMAT);
|
||||
public static final String DATETIME_FORMAT_YMD = String.format("%s %s", DATE_FORMAT_YMD_SLASHED, TIME_FORMAT);
|
||||
public static final String DATETIME_FORMAT_DMY = String.format("%s %s", DATE_FORMAT_DMY_DASHED, TIME_FORMAT);
|
||||
public static final String DATETIME_FORMAT_DMY_SLASHED = String.format("%s %s", DATE_FORMAT_DMY, TIME_FORMAT);
|
||||
public static final String DATETIME_FORMAT_DMY_DASHED = String.format("%s %s", DATE_FORMAT_DMY_DASHED, TIME_FORMAT);
|
||||
@@ -46,6 +48,10 @@ public class CommonConstants {
|
||||
.withZone(ZoneId.systemDefault());
|
||||
|
||||
|
||||
public static final DateTimeFormatter DATE_YMD_SLASHED_FORMATTER = DateTimeFormatter.ofPattern(CommonConstants.DATE_FORMAT_YMD_SLASHED)
|
||||
.withZone(ZoneId.systemDefault());
|
||||
public static final DateTimeFormatter DATETIME_YMD_SLASHED_FORMATTER = DateTimeFormatter.ofPattern(CommonConstants.DATETIME_FORMAT_YMD)
|
||||
.withZone(ZoneId.systemDefault());
|
||||
public static final DateTimeFormatter DATE_YMD_DASHED_FORMATTER = DateTimeFormatter.ofPattern(CommonConstants.DATE_FORMAT_YMD)
|
||||
.withZone(ZoneId.systemDefault());
|
||||
public static final DateTimeFormatter DATETIME_YMD_DASHED_FORMATTER = DateTimeFormatter.ofPattern(CommonConstants.DATETIME_FORMAT_YMD)
|
||||
@@ -53,6 +59,8 @@ public class CommonConstants {
|
||||
|
||||
public static final DateTimeFormatter DATE_DMY_SLASHED_FORMATTER = DateTimeFormatter.ofPattern(CommonConstants.DATE_FORMAT_DMY)
|
||||
.withZone(ZoneId.systemDefault());
|
||||
public static final DateTimeFormatter DATE_DMY_DASHED_FORMATTER = DateTimeFormatter.ofPattern(CommonConstants.DATE_FORMAT_DMY_DASHED)
|
||||
.withZone(ZoneId.systemDefault());
|
||||
public static final DateTimeFormatter DATETIME_DMY_SLASHED_FORMATTER = DateTimeFormatter.ofPattern(CommonConstants.DATETIME_FORMAT_DMY_SLASHED)
|
||||
.withZone(ZoneId.systemDefault());
|
||||
public static final DateTimeFormatter DATETIME_DMY_DASHED_FORMATTER = DateTimeFormatter.ofPattern(CommonConstants.DATETIME_FORMAT_DMY_DASHED)
|
||||
|
||||
@@ -69,7 +69,6 @@ public class EmsCoreDBLoader {
|
||||
try (MultiDBTransactionManager multiDBTransactionManager = new MultiDBTransactionManager(connectionPool)){
|
||||
discoverAllConnections(multiDBTransactionManager);
|
||||
setupAzienda(multiDBTransactionManager);
|
||||
userCacheService.discoverAllUsers(multiDBTransactionManager);
|
||||
|
||||
if (onComplete != null) onComplete.run(multiDBTransactionManager);
|
||||
} catch (Exception ex) {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package it.integry.ems.adapter;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
import it.integry.ems_model.config.EmsRestConstants;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class LongDeserializer extends JsonDeserializer<Long> {
|
||||
|
||||
@Override
|
||||
public Long deserialize(JsonParser parser, DeserializationContext context)
|
||||
throws IOException {
|
||||
String string = parser.getText();
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(string)) {
|
||||
if (string.equalsIgnoreCase("null")) {
|
||||
return EmsRestConstants.LONG_NULL;
|
||||
}
|
||||
return new Long(string);
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ public class ExecutorServiceConfig {
|
||||
|
||||
private final int corePoolSize = Runtime.getRuntime().availableProcessors();
|
||||
private final int maxPoolSize = (int) (corePoolSize * 1.5f);
|
||||
private final int queueSize = 500;
|
||||
private final int queueSize = 1_000_000;
|
||||
|
||||
@Bean
|
||||
public ExecutorService taskExecutor() {
|
||||
|
||||
@@ -793,9 +793,8 @@ public class EmsController {
|
||||
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_DOWNLOAD_STB_EMAIL_CONTENT, method = RequestMethod.GET)
|
||||
public byte[] downloadStbEmailContent(HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@RequestParam Integer idEmail) throws Exception {
|
||||
public ResponseEntity<byte[]> downloadStbEmailContent(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@RequestParam Integer idEmail) throws Exception {
|
||||
StbEmailContent stbEmailContent = new StbEmailContent();
|
||||
stbEmailContent.setIdEmail(idEmail);
|
||||
stbEmailContent.setOperation(OperationType.SELECT_OBJECT);
|
||||
@@ -803,11 +802,7 @@ public class EmsController {
|
||||
stbEmailContent = entityProcessor.processEntity(stbEmailContent, multiDBTransactionManager);
|
||||
|
||||
if (stbEmailContent != null) {
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
response.addHeader(HttpHeaders.CONTENT_DISPOSITION, ContentDisposition.attachment().filename("email.eml").build().toString());
|
||||
|
||||
byte[] byteArr = null;
|
||||
byte[] byteArr;
|
||||
|
||||
String pattern = "[^\\x00-\\x7F]";
|
||||
Pattern pat = Pattern.compile(pattern);
|
||||
@@ -819,13 +814,18 @@ public class EmsController {
|
||||
byteArr = Base64.decodeBase64(stbEmailContent.getEmailContent());
|
||||
}
|
||||
|
||||
response.setContentLength(byteArr != null ? byteArr.length : 0);
|
||||
return byteArr;
|
||||
|
||||
return ResponseEntity.ok()
|
||||
.contentType(MediaType.APPLICATION_OCTET_STREAM)
|
||||
.contentLength(byteArr != null ? byteArr.length : 0)
|
||||
.header(HttpHeaders.CONTENT_DISPOSITION, ContentDisposition
|
||||
.builder("attachment")
|
||||
.filename("email.eml")
|
||||
.build()
|
||||
.toString())
|
||||
.body(byteArr);
|
||||
}
|
||||
|
||||
response.sendError(404, "Allegato non trovato");
|
||||
return null;
|
||||
return ResponseEntity.notFound().build();
|
||||
}
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_DOWNLOAD_DTB_DOC_PDF, method = RequestMethod.GET)
|
||||
@@ -884,12 +884,13 @@ public class EmsController {
|
||||
}
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_DOWNLOAD_DTB_ORD_PDF, method = RequestMethod.GET)
|
||||
public byte[] downloadDtbOrdPdf(HttpServletRequest request, HttpServletResponse response,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@RequestParam String gestione,
|
||||
@RequestParam String dataOrd,
|
||||
@RequestParam Integer numOrd,
|
||||
@RequestParam Integer versione) throws Exception {
|
||||
public ResponseEntity<byte[]> downloadDtbOrdPdf(
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@RequestParam String gestione,
|
||||
@RequestParam String dataOrd,
|
||||
@RequestParam Integer numOrd,
|
||||
@RequestParam Integer versione) throws Exception {
|
||||
|
||||
DtbOrdPdf dtbOrdPdf = new DtbOrdPdf();
|
||||
dtbOrdPdf.setGestione(gestione);
|
||||
dtbOrdPdf.setDataOrd(UtilityDate.RecognizeDate(dataOrd));
|
||||
@@ -900,17 +901,20 @@ public class EmsController {
|
||||
dtbOrdPdf = entityProcessor.processEntity(dtbOrdPdf, multiDBTransactionManager);
|
||||
|
||||
if (dtbOrdPdf != null) {
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
response.addHeader(HttpHeaders.CONTENT_DISPOSITION, ContentDisposition.attachment().filename(dtbOrdPdf.getFilename()).build().toString());
|
||||
|
||||
byte[] byteArr = dtbOrdPdf.getFilecontentByteArr(true);
|
||||
response.setContentLength(byteArr != null ? byteArr.length : 0);
|
||||
return byteArr;
|
||||
|
||||
return ResponseEntity.ok()
|
||||
.contentType(MediaType.APPLICATION_PDF)
|
||||
.contentLength(byteArr != null ? byteArr.length : 0)
|
||||
.header(HttpHeaders.CONTENT_DISPOSITION, ContentDisposition
|
||||
.builder("attachment")
|
||||
.filename(ContentDisposition.attachment().filename(dtbOrdPdf.getFilename()).build().toString())
|
||||
.build()
|
||||
.toString())
|
||||
.body(byteArr);
|
||||
}
|
||||
|
||||
response.sendError(404, "Allegato non trovato");
|
||||
return null;
|
||||
return ResponseEntity.notFound().build();
|
||||
}
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_UPLOAD_STB_FILE_ATTACHMENT, method = RequestMethod.POST)
|
||||
|
||||
@@ -60,7 +60,11 @@ public class DbmsChangeTracker {
|
||||
createConnection();
|
||||
} catch (SQLException e) {
|
||||
try {
|
||||
integryConnection.close();
|
||||
try {
|
||||
integryConnection.close();
|
||||
} catch (Exception ex) {
|
||||
//ignore
|
||||
}
|
||||
createConnection();
|
||||
} catch (SQLException ex) {
|
||||
logger.error("Unable to reestablish DB connection for Change Tracker", ex);
|
||||
@@ -132,21 +136,25 @@ public class DbmsChangeTracker {
|
||||
|
||||
final List<String> trackedTables = retrieveTrackedTables();
|
||||
|
||||
HashMap<Long, DetectedChangeDataDTO> changesByVersion = new HashMap<>();
|
||||
HashMap<Long, List<DetectedChangeDataDTO>> changesByVersion = new HashMap<>();
|
||||
|
||||
for (String trackedTable : trackedTables) {
|
||||
long minValidVersion = getMinValidVersion(trackedTable);
|
||||
if (currentVersion < minValidVersion) {
|
||||
throw new SQLException("Change Tracking on table " + trackedTable + " has been reset. Current version: " + currentVersion + ", Min valid version: " + minValidVersion);
|
||||
}
|
||||
|
||||
if (currentVersion < minValidVersion) {
|
||||
if (eventListener != null) {
|
||||
eventListener.onTrackingResetted();
|
||||
currentVersion = retrieveCurrentVersion();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
final List<DetectedChangeDataDTO> detectedChanges = retrieveChangeList(trackedTable);
|
||||
|
||||
detectedChanges.forEach(detectedChangeDataDTO -> {
|
||||
changesByVersion.put(detectedChangeDataDTO.getSysChangeVersion(), detectedChangeDataDTO);
|
||||
changesByVersion.putIfAbsent(detectedChangeDataDTO.getSysChangeVersion(), new ArrayList<>());
|
||||
changesByVersion.get(detectedChangeDataDTO.getSysChangeVersion()).add(detectedChangeDataDTO);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
logTrace("Detected " + changesByVersion.size() + " changes since version " + currentVersion);
|
||||
@@ -154,32 +162,33 @@ public class DbmsChangeTracker {
|
||||
dispatchChanges(changesByVersion);
|
||||
}
|
||||
|
||||
private void dispatchChanges(HashMap<Long, DetectedChangeDataDTO> changesByVersion) throws Exception {
|
||||
private void dispatchChanges(HashMap<Long, List<DetectedChangeDataDTO>> changesByVersion) throws Exception {
|
||||
final List<Long> sortedChanges = changesByVersion.keySet().stream()
|
||||
.sorted()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
for (Long changeId : sortedChanges) {
|
||||
final DetectedChangeDataDTO detectedChange = changesByVersion.get(changeId);
|
||||
final List<DetectedChangeDataDTO> detectedChanges = changesByVersion.get(changeId);
|
||||
|
||||
switch (detectedChange.getSysChangeOperation()) {
|
||||
case INSERT:
|
||||
if (eventListener != null)
|
||||
eventListener.onInsertDetected(detectedChange.getTableName(), detectedChange.getPrimaryKey());
|
||||
break;
|
||||
for (DetectedChangeDataDTO detectedChange : detectedChanges) {
|
||||
switch (detectedChange.getSysChangeOperation()) {
|
||||
case INSERT:
|
||||
if (eventListener != null)
|
||||
eventListener.onInsertDetected(detectedChange.getTableName(), detectedChange.getPrimaryKey());
|
||||
break;
|
||||
|
||||
case UPDATE:
|
||||
if (eventListener != null)
|
||||
eventListener.onUpdateDetected(detectedChange.getTableName(), detectedChange.getPrimaryKey());
|
||||
break;
|
||||
case UPDATE:
|
||||
if (eventListener != null)
|
||||
eventListener.onUpdateDetected(detectedChange.getTableName(), detectedChange.getPrimaryKey());
|
||||
break;
|
||||
|
||||
case DELETE:
|
||||
if (eventListener != null)
|
||||
eventListener.onDeleteDetected(detectedChange.getTableName(), detectedChange.getPrimaryKey());
|
||||
break;
|
||||
case DELETE:
|
||||
if (eventListener != null)
|
||||
eventListener.onDeleteDetected(detectedChange.getTableName(), detectedChange.getPrimaryKey());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
currentVersion = changeId;
|
||||
}
|
||||
}
|
||||
@@ -287,5 +296,7 @@ public class DbmsChangeTracker {
|
||||
void onUpdateDetected(String tableName, HashMap<String, Object> primaryKey) throws Exception;
|
||||
|
||||
void onDeleteDetected(String tableName, HashMap<String, Object> primaryKey) throws Exception;
|
||||
|
||||
void onTrackingResetted() throws Exception;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,18 +5,17 @@ import it.integry.annotations.PostContextConstruct;
|
||||
import it.integry.ems.dbms_change_tracker.model.events.TableRecordDeletedEvent;
|
||||
import it.integry.ems.dbms_change_tracker.model.events.TableRecordInsertedEvent;
|
||||
import it.integry.ems.dbms_change_tracker.model.events.TableRecordUpdatedEvent;
|
||||
import it.integry.ems.dbms_change_tracker.model.events.TableTrackingResettedEvent;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems_model.entity.*;
|
||||
import it.integry.ems_model.exception.DataConverterNotFoundException;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -29,12 +28,14 @@ public class DbmsChangeTrackerComponent {
|
||||
private final HashMap<IntegryCustomerDB, DbmsChangeTracker> activeChangeTrackers = new HashMap<>();
|
||||
|
||||
private final ArrayList<String> trackedTables = new ArrayList<String>() {{
|
||||
add(MtbAart.ENTITY);
|
||||
add(MtbAartBarCode.ENTITY);
|
||||
add(MtbUntMis.ENTITY);
|
||||
add(MtbDepo.ENTITY);
|
||||
add(MtbDepoPosizioni.ENTITY);
|
||||
add(StbEditLimit.ENTITY);
|
||||
add(StbGestSetup.ENTITY);
|
||||
add(StbGestSetupDepo.ENTITY);
|
||||
add(StbUser.ENTITY);
|
||||
add(WtbClie.ENTITY);
|
||||
add(WtbDepo.ENTITY);
|
||||
add(WtbGestSetupUser.ENTITY);
|
||||
}};
|
||||
|
||||
@@ -60,37 +61,47 @@ public class DbmsChangeTrackerComponent {
|
||||
}
|
||||
|
||||
|
||||
private void enableAllChangeTracking() throws SQLException, DataConverterNotFoundException, InstantiationException, IllegalAccessException {
|
||||
private void enableAllChangeTracking() throws Exception {
|
||||
for (Map.Entry<IntegryCustomerDB, DbmsChangeTracker> entrySet : activeChangeTrackers.entrySet()) {
|
||||
IntegryCustomerDB customerDB = entrySet.getKey();
|
||||
DbmsChangeTracker dbmsChangeTracker = entrySet.getValue();
|
||||
final IntegryCustomerDB customerDB = entrySet.getKey();
|
||||
final DbmsChangeTracker dbmsChangeTracker = entrySet.getValue();
|
||||
|
||||
dbmsChangeTracker.enableTrackerInDbms();
|
||||
try {
|
||||
|
||||
for (String tableName : trackedTables) {
|
||||
dbmsChangeTracker.enableTrackerOnTable(tableName);
|
||||
dbmsChangeTracker.enableTrackerInDbms();
|
||||
|
||||
for (String tableName : trackedTables) {
|
||||
dbmsChangeTracker.enableTrackerOnTable(tableName);
|
||||
}
|
||||
|
||||
dbmsChangeTracker.disableTrackerOnNotUsedTables(trackedTables);
|
||||
|
||||
dbmsChangeTracker.setEventListener(new DbmsChangeTracker.Listener() {
|
||||
@Override
|
||||
public void onInsertDetected(String tableName, HashMap<String, Object> primaryKey) {
|
||||
onItemInserted(customerDB, tableName, primaryKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateDetected(String tableName, HashMap<String, Object> primaryKey) {
|
||||
onItemUpdated(customerDB, tableName, primaryKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeleteDetected(String tableName, HashMap<String, Object> primaryKey) {
|
||||
onItemDeleted(customerDB, tableName, primaryKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTrackingResetted() throws Exception {
|
||||
requestGlobalReset(customerDB);
|
||||
}
|
||||
});
|
||||
|
||||
dbmsChangeTracker.startTracking();
|
||||
} catch (Exception e) {
|
||||
throw new Exception("Errore durante l'abilitazione del DbmsChangeTracker per il customer: " + customerDB.getValue(), e);
|
||||
}
|
||||
|
||||
dbmsChangeTracker.disableTrackerOnNotUsedTables(trackedTables);
|
||||
|
||||
dbmsChangeTracker.setEventListener(new DbmsChangeTracker.Listener() {
|
||||
@Override
|
||||
public void onInsertDetected(String tableName, HashMap<String, Object> primaryKey) {
|
||||
onItemInserted(customerDB, tableName, primaryKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateDetected(String tableName, HashMap<String, Object> primaryKey) {
|
||||
onItemUpdated(customerDB, tableName, primaryKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeleteDetected(String tableName, HashMap<String, Object> primaryKey) {
|
||||
onItemDeleted(customerDB, tableName, primaryKey);
|
||||
}
|
||||
});
|
||||
|
||||
dbmsChangeTracker.startTracking();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +109,11 @@ public class DbmsChangeTrackerComponent {
|
||||
@Scheduled(fixedDelay = 5, timeUnit = TimeUnit.SECONDS)
|
||||
private void checkAllChanges() throws Exception {
|
||||
for (DbmsChangeTracker dbmsChangeTracker : activeChangeTrackers.values()) {
|
||||
dbmsChangeTracker.checkForChanges();
|
||||
try {
|
||||
dbmsChangeTracker.checkForChanges();
|
||||
} catch (Exception e) {
|
||||
logger.error("Errore durante il controllo delle modifiche nel DbmsChangeTracker.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,4 +133,9 @@ public class DbmsChangeTrackerComponent {
|
||||
applicationEventPublisher.publishEvent(new TableRecordDeletedEvent(this, customerDB, tableName, primaryKey));
|
||||
}
|
||||
|
||||
private void requestGlobalReset(IntegryCustomerDB customerDB) {
|
||||
logger.warn("Table tracking resetted in profileDb {} ", customerDB.getValue());
|
||||
applicationEventPublisher.publishEvent(new TableTrackingResettedEvent(this, customerDB));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package it.integry.ems.dbms_change_tracker.component.exception;
|
||||
|
||||
public class DbmsChangeTrackerInvalidMinVersionException extends Exception {
|
||||
|
||||
private final String tableName;
|
||||
private final long currentVersion;
|
||||
private final long minValidVersion;
|
||||
|
||||
public DbmsChangeTrackerInvalidMinVersionException(String tableName, long currentVersion, long minValidVersion) {
|
||||
super("Change Tracking on table " + tableName + " has been reset. Current version: " + currentVersion + ", Min valid version: " + minValidVersion);
|
||||
this.tableName = tableName;
|
||||
this.minValidVersion = minValidVersion;
|
||||
this.currentVersion = currentVersion;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public long getCurrentVersion() {
|
||||
return currentVersion;
|
||||
}
|
||||
|
||||
public long getMinValidVersion() {
|
||||
return minValidVersion;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package it.integry.ems.dbms_change_tracker.model.events;
|
||||
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.event.BaseCustomerDBEvent;
|
||||
|
||||
public class TableTrackingResettedEvent extends BaseCustomerDBEvent {
|
||||
|
||||
public TableTrackingResettedEvent(Object source, IntegryCustomerDB customerDB) {
|
||||
super(source, customerDB);
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,10 @@ import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.http.ContentDisposition;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@@ -28,26 +32,26 @@ public class DownloadController {
|
||||
private MimeTypesHandler mimetypesFileTypeMap;
|
||||
|
||||
@RequestMapping(value = "download/{uuid}/{fileName}", method = RequestMethod.GET)
|
||||
public byte[] download(HttpServletResponse response,
|
||||
@PathVariable String uuid,
|
||||
@PathVariable String fileName) throws Exception {
|
||||
|
||||
public ResponseEntity<byte[]> download(@PathVariable String uuid,
|
||||
@PathVariable String fileName) throws Exception {
|
||||
byte[] fileContent = downloadFileHandlerService.getDownloadFileContent(uuid);
|
||||
|
||||
if (fileContent != null) {
|
||||
String filename = downloadFileHandlerService.getDownloadFileName(uuid);
|
||||
|
||||
String mimeType = Files.probeContentType(Paths.get(fileName));
|
||||
MediaType mediaType = mimetypesFileTypeMap.getContentType(fileName);
|
||||
|
||||
response.setContentType(mimeType);
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
response.addHeader("Content-Disposition", "attachment; filename=\"" + filename + "\"");
|
||||
|
||||
response.setContentLength(fileContent.length);
|
||||
return fileContent;
|
||||
return ResponseEntity.ok()
|
||||
.contentType(mediaType)
|
||||
.contentLength(fileContent.length)
|
||||
.header(HttpHeaders.CONTENT_DISPOSITION, ContentDisposition
|
||||
.builder("attachment")
|
||||
.filename(filename)
|
||||
.build()
|
||||
.toString())
|
||||
.body(fileContent);
|
||||
}
|
||||
|
||||
response.sendError(404, "File non trovato");
|
||||
return null;
|
||||
return ResponseEntity.notFound().build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import it.integry.ems.dbms_change_tracker.component.DbmsChangeTrackerComponent;
|
||||
import it.integry.ems.dbms_change_tracker.model.events.TableRecordDeletedEvent;
|
||||
import it.integry.ems.dbms_change_tracker.model.events.TableRecordInsertedEvent;
|
||||
import it.integry.ems.dbms_change_tracker.model.events.TableRecordUpdatedEvent;
|
||||
import it.integry.ems.dbms_change_tracker.model.events.TableTrackingResettedEvent;
|
||||
import it.integry.ems.dto.EntityHierarchy;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
@@ -43,14 +44,24 @@ public class EntityCacheComponent implements ApplicationListener {
|
||||
|
||||
private final HashMap<IntegryCustomerDB, ConcurrentHashMap<String, ConcurrentHashMap<HashMap<String, Object>, EntityBase>>> entityCache = new HashMap<>();
|
||||
|
||||
// Lock per IntegryCustomerDB per garantire accessi sincronizzati alla cache di quel customer
|
||||
private final ConcurrentHashMap<IntegryCustomerDB, Object> cacheLocks = new ConcurrentHashMap<>();
|
||||
|
||||
private Object getCacheLock(IntegryCustomerDB customerDB) {
|
||||
cacheLocks.putIfAbsent(customerDB, new Object());
|
||||
return cacheLocks.get(customerDB);
|
||||
}
|
||||
|
||||
private final HashMap<String, Class<? extends EntityBase>> enabledEntities = new HashMap<String, Class<? extends EntityBase>>() {{
|
||||
put(MtbAart.ENTITY, MtbAart.class);
|
||||
put(MtbAartBarCode.ENTITY, MtbAartBarCode.class);
|
||||
put(MtbUntMis.ENTITY, MtbUntMis.class);
|
||||
put(MtbDepo.ENTITY, MtbDepo.class);
|
||||
put(MtbDepoPosizioni.ENTITY, MtbDepoPosizioni.class);
|
||||
put(StbEditLimit.ENTITY, StbEditLimit.class);
|
||||
put(StbGestSetup.ENTITY, StbGestSetup.class);
|
||||
put(StbGestSetupDepo.ENTITY, StbGestSetupDepo.class);
|
||||
put(StbUser.ENTITY, StbUser.class);
|
||||
put(WtbDepo.ENTITY, WtbDepo.class);
|
||||
put(WtbGestSetupUser.ENTITY, WtbGestSetupUser.class);
|
||||
put(WtbClie.ENTITY, WtbClie.class);
|
||||
}};
|
||||
|
||||
public EntityCacheComponent(DbmsChangeTrackerComponent dbmsChangeTrackerComponent, EntityPropertyHolder entityPropertyHolder) {
|
||||
@@ -81,6 +92,16 @@ public class EntityCacheComponent implements ApplicationListener {
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshCacheGlobal(IntegryCustomerDB customerDB) throws Exception {
|
||||
try (MultiDBTransactionManager mdb = new MultiDBTransactionManager(customerDB)) {
|
||||
Connection conn = mdb.getPrimaryConnection();
|
||||
for (Map.Entry<String, Class<? extends EntityBase>> enabledEntity : enabledEntities.entrySet()) {
|
||||
String tableName = enabledEntity.getKey();
|
||||
refreshCacheForEntity(conn, customerDB, tableName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshCacheForEntity(IntegryCustomerDB customerDB, String tableName) throws Exception {
|
||||
try (MultiDBTransactionManager mdb = new MultiDBTransactionManager(customerDB)) {
|
||||
Connection conn = mdb.getPrimaryConnection();
|
||||
@@ -89,20 +110,23 @@ public class EntityCacheComponent implements ApplicationListener {
|
||||
}
|
||||
|
||||
private void refreshCacheForEntity(Connection connection, IntegryCustomerDB customerDB, String tableName) throws Exception {
|
||||
Class<? extends EntityBase> clazz = enabledEntities.get(tableName);
|
||||
// Sincronizziamo l'intera operazione di refresh per il customerDB per evitare accessi concorrenti
|
||||
synchronized (getCacheLock(customerDB)) {
|
||||
Class<? extends EntityBase> clazz = enabledEntities.get(tableName);
|
||||
// if (clazz == null)
|
||||
// throw new RuntimeException("Entity cache is not enabled for table " + tableName);
|
||||
|
||||
entityCache.putIfAbsent(customerDB, new ConcurrentHashMap<>());
|
||||
entityCache.get(customerDB).remove(tableName);
|
||||
entityCache.putIfAbsent(customerDB, new ConcurrentHashMap<>());
|
||||
entityCache.get(customerDB).remove(tableName);
|
||||
|
||||
ConcurrentHashMap<HashMap<String, Object>, EntityBase> entities = retrieveEntityList(connection, tableName, clazz);
|
||||
entityCache.get(customerDB).put(tableName, entities);
|
||||
ConcurrentHashMap<HashMap<String, Object>, EntityBase> entities = retrieveEntityList(connection, tableName, clazz);
|
||||
entityCache.get(customerDB).put(tableName, entities);
|
||||
|
||||
logger.trace(String.format("[%s] Cached %d records for entity %s",
|
||||
customerDB.getValue(),
|
||||
entities.size(),
|
||||
clazz.getSimpleName()));
|
||||
logger.trace(String.format("[%s] Cached %d records for entity %s",
|
||||
customerDB.getValue(),
|
||||
entities.size(),
|
||||
clazz.getSimpleName()));
|
||||
}
|
||||
}
|
||||
|
||||
public <T extends EntityBase> List<T> getCachedEntitiesList(IntegryCustomerDB customerDB, String tableName, Predicate<T> filterPredicate) {
|
||||
@@ -111,20 +135,29 @@ public class EntityCacheComponent implements ApplicationListener {
|
||||
}
|
||||
|
||||
public <T extends EntityBase> Stream<T> getCachedEntitiesStream(IntegryCustomerDB customerDB, String tableName, Predicate<T> filterPredicate) {
|
||||
if (!isCacheEnabled(customerDB, tableName)) {
|
||||
try {
|
||||
refreshCacheForEntity(customerDB, tableName);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
// Per evitare accessi concorrenti leggiamo/snapshottiamo la cache sotto lock per quel customerDB
|
||||
Stream<T> snapshot;
|
||||
synchronized (getCacheLock(customerDB)) {
|
||||
if (!isCacheEnabled(customerDB, tableName)) {
|
||||
try {
|
||||
refreshCacheForEntity(customerDB, tableName);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// prendo un'istantanea degli oggetti clonati per poter lavorare fuori dal lock
|
||||
snapshot = entityCache.get(customerDB)
|
||||
.get(tableName)
|
||||
.values()
|
||||
.parallelStream()
|
||||
.map(x -> (T) x.clone());
|
||||
|
||||
if (filterPredicate != null)
|
||||
snapshot = snapshot.filter(filterPredicate);
|
||||
}
|
||||
|
||||
return entityCache.get(customerDB).get(tableName)
|
||||
.values()
|
||||
.parallelStream()
|
||||
.map(x -> (T) x)
|
||||
.filter(filterPredicate)
|
||||
.map(x -> (T) x.clone());
|
||||
return snapshot;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,6 +172,13 @@ public class EntityCacheComponent implements ApplicationListener {
|
||||
} else if (event instanceof TableRecordDeletedEvent) {
|
||||
handleRecordDeleted((TableRecordDeletedEvent) event);
|
||||
|
||||
} else if (event instanceof TableTrackingResettedEvent) {
|
||||
try {
|
||||
handleTableTrackingResetted((TableTrackingResettedEvent) event);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,9 +195,12 @@ public class EntityCacheComponent implements ApplicationListener {
|
||||
event.getPrimaryKey());
|
||||
|
||||
|
||||
entityCache.get(event.getCustomerDB())
|
||||
.get(event.getTableName())
|
||||
.put(entityPrimaryKey, newItem);
|
||||
// sincronizziamo la modifica per il customerDB
|
||||
synchronized (getCacheLock(event.getCustomerDB())) {
|
||||
entityCache.get(event.getCustomerDB())
|
||||
.get(event.getTableName())
|
||||
.put(entityPrimaryKey, newItem);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -174,9 +217,13 @@ public class EntityCacheComponent implements ApplicationListener {
|
||||
enabledEntities.get(event.getTableName()),
|
||||
event.getPrimaryKey());
|
||||
|
||||
entityCache.get(event.getCustomerDB())
|
||||
.get(event.getTableName())
|
||||
.put(entityPrimaryKey, newItem);
|
||||
|
||||
// sincronizziamo la modifica per il customerDB
|
||||
synchronized (getCacheLock(event.getCustomerDB())) {
|
||||
entityCache.get(event.getCustomerDB())
|
||||
.get(event.getTableName())
|
||||
.put(entityPrimaryKey, newItem);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
@@ -189,9 +236,19 @@ public class EntityCacheComponent implements ApplicationListener {
|
||||
|
||||
HashMap<String, Object> entityPrimaryKey = convertSqlMapToEntityMap(event.getPrimaryKey(), enabledEntities.get(event.getTableName()));
|
||||
|
||||
final EntityBase removedItem = entityCache.get(event.getCustomerDB())
|
||||
.get(event.getTableName())
|
||||
.remove(entityPrimaryKey);
|
||||
// sincronizziamo la rimozione per il customerDB
|
||||
final EntityBase removedItem;
|
||||
synchronized (getCacheLock(event.getCustomerDB())) {
|
||||
removedItem = entityCache.get(event.getCustomerDB())
|
||||
.get(event.getTableName())
|
||||
.remove(entityPrimaryKey);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleTableTrackingResetted(TableTrackingResettedEvent event) throws Exception {
|
||||
// reset e refresh sono eseguiti in modo sincronizzato per quel customer
|
||||
resetTablesCache(event.getCustomerDB());
|
||||
refreshCacheGlobal(event.getCustomerDB());
|
||||
}
|
||||
|
||||
|
||||
@@ -240,6 +297,23 @@ public class EntityCacheComponent implements ApplicationListener {
|
||||
}
|
||||
|
||||
|
||||
private void resetTableCache(IntegryCustomerDB customerDB, String tableName) {
|
||||
synchronized (getCacheLock(customerDB)) {
|
||||
if (entityCache.containsKey(customerDB) && entityCache.get(customerDB).containsKey(tableName)) {
|
||||
entityCache.get(customerDB).remove(tableName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void resetTablesCache(IntegryCustomerDB customerDB) {
|
||||
// sincronizziamo la rimozione dell'intera cache per il customer
|
||||
synchronized (getCacheLock(customerDB)) {
|
||||
entityCache.remove(customerDB);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private boolean isCacheEnabled(IntegryCustomerDB customerDB, String tableName) {
|
||||
return (entityCache.containsKey(customerDB) && entityCache.get(customerDB).containsKey(tableName)) ||
|
||||
!(UtilityDebug.isDebugExecution() || UtilityDebug.isIntegryServer());
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package it.integry.ems.exception;
|
||||
|
||||
public class InvalidCustomerDbException extends RuntimeException {
|
||||
public InvalidCustomerDbException(String dbName) {
|
||||
super("Invalid customer database name: " + dbName + ". Please check your ems_settings.json");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package it.integry.ems.exception;
|
||||
|
||||
public class InvalidDbNameException extends RuntimeException {
|
||||
public InvalidDbNameException(String dbName) {
|
||||
super("Invalid database name: " + dbName + ". Please check your ems_settings.json");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package it.integry.ems.exception;
|
||||
|
||||
public class InvalidProfileDbException extends RuntimeException {
|
||||
public InvalidProfileDbException(String profileDb) {
|
||||
super("Invalid profile db: " + profileDb + ". Please check your ems_settings.json");
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package it.integry.ems.file_formatter.txt;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import it.integry.ems_model.annotation.DtoField;
|
||||
import it.integry.ems_model.utility.UtilityLocalDate;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -10,6 +11,7 @@ import java.lang.reflect.Field;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -76,8 +78,16 @@ public class TxtMapper<T> {
|
||||
|
||||
if (ignorePosition)
|
||||
stringBuilder.append(value).append(fieldsSplitChar);
|
||||
else
|
||||
else {
|
||||
if ( stringBuilder.length() > 0 && stringBuilder.length() < dtoField.startPosition() ) {
|
||||
int numChar = dtoField.startPosition() - stringBuilder.length();
|
||||
for (int i = 0; i < numChar; i++) {
|
||||
stringBuilder.append(fieldsSplitChar);
|
||||
}
|
||||
|
||||
}
|
||||
stringBuilder.insert(dtoField.startPosition(), value).append(fieldsSplitChar);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
@@ -208,6 +218,8 @@ public class TxtMapper<T> {
|
||||
if (value != null) {
|
||||
if (!UtilityString.isNullOrEmpty(dtoField.format()) && value instanceof Date) {
|
||||
value = new SimpleDateFormat(dtoField.format()).format(value);
|
||||
} else if (!UtilityString.isNullOrEmpty(dtoField.format()) && value instanceof LocalDate) {
|
||||
value = UtilityLocalDate.formatDate((LocalDate) value, dtoField.format() );
|
||||
} else if (!UtilityString.isNullOrEmpty(dtoField.formula()) && value instanceof BigDecimal) {
|
||||
value = ((BigDecimal) value).setScale(dtoField.scale(), RoundingMode.HALF_DOWN);
|
||||
String formula = dtoField.formula().replaceAll("this", value.toString());
|
||||
|
||||
@@ -3,6 +3,7 @@ package it.integry.ems.javabeans;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems._context.ApplicationContextProvider;
|
||||
import it.integry.ems.jpa.TenantContext;
|
||||
import it.integry.ems.json.ResponseJSONObjectMapper;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.model.IntegryApplicationEnum;
|
||||
@@ -19,13 +20,15 @@ import org.springframework.security.authentication.AnonymousAuthenticationToken;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
|
||||
@Component
|
||||
@Scope("request")
|
||||
@Scope(WebApplicationContext.SCOPE_REQUEST)
|
||||
public class RequestDataDTO {
|
||||
|
||||
private final Logger logger = LogManager.getLogger();
|
||||
@@ -40,6 +43,10 @@ public class RequestDataDTO {
|
||||
private String requestClientIP;
|
||||
|
||||
private String profileDB;
|
||||
|
||||
//Indica il codice deposito reale dell'utente che effettua la richiesta, ovvero la posizione fisica dell'utente
|
||||
private String codMdep;
|
||||
|
||||
private Long deviceId;
|
||||
private String username;
|
||||
private String password;
|
||||
@@ -58,6 +65,10 @@ public class RequestDataDTO {
|
||||
profileDB = request.getHeader(CommonConstants.PROFILE_DB);
|
||||
}
|
||||
|
||||
if (request != null && request.getHeader(CommonConstants.COD_MDEP) != null) {
|
||||
codMdep = request.getHeader(CommonConstants.COD_MDEP);
|
||||
}
|
||||
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
if (authentication != null && !(authentication instanceof AnonymousAuthenticationToken)) {
|
||||
readAuthenticationClaims(authentication);
|
||||
@@ -92,6 +103,24 @@ public class RequestDataDTO {
|
||||
} else {
|
||||
jsonObjectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
}
|
||||
|
||||
// Logica di fallback o recupero tenant da sessione/utente
|
||||
if (profileDB == null || profileDB.isEmpty()) {
|
||||
// Esempio: recupero da sessione se presente
|
||||
// tenantId = (String) request.getSession().getAttribute("TENANT_ID");
|
||||
|
||||
// Fallback temporaneo per test
|
||||
// tenantId = DEFAULT_TENANT;
|
||||
}
|
||||
|
||||
if (profileDB != null) {
|
||||
TenantContext.setCurrentTenant(profileDB);
|
||||
}
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
public void destroy() throws Exception {
|
||||
TenantContext.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -111,6 +140,10 @@ public class RequestDataDTO {
|
||||
return !UtilityString.isNullOrEmpty(profileDB);
|
||||
}
|
||||
|
||||
public boolean isValidCodMdep() {
|
||||
return !UtilityString.isNullOrEmpty(codMdep);
|
||||
}
|
||||
|
||||
public boolean isValidDeviceId() {
|
||||
return deviceId != null;
|
||||
}
|
||||
@@ -141,6 +174,10 @@ public class RequestDataDTO {
|
||||
return profileDB;
|
||||
}
|
||||
|
||||
public String getCodMdep() {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public IntegryCustomerDB getCustomerDB() {
|
||||
if (UtilityString.isNullOrEmpty(profileDB))
|
||||
return null;
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package it.integry.ems.jpa;
|
||||
|
||||
import it.integry.ems.settings.Model.AvailableConnectionModel;
|
||||
import it.integry.ems.settings.Model.SettingsModel;
|
||||
import it.integry.ems.sync.MultiDBTransaction.BasicConnectionPool;
|
||||
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class MultiTenantDataSource extends AbstractRoutingDataSource {
|
||||
|
||||
private final BasicConnectionPool basicConnectionPool;
|
||||
private final SettingsModel settingsModel;
|
||||
|
||||
public MultiTenantDataSource(BasicConnectionPool basicConnectionPool, SettingsModel settingsModel) {
|
||||
this.basicConnectionPool = basicConnectionPool;
|
||||
this.settingsModel = settingsModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object determineCurrentLookupKey() {
|
||||
return TenantContext.getCurrentTenant();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
Map<Object, Object> targetDataSources = new HashMap<>();
|
||||
List<AvailableConnectionModel> connections = settingsModel.getAvailableConnections(false);
|
||||
|
||||
// Imposta il primo come default se necessario, o gestisci il caso null
|
||||
DataSource defaultDataSource = null;
|
||||
|
||||
for (AvailableConnectionModel model : connections) {
|
||||
DataSource ds = basicConnectionPool.getDataSource(model.getProfileName());
|
||||
if (ds != null) {
|
||||
targetDataSources.put(model.getProfileName(), ds);
|
||||
if (defaultDataSource == null) {
|
||||
defaultDataSource = ds;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.setTargetDataSources(targetDataSources);
|
||||
this.setDefaultTargetDataSource(defaultDataSource);
|
||||
super.afterPropertiesSet();
|
||||
}
|
||||
|
||||
// Metodo per ricaricare i datasource se vengono aggiunti nuovi tenant a runtime
|
||||
public void refreshDataSources() {
|
||||
this.afterPropertiesSet();
|
||||
}
|
||||
}
|
||||
|
||||
18
ems-core/src/main/java/it/integry/ems/jpa/TenantContext.java
Normal file
18
ems-core/src/main/java/it/integry/ems/jpa/TenantContext.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package it.integry.ems.jpa;
|
||||
|
||||
public class TenantContext {
|
||||
private static final ThreadLocal<String> currentTenant = new ThreadLocal<>();
|
||||
|
||||
public static void setCurrentTenant(String tenant) {
|
||||
currentTenant.set(tenant);
|
||||
}
|
||||
|
||||
public static String getCurrentTenant() {
|
||||
return currentTenant.get();
|
||||
}
|
||||
|
||||
public static void clear() {
|
||||
currentTenant.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package it.integry.ems.jpa.entity;
|
||||
|
||||
import javax.persistence.MappedSuperclass;
|
||||
import java.io.Serializable;
|
||||
|
||||
@MappedSuperclass
|
||||
public abstract class BaseEntity implements Serializable {
|
||||
// Classe base per le entity JPA
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package it.integry.ems.jpa.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.repository.NoRepositoryBean;
|
||||
|
||||
@NoRepositoryBean
|
||||
public interface BaseRepository<T, ID> extends JpaRepository<T, ID> {
|
||||
// Interfaccia base per i repository
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package it.integry.ems.jpa.repository;
|
||||
|
||||
import it.integry.ems_model.entity.MtbAart;
|
||||
import org.springframework.data.jpa.repository.EntityGraph;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
public interface MtbAartRepository extends BaseRepository<MtbAart, String> {
|
||||
|
||||
Optional<MtbAart> findByCodMart(String codMart);
|
||||
|
||||
@EntityGraph(attributePaths = {"mtbUntMis"})
|
||||
Optional<MtbAart> findWithUntMisByCodMart(String codMart);
|
||||
|
||||
List<MtbAart> findByCodMartIn(List<String> codMarts);
|
||||
|
||||
@EntityGraph(attributePaths = {"mtbUntMis"})
|
||||
List<MtbAart> findWithUntMisByCodMartIn(List<String> codMarts);
|
||||
|
||||
@EntityGraph(attributePaths = {"mtbUntMis", "mtbAartBarCode"})
|
||||
List<MtbAart> findWithBarcodeWithUntMisByCodMartIn(List<String> codMarts);
|
||||
|
||||
@EntityGraph(attributePaths = {"mtbAartBarCode"})
|
||||
Optional<MtbAart> findWithBarcodeByCodMart(String codMart);
|
||||
|
||||
@Query("SELECT m FROM MtbAart m WHERE m.untMis = 'KG'")
|
||||
List<MtbAart> findByUntMisKG();
|
||||
|
||||
@Query("SELECT m.flagQtaCnfFissa FROM MtbAart m WHERE m.codMart = :codMart")
|
||||
Optional<String> findFlagQtaCnfFissaByCodMart(@Param("codMart") String codMart);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package it.integry.ems.jpa.repository;
|
||||
|
||||
import it.integry.ems_model.entity.MtbUntMis;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface MtbUntMisRepository extends BaseRepository<MtbUntMis, String> {
|
||||
|
||||
Optional<MtbUntMis> findByUntMis(String untMis);
|
||||
|
||||
List<MtbUntMis> findByUntMisIn(List<String> untMis);
|
||||
|
||||
@Query("SELECT a.mtbUntMis FROM MtbAart a WHERE a.codMart = :codMart")
|
||||
Optional<MtbUntMis> findByCodMart(@Param("codMart") String codMart);
|
||||
|
||||
int countByUntMis(String untMis);
|
||||
|
||||
@Query("SELECT u.cifreDec FROM MtbUntMis u WHERE u.flagUnitaKg = :flagUnitaKg")
|
||||
List<BigDecimal> findCifreDecByFlagUnitaKg(@Param("flagUnitaKg") String flagUnitaKg);
|
||||
}
|
||||
@@ -33,6 +33,7 @@ public class JsonObjectMapperConfig {
|
||||
|
||||
module.addDeserializer(BigDecimal.class, new BigDecimalDeserialize());
|
||||
module.addDeserializer(Integer.class, new IntegerDeserializer());
|
||||
module.addDeserializer(Long.class, new LongDeserializer());
|
||||
|
||||
module.addDeserializer(String.class, new StringUnicodeDeserialize());
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import it.integry.ems_model.utility.Query;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import it.integry.ems_model.utility.dto.IndexTableDTO;
|
||||
import it.integry.ems_model.utility.dto.PkTableDTO;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.web.context.ContextLoader;
|
||||
@@ -79,6 +80,14 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
return UtilityDB.executeSimpleQueryOnlyFirstColumn(connection, sql);
|
||||
}
|
||||
|
||||
protected @NotNull HashMap<String, Object> executeQueryOnlyFirstRow(String sql) throws SQLException {
|
||||
return UtilityDB.executeSimpleQueryOnlyFirstRow(connection, sql);
|
||||
}
|
||||
|
||||
protected @NotNull <T> T executeQueryOnlyFirstRowFirstColumn(String sql) throws SQLException {
|
||||
return UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||
}
|
||||
|
||||
protected void executeStatement(String... sqls) throws SQLException {
|
||||
executeStatement(connection, sqls);
|
||||
}
|
||||
@@ -163,12 +172,20 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
UtilityDB.createIndex(connection, indexTableDTO);
|
||||
}
|
||||
|
||||
protected void createPrimaryKey(PkTableDTO pkTableDTO) throws Exception {
|
||||
UtilityDB.createPK(connection, pkTableDTO);
|
||||
}
|
||||
|
||||
protected void cloneTable(String sourceTable, String newTable,boolean fillNewTable, boolean dropOldTable, boolean renameNewTable) throws Exception {
|
||||
|
||||
protected void cloneTable(String sourceTable, String newTable, boolean fillNewTable, boolean dropOldTable, boolean renameNewTable) throws Exception {
|
||||
UtilityDB.cloneTable(connection, sourceTable, newTable, fillNewTable, dropOldTable, renameNewTable);
|
||||
}
|
||||
|
||||
protected void dropIndex(String tableName, String indexName) throws Exception {
|
||||
protected boolean existIndex(String tableName, String indexName) throws SQLException {
|
||||
return UtilityDB.existIndex(connection, tableName, indexName);
|
||||
}
|
||||
|
||||
protected void dropIndex(String tableName, String indexName) throws SQLException {
|
||||
UtilityDB.dropIndex(connection, tableName, indexName);
|
||||
}
|
||||
|
||||
@@ -406,6 +423,25 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
}
|
||||
}
|
||||
|
||||
protected String getSetupValue(String gestName, String section, String keySection) throws SQLException {
|
||||
String sql = Query.format("SELECT value FROM " + StbGestSetup.ENTITY +
|
||||
" WHERE gest_name = %s AND" +
|
||||
" section = %s AND" +
|
||||
" key_section = %s", gestName, section, keySection);
|
||||
|
||||
return UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||
}
|
||||
|
||||
//Create a getStbGestSetup method to return the entire StbGestSetup object
|
||||
protected StbGestSetup getStbGestSetup(String gestName, String section, String keySection) throws SQLException, DataConverterNotFoundException, InstantiationException, IllegalAccessException {
|
||||
String sql = Query.format("SELECT * FROM stb_gest_setup " +
|
||||
" WHERE gest_name = %s AND" +
|
||||
" section = %s AND" +
|
||||
" key_section = %s", gestName, section, keySection);
|
||||
|
||||
return UtilityDB.executeSimpleQueryOnlyFirstRowDTO(connection, sql, StbGestSetup.class);
|
||||
}
|
||||
|
||||
protected void deleteSetup(String gestName, String section, String keySection) throws Exception {
|
||||
StbGestSetup stbGestSetup = new StbGestSetup()
|
||||
.setGestName(gestName)
|
||||
@@ -488,6 +524,16 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
stbGestSetup.manageWithParentConnection(connection);
|
||||
}
|
||||
|
||||
protected void dropSetup(String gestName, String section, String keySection) throws Exception {
|
||||
StbGestSetup stbGestSetup = new StbGestSetup()
|
||||
.setGestName(gestName)
|
||||
.setSection(section)
|
||||
.setKeySection(keySection);
|
||||
|
||||
stbGestSetup.setOperation(OperationType.DELETE);
|
||||
stbGestSetup.manageWithParentConnection(connection);
|
||||
}
|
||||
|
||||
protected void addAutomatedOperation(BaseScheduledOperationDTO operation) {
|
||||
new Thread(() -> {
|
||||
try {
|
||||
|
||||
@@ -71,7 +71,8 @@ public enum IntegryCustomer {
|
||||
Gramm(IntegryCustomerDB.Gramm_Gramm,
|
||||
IntegryCustomerDB.Gramm_PrimeOlive,
|
||||
IntegryCustomerDB.Gramm_ProveStage,
|
||||
IntegryCustomerDB.Gramm_2MHolding),
|
||||
IntegryCustomerDB.Gramm_2MHolding,
|
||||
IntegryCustomerDB.Gramm_GrammUsa),
|
||||
Idrotecnica(IntegryCustomerDB.Idrotecnica_Idrotecnica),
|
||||
Igood(IntegryCustomerDB.Igood_Aida,
|
||||
IntegryCustomerDB.Igood_Igood,
|
||||
@@ -118,7 +119,10 @@ public enum IntegryCustomer {
|
||||
IntegryCustomerDB.Suit_TenutaArianna,
|
||||
IntegryCustomerDB.Suit_Valpietro),
|
||||
Tempesta(IntegryCustomerDB.Tempesta_Tempesta,
|
||||
IntegryCustomerDB.Tempesta_VivaiTempesta),
|
||||
IntegryCustomerDB.Tempesta_DI,
|
||||
IntegryCustomerDB.Tempesta_VivaiTempesta,
|
||||
IntegryCustomerDB.Tempesta_VivaiTempesta_DI
|
||||
),
|
||||
Tosca(IntegryCustomerDB.Tosca_Ba,
|
||||
IntegryCustomerDB.Tosca_Ce,
|
||||
IntegryCustomerDB.Tosca_Cz,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package it.integry.ems.migration._base;
|
||||
|
||||
import it.integry.ems.exception.InvalidCustomerDbException;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -96,6 +97,7 @@ public enum IntegryCustomerDB {
|
||||
Gramm_PrimeOlive("primeolive"),
|
||||
Gramm_ProveStage("grammprovestage"),
|
||||
Gramm_2MHolding("dueemme"),
|
||||
Gramm_GrammUsa("gramm_usa"),
|
||||
|
||||
|
||||
Idrotecnica_Idrotecnica("idrotecnica"),
|
||||
@@ -196,7 +198,9 @@ public enum IntegryCustomerDB {
|
||||
|
||||
|
||||
Tempesta_Tempesta("tempesta"),
|
||||
Tempesta_DI("tempestadi"),
|
||||
Tempesta_VivaiTempesta("vivaitempesta"),
|
||||
Tempesta_VivaiTempesta_DI("vivaitempestadi"),
|
||||
|
||||
|
||||
Tosca_Ba("tosca_ba"),
|
||||
@@ -234,6 +238,6 @@ public enum IntegryCustomerDB {
|
||||
|
||||
return Arrays.stream(values()).filter(x -> x.getValue().equalsIgnoreCase(value))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
.orElseThrow(() -> new InvalidCustomerDbException(value));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import it.integry.ems_model.entity.StbUser;
|
||||
import it.integry.ems_model.entity.WtbUsers;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityLocalDate;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import it.integry.security.utility.CryptoUtils;
|
||||
|
||||
@@ -57,7 +58,7 @@ public class Migration_20220413102657 extends BaseMigration implements Migration
|
||||
.setUserCode(wtbUser.getUserCode())
|
||||
.setDetails(wtbUser.getDetails())
|
||||
.setLastAccessDatetime(wtbUser.getLastAccessDatetime())
|
||||
.setPasswordEndtime(wtbUser.getPasswordEndtime())
|
||||
.setPasswordEndtime(UtilityLocalDate.localDateTimeFromDate(wtbUser.getPasswordEndtime()))
|
||||
.setUrlCss(wtbUser.getUrlCss())
|
||||
.setCodLang(wtbUser.getCodLang())
|
||||
.setCreationDatetime(wtbUser.getCreationDatetime())
|
||||
|
||||
@@ -10,6 +10,9 @@ public class Migration_20251113102040 extends BaseMigration implements Migration
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
executeStatement("ALTER TABLE vtb_list_data ADD promo_chiusa bit DEFAULT 0 NOT NULL");
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@ public class Migration_20251113105159 extends BaseMigration implements Migration
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
executeStatement("exec sp_rename 'vtb_list_data.promo_chiusa', 'chiusura_immediata'");
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@ public class Migration_20251113122313 extends BaseMigration implements Migration
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
createOrUpdateFunction("lisv_getTipoUm", "CREATE FUNCTION [dbo].[lisv_getTipoUm]\n" +
|
||||
"(\t\n" +
|
||||
"\t@codMart varchar(15), @tipoUmLisv tinyint\n" +
|
||||
|
||||
@@ -10,6 +10,8 @@ public class Migration_20251114114334 extends BaseMigration implements Migration
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
executeStatement("ALTER TABLE ctb_amac DROP COLUMN cod_mdep;");
|
||||
}
|
||||
|
||||
@@ -10,6 +10,9 @@ public class Migration_20251114163222 extends BaseMigration implements Migration
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
executeStatement("ALTER TABLE vtb_dest ADD data_mod DATETIME");
|
||||
executeStatement("ALTER TABLE ptb_pros ADD data_mod DATETIME");
|
||||
executeStatement("ALTER TABLE ptb_pros_rif ADD data_mod DATETIME");
|
||||
|
||||
@@ -0,0 +1,289 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251117100418 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
createOrUpdateProcedure("sp_moveTableToFileGroup", "CREATE PROCEDURE [dbo].[sp_moveTableToFileGroup] (@tableName varchar(max), @fileGroup varchar(max), @fileName varchar(max), @createFile varchar(1) = 'N')\n" +
|
||||
"AS\n" +
|
||||
"BEGIN\n" +
|
||||
" /*la variabile @fileGroup deve contenere solo il prefisso poi la procedura aggiunge _DATA e _INDEX*/\n" +
|
||||
"\n" +
|
||||
" declare @fileGroupIndex varchar(max), @fileGroupData varchar(max), @sqlText varchar(max),\n" +
|
||||
" @countFile int, @pathDB varchar(max), @fileGroupDataName varchar(max),\n" +
|
||||
" @fileGroupIndexName varchar(max)\n" +
|
||||
"\n" +
|
||||
" SELECT @pathDB = reverse(substring(reverse(physical_name), charindex('\', reverse(physical_name)), LEN(physical_name) -charindex('', reverse(physical_name) ) + 1)) \n" +
|
||||
" FROM sys.master_files inner join sys.databases on sys.master_files.database_id = sys.databases.database_id WHERE sys.databases.name = DB_NAME()and data_space_id = 1\n" +
|
||||
"\n" +
|
||||
" select @fileGroup = case when IsNull(@fileGroup, '') <> '' and RIGHT(@fileGroup, 5) = '_DATA' THEN LEFT(@fileGroup, LEN(@fileGroup) - 5 ) ELSE @fileGroup END\n" +
|
||||
" \n" +
|
||||
" SELECT @fileGroupData = CASE WHEN @fileGroup = 'PRIMARY' OR IsNull(@fileGroup, '') = '' THEN '' ELSE @fileGroup + '_DATA' END,\n" +
|
||||
" @fileGroupIndex = CASE WHEN @fileGroup = 'PRIMARY' OR IsNull(@fileGroup, '') = '' THEN '' ELSE @fileGroup + '_INDEX ' END\n" +
|
||||
"\n" +
|
||||
" if @fileGroup <> 'PRIMARY' \n" +
|
||||
" BEGIN\n" +
|
||||
" select @countFile = COUNT(*) from sys.filegroups f WHERE name like @fileGroup + '%'\n" +
|
||||
" \n" +
|
||||
" IF @countFile = 0 AND @createFile = 'S'\n" +
|
||||
" BEGIN\n" +
|
||||
" select @fileGroupDataName = Lower(db_name()) + '_' + \n" +
|
||||
" (SELECT UPPER(LEFT(value_string,1)) + LOWER(SUBSTRING(value_string,2,LEN(value_string))) \n" +
|
||||
" FROM dbo.ParseStringIntoArray(@fileGroupData, '_') FOR XML PATH('') ),\n" +
|
||||
" @fileGroupIndexName = Lower(db_name()) + '_' + \n" +
|
||||
" (SELECT UPPER(LEFT(value_string,1)) + LOWER(SUBSTRING(value_string,2,LEN(value_string))) \n" +
|
||||
" FROM dbo.ParseStringIntoArray(@fileGroupIndex, '_') FOR XML PATH('') )\n" +
|
||||
"\n" +
|
||||
" \n" +
|
||||
" SELECT @sqlText =\n" +
|
||||
" 'ALTER DATABASE ' + Upper(db_name()) + ' ADD FILEGROUP ' + @fileGroupData + '; '+ CHAR(13) + CHAR(10) + ' GO' + CHAR(13) + CHAR(10) + \n" +
|
||||
" 'ALTER DATABASE ' + Upper(db_name()) + ' ADD FILE (NAME = ' + @fileGroupDataName + ',' +\n" +
|
||||
" 'FILENAME = ''' + @pathDB + @fileGroupDataName + '.ndf'' ' +\n" +
|
||||
" ') TO FILEGROUP ' + @fileGroupData + ';'+ CHAR(13) + CHAR(10) + ' GO' + CHAR(13) + CHAR(10) + \n" +
|
||||
" 'ALTER DATABASE ' + Upper(db_name()) + ' ADD FILEGROUP ' + @fileGroupIndex + '; '+ CHAR(13) + CHAR(10) + ' GO' + CHAR(13) + CHAR(10) + \n" +
|
||||
" 'ALTER DATABASE ' + Upper(db_name()) + ' ADD FILE (NAME = ' +@fileGroupIndexName + ',' + \n" +
|
||||
" 'FILENAME = ''' + @pathDB + @fileGroupIndexName + '.ndf'' ' +\n" +
|
||||
" ') TO FILEGROUP ' + @fileGroupIndex + ';' + CHAR(13) + CHAR(10) + ' GO' + CHAR(13) + CHAR(10) ;\n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
" if @fileName <> '' \n" +
|
||||
" exec sp_writeFile @fileName, @sqlText, 'S' \n" +
|
||||
" else \n" +
|
||||
" select @sqlText\n" +
|
||||
" \n" +
|
||||
" END\n" +
|
||||
"\n" +
|
||||
" SELECT @fileGroupData = ' ON ' + @fileGroupData, \n" +
|
||||
" @fileGroupIndex = ' ON ' + @fileGroupIndex\n" +
|
||||
"\n" +
|
||||
" END\n" +
|
||||
" \n" +
|
||||
" \n" +
|
||||
" DECLARE crs_query CURSOR FOR\n" +
|
||||
" SELECT 'DROP INDEX '+ schema_name(t.schema_id) + '.' + t.name + '.' +i.name + CHAR(13) + CHAR(10) + ' GO' as script\n" +
|
||||
" FROM sys.indexes i\n" +
|
||||
" INNER JOIN sys.tables t ON t.object_id= i.object_id\n" +
|
||||
" WHERE i.type>0 and \n" +
|
||||
" t.is_ms_shipped=0 and \n" +
|
||||
" t.name<>'sysdiagrams' and \n" +
|
||||
" (is_primary_key=0 and is_unique_constraint=0) and\n" +
|
||||
" t.name = @tableName\n" +
|
||||
" union all\n" +
|
||||
" SELECT 'CREATE ' +\n" +
|
||||
" CASE \n" +
|
||||
" WHEN I.is_unique = 1 THEN ' UNIQUE '\n" +
|
||||
" ELSE ''\n" +
|
||||
" END +\n" +
|
||||
" I.type_desc COLLATE DATABASE_DEFAULT + ' INDEX ' +\n" +
|
||||
" I.name + ' ON ' +\n" +
|
||||
" SCHEMA_NAME(T.schema_id) + '.' + T.name + ' ( ' +\n" +
|
||||
" KeyColumns + ' ) ' +\n" +
|
||||
" ISNULL(' INCLUDE (' + IncludedColumns + ' ) ', '') +\n" +
|
||||
" ISNULL(' WHERE ' + I.filter_definition, '') + ' WITH ( ' +\n" +
|
||||
" CASE \n" +
|
||||
" WHEN I.is_padded = 1 THEN ' PAD_INDEX = ON '\n" +
|
||||
" ELSE ' PAD_INDEX = OFF '\n" +
|
||||
" END + ',' +\n" +
|
||||
" 'FILLFACTOR = ' + CONVERT(\n" +
|
||||
" CHAR(5),\n" +
|
||||
" CASE \n" +
|
||||
" WHEN I.fill_factor = 0 THEN 100\n" +
|
||||
" ELSE I.fill_factor\n" +
|
||||
" END\n" +
|
||||
" ) + ',' +\n" +
|
||||
" -- default value \n" +
|
||||
" 'SORT_IN_TEMPDB = OFF ' + ',' +\n" +
|
||||
" CASE \n" +
|
||||
" WHEN I.ignore_dup_key = 1 THEN ' IGNORE_DUP_KEY = ON '\n" +
|
||||
" ELSE ' IGNORE_DUP_KEY = OFF '\n" +
|
||||
" END + ',' +\n" +
|
||||
" CASE \n" +
|
||||
" WHEN ST.no_recompute = 0 THEN ' STATISTICS_NORECOMPUTE = OFF '\n" +
|
||||
" ELSE ' STATISTICS_NORECOMPUTE = ON '\n" +
|
||||
" END + ',' +\n" +
|
||||
" ' ONLINE = OFF ' + ',' +\n" +
|
||||
" CASE \n" +
|
||||
" WHEN I.allow_row_locks = 1 THEN ' ALLOW_ROW_LOCKS = ON '\n" +
|
||||
" ELSE ' ALLOW_ROW_LOCKS = OFF '\n" +
|
||||
" END + ',' +\n" +
|
||||
" CASE \n" +
|
||||
" WHEN I.allow_page_locks = 1 THEN ' ALLOW_PAGE_LOCKS = ON '\n" +
|
||||
" ELSE ' ALLOW_PAGE_LOCKS = OFF '\n" +
|
||||
" END + ' ) ' + @fileGroupIndex + CHAR(13) + CHAR(10) + ' GO' [CreateIndexScript]\n" +
|
||||
" FROM sys.indexes I\n" +
|
||||
" JOIN sys.tables T\n" +
|
||||
" ON T.object_id = I.object_id\n" +
|
||||
" JOIN sys.sysindexes SI\n" +
|
||||
" ON I.object_id = SI.id\n" +
|
||||
" AND I.index_id = SI.indid\n" +
|
||||
" JOIN (\n" +
|
||||
" SELECT *\n" +
|
||||
" FROM (\n" +
|
||||
" SELECT IC2.object_id,\n" +
|
||||
" IC2.index_id,\n" +
|
||||
" STUFF(\n" +
|
||||
" (\n" +
|
||||
" SELECT ' , ' + C.name + CASE \n" +
|
||||
" WHEN MAX(CONVERT(INT, IC1.is_descending_key)) \n" +
|
||||
" = 1 THEN \n" +
|
||||
" ' DESC '\n" +
|
||||
" ELSE \n" +
|
||||
" ' ASC '\n" +
|
||||
" END\n" +
|
||||
" FROM sys.index_columns IC1\n" +
|
||||
" JOIN sys.columns C\n" +
|
||||
" ON C.object_id = IC1.object_id\n" +
|
||||
" AND C.column_id = IC1.column_id\n" +
|
||||
" AND IC1.is_included_column = \n" +
|
||||
" 0\n" +
|
||||
" WHERE IC1.object_id = IC2.object_id\n" +
|
||||
" AND IC1.index_id = IC2.index_id\n" +
|
||||
" GROUP BY\n" +
|
||||
" IC1.object_id,\n" +
|
||||
" C.name,\n" +
|
||||
" index_id\n" +
|
||||
" ORDER BY\n" +
|
||||
" MAX(IC1.key_ordinal) \n" +
|
||||
" FOR XML PATH('')\n" +
|
||||
" ),\n" +
|
||||
" 1,\n" +
|
||||
" 2,\n" +
|
||||
" ''\n" +
|
||||
" ) KeyColumns\n" +
|
||||
" FROM sys.index_columns IC2 \n" +
|
||||
" --WHERE IC2.Object_id = object_id('Person.Address') --Comment for all tables\n" +
|
||||
" GROUP BY\n" +
|
||||
" IC2.object_id,\n" +
|
||||
" IC2.index_id\n" +
|
||||
" ) tmp3\n" +
|
||||
" )tmp4\n" +
|
||||
" ON I.object_id = tmp4.object_id\n" +
|
||||
" AND I.Index_id = tmp4.index_id\n" +
|
||||
" JOIN sys.stats ST\n" +
|
||||
" ON ST.object_id = I.object_id\n" +
|
||||
" AND ST.stats_id = I.index_id\n" +
|
||||
" JOIN sys.data_spaces DS\n" +
|
||||
" ON I.data_space_id = DS.data_space_id\n" +
|
||||
" JOIN sys.filegroups FG\n" +
|
||||
" ON I.data_space_id = FG.data_space_id\n" +
|
||||
" LEFT JOIN (\n" +
|
||||
" SELECT *\n" +
|
||||
" FROM (\n" +
|
||||
" SELECT IC2.object_id,\n" +
|
||||
" IC2.index_id,\n" +
|
||||
" STUFF(\n" +
|
||||
" (\n" +
|
||||
" SELECT ' , ' + C.name\n" +
|
||||
" FROM sys.index_columns IC1\n" +
|
||||
" JOIN sys.columns C\n" +
|
||||
" ON C.object_id = IC1.object_id\n" +
|
||||
" AND C.column_id = IC1.column_id\n" +
|
||||
" AND IC1.is_included_column = \n" +
|
||||
" 1\n" +
|
||||
" WHERE IC1.object_id = IC2.object_id\n" +
|
||||
" AND IC1.index_id = IC2.index_id\n" +
|
||||
" GROUP BY\n" +
|
||||
" IC1.object_id,\n" +
|
||||
" C.name,\n" +
|
||||
" index_id \n" +
|
||||
" FOR XML PATH('')\n" +
|
||||
" ),\n" +
|
||||
" 1,\n" +
|
||||
" 2,\n" +
|
||||
" ''\n" +
|
||||
" ) IncludedColumns\n" +
|
||||
" FROM sys.index_columns IC2 \n" +
|
||||
" --WHERE IC2.Object_id = object_id('Person.Address') --Comment for all tables\n" +
|
||||
" GROUP BY\n" +
|
||||
" IC2.object_id,\n" +
|
||||
" IC2.index_id\n" +
|
||||
" ) tmp1\n" +
|
||||
" WHERE IncludedColumns IS NOT NULL\n" +
|
||||
" ) tmp2\n" +
|
||||
" ON tmp2.object_id = I.object_id\n" +
|
||||
" AND tmp2.index_id = I.index_id\n" +
|
||||
" WHERE I.is_primary_key = 0\n" +
|
||||
" AND I.is_unique_constraint = 0 and\n" +
|
||||
" t.name = @tableName\n" +
|
||||
" --AND I.Object_id = object_id('Person.Address') --Comment for all tables\n" +
|
||||
" --AND I.name = 'IX_Address_PostalCode' --comment for all indexes \n" +
|
||||
" union all\n" +
|
||||
" SELECT 'ALTER TABLE ' + schema_name(fk.schema_id) + '.' + object_name(fk.parent_object_id)+ ' DROP CONSTRAINT ' + name + CHAR(13) + CHAR(10) + ' GO'\n" +
|
||||
" from sys.foreign_keys fk\n" +
|
||||
" where (object_name(fk.referenced_object_id) = @tableName)\n" +
|
||||
" union all\n" +
|
||||
" SELECT 'EXEC dbo.DropPrimaryKey '''+@tableName+''''+ CHAR(13) + CHAR(10) + ' GO' \n" +
|
||||
" FROM sysobjects sysobjects_a, \n" +
|
||||
" sysobjects sysobjects_b\n" +
|
||||
" WHERE ( sysobjects_a.parent_obj = sysobjects_b.id) and \n" +
|
||||
" ( sysobjects_a.xtype = 'PK' ) and \n" +
|
||||
" ( sysobjects_b.name = @tableName )\n" +
|
||||
" union all\n" +
|
||||
" SELECT 'ALTER TABLE ' + schema_name(tb.schema_id) + '.' + tb. name + ' ADD CONSTRAINT pk_' + tb.name + ' primary key (' + \n" +
|
||||
" ( select STUFF(( select ',' + col.name\n" +
|
||||
" from sys.indexes ix \n" +
|
||||
" inner join sys.index_columns ixc on ix.object_id=ixc.object_id and ix.index_id= ixc.index_id\n" +
|
||||
" inner join sys.columns col on ixc.object_id =col.object_id and ixc.column_id=col.column_id\n" +
|
||||
" where ix.type>0 and (ix.is_primary_key=1 or ix.is_unique_constraint=1)\n" +
|
||||
" and object_name(ix.object_id) = tb.name\n" +
|
||||
" ORDER BY ixc.key_ordinal\n" +
|
||||
" FOR XML PATH('')), 1, 1, '' ) ) + ') ' + @fileGroupData + CHAR(13) + CHAR(10) + ' GO'\n" +
|
||||
" from sys.tables tb\n" +
|
||||
" where tb.name = @tableName and\n" +
|
||||
" object_id in ( select object_id from sys.indexes ix where ix.is_primary_key=1 ) \n" +
|
||||
" union all\n" +
|
||||
" SELECT 'ALTER TABLE ' + schema_name(fk.schema_id) + '.' + object_name(fk.parent_object_id) + \n" +
|
||||
" ' ADD CONSTRAINT ' + FK.NAME + ' FOREIGN KEY (' + \n" +
|
||||
" (SELECT STUFF(( select ',' + c1.NAME \n" +
|
||||
" from sys.foreign_key_columns fkc \n" +
|
||||
" inner join sys.columns c1 on c1.object_id=fkc.parent_object_id and c1.column_id=fkc.parent_column_id \n" +
|
||||
" where fkc.constraint_object_id = fk.OBJECT_ID \n" +
|
||||
" ORDER by fkc.constraint_column_id\n" +
|
||||
" FOR XML PATH('')), 1, 1, '' )) + \n" +
|
||||
" ') REFERENCES ' + OBJECT_NAME(fk.referenced_object_id) + CHAR(13) + CHAR(10) + ' GO'\n" +
|
||||
" from sys.foreign_keys fk\n" +
|
||||
" where ( object_name(fk.referenced_object_id) = @tableName)\n" +
|
||||
" union all\n" +
|
||||
" select 'ALTER TABLE ' + + schema_name(tb.schema_id) + '.' + tb. name + ' ADD ID_PK_TEMP INT IDENTITY; ' + + CHAR(13) + CHAR(10) + 'GO' + CHAR(13) + CHAR(10) + \n" +
|
||||
" 'ALTER TABLE ' + schema_name(tb.schema_id) + '.' + tb. name + ' ADD CONSTRAINT PK_' + tb. name + ' PRIMARY KEY(ID_PK_TEMP) ' + @fileGroupData + '; ' +\n" +
|
||||
"CHAR(13) + CHAR(10) + 'GO' + CHAR(13) + CHAR(10) + \n" +
|
||||
" 'ALTER TABLE ' + schema_name(tb.schema_id) + '.' + tb. name + ' DROP CONSTRAINT PK_' + tb. name + ' ;' + CHAR(13) + CHAR(10) + 'GO'\n" +
|
||||
" from sys.tables tb\n" +
|
||||
" where object_id not in (\n" +
|
||||
" select object_id\n" +
|
||||
" from sys.indexes ix \n" +
|
||||
" where ix.is_primary_key=1 ) and tb.name = @tableName\n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
" OPEN crs_query \n" +
|
||||
" FETCH NEXT FROM crs_query INTO @sqlText\n" +
|
||||
" WHILE @@FETCH_STATUS = 0\n" +
|
||||
" BEGIN\n" +
|
||||
" if @fileName <> '' \n" +
|
||||
" exec sp_writeFile @fileName, @sqlText, 'S' \n" +
|
||||
" else \n" +
|
||||
" select @sqlText\n" +
|
||||
" \n" +
|
||||
"\n" +
|
||||
" FETCH NEXT FROM crs_query INTO @sqlText\n" +
|
||||
" END\n" +
|
||||
" CLOSE crs_query\n" +
|
||||
" DEALLOCATE crs_query \n" +
|
||||
"END");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251118172320 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
createOrUpdateTrigger("tr_changeTipoRiep", "CREATE TRIGGER [dbo].[tr_changeTipoRiep]\n" +
|
||||
" ON [dbo].[ctb_cont]\n" +
|
||||
" INSTEAD OF update\n" +
|
||||
"AS\n" +
|
||||
"BEGIN\n" +
|
||||
" SET NOCOUNT ON;\n" +
|
||||
" declare @cnt int = 0\n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
" if Update(tipo_riep ) \n" +
|
||||
" begin\n" +
|
||||
" SELECT @cnt = COUNT(*) from ctb_movr inner join inserted on ctb_movr.cod_ccon = inserted.cod_ccon and \n" +
|
||||
" ( (inserted.tipo_riep is null and ctb_movr.cod_anag is not null ) or (inserted.tipo_riep is null and ctb_movr.cod_anag is null ) )\n" +
|
||||
" end\n" +
|
||||
" \n" +
|
||||
" \n" +
|
||||
" IF @cnt > 0\n" +
|
||||
" BEGIN\n" +
|
||||
" THROW 50002, 'Update non consentito: esistono movimenti collegati.', 1;\n" +
|
||||
" RETURN;\n" +
|
||||
" END\n" +
|
||||
" \n" +
|
||||
" update ctb_cont \n" +
|
||||
" set cod_cmas = inserted.cod_cmas,\n" +
|
||||
" cod_cgrp = inserted.cod_cgrp,\n" +
|
||||
" descrizione = inserted.descrizione,\n" +
|
||||
" tipo_riep = inserted.tipo_riep,\n" +
|
||||
" saldo_att = inserted.saldo_att,\n" +
|
||||
" flag_cont_analit = inserted.flag_cont_analit,\n" +
|
||||
" cod_biva = inserted.cod_biva,\n" +
|
||||
" cod_jfas = inserted.cod_jfas,\n" +
|
||||
" cod_csct = inserted.cod_csct,\n" +
|
||||
" flag_risconto = inserted.flag_risconto,\n" +
|
||||
" perc_ded = inserted.perc_ded,\n" +
|
||||
" diacod = inserted.diacod,\n" +
|
||||
" data_ins = inserted.data_ins,\n" +
|
||||
" data_mod = inserted.data_mod\n" +
|
||||
" from ctb_cont inner join inserted on ctb_cont.cod_ccon = inserted.cod_ccon\n" +
|
||||
"\n" +
|
||||
"END");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251119084719 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
executeStatement("alter table dtb_note_doc add flag_bio bit not null default 0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251119170058 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetupQuery("COD_PAGA_D", "Codice pagamento", " SELECT COD_PAGA + '|' + COD_PAGA + '-' + DESCRIZIONE FROM gtb_paga WHERE flag_attivo = 'S'");
|
||||
executeStatement("UPDATE stb_gest_setup SET query_default = 'COD_PAGA_D'\n" +
|
||||
"WHERE gest_name = 'CTB_SCAD'\n" +
|
||||
"AND section ='COD_PAGA'",
|
||||
"alter table ctb_caus add flag_paga_enasarco bit default 0 not null");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251120123843 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
executeStatement("alter table gtb_anag alter column citta varchar(60)");
|
||||
|
||||
createOrUpdateFunction("IntToBase36", "CREATE FUNCTION dbo.IntToBase36(@n bigint)\n" +
|
||||
" RETURNS varchar(50)\n" +
|
||||
" AS\n" +
|
||||
" BEGIN\n" +
|
||||
" DECLARE @chars varchar(36) = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n" +
|
||||
" DECLARE @res varchar(50) = '';\n" +
|
||||
" DECLARE @rem bigint;\n" +
|
||||
" IF @n IS NULL RETURN NULL;\n" +
|
||||
" IF @n = 0 RETURN '0';\n" +
|
||||
" WHILE @n > 0\n" +
|
||||
" BEGIN\n" +
|
||||
" SET @rem = @n % 36;\n" +
|
||||
" SET @res = SUBSTRING(@chars, @rem + 1, 1) + @res;\n" +
|
||||
" SET @n = @n / 36;\n" +
|
||||
" END\n" +
|
||||
" RETURN @res;\n" +
|
||||
" END;");
|
||||
createOrUpdateFunction("Base36ToInt", "CREATE FUNCTION dbo.Base36ToInt(@s varchar(50))\n" +
|
||||
" RETURNS bigint\n" +
|
||||
" AS\n" +
|
||||
" BEGIN\n" +
|
||||
" DECLARE @chars varchar(36) = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n" +
|
||||
" DECLARE @i int = 1;\n" +
|
||||
" DECLARE @len int = LEN(@s);\n" +
|
||||
" DECLARE @val bigint = 0;\n" +
|
||||
" DECLARE @c char(1);\n" +
|
||||
" IF @s IS NULL RETURN NULL;\n" +
|
||||
" WHILE @i <= @len\n" +
|
||||
" BEGIN\n" +
|
||||
" SET @c = UPPER(SUBSTRING(@s, @i, 1));\n" +
|
||||
" SET @val = @val * 36 + (CHARINDEX(@c, @chars) - 1);\n" +
|
||||
" SET @i = @i + 1;\n" +
|
||||
" END\n" +
|
||||
" RETURN @val;\n" +
|
||||
" END;");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251120153047 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
executeStatement("alter table gtb_anag alter column rag_soc varchar(100)");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251120172527 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
|
||||
if(!isCustomer(IntegryCustomer.CapelliMonelli)) return;
|
||||
|
||||
createOrUpdateFunction("[f_suggestCodeCodAnag]", "CREATE FUNCTION [dbo].[f_suggestCodeCodAnag](@partialCode varchar(5))\n" +
|
||||
" \n" +
|
||||
"RETURNS varchar(20) \n" +
|
||||
"WITH INLINE = OFF\n" +
|
||||
"AS\n" +
|
||||
"BEGIN\n" +
|
||||
" DECLARE @ls_codAnag VARCHAR(5), @codLen int, @condPartialCode varchar(10), @recuperaCodici varchar(1);\n" +
|
||||
"\n" +
|
||||
" SELECT @condPartialCode= ISNULL(@partialCode, '') + '[0-9]'\n" +
|
||||
"\n" +
|
||||
" SELECT @partialCode = ISNULL(@partialCode, '')\n" +
|
||||
"\n" +
|
||||
" SET @codLen = 5\n" +
|
||||
" \n" +
|
||||
" SELECT @recuperaCodici = dbo.getGestSetup('GTB_ANAG','SETUP','RECUPERA_CODICI')\n" +
|
||||
"\n" +
|
||||
" IF @recuperaCodici = 'S'\n" +
|
||||
" BEGIN\n" +
|
||||
" SELECT @ls_codAnag = (\n" +
|
||||
" SELECT top 1 @partialCode + REPLICATE('0', 5 - len(@partialCode) - len(row_id)) + cast(row_id as varchar)\n" +
|
||||
" from (\n" +
|
||||
" select cast(SUBSTRING(cod_anag, len(@partialCode) + 1, len(cod_anag) - len(@partialCode) + 1) as int) as num_code, \n" +
|
||||
" ROW_NUMBER() over (order by cast(SUBSTRING(cod_anag, len(@partialCode) + 1, len(cod_anag) - len(@partialCode) + 1) as int)) as row_id\n" +
|
||||
" from gtb_anag\n" +
|
||||
" where cod_anag like @condPartialCode+'%') tmp \n" +
|
||||
" where tmp.num_code > tmp.row_id and tmp.num_code <> 0)\n" +
|
||||
" END\n" +
|
||||
"\n" +
|
||||
" if @ls_codAnag is null \n" +
|
||||
" begin \n" +
|
||||
" SELECT @ls_codAnag = @partialCode + REPLICATE('0', @codLen - len(@partialCode) - len(dbo.IntToBase36(max_code.partial_code))) + Cast(dbo.IntToBase36(max_code.partial_code) as varchar)\n" +
|
||||
" from ( \n" +
|
||||
" SELECT cast(IsNull(max(try_cast(substring(cod_anag, len(@partialCode)+1, len(cod_anag) - len(@partialCode)) as numeric)), 0) + 1 as varchar) as partial_code\n" +
|
||||
" FROM gtb_anag\n" +
|
||||
" WHERE cod_anag like @partialCode + '%' ) max_code;\n" +
|
||||
" end \n" +
|
||||
" RETURN @ls_codAnag;\n" +
|
||||
"END");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251120181812 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
createOrUpdateView("cvw_tipi_pdc", "CREATE VIEW cvw_tipi_pdc AS\n" +
|
||||
"SELECT '1' AS codice, Upper('Attivo') descrizione, '1' as sezione\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT '2', Upper('Passivo'), '1' as sezione\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT '3', Upper('Netto'), '1' as sezione\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT '4', Upper('Costi'), '2' as sezione\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT '5', Upper('Ricavi'), '2' as sezione\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT '6', Upper('D''ordine'), '3'\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT '7', Upper('Epilogativi'), '3'");
|
||||
createOrUpdateView("cvw_sezione_pdc", "CREATE VIEW cvw_sezione_pdc AS\n" +
|
||||
"SELECT '1' AS codice, Upper('Stato Patrimoniale') AS descrizione\n" +
|
||||
"UNION ALL\n" +
|
||||
"SELECT '2', Upper('Conto Economico')\n" +
|
||||
"UNION ALL\n" +
|
||||
"SELECT '3', upper('Conti d''ordine e di Riepilogo')");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251121105212 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
addDefault("mtb_lisv", "add_ric_spese", 1);
|
||||
addDefault("mtb_lisv", "add_sco_spese", 1);
|
||||
addDefault("mtb_lisv", "add_val_spese", 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251121132504 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetupQuery("SI_NO", "SI_NO", "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
createSetup("VTB_LIST", "SETUP", "GESTISCI_SPESE_LISTINO", "N",
|
||||
"permette di gestire le spese di trasporto agganciate a listino", false, "SI_NO", false, false,
|
||||
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
|
||||
if (isCustomer(IntegryCustomer.RossoGargano))
|
||||
updateSetupValue("VTB_LIST", "SETUP", "GESTISCI_SPESE_LISTINO", "S");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251121133310 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomer(IntegryCustomer.Carelli) || isCustomer(IntegryCustomer.SaporiVeri)) return;
|
||||
updateSetupValue("W_VLISTDATA_RC", "SETUP", "FILTRO_ARTICOLI", "N");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251121140004 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetupQuery("SI_NO", "SI_NO", "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
createSetup("PICKING", "SPEDIZIONE", "FLAG_UNDERFLOW_QUANTITY_WARNING", "N",
|
||||
"Avvisa l'operatore che sta prelevando una quantità inferiore rispetto a quella disponibile nel UL", false, "SI_NO", false, false,
|
||||
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
|
||||
if (isCustomer(IntegryCustomer.RossoGargano)) {
|
||||
updateSetupValue("PICKING", "SPEDIZIONE", "FLAG_UNDERFLOW_QUANTITY_WARNING", "S");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251121150257 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
createOrUpdateFunction("getMaggiorazioneSpese", "CREATE FUNCTION [dbo].[getMaggiorazioneSpese](@dataValidita datetime, @codVlis varchar(5), @codSpes varchar(5)) \n" +
|
||||
"RETURNS TABLE AS \n" +
|
||||
" return \n" +
|
||||
" select vtb_list.cod_vlis, \n" +
|
||||
" vtb_list.descrizione, \n" +
|
||||
" case when tmp_lisv_spese.max_lisv is null then null else Convert(datetime, left(tmp_lisv_spese.max_lisv, 10)) end as data_iniz, \n" +
|
||||
" case when tmp_lisv_spese.max_lisv is null then null else Convert(int, right(tmp_lisv_spese.max_lisv, 4)) end as versione, \n" +
|
||||
" vtb_list.cod_divi,\n" +
|
||||
" tmp_lisv_spese.cod_spes as 'cod_spes', \n" +
|
||||
" IsNull(mtb_lisv_data_spese.perc_ricarico, 0) as perc_ricarico, \n" +
|
||||
" IsNull(mtb_lisv_data_spese.val_ricarico, 0) as val_ricarico,\n" +
|
||||
" mtb_lisv_data_spese.da as da,\n" +
|
||||
" mtb_lisv_data_spese.a as a,\n" +
|
||||
" IsNull(mtb_lisv_data_spese.perc_sconto, 0) as perc_sconto,\n" +
|
||||
" mtb_lisv_data_spese.id\n" +
|
||||
" from ( SELECT vtb_list.cod_vlis as cod_vlis, \n" +
|
||||
" mtb_lisv_data_spese.cod_spes, \n" +
|
||||
" max(case when vtb_list_data.versione is null then null else Convert(varchar(10), vtb_list_data.data_iniz, 111) + ' ' + replicate('0', 4 - len(vtb_list_data.versione)) + Convert(varchar(5), vtb_list_data.versione) end ) as max_lisv,\n" +
|
||||
" vtb_list.cod_vlis as 'cod_vlis_rif'\n" +
|
||||
" FROM vtb_list, \n" +
|
||||
" mtb_lisv_data_spese LEFT OUTER JOIN vtb_list_data ON mtb_lisv_data_spese.cod_vlis = vtb_list_data.cod_vlis AND \n" +
|
||||
" mtb_lisv_data_spese.versione = vtb_list_data.versione and \n" +
|
||||
" vtb_list_data.cod_promo is null AND\n" +
|
||||
" vtb_list_data.data_iniz <= IsNull(@dataValidita, GetDate())\n" +
|
||||
" WHERE vtb_list.cod_vlis = mtb_lisv_data_spese.cod_vlis and vtb_list.cod_vlis_rif is null\n" +
|
||||
" GROUP BY vtb_list.cod_vlis,\n" +
|
||||
" mtb_lisv_data_spese.cod_spes\n" +
|
||||
" union\n" +
|
||||
" SELECT vtb_list.cod_vlis as cod_vlis, \n" +
|
||||
" mtb_lisv_data_spese.cod_spes, \n" +
|
||||
" max(case when vtb_list_data.versione is null then null else Convert(varchar(10), vtb_list_data.data_iniz, 111) + ' ' + replicate('0', 4 - len(vtb_list_data.versione)) + Convert(varchar(5), vtb_list_data.versione) end ) as max_lisv,\n" +
|
||||
" vtb_list.cod_vlis_rif as 'cod_vlis_rif'\n" +
|
||||
" FROM vtb_list, \n" +
|
||||
" mtb_lisv_data_spese \n" +
|
||||
" LEFT OUTER JOIN vtb_list_data ON mtb_lisv_data_spese.cod_vlis = vtb_list_data.cod_vlis AND \n" +
|
||||
" mtb_lisv_data_spese.versione = vtb_list_data.versione and \n" +
|
||||
" vtb_list_data.cod_promo is null AND\n" +
|
||||
" vtb_list_data.data_iniz <= IsNull(@dataValidita, GetDate())\n" +
|
||||
" WHERE vtb_list.cod_vlis_rif = mtb_lisv_data_spese.cod_vlis and vtb_list.cod_vlis_rif is not null\n" +
|
||||
" GROUP BY vtb_list.cod_vlis,\n" +
|
||||
" mtb_lisv_data_spese.cod_spes, \n" +
|
||||
" vtb_list.cod_vlis_rif ) tmp_lisv_spese LEFT OUTER JOIN mtb_lisv_data_spese ON tmp_lisv_spese.cod_vlis_rif = mtb_lisv_data_spese.cod_vlis AND \n" +
|
||||
" tmp_lisv_spese.cod_spes = mtb_lisv_data_spese.cod_spes AND\n" +
|
||||
" Convert(int, right( tmp_lisv_spese.max_lisv, 4)) = mtb_lisv_data_spese.versione, \n" +
|
||||
" vtb_list,\n" +
|
||||
" gtb_spes\n" +
|
||||
" WHERE vtb_list.cod_vlis = tmp_lisv_spese.cod_vlis and \n" +
|
||||
" ( @codSpes is null or tmp_lisv_spese.cod_spes = @codSpes ) and\n" +
|
||||
" ( @codVlis is null or tmp_lisv_spese.cod_vlis = @codVlis) and\n" +
|
||||
" tmp_lisv_spese.cod_spes = gtb_spes.cod_spes");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251121165211 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if(isCustomer(IntegryCustomer.Biolevante)) {
|
||||
createOrUpdateFunction("[getSchedaCosti]", "CREATE FUNCTION [dbo].[getSchedaCosti](@CodProd VARCHAR(15), @DataCosto DATETIME, @codVlis VARCHAR(5),\n" +
|
||||
" @tipoCosto VARCHAR(2))\n" +
|
||||
" RETURNS TABLE\n" +
|
||||
" AS\n" +
|
||||
" RETURN\n" +
|
||||
" (\n" +
|
||||
"/*\n" +
|
||||
"\n" +
|
||||
"declare @CodProd VARCHAR(15), @DataCosto DATETIME, @codVlis VARCHAR(5), @tipoCosto varchar(2)\n" +
|
||||
"\n" +
|
||||
"set @codProd = 'ccondib1lev'\n" +
|
||||
"set @dataCosto = Cast(getDAte() as date)\n" +
|
||||
"set @tipoCosto = 'UC';\n" +
|
||||
"set @codVlis = '0036';\n" +
|
||||
"*/\n" +
|
||||
"/*tipoCosto: \n" +
|
||||
" UC = Ultimo costo\n" +
|
||||
" CM = Costo di mercato */\n" +
|
||||
" WITH gruppi_merc AS (SELECT cod_mgrp,\n" +
|
||||
" descrizione,\n" +
|
||||
" tipo_mgrp,\n" +
|
||||
" CASE tipo_mgrp\n" +
|
||||
" WHEN 'MP' THEN '01'\n" +
|
||||
" WHEN 'IMB' THEN '02'\n" +
|
||||
" WHEN 'ACC' THEN '03'\n" +
|
||||
" WHEN 'SL' THEN '04'\n" +
|
||||
" WHEN 'PF' THEN '04'\n" +
|
||||
" ELSE 11 END AS sort_categ,\n" +
|
||||
" CASE tipo_mgrp\n" +
|
||||
" WHEN 'MP' THEN 'MATERIE PRIME'\n" +
|
||||
" WHEN 'IMB' THEN 'IMBALLAGGI'\n" +
|
||||
" WHEN 'ACC' THEN 'MATERIALE ACCESSORIO'\n" +
|
||||
" WHEN 'SL' THEN 'COSTO LAVORAZIONI'\n" +
|
||||
" WHEN 'PF' THEN 'COSTO LAVORAZIONI'\n" +
|
||||
" ELSE tipo_mgrp\n" +
|
||||
" END AS categoria,\n" +
|
||||
" CASE WHEN tipo_mgrp IN ('MP', 'IMB', 'ACC') THEN 1 ELSE 0 END AS isMateriaPrima\n" +
|
||||
" from mtb_grup)\n" +
|
||||
" ,explode_dist AS (\n" +
|
||||
" SELECT CASE WHEN sfuso.cod_mart IS NOT NULL THEN 1 ELSE 0 END AS isSfuso,\n" +
|
||||
" ISNULL(ISNULL(sfuso.cod_mart, dist.cod_prod), mtb_aart.cod_mart) AS cod_mart,\n" +
|
||||
" dist.flag_foglia,\n" +
|
||||
" dist.unt_mis_prod AS unt_mis_art,\n" +
|
||||
" mtb_aart.unt_mis AS unt_mis_prod,\n" +
|
||||
" dist.qta_prod * ISNULL(sfuso.PercProd, 1) AS qta_prod,\n" +
|
||||
" case when sfuso.cod_mart IS not null \n" +
|
||||
" then\n" +
|
||||
" /*se si tratta di un mix pendiamo il costo dei materiali dalla mtb_aart*/\n" +
|
||||
" sfuso_art.val_ult_car\n" +
|
||||
" else\n" +
|
||||
" ROUND(ISNULL(dist.costo_materiali, 0) / dist.qta_prod *\n" +
|
||||
" ISNULL(sfuso.PercProd, 1),\n" +
|
||||
" 5) end AS costo_unt,\n" +
|
||||
" ISNULL( (case \n" +
|
||||
" when sfuso.cod_mart IS not null \n" +
|
||||
" then sfuso_art.val_ult_car * dist.qta_prod \n" +
|
||||
" else dist.costo_materiali end ) \n" +
|
||||
" * ISNULL(sfuso.PercProd, 1), 0) AS costo_materiali,\n" +
|
||||
" \n" +
|
||||
" ISNULL(dist.costo_manodopera, 0) +\n" +
|
||||
" ISNULL(dist.costo_manodopera_magaz, 0) +\n" +
|
||||
" ISNULL(dist.costo_servizi, 0) \n" +
|
||||
" AS altri_costi\n" +
|
||||
" FROM dbo.f_explodedist(@codprod, 1, 'U', @datacosto, 'S', 'S') dist\n" +
|
||||
" INNER JOIN mtb_aart\n" +
|
||||
" ON mtb_aart.cod_mart = ISNULL(dist.cod_prod_pri, dist.cod_prod) \n" +
|
||||
" LEFT OUTER JOIN olvw_miscele_olio miscele ON dist.cod_prod = miscele.cod_mart\n" +
|
||||
" LEFT OUTER JOIN olvw_distinta_sfuso sfuso\n" +
|
||||
" ON dist.cod_prod_pri = sfuso.cod_prod AND\n" +
|
||||
" dist.cod_prod = miscele.cod_mart\n" +
|
||||
" LEFT OUTER JOIN mtb_aart sfuso_art on sfuso.cod_mart = sfuso_art.cod_mart\n" +
|
||||
"\n" +
|
||||
" )\n" +
|
||||
" , distinta_base AS (\n" +
|
||||
" SELECT 1 AS sort,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN explode_dist.flag_foglia = 1 THEN gruppi_merc.sort_categ ELSE '4' END as sort_categ,\n" +
|
||||
" gruppi_merc.tipo_mgrp,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN explode_dist.flag_foglia = 1 THEN gruppi_merc.categoria ELSE 'COSTO LAVORAZIONI' END as categoria,\n" +
|
||||
" mtb_aart.cod_msgr, \n" +
|
||||
" CASE\n" +
|
||||
" WHEN explode_dist.flag_foglia = 1 --OR gruppi_merc.isMateriaPrima = 1\n" +
|
||||
" THEN mtb_aart.descrizione\n" +
|
||||
" ELSE 'MANO DOPERA E ALTRI COSTI DI PRODUZIONE (' + gruppi_merc.tipo_mgrp + ')' END AS descr_costo,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN explode_dist.flag_foglia = 1 --OR gruppi_merc.isMateriaPrima = 1\n" +
|
||||
" THEN explode_dist.cod_mart\n" +
|
||||
" END AS cod_mart,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN explode_dist.flag_foglia = 1 --OR gruppi_merc.isMateriaPrima = 1\n" +
|
||||
" THEN explode_dist.unt_mis_art\n" +
|
||||
" ELSE explode_dist.unt_mis_prod END AS unt_mis,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN explode_dist.flag_foglia = 1 --OR gruppi_merc.isMateriaPrima = 1\n" +
|
||||
" THEN explode_dist.qta_prod\n" +
|
||||
" ELSE 1 END AS qta_prod,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN explode_dist.flag_foglia = 1 --OR gruppi_merc.isMateriaPrima = 1 \n" +
|
||||
" THEN\n" +
|
||||
" CASE\n" +
|
||||
" WHEN @tipoCosto = 'CM' THEN ISNULL(lisa.costo_mercato, 0)\n" +
|
||||
" ELSE explode_dist.costo_unt END\n" +
|
||||
" ELSE explode_dist.altri_costi END AS costo_unit,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN explode_dist.flag_foglia = 1 THEN\n" +
|
||||
" CASE\n" +
|
||||
" WHEN @tipoCosto = 'CM'\n" +
|
||||
" THEN ISNULL(lisa.costo_mercato, 0) * explode_dist.qta_prod\n" +
|
||||
" ELSE explode_dist.costo_materiali END +\n" +
|
||||
" --ISNULL(oneri_acq.costo_kg * explode_dist.qta_prod, 0)\n" +
|
||||
" CASE WHEN @tipoCosto = 'CM'\n" +
|
||||
" THEN ISNULL(oneri_acq.costo_kg * explode_dist.qta_prod, 0)\n" +
|
||||
" ELSE 0 END\n" +
|
||||
" ELSE explode_dist.altri_costi END costo_materiali,\n" +
|
||||
" CONVERT(VARCHAR(4), 'VAL') AS qualificatore,\n" +
|
||||
" CONVERT(VARCHAR(1), 'V') AS tipo_calcolo,\n" +
|
||||
" dati_listino.dati AS dati_listino\n" +
|
||||
" FROM explode_dist\n" +
|
||||
" INNER JOIN mtb_aart ON explode_dist.cod_mart = mtb_aart.cod_mart\n" +
|
||||
" INNER JOIN gruppi_merc ON mtb_aart.cod_mgrp = gruppi_merc.cod_mgrp\n" +
|
||||
" OUTER APPLY (SELECT LISA.COD_MART,\n" +
|
||||
" AVG(prz_acq_netto_um) AS costo_mercato\n" +
|
||||
" FROM dbo.getListinoAcquisto(DATEADD(MONTH, 1, @DataCosto),\n" +
|
||||
" NULL, NULL, mtb_aart.cod_mart,\n" +
|
||||
" 'S', NULL) lisa\n" +
|
||||
" WHERE ( Lisa.tipo_variazione is null OR lisa.tipo_variazione <> 'D' )\n" +
|
||||
" AND lisa.flag_attivo = 'S'\n" +
|
||||
" AND lisa.flag_forn_pref = 'S'\n" +
|
||||
" AND @tipoCosto = 'CM'\n" +
|
||||
" GROUP BY lisa.cod_mart) lisa\n" +
|
||||
" OUTER APPLY (SELECT STUFF((SELECT '~' + lisa.cod_alis + ' - ' +\n" +
|
||||
" lisa.descrizione + ' DEL ' +\n" +
|
||||
" CONVERT(VARCHAR(10), lisa.data_iniz, 103) +\n" +
|
||||
" ' PREZZO: ' +\n" +
|
||||
" FORMAT(prz_acq_netto_um, '#,##0.00###') +\n" +
|
||||
" '€' AS [text()]\n" +
|
||||
" FROM dbo.getListinoAcquisto(\n" +
|
||||
" DATEADD(WEEK, 1, @DataCosto),\n" +
|
||||
" NULL, NULL, mtb_aart.cod_mart,\n" +
|
||||
" 'S', NULL) lisa\n" +
|
||||
" WHERE lisa.tipo_variazione <> 'D'\n" +
|
||||
" AND lisa.flag_attivo = 'S'\n" +
|
||||
" AND lisa.flag_forn_pref = 'S'\n" +
|
||||
" AND @tipoCosto = 'CM'\n" +
|
||||
" FOR XML PATH('')), 1, 1,\n" +
|
||||
" '') AS dati) dati_listino\n" +
|
||||
" OUTER APPLY (SELECT SUM(conai.costo_kg * mtb_spes.qta_spes) AS costo_kg\n" +
|
||||
" FROM mtb_aart arti\n" +
|
||||
" INNER JOIN mtb_spes ON arti.cod_mart = mtb_spes.cod_mart\n" +
|
||||
" LEFT OUTER JOIN (SELECT cod_conai,\n" +
|
||||
" da_data,\n" +
|
||||
" LEAD(\n" +
|
||||
" DATEADD(DAY, -1, da_data),\n" +
|
||||
" 1,\n" +
|
||||
" CAST(GETDATE() AS DATE))\n" +
|
||||
" OVER (PARTITION BY cod_conai ORDER BY da_data) AS a_data,\n" +
|
||||
" costo_kg\n" +
|
||||
" FROM gtb_conai_costi) conai\n" +
|
||||
" ON mtb_spes.cod_spes =\n" +
|
||||
" conai.cod_conai AND\n" +
|
||||
" CAST(GETDATE() AS DATE) BETWEEN da_data AND a_data\n" +
|
||||
" WHERE arti.cod_mart = mtb_aart.cod_mart) AS oneri_acq )\n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
" SELECT sort,\n" +
|
||||
" sort_categ AS group_categ,\n" +
|
||||
" sort_categ,\n" +
|
||||
" tipo_mgrp,\n" +
|
||||
" categoria,\n" +
|
||||
" cod_msgr,\n" +
|
||||
" descr_costo,\n" +
|
||||
" cod_mart,\n" +
|
||||
" unt_mis,\n" +
|
||||
" ROUND(qta_prod, 4) AS qta_prod,\n" +
|
||||
" /*costo_unit,*/\n" +
|
||||
" CASE\n" +
|
||||
" WHEN qta_prod > 0 THEN ROUND(ISNULL(costo_materiali, 0) / qta_prod, 5)\n" +
|
||||
" ELSE 0 END AS costo_unit,\n" +
|
||||
" ROUND(ISNULL(costo_materiali, 0), 5) AS valore,\n" +
|
||||
" qualificatore,\n" +
|
||||
" tipo_calcolo,\n" +
|
||||
" dati_listino\n" +
|
||||
" FROM distinta_base\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT CASE WHEN tipo_calcolo = 'LAVORAZIONE' THEN 1 ELSE 2 END AS sort,\n" +
|
||||
" CASE WHEN tipo_calcolo = 'LAVORAZIONE' THEN 4 ELSE 5 END AS group_categ,\n" +
|
||||
" 20,\n" +
|
||||
" NULL,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN tipo_calcolo = 'LAVORAZIONE' THEN 'COSTO LAVORAZIONI'\n" +
|
||||
" ELSE 'COSTI DIRETTI COMMERCIALI E CONSEGNA' END,\n" +
|
||||
" NULL,\n" +
|
||||
" jtb_dist_clav_dir.descrizione,\n" +
|
||||
" jtb_dist_clav_dir.cod_prod,\n" +
|
||||
" jtb_dist_clav_dir.unt_mis,\n" +
|
||||
" jtb_dist_clav_dir.qta_lav / jtb_cicl.qta_prod / jtb_cicl.rap_conv_prod AS qta_lav,\n" +
|
||||
" jtb_dist_clav_dir.val_unt,\n" +
|
||||
" (jtb_dist_clav_dir.qta_lav * jtb_dist_clav_dir.val_unt / jtb_cicl.qta_prod /\n" +
|
||||
" jtb_cicl.rap_conv_prod),\n" +
|
||||
" CONVERT(VARCHAR(4), 'VAL') AS qualificatore,\n" +
|
||||
" CONVERT(VARCHAR(1), 'V') AS tipo_calcolo,\n" +
|
||||
" NULL AS dati_listino\n" +
|
||||
" FROM jtb_dist_clav_dir\n" +
|
||||
" INNER JOIN jtb_cicl ON jtb_cicl.cod_prod = jtb_dist_clav_dir.cod_prod\n" +
|
||||
" INNER JOIN gtb_spes ON jtb_dist_clav_dir.cod_jcos_dir = gtb_spes.cod_spes\n" +
|
||||
" WHERE jtb_dist_clav_dir.cod_prod = (@codprod)\n" +
|
||||
" AND gtb_spes.tipo_calcolo IN ('TRASPORTO PER KG', 'TRASPORTO PER COLLO', 'COMMERCIALI', 'LAVORAZIONE')\n" +
|
||||
" AND jtb_dist_clav_dir.flag_fase_pref = 'S'\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT 2,\n" +
|
||||
" 5 AS group_categ,\n" +
|
||||
" 21,\n" +
|
||||
" NULL,\n" +
|
||||
" 'COSTI DIRETTI COMMERCIALI E CONSEGNA',\n" +
|
||||
" NULL,\n" +
|
||||
" jtb_clav_ind.descrizione,\n" +
|
||||
" NULL,\n" +
|
||||
" NULL,\n" +
|
||||
" NULL,\n" +
|
||||
" NULL,\n" +
|
||||
" jtb_dist_clav_ind.perc_cost,\n" +
|
||||
" CONVERT(VARCHAR(4), 'PERC') AS qualificatore,\n" +
|
||||
" jtb_clav_ind.tipo_calcolo AS tipo_calcolo,\n" +
|
||||
" NULL AS dati_listino\n" +
|
||||
" FROM jtb_dist_clav_ind\n" +
|
||||
" INNER JOIN jtb_clav_ind ON jtb_clav_ind.cod_jcos_ind = jtb_dist_clav_ind.cod_jcos_ind\n" +
|
||||
" WHERE jtb_dist_clav_ind.cod_prod = (@codprod)\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT sort,\n" +
|
||||
" group_categ,\n" +
|
||||
" sort_categ,\n" +
|
||||
" tipo_mgrp,\n" +
|
||||
" categoria,\n" +
|
||||
" cod_msgr,\n" +
|
||||
" descr_costo,\n" +
|
||||
" cod_mart,\n" +
|
||||
" unt_mis,\n" +
|
||||
" ROUND(qta_prod, 4) AS qta_prod,\n" +
|
||||
" costo_unit,\n" +
|
||||
" valore,\n" +
|
||||
" qualificatore,\n" +
|
||||
" tipo_calcolo,\n" +
|
||||
" dati_listino\n" +
|
||||
" FROM dbo.getSchedaCosti_DatiCommerciali(@codprod, @DataCosto, @codvlis) AS dati_commerciali\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT 3,\n" +
|
||||
" 6 AS group_categ,\n" +
|
||||
" 31,\n" +
|
||||
" NULL,\n" +
|
||||
" 'COSTI INDIRETTI',\n" +
|
||||
" NULL,\n" +
|
||||
" 'COSTI GENERALI INCIDENZA A PERCENTUALE',\n" +
|
||||
" jtb_cicl.cod_mart,\n" +
|
||||
" NULL,\n" +
|
||||
" NULL,\n" +
|
||||
" NULL,\n" +
|
||||
" ISNULL(jtb_cicl.perc_cost_gen, 0) AS perc_costi_gen,\n" +
|
||||
" CONVERT(VARCHAR(4), 'PERC') AS qualificatore,\n" +
|
||||
" CONVERT(VARCHAR(1), 'V') AS tipo_calcolo,\n" +
|
||||
" NULL AS dati_listino\n" +
|
||||
" FROM mtb_aart\n" +
|
||||
" INNER JOIN jtb_cicl ON mtb_aart.cod_mart = jtb_cicl.cod_prod \n" +
|
||||
" WHERE mtb_aart.cod_mart = (@codprod) \n" +
|
||||
" )");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251121183801 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomer(IntegryCustomer.Materica) && !isCustomer(IntegryCustomer.Ime)) return;
|
||||
updateSetupValue("CRM", "COD_CCON", "PREFISSO_I", "105000");
|
||||
updateSetupValue("CRM", "COD_CCON", "DEFAULT", "111000");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
import it.integry.ems_model.utility.dto.IndexTableDTO;
|
||||
import it.integry.ems_model.utility.dto.PkTableDTO;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Migration_20251124102759 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomer(IntegryCustomer.Carelli) || isCustomer(IntegryCustomer.RistoCash)) {
|
||||
executeStatement("create table apuliac_perc_premio (\n" +
|
||||
"id bigint identity,\n" +
|
||||
"cod_forn varchar(10) not null,\n" +
|
||||
"divisione varchar(10),\n" +
|
||||
"perc_premio numeric(5,3) not null default 0 )");
|
||||
|
||||
|
||||
PkTableDTO pkTableDTO = new PkTableDTO()
|
||||
.setTableName("apuliac_perc_premio")
|
||||
.addColumn(new PkTableDTO.Column("id"));
|
||||
createPrimaryKey(pkTableDTO);
|
||||
|
||||
IndexTableDTO indexTableDTO = new IndexTableDTO()
|
||||
.setTableName("apuliac_perc_premio")
|
||||
.setIndexName("ix_apuliac_perc_premio_codforn_div")
|
||||
.setUnique(true)
|
||||
.setColumnsIndex(Arrays.asList(
|
||||
new IndexTableDTO.ColumnIndex("cod_forn"),
|
||||
new IndexTableDTO.ColumnIndex("divisione")
|
||||
));
|
||||
|
||||
createIndex(indexTableDTO);
|
||||
|
||||
executeStatement("exec sp_rename 'apuliac_agg_prz_csv.altro', 'divisione_premio'");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251124135552 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
createOrUpdateFunction("getGrigliaAcquisto","CREATE FUNCTION [dbo].[getGrigliaAcquisto] (@dataValidita datetime, @codAlis varchar(5), @codMdep varchar(5), @codArtFor varchar(25), @codMart varchar(15)) RETURNS TABLE AS\n" +
|
||||
"return\n" +
|
||||
"SELECT *\n" +
|
||||
"FROM (SELECT atb_griglie.cod_alis,\n" +
|
||||
" atb_griglie.cod_mdep,\n" +
|
||||
" atb_griglie.data_validita,\n" +
|
||||
" atb_griglie.note,\n" +
|
||||
" atb_griglie_art.cod_art_for,\n" +
|
||||
" atb_griglie_art.cod_mart,\n" +
|
||||
" atb_griglie_art.tipo_assortimento,\n" +
|
||||
" atb_griglie_art.tipo_variazione,\n" +
|
||||
" ROW_NUMBER() OVER (PARTITION BY atb_griglie.cod_alis,\n" +
|
||||
" atb_griglie.cod_mdep,\n" +
|
||||
" atb_griglie_art.cod_mart,\n" +
|
||||
" atb_griglie_art.cod_art_for ORDER BY atb_griglie.data_validita DESC) AS last_griglia\n" +
|
||||
" FROM atb_griglie\n" +
|
||||
" INNER JOIN atb_griglie_art ON atb_griglie.cod_alis = atb_griglie_art.cod_alis AND\n" +
|
||||
" atb_griglie.cod_mdep = atb_griglie_art.cod_mdep AND\n" +
|
||||
" atb_griglie.data_validita = atb_griglie_art.data_validita\n" +
|
||||
" WHERE atb_griglie.data_validita <= COALESCE(@datavalidita, CAST(GETDATE() AS DATE))\n" +
|
||||
" AND (@codmdep IS NULL OR atb_griglie.cod_mdep = @codmdep)\n" +
|
||||
" AND (@codalis IS NULL OR atb_griglie.cod_alis = @codalis)\n" +
|
||||
" AND (@codartfor IS NULL OR atb_griglie_art.cod_art_for = @codartfor)\n" +
|
||||
" AND (@codmart IS NULL OR atb_griglie_art.cod_mart = @codmart)) t\n" +
|
||||
"WHERE last_griglia = 1\n" +
|
||||
"\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251124143153 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetupQuery("TIPO_GRIGLIA", "tipo griglia", "SELECT 'A|GRIGLIA DI ACQUISTO'\n" +
|
||||
"UNION ALL\n" +
|
||||
"SELECT 'V|GRIGLIA DI VENDITA'");
|
||||
createSetup
|
||||
("PVM", "RILEVAZIONI_STEUP", "TIPO_GRIGLIA", null,
|
||||
"Indicare per ogni reparto se la griglia per l'assortimento è quella di acquisto o di vendita",
|
||||
false, "TIPO_GRIGLIA", true, false, false, false, false, "jtb_fasi", false,
|
||||
"SELECT 'A|GRIGLIA DI ACQUISTO'\n" +
|
||||
"UNION ALL\n" +
|
||||
"SELECT 'V|GRIGLIA DI VENDITA'");
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Carelli_Winact)) return;
|
||||
|
||||
executeStatement("insert into stb_gest_setup_det \n" +
|
||||
"select gest_name, section, key_section, tipo_setup, f.cod_jfas, f.valUe\n" +
|
||||
"from stb_gest_setup\n" +
|
||||
"cross apply (\n" +
|
||||
"select distinct jtb_fasi.cod_jfas,\n" +
|
||||
"IIF (jtb_fasi.cod_jfas = '01' OR jtb_fasi.cod_jfas = '02', 'V', 'A') as valUe\n" +
|
||||
"from jtb_fasi inner join jrl_fasi_mtb_grup on jtb_fasi.cod_jfas = jrl_fasi_mtb_grup.cod_jfas ) f\n" +
|
||||
"where gest_name = 'PVM' \n" +
|
||||
"and section = 'RILEVAZIONI_STEUP'\n" +
|
||||
"and key_section = 'TIPO_GRIGLIA'\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251124161416 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Carelli_Winact)) return;
|
||||
|
||||
createOrUpdateFunction("[steup_getGrigliaVendita]", "CREATE FUNCTION [dbo].[steup_getGrigliaVendita](\n" +
|
||||
" @codMdep VARCHAR(5), @codJfas VARCHAR(5), @dataIspezione datetime\n" +
|
||||
")\n" +
|
||||
" RETURNS TABLE\n" +
|
||||
" AS\n" +
|
||||
" RETURN(WITH tipiArt AS (SELECT value_string AS cod_mtip\n" +
|
||||
" FROM dbo.ParseStringIntoArray((SELECT value\n" +
|
||||
" FROM stb_gest_setup\n" +
|
||||
" WHERE gest_name = 'PVM'\n" +
|
||||
" AND section = 'RILEVAZIONI_STEUP'\n" +
|
||||
" AND key_section = 'EXCLUDE_COD_MTIP'), '|') t)\n" +
|
||||
" , art AS (SELECT DISTINCT cod_griglia, cod_mart\n" +
|
||||
" FROM carelli.dbo.vtb_griglia_art\n" +
|
||||
" WHERE cod_griglia = @codMdep\n" +
|
||||
" AND data_validita =\n" +
|
||||
" (SELECT MAX(data_validita) FROM carelli.dbo.vtb_griglia_art WHERE cod_griglia = @codMdep AND data_validita <=@dataIspezione)\n" +
|
||||
" )\n" +
|
||||
" \n" +
|
||||
" SELECT DISTINCT case when @codJfas = '01' then art_det.cod_mart_griglia else mtb_aart.cod_mart end as cod_mart,\n" +
|
||||
" mtb_aart.descrizione,\n" +
|
||||
" mtb_aart.bar_code,\n" +
|
||||
" mtb_aart.cod_msgr,\n" +
|
||||
" mtb_aart.plu,\n" +
|
||||
" art_det.cod_mart AS cod_mart_kit \n" +
|
||||
" FROM carelli.dbo.mtb_aart\n" +
|
||||
" INNER JOIN jrl_fasi_mtb_grup ON\n" +
|
||||
" mtb_aart.cod_mgrp = jrl_fasi_mtb_grup.cod_mgrp\n" +
|
||||
" INNER JOIN (SELECT cod_mart, cod_comp AS cod_mart_griglia\n" +
|
||||
" FROM carelli.dbo.mtb_comp\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT cod_comp AS cod_mart, cod_mart AS cod_mart_griglia\n" +
|
||||
" FROM carelli.dbo.mtb_comp \n" +
|
||||
" where @codJfas <> '01'\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT cod_mart, cod_mart AS cod_mart_griglia\n" +
|
||||
" FROM carelli.dbo.mtb_aart\n" +
|
||||
" WHERE cod_mart NOT IN (SELECT cod_mart FROM carelli.dbo.mtb_comp)) AS art_det\n" +
|
||||
" ON mtb_aart.cod_mart = art_det.cod_mart\n" +
|
||||
" INNER JOIN art ON art_det.cod_mart_griglia = art.cod_mart\n" +
|
||||
" WHERE jrl_fasi_mtb_grup.cod_jfas = @codJfas\n" +
|
||||
" AND flag_stato = 'A'\n" +
|
||||
" AND (mtb_aart.cod_mtip IS NULL OR mtb_aart.cod_mtip NOT IN (SELECT cod_mtip FROM tipiArt)) \n" +
|
||||
" )");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251124164630 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
createOrUpdateFunction("getMaterialiDistinta",
|
||||
"CREATE FUNCTION [dbo].[getMaterialiDistinta](@codProd VARCHAR(15), @explodeSemilavorati BIT)\n" +
|
||||
" RETURNS TABLE\n" +
|
||||
" AS\n" +
|
||||
" RETURN(WITH distinta AS (SELECT cod_prod,\n" +
|
||||
" CONVERT(VARCHAR(15), NULL) AS cod_parent,\n" +
|
||||
" cod_prod AS cod_mart,\n" +
|
||||
" jtb_cicl.descrizione_prod AS descrizione,\n" +
|
||||
" jtb_cicl.descrizione_estesa,\n" +
|
||||
" CONVERT(VARCHAR(3), unt_mis_prod) AS unt_mis_prod,\n" +
|
||||
" CONVERT(NUMERIC(20, 5), rap_conv_prod) AS rap_conv_prod,\n" +
|
||||
" CONVERT(NUMERIC(20, 5), jtb_cicl.qta_prod) AS qta_prod,\n" +
|
||||
" CONVERT(NUMERIC(20, 5), jtb_cicl.qta_prod) AS qta_dist,\n" +
|
||||
" 1 AS livello,\n" +
|
||||
" FORMAT(ROW_NUMBER() OVER ( ORDER BY cod_prod), '00000') AS item_id,\n" +
|
||||
" CONVERT(VARCHAR(15), cod_prod) AS cod_prod_pri,\n" +
|
||||
" CAST(0 AS BIT) AS ricorsione,\n" +
|
||||
" CONVERT(NUMERIC(5, 2), 0) AS perc_sfrido,\n" +
|
||||
" CONVERT(INT, NULL) AS num_fase,\n" +
|
||||
" CONVERT(VARCHAR(1), NULL) AS flag_pri,\n" +
|
||||
" CONVERT(VARCHAR(1024), NULL) AS note,\n" +
|
||||
" CAST(1 AS BIT) AS is_root,\n" +
|
||||
" CAST(0 AS BIT) AS is_foglia\n" +
|
||||
" FROM jtb_cicl\n" +
|
||||
" WHERE (@codProd IS NULL OR cod_prod = @codProd)\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT distinta.cod_prod,\n" +
|
||||
" CONVERT(VARCHAR(15), jtb_dist_mate.cod_prod) AS cod_parent,\n" +
|
||||
" jtb_dist_mate.cod_mart,\n" +
|
||||
" jtb_dist_mate.descrizione,\n" +
|
||||
" jtb_dist_mate.descrizione_estesa,\n" +
|
||||
" CONVERT(VARCHAR(3), jtb_dist_mate.unt_mis_dist) AS unt_mis_prod,\n" +
|
||||
" CONVERT(NUMERIC(20, 5), jtb_dist_mate.rap_conv_dist) AS rap_conv_prod,\n" +
|
||||
" CONVERT(NUMERIC(20, 5),\n" +
|
||||
" ((jtb_dist_mate.qta_std * (1 + jtb_dist_mate.perc_sfrido / 100)) /\n" +
|
||||
" (distinta.qta_prod)) * distinta.qta_prod) AS qta_prod,\n" +
|
||||
" CONVERT(NUMERIC(20, 5), NULL),\n" +
|
||||
" distinta.livello + 1,\n" +
|
||||
" distinta.item_id + '_' +\n" +
|
||||
" FORMAT(\n" +
|
||||
" ROW_NUMBER() OVER ( ORDER BY jtb_dist_mate.flag_pri DESC, jtb_dist_mate.num_fase, id_riga ),\n" +
|
||||
" '00000') AS item_id,\n" +
|
||||
" CONVERT(VARCHAR(15), distinta.cod_mart) AS cod_prod_pri,\n" +
|
||||
" CAST(CASE\n" +
|
||||
" WHEN jtb_dist_mate.cod_mart = jtb_dist_mate.cod_prod THEN 1\n" +
|
||||
" ELSE 0 END AS BIT) AS ricorsione,\n" +
|
||||
" jtb_dist_mate.perc_sfrido,\n" +
|
||||
" jtb_dist_mate.num_fase,\n" +
|
||||
" CONVERT(VARCHAR(1), jtb_dist_mate.flag_pri) AS flag_pri,\n" +
|
||||
" CONVERT(VARCHAR(1024), jtb_dist_mate.note) AS note,\n" +
|
||||
" CAST(0 AS BIT) AS is_root,\n" +
|
||||
" CAST(IIF(jtb_dist_mate.flag_pri = 's', 0, 1) AS BIT) AS is_foglia\n" +
|
||||
" FROM jtb_dist_mate\n" +
|
||||
" INNER JOIN distinta ON jtb_dist_mate.cod_prod = distinta.cod_mart\n" +
|
||||
" INNER JOIN mtb_aart ON mtb_aart.cod_mart = jtb_dist_mate.cod_mart\n" +
|
||||
" WHERE distinta.ricorsione = 0\n" +
|
||||
" AND (distinta.is_root = 1 OR distinta.flag_pri = 'S' OR @explodeSemilavorati = 1))\n" +
|
||||
" SELECT cod_prod,\n" +
|
||||
" cod_parent,\n" +
|
||||
" cod_mart,\n" +
|
||||
" descrizione,\n" +
|
||||
" descrizione_estesa,\n" +
|
||||
" unt_mis_prod,\n" +
|
||||
" rap_conv_prod,\n" +
|
||||
" ISNULL(qta_dist, qta_prod) AS qta_prod,\n" +
|
||||
" livello,\n" +
|
||||
" item_id,\n" +
|
||||
" cod_prod_pri,\n" +
|
||||
" perc_sfrido,\n" +
|
||||
" num_fase,\n" +
|
||||
" DENSE_RANK() OVER ( PARTITION BY cod_prod ORDER BY cod_prod_pri ) - 1 + num_fase AS num_fase_calc,\n" +
|
||||
" flag_pri,\n" +
|
||||
" note,\n" +
|
||||
" is_root,\n" +
|
||||
" is_foglia\n" +
|
||||
" FROM distinta)");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,304 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251125093824 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomer(IntegryCustomer.Biolevante)) return;
|
||||
|
||||
createOrUpdateFunction("f_pp_consuntivo_prod_tracc", "CREATE function [dbo].[f_pp_consuntivo_prod_tracc] (@as_codProdParent varchar(15), @as_partitaMagParent varchar(20), @ac_qtaProdParent numeric(20,5), @as_codProd varchar(15), @as_partitaMag varchar(20), @ac_qtaProd numeric(20, 5), @ai_livello integer, @as_item_id varchar(255), @ai_idRiga integer) \n" +
|
||||
"RETURNS @dettCosti TABLE(livello integer, \n" +
|
||||
" item_id varchar(255),\n" +
|
||||
" cod_prod_parent varchar(15),\n" +
|
||||
" partita_mag_parent varchar(20), \n" +
|
||||
" qta_prod_parent numeric(20,5),\n" +
|
||||
" cod_prod varchar(15),\n" +
|
||||
" partita_mag varchar(20), \n" +
|
||||
" qta_prod numeric(20,5),\n" +
|
||||
" gruppo_conto varchar(40), \n" +
|
||||
" conto varchar(40), \n" +
|
||||
" descrizione_conto varchar(255), \n" +
|
||||
" dettaglio_conto varchar(40),\n" +
|
||||
" unt_mis varchar(5), \n" +
|
||||
" qta_consumata numeric(20, 5)) AS\n" +
|
||||
"Begin\n" +
|
||||
" DECLARE \n" +
|
||||
" @lc_qtaProd numeric(20,5), \n" +
|
||||
" @ls_gruppoConto varchar(40), \n" +
|
||||
" @ls_codMart varchar(15), \n" +
|
||||
" @ls_partitaMag varchar(20), \n" +
|
||||
" @ls_descrizione varchar(255), \n" +
|
||||
" @ls_untMis varchar(5), \n" +
|
||||
" @lc_qtaMP numeric(20,5), \n" +
|
||||
" @li_existDist integer, \n" +
|
||||
" @lc_rapporto numeric(20, 5),\n" +
|
||||
" @lc_qtaProdScaricata numeric(20,5),\n" +
|
||||
" @li_livello integer, \n" +
|
||||
" @ls_itemID varchar(255),\n" +
|
||||
" @li_idRiga integer,\n" +
|
||||
" @ls_codMiscela varchar(15),\n" +
|
||||
" @ls_posizione varchar(20),\n" +
|
||||
" @ls_posizione_da varchar(20),\n" +
|
||||
" @ls_posizione_a varchar(20),\n" +
|
||||
" @li_countScarichiLotto integer\n" +
|
||||
"\n" +
|
||||
" SELECT @ls_codMiscela = cod_mart FROM olvw_miscele_olio\n" +
|
||||
"\n" +
|
||||
" if @ai_idRiga is null\n" +
|
||||
" begin\n" +
|
||||
" SELECT @ai_livello = 1\n" +
|
||||
" SELECT @as_item_id = '00001';\n" +
|
||||
" end ;\n" +
|
||||
" IF @as_item_id = '' \n" +
|
||||
" begin\n" +
|
||||
" Select @ls_posizione = mtb_depo_posizioni.posizione from mtb_partita_mag, mtb_depo_posizioni \n" +
|
||||
" where mtb_depo_posizioni.posizione = mtb_partita_mag.posizione and\n" +
|
||||
" mtb_partita_mag.cod_mart = @as_codProdParent and partita_mag = @as_partitaMagParent and\n" +
|
||||
" mtb_depo_posizioni.flag_silos_liquidi = 1;\n" +
|
||||
" If @ls_posizione is not null Select @as_item_id = 'SILOS' --Serve ad identificare le miscele di olio\n" +
|
||||
" end\n" +
|
||||
"\n" +
|
||||
" /* Acquisizione quantita totale prodotta per prodotto-partita */\n" +
|
||||
" Select @lc_qtaProd = ISNULL(sum(dtb_docr.qta_doc * dtb_docr.rap_conv * dtb_tipi.segno_qta_car), 0)\n" +
|
||||
" from dtb_docr, \n" +
|
||||
" dtb_tipi, \n" +
|
||||
" mtb_aart, \n" +
|
||||
" mtb_grup\n" +
|
||||
" where dtb_docr.cod_dtip = dtb_tipi.cod_dtip and\n" +
|
||||
" dtb_docr.cod_mart = mtb_aart.cod_mart and\n" +
|
||||
" mtb_aart.cod_mgrp = mtb_Grup.cod_mgrp and\n" +
|
||||
" dtb_docr.cod_mart = @as_codProd and\n" +
|
||||
" dtb_docr.partita_mag = @as_partitaMag and\n" +
|
||||
" dtb_tipi.gestione = 'L' and\n" +
|
||||
" dtb_tipi.tipo_emissione = 'DIRETTA' and\n" +
|
||||
" dtb_tipi.segno_qta_car <> 0\n" +
|
||||
"\n" +
|
||||
" /* Calcolo del rapporto della qta passata come parametro e di quella totale*/\n" +
|
||||
" if @ac_qtaProd is not null\n" +
|
||||
" if @lc_qtaProd = 0 select @lc_rapporto = 0 else select @lc_rapporto = @ac_qtaProd / @lc_qtaProd\n" +
|
||||
" else\n" +
|
||||
" begin \n" +
|
||||
" select @lc_rapporto = 1\n" +
|
||||
" select @ac_qtaProdParent = @lc_qtaProd\n" +
|
||||
" end\n" +
|
||||
" \n" +
|
||||
" /* Acquisizione totale quantita' prodotta per prododo-partita_mag dagli scarichi\n" +
|
||||
" E' necessario prendere la quantita dalla testata degli scarichi perche' ci \n" +
|
||||
" potrebbero essere delle perdite rispetto alla quantita' caricata.\n" +
|
||||
" N.B. al momento questa variabile viene acquisita solo per controllo in fase di debug\n" +
|
||||
" */\n" +
|
||||
" Select @lc_qtaProdScaricata = sum(dtb_doct.qta_prod*dtb_doct.rap_conv_prod * @lc_rapporto)\n" +
|
||||
" From dtb_doct, \n" +
|
||||
" dtb_tipi\n" +
|
||||
" Where dtb_doct.cod_dtip = dtb_tipi.cod_dtip and\n" +
|
||||
" dtb_tipi.gestione = 'L' and \n" +
|
||||
" dtb_tipi.segno_qta_scar = 1 and\n" +
|
||||
" dtb_doct.cod_prod = @as_codProd and\n" +
|
||||
" ISNULL(dtb_doct.partita_mag, '') = ISNULL(@as_partitaMag, '')\n" +
|
||||
" \n" +
|
||||
"\n" +
|
||||
" /* Acquisizione scarichi per prodotto-partita_mag */\n" +
|
||||
" select @li_idRiga = 0;\n" +
|
||||
" IF @as_codProd = @ls_codMiscela\n" +
|
||||
" begin\n" +
|
||||
" Select @ai_livello = @ai_livello+1\n" +
|
||||
" end\n" +
|
||||
" Declare csr_scarichi Cursor LOCAL SCROLL FOR\n" +
|
||||
" Select PP_gruppiCostiMP.GruppoConto,\n" +
|
||||
" dtb_docr.cod_mart, \n" +
|
||||
" dtb_docr.partita_mag,\n" +
|
||||
" dtb_docr.descrizione_estesa as descrizione,\n" +
|
||||
" mtb_aart.unt_mis,\n" +
|
||||
" sum(dtb_docr.qta_doc*dtb_docr.rap_conv*dtb_tipi.segno_qta_scar*@lc_rapporto) as Qta_mp\n" +
|
||||
" From dtb_doct, \n" +
|
||||
" dtb_docr, \n" +
|
||||
" dtb_tipi, \n" +
|
||||
" mtb_aart, \n" +
|
||||
" mtb_grup, \n" +
|
||||
" PP_gruppiCostiMP\n" +
|
||||
" Where dtb_doct.cod_anag = dtb_docr.cod_anag and\n" +
|
||||
" dtb_doct.cod_dtip = dtb_docr.cod_dtip and\n" +
|
||||
" dtb_doct.data_doc = dtb_docr.data_doc and\n" +
|
||||
" dtb_doct.ser_doc = dtb_docr.ser_doc and\n" +
|
||||
" dtb_doct.num_doc = dtb_docr.num_doc and\n" +
|
||||
" dtb_doct.cod_dtip = dtb_tipi.cod_dtip and\n" +
|
||||
" dtb_tipi.gestione = 'L' and \n" +
|
||||
" dtb_tipi.segno_qta_scar = 1 and\n" +
|
||||
" dtb_docr.cod_mart = mtb_aart.cod_mart and\n" +
|
||||
" mtb_aart.cod_mgrp = mtb_grup.cod_mgrp and\n" +
|
||||
" dtb_docr.cod_mart = PP_gruppiCostiMP.cod_mart and\n" +
|
||||
" dtb_doct.cod_prod = @as_codProd and\n" +
|
||||
" ISNULL(dtb_doct.partita_mag, '') = ISNULL(@as_partitaMag, '')\n" +
|
||||
" and NOT (dtb_docr.cod_mart = @as_codProd and ISNULL(dtb_docr.partita_mag, '') = ISNULL(@as_partitaMag, ''))\n" +
|
||||
" group by PP_gruppiCostiMP.GruppoConto,\n" +
|
||||
" dtb_docr.cod_mart, \n" +
|
||||
" dtb_docr.partita_mag,\n" +
|
||||
" dtb_docr.descrizione_estesa,\n" +
|
||||
" mtb_aart.unt_mis\n" +
|
||||
" union all\n" +
|
||||
" \n" +
|
||||
" Select PP_gruppiCostiMP.GruppoConto,\n" +
|
||||
" car.cod_mart, \n" +
|
||||
" car.partita_mag,\n" +
|
||||
" car.descrizione_estesa as descrizione,\n" +
|
||||
" mtb_aart.unt_mis,\n" +
|
||||
" sum(car.qta_doc*car.rap_conv*dtb_tipi.segno_qta_scar*@lc_rapporto) as Qta_mp \n" +
|
||||
" from dtb_doct inner join dtb_docr on dtb_doct.cod_anag = dtb_docr.cod_anag and\n" +
|
||||
" dtb_doct.cod_dtip = dtb_docr.cod_dtip and\n" +
|
||||
" dtb_doct.data_doc = dtb_docr.data_doc and\n" +
|
||||
" dtb_doct.ser_doc = dtb_docr.ser_doc and\n" +
|
||||
" dtb_doct.num_doc = dtb_docr.num_doc \n" +
|
||||
" inner join dtb_tipi on dtb_doct.cod_dtip = dtb_tipi.cod_dtip \n" +
|
||||
" inner join dtb_docr car on dtb_doct.activity_id = car.activity_id_row \n" +
|
||||
" inner join dtb_tipi tipo_car on car.cod_dtip = tipo_car.cod_dtip\n" +
|
||||
" inner join olvw_caratteristiche on car.cod_mart = olvw_caratteristiche.cod_mart\n" +
|
||||
" inner join PP_gruppiCostiMP on car.cod_mart = PP_gruppiCostiMP.cod_mart\n" +
|
||||
" inner join mtb_aart on car.cod_mart = mtb_aart.cod_mart \n" +
|
||||
" inner join mtb_grup on mtb_aart.cod_mgrp = mtb_grup.cod_mgrp \n" +
|
||||
" where tipo_car.gestione = 'L' and \n" +
|
||||
" tipo_car.segno_qta_car - tipo_car.segno_qta_scar < 0 and \n" +
|
||||
" olvw_caratteristiche.Confezionato = 'S' and \n" +
|
||||
" dtb_tipi.gestione = 'L' and \n" +
|
||||
" dtb_tipi.segno_qta_scar = 1 and\n" +
|
||||
" dtb_doct.cod_prod = @as_codProd and\n" +
|
||||
" ISNULL(dtb_doct.partita_mag, '') = ISNULL(@as_partitaMag, '')\n" +
|
||||
" and NOT (dtb_docr.cod_mart = @as_codProd and ISNULL(dtb_docr.partita_mag, '') = ISNULL(@as_partitaMag, '')) \n" +
|
||||
" group by PP_gruppiCostiMP.GruppoConto,\n" +
|
||||
" car.cod_mart, \n" +
|
||||
" car.partita_mag,\n" +
|
||||
" car.descrizione_estesa,\n" +
|
||||
" mtb_aart.unt_mis\n" +
|
||||
" Order by PP_gruppiCostiMP.GruppoConto desc \n" +
|
||||
" \n" +
|
||||
" OPEN csr_scarichi\n" +
|
||||
" FETCH NEXT FROM csr_scarichi INTO @ls_gruppoConto, @ls_codMart, @ls_partitaMag, @ls_descrizione, @ls_untMis, @lc_qtaMP\n" +
|
||||
" WHILE @@FETCH_STATUS = 0\n" +
|
||||
" begin\n" +
|
||||
" IF ABS(@lc_qtaMP) > 0.01\n" +
|
||||
" Begin\n" +
|
||||
" select @li_idRiga = @li_idRiga + 1;\n" +
|
||||
" SELECT @ls_itemID = @as_item_id + '_' + REPLICATE('0', 5 - len(CONVERT(varchar(15), @li_idRiga))) + CONVERT(varchar(15), @li_idRiga); \n" +
|
||||
"\n" +
|
||||
" /* verifica esistenza scarico, Indica che siamo in presenza di un semilavorato/lotto */\n" +
|
||||
" select @li_existDist = count(*)\n" +
|
||||
" from dtb_doct, dtb_tipi\n" +
|
||||
" where dtb_doct.cod_prod = @ls_codMart and partita_mag = @ls_partitaMag and \n" +
|
||||
" dtb_doct.cod_dtip = dtb_tipi.cod_dtip and\n" +
|
||||
" dtb_tipi.segno_qta_scar = 1 and \n" +
|
||||
" dtb_doct.gestione = 'L'\n" +
|
||||
" \n" +
|
||||
" \n" +
|
||||
" /* Materia prima */\n" +
|
||||
" if @li_existDist = 0 or @@NESTLEVEL >= 30\n" +
|
||||
" begin\n" +
|
||||
" insert into @dettCosti \n" +
|
||||
" select @ai_livello,\n" +
|
||||
" @ls_itemID,\n" +
|
||||
" @as_codProdParent, \n" +
|
||||
" @as_partitaMagParent, \n" +
|
||||
" @ac_qtaProdParent, \n" +
|
||||
" @as_codProd, \n" +
|
||||
" @as_partitaMag, \n" +
|
||||
" @lc_qtaProdScaricata, \n" +
|
||||
" @ls_gruppoConto, \n" +
|
||||
" @ls_codMart, \n" +
|
||||
" @ls_descrizione, \n" +
|
||||
" @ls_partitaMag, \n" +
|
||||
" @ls_untMis, \n" +
|
||||
" @lc_qtaMP\n" +
|
||||
" end\n" +
|
||||
" else\n" +
|
||||
" Begin\n" +
|
||||
" /* Semilavorato */\n" +
|
||||
" \n" +
|
||||
" Select @ls_posizione_a = mtb_depo_posizioni.posizione \n" +
|
||||
" from mtb_partita_mag, mtb_depo_posizioni \n" +
|
||||
" where mtb_depo_posizioni.posizione = mtb_partita_mag.posizione and\n" +
|
||||
" mtb_partita_mag.cod_mart = @as_codProd and partita_mag = @as_partitaMag and\n" +
|
||||
" mtb_depo_posizioni.flag_silos_liquidi = 1;\n" +
|
||||
" Select @ls_posizione_da = mtb_depo_posizioni.posizione \n" +
|
||||
" from mtb_partita_mag, mtb_depo_posizioni \n" +
|
||||
" where mtb_depo_posizioni.posizione = mtb_partita_mag.posizione and\n" +
|
||||
" mtb_partita_mag.cod_mart = @as_codProd and partita_mag = @as_partitaMag and\n" +
|
||||
" mtb_depo_posizioni.flag_silos_liquidi = 1;\n" +
|
||||
" \n" +
|
||||
" --24/11/25 (Massimo) Segue query per verificare se siamo su un lotto di olio che è stato scaricato e non azzerato. In tal caso la ricorsione non deve avvenire\n" +
|
||||
" select @li_countScarichiLotto = count(*)\n" +
|
||||
" from dtb_docr inner join dtb_tipi on dtb_docr.cod_dtip = dtb_tipi.cod_dtip \n" +
|
||||
" where dtb_tipi.segno_qta_scar = 1\n" +
|
||||
" and dtb_docr.cod_mart = @ls_codMart and dtb_docr.partita_mag = @ls_partitaMag\n" +
|
||||
" and @ls_posizione_da = @ls_posizione_a\n" +
|
||||
"\n" +
|
||||
" If @ls_posizione_da is not null and \n" +
|
||||
" (ISNULL(@ls_posizione_da,'') <> ISNULL(@ls_posizione_a,00) or \n" +
|
||||
" @ls_posizione_da is null or @ls_posizione_a is null or \n" +
|
||||
" (@ai_livello <1 and @as_codProd = @ls_codMiscela) or \n" +
|
||||
" (ISNULL(@ls_posizione_da,'') = ISNULL(@ls_posizione_a,00) and @as_codProd= @ls_codMiscela) or\n" +
|
||||
" IsNull(@li_countScarichiLotto,1) > 1)\n" +
|
||||
" --Questa insert serve per trattare l'olio che proviene da altro serbatoio come una materia prima a partire dal 2° livello di ricorsione\n" +
|
||||
" --dal 24/11/25 vale anche per olio proveniente dallo stesso serbatoio ma già scaricato parzialmente prima del carico del lotto parent\n" +
|
||||
" Begin\n" +
|
||||
" insert into @dettCosti \n" +
|
||||
" select @ai_livello,\n" +
|
||||
" @ls_itemID,\n" +
|
||||
" @as_codProdParent, \n" +
|
||||
" @as_partitaMagParent, \n" +
|
||||
" @ac_qtaProdParent, \n" +
|
||||
" @as_codProd, \n" +
|
||||
" @as_partitaMag, \n" +
|
||||
" @lc_qtaProdScaricata, \n" +
|
||||
" @ls_gruppoConto, \n" +
|
||||
" @ls_codMart, \n" +
|
||||
" @ls_descrizione, \n" +
|
||||
" @ls_partitaMag, \n" +
|
||||
" @ls_untMis, \n" +
|
||||
" @lc_qtaMP;\n" +
|
||||
" End\n" +
|
||||
" \n" +
|
||||
" /*Ricorsione su semilavorato-partita_mag*/\n" +
|
||||
" If IsNull(@li_countScarichiLotto,1) = 1 and --Aggiunta 24/11/25 da Massimo per escludere ricorsione su olio proveniente dallo stesso serbatoio ma già scaricato parzialmente prima del carico del lotto parent\n" +
|
||||
" ISNULL(@ls_posizione_da,'') = ISNULL(@ls_posizione_a,00) and @as_codProd <> @ls_codMiscela or \n" +
|
||||
" @ls_posizione_da is null or @ls_posizione_a is null or \n" +
|
||||
" (@ai_livello <1 and @as_codProd = @ls_codMiscela)\n" +
|
||||
" --La ricorsione non avviene sugli olii provenienti da altro serbatoio e neanche nel caso di Miscele fittizie create nello stesso serbatoio dell'olio di provenienza in assenza di polmone\n" +
|
||||
" insert into @dettCosti \n" +
|
||||
" select costi.livello, \n" +
|
||||
" costi.item_id,\n" +
|
||||
" @as_codProdParent, \n" +
|
||||
" @as_partitaMagParent,\n" +
|
||||
" @ac_qtaProdParent,\n" +
|
||||
" costi.cod_prod, \n" +
|
||||
" costi.partita_mag, \n" +
|
||||
" costi.qta_prod,\n" +
|
||||
" costi.gruppo_conto, \n" +
|
||||
" costi.conto, \n" +
|
||||
" costi.descrizione_conto, \n" +
|
||||
" costi.dettaglio_conto,\n" +
|
||||
" costi.unt_mis, \n" +
|
||||
" costi.qta_consumata \n" +
|
||||
" from dbo.f_pp_consuntivo_prod_tracc(@as_codProdParent, @as_partitaMagParent, @ac_qtaProdParent, @ls_codMart, @ls_partitaMag, @lc_qtaMP, @ai_livello, @ls_itemID, @li_idRiga) costi\n" +
|
||||
" \n" +
|
||||
" \n" +
|
||||
" end\n" +
|
||||
" end\n" +
|
||||
" FETCH NEXT FROM csr_scarichi INTO @ls_gruppoConto, @ls_codMart, @ls_partitaMag, @ls_descrizione, @ls_untMis, @lc_qtaMP\n" +
|
||||
" end\n" +
|
||||
" close csr_scarichi\n" +
|
||||
" deallocate csr_scarichi\n" +
|
||||
" return\n" +
|
||||
"END");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251125095325 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
createOrUpdateFunction("getMaterialiDistinta",
|
||||
"CREATE FUNCTION [dbo].[getMaterialiDistinta](@codProd VARCHAR(15), @explodeSemilavorati BIT)\n" +
|
||||
" RETURNS TABLE\n" +
|
||||
" AS\n" +
|
||||
" RETURN(WITH distinta AS (SELECT cod_prod,\n" +
|
||||
" CONVERT(VARCHAR(15), NULL) AS cod_parent,\n" +
|
||||
" cod_prod AS cod_mart,\n" +
|
||||
" jtb_cicl.descrizione_prod AS descrizione,\n" +
|
||||
" jtb_cicl.descrizione_estesa,\n" +
|
||||
" CONVERT(VARCHAR(3), unt_mis_prod) AS unt_mis_prod,\n" +
|
||||
" CONVERT(NUMERIC(20, 5), rap_conv_prod) AS rap_conv_prod,\n" +
|
||||
" CONVERT(NUMERIC(20, 5), jtb_cicl.qta_prod) AS qta_prod,\n" +
|
||||
" CONVERT(NUMERIC(20, 5), jtb_cicl.qta_prod) AS qta_dist,\n" +
|
||||
" 1 AS livello,\n" +
|
||||
" FORMAT(ROW_NUMBER() OVER ( ORDER BY cod_prod), '00000') AS item_id,\n" +
|
||||
" CONVERT(VARCHAR(15), cod_prod) AS cod_prod_pri,\n" +
|
||||
" CAST(0 AS BIT) AS ricorsione,\n" +
|
||||
" CONVERT(NUMERIC(5, 2), 0) AS perc_sfrido,\n" +
|
||||
" CONVERT(INT, NULL) AS num_fase,\n" +
|
||||
" CONVERT(VARCHAR(1), NULL) AS flag_pri,\n" +
|
||||
" CONVERT(VARCHAR(1024), NULL) AS note,\n" +
|
||||
" CAST(1 AS BIT) AS is_root,\n" +
|
||||
" CAST(0 AS BIT) AS is_foglia\n" +
|
||||
" FROM jtb_cicl\n" +
|
||||
" WHERE (@codProd IS NULL OR cod_prod = @codProd)\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT distinta.cod_prod,\n" +
|
||||
" CONVERT(VARCHAR(15), jtb_dist_mate.cod_prod) AS cod_parent,\n" +
|
||||
" jtb_dist_mate.cod_mart,\n" +
|
||||
" jtb_dist_mate.descrizione,\n" +
|
||||
" jtb_dist_mate.descrizione_estesa,\n" +
|
||||
" CONVERT(VARCHAR(3), jtb_dist_mate.unt_mis_dist) AS unt_mis_prod,\n" +
|
||||
" CONVERT(NUMERIC(20, 5), jtb_dist_mate.rap_conv_dist) AS rap_conv_prod,\n" +
|
||||
" CONVERT(NUMERIC(20, 5),\n" +
|
||||
" ((jtb_dist_mate.qta_std * (1 + jtb_dist_mate.perc_sfrido / 100)) /\n" +
|
||||
" (jtb_cicl.qta_prod)) * distinta.qta_prod) AS qta_prod,\n" +
|
||||
" CONVERT(NUMERIC(20, 5), NULL),\n" +
|
||||
" distinta.livello + 1,\n" +
|
||||
" distinta.item_id + '_' +\n" +
|
||||
" FORMAT(\n" +
|
||||
" ROW_NUMBER() OVER ( ORDER BY jtb_dist_mate.flag_pri DESC, jtb_dist_mate.num_fase, id_riga ),\n" +
|
||||
" '00000') AS item_id,\n" +
|
||||
" CONVERT(VARCHAR(15), distinta.cod_mart) AS cod_prod_pri,\n" +
|
||||
" CAST(CASE\n" +
|
||||
" WHEN jtb_dist_mate.cod_mart = jtb_dist_mate.cod_prod THEN 1\n" +
|
||||
" ELSE 0 END AS BIT) AS ricorsione,\n" +
|
||||
" jtb_dist_mate.perc_sfrido,\n" +
|
||||
" jtb_dist_mate.num_fase,\n" +
|
||||
" CONVERT(VARCHAR(1), jtb_dist_mate.flag_pri) AS flag_pri,\n" +
|
||||
" CONVERT(VARCHAR(1024), jtb_dist_mate.note) AS note,\n" +
|
||||
" CAST(0 AS BIT) AS is_root,\n" +
|
||||
" CAST(IIF(jtb_dist_mate.flag_pri = 's', 0, 1) AS BIT) AS is_foglia\n" +
|
||||
" FROM jtb_dist_mate\n" +
|
||||
" INNER JOIN distinta ON jtb_dist_mate.cod_prod = distinta.cod_mart\n" +
|
||||
" INNER JOIN jtb_cicl\n" +
|
||||
" ON jtb_dist_mate.cod_prod = jtb_cicl.cod_prod\n" +
|
||||
" INNER JOIN mtb_aart ON mtb_aart.cod_mart = jtb_dist_mate.cod_mart\n" +
|
||||
" WHERE distinta.ricorsione = 0\n" +
|
||||
" AND (distinta.is_root = 1 OR distinta.flag_pri = 'S' OR @explodeSemilavorati = 1))\n" +
|
||||
" SELECT cod_prod,\n" +
|
||||
" cod_parent,\n" +
|
||||
" cod_mart,\n" +
|
||||
" descrizione,\n" +
|
||||
" descrizione_estesa,\n" +
|
||||
" unt_mis_prod,\n" +
|
||||
" rap_conv_prod,\n" +
|
||||
" ISNULL(qta_dist, qta_prod) AS qta_prod,\n" +
|
||||
" livello,\n" +
|
||||
" item_id,\n" +
|
||||
" cod_prod_pri,\n" +
|
||||
" perc_sfrido,\n" +
|
||||
" num_fase,\n" +
|
||||
" DENSE_RANK() OVER ( PARTITION BY cod_prod ORDER BY cod_prod_pri ) - 1 + num_fase AS num_fase_calc,\n" +
|
||||
" flag_pri,\n" +
|
||||
" note,\n" +
|
||||
" is_root,\n" +
|
||||
" is_foglia\n" +
|
||||
" FROM distinta)");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251125100117 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement("create table dbo.mtb_livelli_anomalie\n" +
|
||||
"(\n" +
|
||||
" id bigint identity\n" +
|
||||
" constraint pk_mtb_livelli_anomalie\n" +
|
||||
" primary key,\n" +
|
||||
" descrizione varchar(255) not null,\n" +
|
||||
" hex_colore varchar(20) default '#ffffff',\n" +
|
||||
" escludi_picking_vendita bit default 0 not null,\n" +
|
||||
" escludi_picking_lavorazione bit default 0 not null\n" +
|
||||
")");
|
||||
|
||||
executeStatement("create table dbo.mtb_anomalie_ul\n" +
|
||||
"(\n" +
|
||||
" id bigint identity\n" +
|
||||
" constraint pk_mtb_anomalie_ul\n" +
|
||||
" primary key,\n" +
|
||||
" descrizione varchar(200) not null,\n" +
|
||||
" annotazioni varchar(400),\n" +
|
||||
" inizio_anomalia datetime,\n" +
|
||||
" fine_anomalia datetime,\n" +
|
||||
" id_livello_anomalia bigint not null\n" +
|
||||
" constraint mtb_anomalie_ul_mtb_livelli_anomalie_id_fk\n" +
|
||||
" references dbo.mtb_livelli_anomalie,\n" +
|
||||
" cod_jfas varchar(5)\n" +
|
||||
" constraint mtb_anomalie_ul_jtb_fasi_cod_jfas_fk\n" +
|
||||
" references dbo.jtb_fasi\n" +
|
||||
")");
|
||||
|
||||
executeStatement("alter table dbo.mtb_colt\n" +
|
||||
" add id_anomalia bigint\n" +
|
||||
" constraint mtb_colt_mtb_anomalie_ul_id_fk\n" +
|
||||
" references dbo.mtb_anomalie_ul (id)");
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.RossoGargano_RossoGargano)) {
|
||||
executeInsertStatement("INSERT INTO mtb_livelli_anomalie (descrizione, hex_colore, escludi_picking_vendita, escludi_picking_lavorazione) VALUES (N'Prodotto non conforme', N'#FF0000', 1, 1)");
|
||||
executeInsertStatement("INSERT INTO mtb_livelli_anomalie (descrizione, hex_colore, escludi_picking_vendita, escludi_picking_lavorazione) VALUES (N'Prodotto uscito con alte temperature', N'#E36C0A', 1, 0)");
|
||||
executeInsertStatement("INSERT INTO mtb_livelli_anomalie (descrizione, hex_colore, escludi_picking_vendita, escludi_picking_lavorazione) VALUES (N'Pedana in osservazione', N'#FFC000', 1, 0)");
|
||||
executeInsertStatement("INSERT INTO mtb_livelli_anomalie (descrizione, hex_colore, escludi_picking_vendita, escludi_picking_lavorazione) VALUES (N'Barattoli con difetto di marcatura', N'#00B050', 0, 0)");
|
||||
executeInsertStatement("INSERT INTO mtb_livelli_anomalie (descrizione, hex_colore, escludi_picking_vendita, escludi_picking_lavorazione) VALUES (N'Barattoli difettati', N'#00B0F0', 0, 1)");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,240 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251125105713 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
|
||||
createOrUpdateProcedure("MRP_UpdateQtaImpProx", "CREATE Procedure [dbo].[MRP_UpdateQtaImpProx](@elencoArticoli varchar(max) = null)\n" +
|
||||
"AS \n" +
|
||||
"--DECLARE @elencoarticoli VARCHAR(MAX) --= 'CEB1TREORI6|CEB1LMS5|CEBB1MRCH2|CVINACBO1LEV2'\n" +
|
||||
"--DROP TABLE #tmp\n" +
|
||||
"\n" +
|
||||
"SET NOCOUNT ON;\n" +
|
||||
"DECLARE @tableart TABLE\n" +
|
||||
" (\n" +
|
||||
" cod_mart VARCHAR(15)\n" +
|
||||
" );\n" +
|
||||
"\n" +
|
||||
"IF @elencoarticoli IS NOT NULL AND @elencoarticoli <> ''\n" +
|
||||
" BEGIN\n" +
|
||||
" INSERT INTO @tableart\n" +
|
||||
" SELECT *\n" +
|
||||
" FROM dbo.parsestringintoarray(@elencoarticoli, '|')\n" +
|
||||
" END\n" +
|
||||
"ELSE\n" +
|
||||
" BEGIN\n" +
|
||||
" INSERT INTO @tableart\n" +
|
||||
" SELECT mtb_aart.cod_mart\n" +
|
||||
" FROM mtb_aart\n" +
|
||||
" INNER JOIN jtb_cicl ON mtb_aart.cod_mart = jtb_cicl.cod_mart\n" +
|
||||
" WHERE mtb_aart.flag_stato = 'A'\n" +
|
||||
" END;\n" +
|
||||
"\n" +
|
||||
"WITH imp_ordini AS (SELECT mtb_part.cod_mart,\n" +
|
||||
" mtb_aart.unt_mis,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN SUM(mtb_part.qta_imp_cli) > SUM(iif(mtb_part.qta_esistente<0,0,mtb_part.qta_esistente) + mtb_part.qta_ord_for) THEN\n" +
|
||||
" SUM(mtb_part.qta_imp_cli - (iif(mtb_part.qta_esistente<0,0,mtb_part.qta_esistente) + mtb_part.qta_ord_for))\n" +
|
||||
" ELSE 0 END AS qtadaprodurre,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN SUM(mtb_part.qta_imp_cli) > SUM(iif(mtb_part.qta_esistente<0,0,mtb_part.qta_esistente) + mtb_part.qta_ord_for) THEN\n" +
|
||||
" SUM(mtb_part.qta_imp_cli - (iif(mtb_part.qta_esistente<0,0,mtb_part.qta_esistente) + mtb_part.qta_ord_for)) /\n" +
|
||||
" mtb_aart.qta_cnf\n" +
|
||||
" ELSE 0 END AS numdaprodurre,\n" +
|
||||
" SUM((iif(mtb_part.qta_esistente<0,0,mtb_part.qta_esistente) + mtb_part.qta_ord_for) - mtb_part.qta_imp_cli) AS qta_disp\n" +
|
||||
" \n" +
|
||||
" FROM mtb_part\n" +
|
||||
" INNER JOIN jtb_cicl ON mtb_part.cod_mart = jtb_cicl.cod_prod\n" +
|
||||
" INNER JOIN mtb_aart ON mtb_part.cod_mart = mtb_aart.cod_mart\n" +
|
||||
" INNER JOIN @tableart a ON mtb_aart.cod_mart = a.cod_mart\n" +
|
||||
" WHERE mtb_aart.flag_stato = 'A'\n" +
|
||||
" GROUP BY mtb_part.cod_mart, mtb_aart.unt_mis, mtb_aart.qta_cnf\n" +
|
||||
" HAVING SUM(iif(mtb_part.qta_esistente<0,0,mtb_part.qta_esistente) + mtb_part.qta_ord_for) <> SUM(mtb_part.qta_imp_cli) )\n" +
|
||||
" \n" +
|
||||
" \n" +
|
||||
" \n" +
|
||||
" , imp_contratti AS ( SELECT c.cod_mart,\n" +
|
||||
" ISNULL(SUM((qta_vend_contratto - qta_ord - qta_doc) /\n" +
|
||||
" CASE WHEN c.rap_conv = 0 THEN 1 ELSE c.rap_conv END), 0) AS qtacontratto\n" +
|
||||
" FROM vvw_contratti_vendita c\n" +
|
||||
" INNER JOIN @tableart a ON c.cod_mart = a.cod_mart\n" +
|
||||
" WHERE c.data_fine >= CAST(GETDATE() AS DATE)\n" +
|
||||
" GROUP BY c.cod_mart\n" +
|
||||
" HAVING ISNULL(SUM(qta_residua), 0) > 0)\n" +
|
||||
" , imp_budget AS (SELECT b.cod_mart,\n" +
|
||||
" SUM(qta_saldo) AS qta_bdg\n" +
|
||||
" FROM ovw_budget_ordv b\n" +
|
||||
" INNER JOIN @tableart a ON b.cod_mart = a.cod_mart\n" +
|
||||
" WHERE CAST(GETDATE() AS DATE) BETWEEN b.data_iniz AND b.data_fine\n" +
|
||||
" AND qta_saldo <> 0\n" +
|
||||
" GROUP BY b.cod_mart)\n" +
|
||||
" , tmp_impegni\n" +
|
||||
" AS (SELECT ISNULL(ISNULL(imp_ordini.cod_mart, imp_contratti.cod_mart), imp_budget.cod_mart) AS cod_mart,\n" +
|
||||
" SUM(ISNULL(imp_ordini.qtadaprodurre, 0)) AS qtadaprodurre,\n" +
|
||||
" SUM(ISNULL(imp_ordini.numdaprodurre, 0)) AS numdaprodurre,\n" +
|
||||
" SUM(ISNULL(imp_contratti.qtacontratto,0)) AS qtacontratto ,\n" +
|
||||
" SUM(ISNULL(imp_budget.qta_bdg, 0)) AS qtabudget\n" +
|
||||
" \n" +
|
||||
" FROM imp_ordini\n" +
|
||||
" FULL OUTER JOIN imp_contratti ON imp_ordini.cod_mart = imp_contratti.cod_mart\n" +
|
||||
" FULL OUTER JOIN imp_budget ON imp_ordini.cod_mart = imp_budget.cod_mart\n" +
|
||||
" \n" +
|
||||
" GROUP BY ISNULL(ISNULL(imp_ordini.cod_mart, imp_contratti.cod_mart), imp_budget.cod_mart)\n" +
|
||||
" HAVING SUM(ISNULL(imp_ordini.qtadaprodurre, 0)) <> 0\n" +
|
||||
" OR SUM(ISNULL(imp_contratti.qtacontratto,0)) <> 0\n" +
|
||||
" OR SUM(ISNULL(imp_budget.qta_bdg, 0)) <> 0)\n" +
|
||||
"\n" +
|
||||
"SELECT materiali.cod_mart,\n" +
|
||||
" materiali.cod_prod,\n" +
|
||||
" jtb_fasi.cod_mdep_lav AS cod_mdep,\n" +
|
||||
" SUM(qtadaprodurre * (materiali.qta_prod * materiali.rap_conv) /\n" +
|
||||
" (jtb_cicl.qta_prod * jtb_cicl.rap_conv_prod)) AS impegnatoprox,\n" +
|
||||
" SUM(qtacontratto * (materiali.qta_prod * materiali.rap_conv) /\n" +
|
||||
" (jtb_cicl.qta_prod * jtb_cicl.rap_conv_prod)) AS impproxcontratto,\n" +
|
||||
" SUM(qtabudget * (materiali.qta_prod * materiali.rap_conv) /\n" +
|
||||
" (jtb_cicl.qta_prod * jtb_cicl.rap_conv_prod)) AS impproxbudget,\n" +
|
||||
" /*\n" +
|
||||
" max(case when ord.gestione = 'L' THEN max_data_cons else null end ) as data_imp_prox,\n" +
|
||||
" max(case when ord.gestione = 'A' THEN max_data_cons else null end ) as data_imp_prox_contr\n" +
|
||||
" */\n" +
|
||||
" IsNull(max(ORD.data_imp_prox), convert(date,GetDate())) as data_imp_prox,\n" +
|
||||
" IsNull(max(ORD.data_imp_prox_contr), convert(date,GetDate())) as data_imp_prox_contr\n" +
|
||||
"INTO #tmp\n" +
|
||||
"FROM tmp_impegni\n" +
|
||||
" INNER JOIN\n" +
|
||||
" (\n" +
|
||||
" SELECT cod_mart, descrizione_estesa, unt_mis_prod AS unt_doc, rap_conv_prod AS rap_conv, qta_prod, cod_prod\n" +
|
||||
" FROM [dbo].getmaterialidistinta(NULL, 1)\n" +
|
||||
" WHERE cod_parent IS NOT NULL) materiali ON materiali.cod_prod = tmp_impegni.cod_mart\n" +
|
||||
" INNER JOIN jtb_cicl ON materiali.cod_prod = jtb_cicl.cod_prod\n" +
|
||||
" INNER JOIN jtb_fasi ON jtb_cicl.cod_jfas = jtb_fasi.cod_jfas \n" +
|
||||
" LEFT OUTER JOIN (\n" +
|
||||
" /* Modifcata da Massimo 10/07/24 la vecchia query creva quantità doppie in presenza di ordini L e A\n" +
|
||||
" select cod_mart, dtb_ordt.gestione, MAX(dtb_ordr.data_cons) as max_data_cons\n" +
|
||||
" from dtb_ordt inner join dtb_ordr on dtb_ordt.gestione = dtb_ordr.gestione\n" +
|
||||
" and dtb_ordt.data_ord = dtb_ordr.data_ord\n" +
|
||||
" and dtb_ordt.num_ord = dtb_ordr.num_ord\n" +
|
||||
" where dtb_ordt.gestione <> 'V' AND\n" +
|
||||
" dtb_ordt.flag_annulla = 'N' and\n" +
|
||||
" dtb_ordt.flag_budget = 0 and\n" +
|
||||
" dtb_ordt.flag_sospeso = 'N' and\n" +
|
||||
" dtb_ordt.flag_evaso_forzato = 'N' and \n" +
|
||||
" dtb_ordr.flag_evaso = 'I' \n" +
|
||||
" group by cod_mart, dtb_ordt.gestione\n" +
|
||||
" */\n" +
|
||||
" Select isNull(ODL.cod_mart,ODA.cod_mart) as cod_mart, ODL.data_imp_prox, ODA.data_imp_prox_contr\n" +
|
||||
" from \n" +
|
||||
" (select cod_mart, dtb_ordt.gestione, MAX(dtb_ordr.data_cons) as data_imp_prox\n" +
|
||||
" from dtb_ordt inner join dtb_ordr on dtb_ordt.gestione = dtb_ordr.gestione\n" +
|
||||
" and dtb_ordt.data_ord = dtb_ordr.data_ord\n" +
|
||||
" and dtb_ordt.num_ord = dtb_ordr.num_ord\n" +
|
||||
" where dtb_ordt.gestione = 'L' AND\n" +
|
||||
" dtb_ordt.flag_annulla = 'N' and\n" +
|
||||
" dtb_ordt.flag_budget = 0 and\n" +
|
||||
" dtb_ordt.flag_sospeso = 'N' and\n" +
|
||||
" dtb_ordt.flag_evaso_forzato = 'N' and \n" +
|
||||
" dtb_ordt.flag_evaso_prod = 'I' and\n" +
|
||||
" dtb_ordr.flag_evaso = 'I' \n" +
|
||||
" group by cod_mart, dtb_ordt.gestione\n" +
|
||||
" )ODL full outer join\n" +
|
||||
" (\n" +
|
||||
" select cod_mart, dtb_ordt.gestione, MAX(dtb_ordr.data_cons) as data_imp_prox_contr\n" +
|
||||
" from dtb_ordt inner join dtb_ordr on dtb_ordt.gestione = dtb_ordr.gestione\n" +
|
||||
" and dtb_ordt.data_ord = dtb_ordr.data_ord\n" +
|
||||
" and dtb_ordt.num_ord = dtb_ordr.num_ord\n" +
|
||||
" where dtb_ordt.gestione = 'A' AND\n" +
|
||||
" dtb_ordt.flag_annulla = 'N' and\n" +
|
||||
" dtb_ordt.flag_budget = 0 and\n" +
|
||||
" dtb_ordt.flag_sospeso = 'N' and\n" +
|
||||
" dtb_ordt.flag_evaso_forzato = 'N' and \n" +
|
||||
" dtb_ordr.flag_evaso = 'I' \n" +
|
||||
" \n" +
|
||||
" group by cod_mart, dtb_ordt.gestione)\n" +
|
||||
" ODA on ODA.cod_mart = ODL.cod_mart\n" +
|
||||
" ) ORD ON materiali.cod_mart = ORD.cod_mart\n" +
|
||||
"GROUP BY materiali.cod_prod,\n" +
|
||||
" materiali.cod_mart,\n" +
|
||||
" jtb_fasi.cod_mdep_lav\n" +
|
||||
" \n" +
|
||||
"SELECT cod_mart,\n" +
|
||||
" cod_mdep,\n" +
|
||||
" SUM(impegnatoprox) AS impegnatoprox,\n" +
|
||||
" SUM(impproxcontratto) AS impproxcontratto,\n" +
|
||||
" SUM(impproxbudget) AS impproxbudget,\n" +
|
||||
" case when data_imp_prox < convert(date, GetDate()) then convert(date, getDate()) else data_imp_prox end data_imp_prox,\n" +
|
||||
" case when data_imp_prox_contr < case when data_imp_prox < convert(date, GetDate()) then convert(date, getDate()) else data_imp_prox end \n" +
|
||||
" then case when data_imp_prox < convert(date, GetDate()) then convert(date, getDate()) else data_imp_prox end \n" +
|
||||
" else data_imp_prox_contr end as data_imp_prox_contr\n" +
|
||||
" --case when data_imp_prox_contr is null then isNull(data_imp_prox,convert(date,GetDate())) else data_imp_prox_contr end as data_imp_prox_contr\n" +
|
||||
" --IIF( data_imp_prox is null or data_imp_prox < Cast(getdate() as date), Cast(getdate() as date), data_imp_prox) as data_imp_prox,\n" +
|
||||
" --IIF( data_imp_prox_contr is null or isNull(data_imp_prox_contr,data_imp_prox) < Cast(getdate() as date), Cast(getdate() as date), data_imp_prox_contr) as data_imp_prox_contr \n" +
|
||||
"INTO #tmpsum\n" +
|
||||
"FROM #tmp\n" +
|
||||
"WHERE cod_mdep IS NOT NULL\n" +
|
||||
"GROUP BY cod_mart, cod_mdep,\n" +
|
||||
" data_imp_prox,\n" +
|
||||
" data_imp_prox_contr\n" +
|
||||
"\n" +
|
||||
"INSERT INTO mtb_part (cod_mart, cod_mdep, scorta_min, qta_esistente, qta_imp_cli, qta_imp_lav, qta_ord_for)\n" +
|
||||
"SELECT cod_mart, cod_mdep, 0, 0, 0, 0, 0\n" +
|
||||
"FROM #tmpsum t\n" +
|
||||
"WHERE NOT EXISTS(SELECT * FROM mtb_part WHERE mtb_part.cod_mart = t.cod_mart AND mtb_part.cod_mdep = t.cod_mdep)\n" +
|
||||
"\n" +
|
||||
"IF @elencoarticoli IS NULL OR @elencoarticoli = ''\n" +
|
||||
" UPDATE mtb_part SET qta_imp_prox = 0, qta_imp_prox_contr = 0, qta_imp_prox_bdg = 0, data_imp_prox = null, data_imp_prox_contr = null\n" +
|
||||
"ELSE\n" +
|
||||
" UPDATE mtb_part\n" +
|
||||
" SET qta_imp_prox = 0,\n" +
|
||||
" qta_imp_prox_contr = 0,\n" +
|
||||
" qta_imp_prox_bdg = 0,\n" +
|
||||
" data_imp_prox = null, \n" +
|
||||
" data_imp_prox_contr = null \n" +
|
||||
" WHERE cod_mart IN (SELECT cod_mart FROM #tmpsum)\n" +
|
||||
"\n" +
|
||||
"UPDATE mtb_part\n" +
|
||||
"SET qta_imp_prox = q.impegnatoprox,\n" +
|
||||
" qta_imp_prox_contr = q.impproxcontratto,\n" +
|
||||
" qta_imp_prox_bdg = q.impproxbudget,\n" +
|
||||
" data_imp_prox = DateAdd(day, 1, q.data_imp_prox), \n" +
|
||||
" data_imp_prox_contr = DateAdd(day, 1, q.data_imp_prox_contr )\n" +
|
||||
"FROM mtb_part\n" +
|
||||
" INNER JOIN #tmpsum q ON mtb_part.cod_mdep = q.cod_mdep AND mtb_part.cod_mart = q.cod_mart\n" +
|
||||
"\n" +
|
||||
"IF EXISTS(SELECT *\n" +
|
||||
" FROM #tmp\n" +
|
||||
" WHERE cod_mdep IS NULL)\n" +
|
||||
" BEGIN\n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
" DECLARE @message VARCHAR(MAX), @email VARCHAR(MAX)\n" +
|
||||
"\n" +
|
||||
" SELECT @email = e_mail FROM stb_email WHERE flag_default = 'S';\n" +
|
||||
"\n" +
|
||||
" SET @message = 'Verificare i seguenti articoli: la fase non ha il deposito agganciato.' + CHAR(10) + CHAR(13)\n" +
|
||||
" SELECT @message = @message +\n" +
|
||||
" STUFF((SELECT ',' + cod_prod\n" +
|
||||
" FROM #tmp\n" +
|
||||
" WHERE cod_mdep IS NULL\n" +
|
||||
" FOR XML PATH('')), 1, 1, '')\n" +
|
||||
"\n" +
|
||||
" EXECUTE [dbo].[sp_sendEmail] @email, 'helpdesk@integry.it', 'Errore Impegni Prossimi', @message\n" +
|
||||
"\n" +
|
||||
" END");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251125113907 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if(isCustomer(IntegryCustomer.Carelli)) {
|
||||
updateSetupValue("W_DDOCU_ORD_RC", "SITUAZONE_CLIENTE", "SHOW_DIALOG", "N",
|
||||
"Attiva Situazione cliente", false, "SI_NO", false, false, false,
|
||||
false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251126113917 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomer(IntegryCustomer.Sardinya)) {
|
||||
|
||||
createSetup("EXPORT_DOCUMENTI DI VENDITA", "MD", "ATTIVO", "N",
|
||||
"Inserire S/N per attivare/disattivare il tipo di importazione", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("EXPORT_DOCUMENTI DI VENDITA", "MD", "EMAIL_FOR_LOG", null,
|
||||
"Inserire il file l'indirizzo email per inviare il log dell'importazione", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("EXPORT_DOCUMENTI DI VENDITA", "MD", "GG_CANC_FILE", null,
|
||||
"Giorni per la cancellazione dei file dalla cartella di appoggio", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("EXPORT_DOCUMENTI DI VENDITA", "MD", "IMPORT_REST", "S",
|
||||
"Inserire S/N per attivare/disattivare il salvataggio con i servizi REST", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("EXPORT_DOCUMENTI DI VENDITA", "MD", "PATH_FILE", null,
|
||||
"Directory dove vengono salvati i file temporanei, se non è configurata i file saranno salvati in c:\\mlSetupWS\\TEMP_EXPORT", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
}
|
||||
updateSetupValue("EXPORT_DOCUMENTI DI VENDITA", "MD", "ATTIVO", "S",
|
||||
"Inserire S/N per attivare/disattivare il tipo di importazione", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251126115627 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Carelli_Winact))
|
||||
return;
|
||||
|
||||
boolean existIndex = existIndex("wtb_depo", "ux_wtb_depo_depo_default_utente");
|
||||
|
||||
if(existIndex)
|
||||
dropIndex("wtb_depo", "ux_wtb_depo_depo_default_utente");
|
||||
|
||||
executeStatement("ALTER TABLE dbo.wtb_depo\n" +
|
||||
" ALTER COLUMN user_name VARCHAR(40) NOT NULL",
|
||||
|
||||
"ALTER TABLE dbo.wtb_depo\n" +
|
||||
" ALTER COLUMN cod_mdep VARCHAR(5) NOT NULL",
|
||||
|
||||
"ALTER TABLE dbo.wtb_depo\n" +
|
||||
" ADD CONSTRAINT pk_wtb_depo\n" +
|
||||
" PRIMARY KEY (cod_mdep, user_name)");
|
||||
|
||||
if(existIndex)
|
||||
executeStatement("CREATE unique index ux_wtb_depo_depo_default_utente\n" +
|
||||
" on dbo.wtb_depo (user_name)\n" +
|
||||
" where [default_depo] = 1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251126191506 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
|
||||
String value = executeQueryOnlyFirstRowFirstColumn("SELECT value FROM stb_gest_setup WHERE gest_name = 'PICKING' AND section = 'SETUP' AND key_section = 'ASS_SERIE_ORD_A_COLLO'");
|
||||
|
||||
if (value == null || value.isEmpty())
|
||||
updateSetupValue("PICKING", "SETUP", "ASS_SERIE_ORD_A_COLLO", "N");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,306 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251127104634 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
if (!isCustomer(IntegryCustomer.Biolevante)) return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
createOrUpdateFunction("f_pp_consuntivo_prod_tracc", "CREATE function [dbo].[f_pp_consuntivo_prod_tracc] (@as_codProdParent varchar(15), @as_partitaMagParent varchar(20), @ac_qtaProdParent numeric(20,5), @as_codProd varchar(15), @as_partitaMag varchar(20), @ac_qtaProd numeric(20, 5), @ai_livello integer, @as_item_id varchar(255), @ai_idRiga integer) \n" +
|
||||
"RETURNS @dettCosti TABLE(livello integer, \n" +
|
||||
" item_id varchar(255),\n" +
|
||||
" cod_prod_parent varchar(15),\n" +
|
||||
" partita_mag_parent varchar(20), \n" +
|
||||
" qta_prod_parent numeric(20,5),\n" +
|
||||
" cod_prod varchar(15),\n" +
|
||||
" partita_mag varchar(20), \n" +
|
||||
" qta_prod numeric(20,5),\n" +
|
||||
" gruppo_conto varchar(40), \n" +
|
||||
" conto varchar(40), \n" +
|
||||
" descrizione_conto varchar(255), \n" +
|
||||
" dettaglio_conto varchar(40),\n" +
|
||||
" unt_mis varchar(5), \n" +
|
||||
" qta_consumata numeric(20, 5)) AS\n" +
|
||||
"Begin\n" +
|
||||
" DECLARE \n" +
|
||||
" @lc_qtaProd numeric(20,5), \n" +
|
||||
" @ls_gruppoConto varchar(40), \n" +
|
||||
" @ls_codMart varchar(15), \n" +
|
||||
" @ls_partitaMag varchar(20), \n" +
|
||||
" @ls_descrizione varchar(255), \n" +
|
||||
" @ls_untMis varchar(5), \n" +
|
||||
" @lc_qtaMP numeric(20,5), \n" +
|
||||
" @li_existDist integer, \n" +
|
||||
" @lc_rapporto numeric(20, 5),\n" +
|
||||
" @lc_qtaProdScaricata numeric(20,5),\n" +
|
||||
" @li_livello integer, \n" +
|
||||
" @ls_itemID varchar(255),\n" +
|
||||
" @li_idRiga integer,\n" +
|
||||
" @ls_codMiscela varchar(15),\n" +
|
||||
" @ls_posizione varchar(20),\n" +
|
||||
" @ls_posizione_da varchar(20),\n" +
|
||||
" @ls_posizione_a varchar(20),\n" +
|
||||
" @li_countScarichiLotto integer\n" +
|
||||
"\n" +
|
||||
" SELECT @ls_codMiscela = cod_mart FROM olvw_miscele_olio\n" +
|
||||
"\n" +
|
||||
" if @ai_idRiga is null\n" +
|
||||
" begin\n" +
|
||||
" SELECT @ai_livello = 1\n" +
|
||||
" SELECT @as_item_id = '00001';\n" +
|
||||
" end ;\n" +
|
||||
" IF @as_item_id = '' \n" +
|
||||
" begin\n" +
|
||||
" Select @ls_posizione = mtb_depo_posizioni.posizione from mtb_partita_mag, mtb_depo_posizioni \n" +
|
||||
" where mtb_depo_posizioni.posizione = mtb_partita_mag.posizione and\n" +
|
||||
" mtb_partita_mag.cod_mart = @as_codProdParent and partita_mag = @as_partitaMagParent and\n" +
|
||||
" mtb_depo_posizioni.flag_silos_liquidi = 1;\n" +
|
||||
" If @ls_posizione is not null Select @as_item_id = 'SILOS' --Serve ad identificare le miscele di olio\n" +
|
||||
" end\n" +
|
||||
"\n" +
|
||||
" /* Acquisizione quantita totale prodotta per prodotto-partita */\n" +
|
||||
" Select @lc_qtaProd = ISNULL(sum(dtb_docr.qta_doc * dtb_docr.rap_conv * dtb_tipi.segno_qta_car), 0)\n" +
|
||||
" from dtb_docr, \n" +
|
||||
" dtb_tipi, \n" +
|
||||
" mtb_aart, \n" +
|
||||
" mtb_grup\n" +
|
||||
" where dtb_docr.cod_dtip = dtb_tipi.cod_dtip and\n" +
|
||||
" dtb_docr.cod_mart = mtb_aart.cod_mart and\n" +
|
||||
" mtb_aart.cod_mgrp = mtb_Grup.cod_mgrp and\n" +
|
||||
" dtb_docr.cod_mart = @as_codProd and\n" +
|
||||
" dtb_docr.partita_mag = @as_partitaMag and\n" +
|
||||
" dtb_tipi.gestione = 'L' and\n" +
|
||||
" dtb_tipi.tipo_emissione = 'DIRETTA' and\n" +
|
||||
" dtb_tipi.segno_qta_car <> 0\n" +
|
||||
"\n" +
|
||||
" /* Calcolo del rapporto della qta passata come parametro e di quella totale*/\n" +
|
||||
" if @ac_qtaProd is not null\n" +
|
||||
" if @lc_qtaProd = 0 select @lc_rapporto = 0 else select @lc_rapporto = @ac_qtaProd / @lc_qtaProd\n" +
|
||||
" else\n" +
|
||||
" begin \n" +
|
||||
" select @lc_rapporto = 1\n" +
|
||||
" select @ac_qtaProdParent = @lc_qtaProd\n" +
|
||||
" end\n" +
|
||||
" \n" +
|
||||
" /* Acquisizione totale quantita' prodotta per prododo-partita_mag dagli scarichi\n" +
|
||||
" E' necessario prendere la quantita dalla testata degli scarichi perche' ci \n" +
|
||||
" potrebbero essere delle perdite rispetto alla quantita' caricata.\n" +
|
||||
" N.B. al momento questa variabile viene acquisita solo per controllo in fase di debug\n" +
|
||||
" */\n" +
|
||||
" Select @lc_qtaProdScaricata = sum(dtb_doct.qta_prod*dtb_doct.rap_conv_prod * @lc_rapporto)\n" +
|
||||
" From dtb_doct, \n" +
|
||||
" dtb_tipi\n" +
|
||||
" Where dtb_doct.cod_dtip = dtb_tipi.cod_dtip and\n" +
|
||||
" dtb_tipi.gestione = 'L' and \n" +
|
||||
" dtb_tipi.segno_qta_scar = 1 and\n" +
|
||||
" dtb_doct.cod_prod = @as_codProd and\n" +
|
||||
" ISNULL(dtb_doct.partita_mag, '') = ISNULL(@as_partitaMag, '')\n" +
|
||||
" \n" +
|
||||
"\n" +
|
||||
" /* Acquisizione scarichi per prodotto-partita_mag */\n" +
|
||||
" select @li_idRiga = 0;\n" +
|
||||
" IF @as_codProd = @ls_codMiscela\n" +
|
||||
" begin\n" +
|
||||
" Select @ai_livello = @ai_livello+1\n" +
|
||||
" end\n" +
|
||||
" Declare csr_scarichi Cursor LOCAL SCROLL FOR\n" +
|
||||
" Select PP_gruppiCostiMP.GruppoConto,\n" +
|
||||
" dtb_docr.cod_mart, \n" +
|
||||
" dtb_docr.partita_mag,\n" +
|
||||
" dtb_docr.descrizione_estesa as descrizione,\n" +
|
||||
" mtb_aart.unt_mis,\n" +
|
||||
" sum(dtb_docr.qta_doc*dtb_docr.rap_conv*dtb_tipi.segno_qta_scar*@lc_rapporto) as Qta_mp\n" +
|
||||
" From dtb_doct, \n" +
|
||||
" dtb_docr, \n" +
|
||||
" dtb_tipi, \n" +
|
||||
" mtb_aart, \n" +
|
||||
" mtb_grup, \n" +
|
||||
" PP_gruppiCostiMP\n" +
|
||||
" Where dtb_doct.cod_anag = dtb_docr.cod_anag and\n" +
|
||||
" dtb_doct.cod_dtip = dtb_docr.cod_dtip and\n" +
|
||||
" dtb_doct.data_doc = dtb_docr.data_doc and\n" +
|
||||
" dtb_doct.ser_doc = dtb_docr.ser_doc and\n" +
|
||||
" dtb_doct.num_doc = dtb_docr.num_doc and\n" +
|
||||
" dtb_doct.cod_dtip = dtb_tipi.cod_dtip and\n" +
|
||||
" dtb_tipi.gestione = 'L' and \n" +
|
||||
" dtb_tipi.segno_qta_scar = 1 and\n" +
|
||||
" dtb_docr.cod_mart = mtb_aart.cod_mart and\n" +
|
||||
" mtb_aart.cod_mgrp = mtb_grup.cod_mgrp and\n" +
|
||||
" dtb_docr.cod_mart = PP_gruppiCostiMP.cod_mart and\n" +
|
||||
" dtb_doct.cod_prod = @as_codProd and\n" +
|
||||
" ISNULL(dtb_doct.partita_mag, '') = ISNULL(@as_partitaMag, '')\n" +
|
||||
" and NOT (dtb_docr.cod_mart = @as_codProd and ISNULL(dtb_docr.partita_mag, '') = ISNULL(@as_partitaMag, ''))\n" +
|
||||
" group by PP_gruppiCostiMP.GruppoConto,\n" +
|
||||
" dtb_docr.cod_mart, \n" +
|
||||
" dtb_docr.partita_mag,\n" +
|
||||
" dtb_docr.descrizione_estesa,\n" +
|
||||
" mtb_aart.unt_mis\n" +
|
||||
" union all\n" +
|
||||
" \n" +
|
||||
" Select PP_gruppiCostiMP.GruppoConto,\n" +
|
||||
" car.cod_mart, \n" +
|
||||
" car.partita_mag,\n" +
|
||||
" car.descrizione_estesa as descrizione,\n" +
|
||||
" mtb_aart.unt_mis,\n" +
|
||||
" sum(car.qta_doc*car.rap_conv*dtb_tipi.segno_qta_scar*@lc_rapporto) as Qta_mp \n" +
|
||||
" from dtb_doct inner join dtb_docr on dtb_doct.cod_anag = dtb_docr.cod_anag and\n" +
|
||||
" dtb_doct.cod_dtip = dtb_docr.cod_dtip and\n" +
|
||||
" dtb_doct.data_doc = dtb_docr.data_doc and\n" +
|
||||
" dtb_doct.ser_doc = dtb_docr.ser_doc and\n" +
|
||||
" dtb_doct.num_doc = dtb_docr.num_doc \n" +
|
||||
" inner join dtb_tipi on dtb_doct.cod_dtip = dtb_tipi.cod_dtip \n" +
|
||||
" inner join dtb_docr car on dtb_doct.activity_id = car.activity_id_row \n" +
|
||||
" inner join dtb_tipi tipo_car on car.cod_dtip = tipo_car.cod_dtip\n" +
|
||||
" inner join olvw_caratteristiche on car.cod_mart = olvw_caratteristiche.cod_mart\n" +
|
||||
" inner join PP_gruppiCostiMP on car.cod_mart = PP_gruppiCostiMP.cod_mart\n" +
|
||||
" inner join mtb_aart on car.cod_mart = mtb_aart.cod_mart \n" +
|
||||
" inner join mtb_grup on mtb_aart.cod_mgrp = mtb_grup.cod_mgrp \n" +
|
||||
" where tipo_car.gestione = 'L' and \n" +
|
||||
" tipo_car.segno_qta_car - tipo_car.segno_qta_scar < 0 and \n" +
|
||||
" olvw_caratteristiche.Confezionato = 'S' and \n" +
|
||||
" dtb_tipi.gestione = 'L' and \n" +
|
||||
" dtb_tipi.segno_qta_scar = 1 and\n" +
|
||||
" dtb_doct.cod_prod = @as_codProd and\n" +
|
||||
" ISNULL(dtb_doct.partita_mag, '') = ISNULL(@as_partitaMag, '')\n" +
|
||||
" and NOT (dtb_docr.cod_mart = @as_codProd and ISNULL(dtb_docr.partita_mag, '') = ISNULL(@as_partitaMag, '')) \n" +
|
||||
" group by PP_gruppiCostiMP.GruppoConto,\n" +
|
||||
" car.cod_mart, \n" +
|
||||
" car.partita_mag,\n" +
|
||||
" car.descrizione_estesa,\n" +
|
||||
" mtb_aart.unt_mis\n" +
|
||||
" Order by PP_gruppiCostiMP.GruppoConto desc \n" +
|
||||
" \n" +
|
||||
" OPEN csr_scarichi\n" +
|
||||
" FETCH NEXT FROM csr_scarichi INTO @ls_gruppoConto, @ls_codMart, @ls_partitaMag, @ls_descrizione, @ls_untMis, @lc_qtaMP\n" +
|
||||
" WHILE @@FETCH_STATUS = 0\n" +
|
||||
" begin\n" +
|
||||
" IF ABS(@lc_qtaMP) > 0.01\n" +
|
||||
" Begin\n" +
|
||||
" select @li_idRiga = @li_idRiga + 1;\n" +
|
||||
" SELECT @ls_itemID = @as_item_id + '_' + REPLICATE('0', 5 - len(CONVERT(varchar(15), @li_idRiga))) + CONVERT(varchar(15), @li_idRiga); \n" +
|
||||
"\n" +
|
||||
" /* verifica esistenza scarico, Indica che siamo in presenza di un semilavorato/lotto */\n" +
|
||||
" select @li_existDist = count(*)\n" +
|
||||
" from dtb_doct, dtb_tipi\n" +
|
||||
" where dtb_doct.cod_prod = @ls_codMart and partita_mag = @ls_partitaMag and \n" +
|
||||
" dtb_doct.cod_dtip = dtb_tipi.cod_dtip and\n" +
|
||||
" dtb_tipi.segno_qta_scar = 1 and \n" +
|
||||
" dtb_doct.gestione = 'L'\n" +
|
||||
" \n" +
|
||||
" \n" +
|
||||
" /* Materia prima */\n" +
|
||||
" if @li_existDist = 0 or @@NESTLEVEL >= 30\n" +
|
||||
" begin\n" +
|
||||
" insert into @dettCosti \n" +
|
||||
" select @ai_livello,\n" +
|
||||
" @ls_itemID,\n" +
|
||||
" @as_codProdParent, \n" +
|
||||
" @as_partitaMagParent, \n" +
|
||||
" @ac_qtaProdParent, \n" +
|
||||
" @as_codProd, \n" +
|
||||
" @as_partitaMag, \n" +
|
||||
" @lc_qtaProdScaricata, \n" +
|
||||
" @ls_gruppoConto, \n" +
|
||||
" @ls_codMart, \n" +
|
||||
" @ls_descrizione, \n" +
|
||||
" @ls_partitaMag, \n" +
|
||||
" @ls_untMis, \n" +
|
||||
" @lc_qtaMP\n" +
|
||||
" end\n" +
|
||||
" else\n" +
|
||||
" Begin\n" +
|
||||
" /* Semilavorato */\n" +
|
||||
" \n" +
|
||||
" Select @ls_posizione_a = mtb_depo_posizioni.posizione \n" +
|
||||
" from mtb_partita_mag, mtb_depo_posizioni \n" +
|
||||
" where mtb_depo_posizioni.posizione = mtb_partita_mag.posizione and\n" +
|
||||
" mtb_partita_mag.cod_mart = @as_codProd and partita_mag = @as_partitaMag and\n" +
|
||||
" mtb_depo_posizioni.flag_silos_liquidi = 1;\n" +
|
||||
" Select @ls_posizione_da = mtb_depo_posizioni.posizione \n" +
|
||||
" from mtb_partita_mag, mtb_depo_posizioni \n" +
|
||||
" where mtb_depo_posizioni.posizione = mtb_partita_mag.posizione and\n" +
|
||||
" mtb_partita_mag.cod_mart = @ls_codMart and partita_mag = @ls_partitaMag and\n" +
|
||||
" mtb_depo_posizioni.flag_silos_liquidi = 1;\n" +
|
||||
" \n" +
|
||||
" --24/11/25 (Massimo) Segue query per verificare se siamo su un lotto di olio che è stato scaricato e non azzerato. In tal caso la ricorsione non deve avvenire\n" +
|
||||
" select @li_countScarichiLotto = count(*)\n" +
|
||||
" from dtb_docr inner join dtb_tipi on dtb_docr.cod_dtip = dtb_tipi.cod_dtip \n" +
|
||||
" where dtb_tipi.segno_qta_scar = 1\n" +
|
||||
" and dtb_docr.cod_mart = @ls_codMart and dtb_docr.partita_mag = @ls_partitaMag\n" +
|
||||
" and @ls_posizione_da = @ls_posizione_a\n" +
|
||||
"\n" +
|
||||
" If @ls_posizione_da is not null and \n" +
|
||||
" (ISNULL(@ls_posizione_da,'') <> ISNULL(@ls_posizione_a,00) or \n" +
|
||||
" @ls_posizione_da is null or @ls_posizione_a is null or \n" +
|
||||
" (@ai_livello <1 and @as_codProd = @ls_codMiscela) or \n" +
|
||||
" (ISNULL(@ls_posizione_da,'') = ISNULL(@ls_posizione_a,00) and @as_codProd= @ls_codMiscela) or\n" +
|
||||
" IsNull(@li_countScarichiLotto,1) > 1)\n" +
|
||||
" --Questa insert serve per trattare l'olio che proviene da altro serbatoio come una materia prima a partire dal 2° livello di ricorsione\n" +
|
||||
" --dal 24/11/25 vale anche per olio proveniente dallo stesso serbatoio ma già scaricato parzialmente prima del carico del lotto parent\n" +
|
||||
" Begin\n" +
|
||||
" insert into @dettCosti \n" +
|
||||
" select @ai_livello,\n" +
|
||||
" @ls_itemID,\n" +
|
||||
" @as_codProdParent, \n" +
|
||||
" @as_partitaMagParent, \n" +
|
||||
" @ac_qtaProdParent, \n" +
|
||||
" @as_codProd, \n" +
|
||||
" @as_partitaMag, \n" +
|
||||
" @lc_qtaProdScaricata, \n" +
|
||||
" @ls_gruppoConto, \n" +
|
||||
" @ls_codMart, \n" +
|
||||
" @ls_descrizione, \n" +
|
||||
" @ls_partitaMag, \n" +
|
||||
" @ls_untMis, \n" +
|
||||
" @lc_qtaMP;\n" +
|
||||
" End\n" +
|
||||
" \n" +
|
||||
" /*Ricorsione su semilavorato-partita_mag*/\n" +
|
||||
" If IsNull(@li_countScarichiLotto,1) = 1 and --Aggiunta 24/11/25 da Massimo per escludere ricorsione su olio proveniente dallo stesso serbatoio ma già scaricato parzialmente prima del carico del lotto parent\n" +
|
||||
" ISNULL(@ls_posizione_da,'') = ISNULL(@ls_posizione_a,00) and @as_codProd <> @ls_codMiscela or \n" +
|
||||
" @ls_posizione_da is null or @ls_posizione_a is null or \n" +
|
||||
" (@ai_livello <1 and @as_codProd = @ls_codMiscela)\n" +
|
||||
" --La ricorsione non avviene sugli olii provenienti da altro serbatoio e neanche nel caso di Miscele fittizie create nello stesso serbatoio dell'olio di provenienza in assenza di polmone\n" +
|
||||
" insert into @dettCosti \n" +
|
||||
" select costi.livello, \n" +
|
||||
" costi.item_id,\n" +
|
||||
" @as_codProdParent, \n" +
|
||||
" @as_partitaMagParent,\n" +
|
||||
" @ac_qtaProdParent,\n" +
|
||||
" costi.cod_prod, \n" +
|
||||
" costi.partita_mag, \n" +
|
||||
" costi.qta_prod,\n" +
|
||||
" costi.gruppo_conto, \n" +
|
||||
" costi.conto, \n" +
|
||||
" costi.descrizione_conto, \n" +
|
||||
" costi.dettaglio_conto,\n" +
|
||||
" costi.unt_mis, \n" +
|
||||
" costi.qta_consumata \n" +
|
||||
" from dbo.f_pp_consuntivo_prod_tracc(@as_codProdParent, @as_partitaMagParent, @ac_qtaProdParent, @ls_codMart, @ls_partitaMag, @lc_qtaMP, @ai_livello, @ls_itemID, @li_idRiga) costi\n" +
|
||||
" \n" +
|
||||
" \n" +
|
||||
" end\n" +
|
||||
" end\n" +
|
||||
" FETCH NEXT FROM csr_scarichi INTO @ls_gruppoConto, @ls_codMart, @ls_partitaMag, @ls_descrizione, @ls_untMis, @lc_qtaMP\n" +
|
||||
" end\n" +
|
||||
" close csr_scarichi\n" +
|
||||
" deallocate csr_scarichi\n" +
|
||||
" return\n" +
|
||||
"END");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
import it.integry.ems_model.utility.dto.IndexTableDTO;
|
||||
import it.integry.ems_model.utility.dto.PkTableDTO;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Migration_20251127114735 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
executeStatement(
|
||||
"exec DropForeignKey 'mtb_aart', 'mtb_marchio_linea'",
|
||||
"exec DropForeignKey 'mtb_aart', 'mtb_marchio_slinea'",
|
||||
"exec DropForeignKey 'mtb_aart', 'mtb_marchio_sslinea'",
|
||||
"exec DropForeignKey 'mtb_marchio_sslinea', 'mtb_marchio_slinea'",
|
||||
"exec DropForeignKey 'mtb_marchio_slinea', 'mtb_marchio_linea'",
|
||||
"exec DropForeignKey 'mtb_marchio_linea', 'mtb_aart_marchio'",
|
||||
"exec DropPrimaryKey 'mtb_marchio_linea'",
|
||||
"exec DropPrimaryKey 'mtb_marchio_slinea'",
|
||||
"exec DropPrimaryKey 'mtb_marchio_sslinea'",
|
||||
"alter table mtb_marchio_linea drop column id_marchio",
|
||||
"alter table mtb_marchio_slinea drop column cod_linea",
|
||||
"alter table mtb_marchio_sslinea drop column cod_slinea",
|
||||
"exec sp_rename 'mtb_marchio_linea', 'mtb_aart_linea'",
|
||||
"exec sp_rename 'mtb_marchio_slinea', 'mtb_aart_slinea'",
|
||||
"exec sp_rename 'mtb_marchio_sslinea', 'mtb_aart_sslinea'"
|
||||
);
|
||||
|
||||
PkTableDTO pkTableDTO = new PkTableDTO()
|
||||
.setTableName("mtb_aart_linea")
|
||||
.setColumns(Arrays.asList(
|
||||
new PkTableDTO.Column("cod_linea")
|
||||
));
|
||||
createPrimaryKey(pkTableDTO);
|
||||
|
||||
pkTableDTO = new PkTableDTO()
|
||||
.setTableName("mtb_aart_slinea")
|
||||
.setColumns(Arrays.asList(
|
||||
new PkTableDTO.Column("cod_slinea")
|
||||
));
|
||||
createPrimaryKey(pkTableDTO);
|
||||
|
||||
|
||||
pkTableDTO = new PkTableDTO()
|
||||
.setTableName("mtb_aart_sslinea")
|
||||
.setColumns(Arrays.asList(
|
||||
new PkTableDTO.Column("cod_sslinea")
|
||||
));
|
||||
createPrimaryKey(pkTableDTO);
|
||||
|
||||
executeStatement(
|
||||
"ALTER TABLE mtb_aart ADD CONSTRAINT fk_mtb_aart_mtb_aart_linea "
|
||||
+ "FOREIGN KEY (cod_linea) REFERENCES mtb_aart_linea(cod_linea);",
|
||||
"ALTER TABLE mtb_aart ADD CONSTRAINT fk_mtb_aart_mtb_aart_slinea "
|
||||
+ "FOREIGN KEY (cod_slinea) REFERENCES mtb_aart_slinea(cod_slinea);",
|
||||
"ALTER TABLE mtb_aart ADD CONSTRAINT fk_mtb_aart_mtb_aart_sslinea "
|
||||
+ "FOREIGN KEY (cod_sslinea) REFERENCES mtb_aart_sslinea(cod_sslinea);");
|
||||
|
||||
dropIndex("mtb_aart_marchio", "marchio");
|
||||
|
||||
|
||||
executeStatement(
|
||||
"insert into mtb_aart_marchio\n" +
|
||||
"select distinct marchio\n" +
|
||||
"from mtb_aart\n" +
|
||||
"where marchio is not null\n" +
|
||||
"except\n" +
|
||||
"select marchio\n" +
|
||||
"from mtb_aart_marchio",
|
||||
"exec DropForeignKey 'mtb_aart', 'mtb_aart_marchio' ",
|
||||
"alter table mtb_aart drop column id_marchio ",
|
||||
"exec DropPrimaryKey 'mtb_aart_marchio' ",
|
||||
"alter table mtb_aart_marchio drop column id ",
|
||||
"alter table mtb_aart_marchio add constraint pk_mtb_aart_marchio primary key (marchio) ",
|
||||
"ALTER TABLE mtb_aart ADD CONSTRAINT fk_mtb_aart_mtb_aart_marchio FOREIGN KEY (marchio) REFERENCES mtb_aart_marchio(marchio) ");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251127121331 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("W_EINVIO_FATT_ELE_DLG", "SETUP", "PATH_FILE", null,
|
||||
"Path dove saranno salvati i file dopo l'esportazione", false, null, false, false,
|
||||
true, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251128153854 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
executeStatement("update stb_menu set flag_attivo = 'N' where cod_opz in ('mg077', 'mg078', 'mg079', 'mg080')");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251128190648 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Carelli_Winact)) {
|
||||
dropTable("crl_amac_manutenzioni_files");
|
||||
dropTable("ctb_amac_manutenzioni");
|
||||
|
||||
executeStatement(
|
||||
"create table dbo.ctb_amac_manutenzioni\n" +
|
||||
"(\n" +
|
||||
" id bigint identity\n" +
|
||||
" constraint pk_ctb_amac_manutenzioni\n" +
|
||||
" primary key,\n" +
|
||||
" cod_cmac varchar(20) not null\n" +
|
||||
" constraint FK_ctb_amac_manutenzioni_cod_cmac\n" +
|
||||
" references dbo.ctb_amac,\n" +
|
||||
" descrizione varchar(255) not null,\n" +
|
||||
" data_manutenzione datetime not null,\n" +
|
||||
" data_inserimento datetime not null,\n" +
|
||||
" data_iniz datetime,\n" +
|
||||
" data_fine datetime,\n" +
|
||||
" stato int default 0 not null,\n" +
|
||||
" esito varchar(8000),\n" +
|
||||
" dati_macchina varchar(8000),\n" +
|
||||
" ore_lavoro numeric(10, 2),\n" +
|
||||
" esito_positivo bit default 1,\n" +
|
||||
" manutenzione_ordinaria bit default 1,\n" +
|
||||
" convalidato_da varchar(40),\n" +
|
||||
" data_convalida datetime2,\n" +
|
||||
" convalidato_da2 varchar(40),\n" +
|
||||
" data_convalida2 datetime2\n" +
|
||||
")",
|
||||
"CREATE TABLE dbo.crl_amac_manutenzioni_files\n" +
|
||||
"(\n" +
|
||||
" id_manutenzione BIGINT NOT NULL\n" +
|
||||
" CONSTRAINT fk_crl_amac_manutenzioni_files_ctb_amac_manutenzioni\n" +
|
||||
" REFERENCES dbo.ctb_amac_manutenzioni,\n" +
|
||||
" id_attach VARCHAR(40) NOT NULL\n" +
|
||||
" CONSTRAINT fk_crl_amac_manutenzioni_files_stb_files_attached\n" +
|
||||
" REFERENCES dbo.stb_files_attached,\n" +
|
||||
" CONSTRAINT pk_crl_amac_manutenzioni_files\n" +
|
||||
" PRIMARY KEY (id_manutenzione, id_attach)\n" +
|
||||
")"
|
||||
);
|
||||
}
|
||||
|
||||
executeStatement(
|
||||
"CREATE TABLE dbo.ctb_amac_ricambi\n" +
|
||||
"(\n" +
|
||||
" id BIGINT IDENTITY\n" +
|
||||
" CONSTRAINT ctb_amac_ricambi_pk\n" +
|
||||
" PRIMARY KEY,\n" +
|
||||
" cod_cmac VARCHAR(20) NOT NULL\n" +
|
||||
" CONSTRAINT ctb_amac_ricambi_ctb_amac_cod_cmac_fk\n" +
|
||||
" REFERENCES dbo.ctb_amac,\n" +
|
||||
" sezione VARCHAR(100),\n" +
|
||||
" cod_mart VARCHAR(15) NOT NULL\n" +
|
||||
" CONSTRAINT ctb_amac_ricambi_mtb_aart_cod_mart_fk\n" +
|
||||
" REFERENCES dbo.mtb_aart,\n" +
|
||||
" durata_gg INT\n" +
|
||||
");",
|
||||
"ALTER TABLE dbo.ctb_amac_manutenzioni\n" +
|
||||
" ADD nome_squadra VARCHAR(250);",
|
||||
"CREATE TABLE dbo.crl_amac_manutenzioni_ord\n" +
|
||||
"(\n" +
|
||||
" id_manutenzione BIGINT\n" +
|
||||
" CONSTRAINT crl_amac_manutenzioni_ord_ctb_amac_manutenzioni_id_fk\n" +
|
||||
" REFERENCES dbo.ctb_amac_manutenzioni,\n" +
|
||||
" gestione VARCHAR,\n" +
|
||||
" data_ord DATETIME,\n" +
|
||||
" num_ord INT,\n" +
|
||||
" CONSTRAINT crl_amac_manutenzioni_ord_pk\n" +
|
||||
" PRIMARY KEY (id_manutenzione, gestione, num_ord, data_ord),\n" +
|
||||
" CONSTRAINT crl_amac_manutenzioni_ord_dtb_ordt_gestione_data_ord_num_ord_fk\n" +
|
||||
" FOREIGN KEY (gestione, data_ord, num_ord) REFERENCES dbo.dtb_ordt\n" +
|
||||
");"
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251201090147 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement("alter table ctb_cont add flag_attivo bit not null default 1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251201105344 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
|
||||
createOrUpdateTrigger("tr_changeTipoRiep", "CREATE TRIGGER [dbo].[tr_changeTipoRiep]\n" +
|
||||
" ON [dbo].[ctb_cont]\n" +
|
||||
" INSTEAD OF update\n" +
|
||||
"AS\n" +
|
||||
"BEGIN\n" +
|
||||
"\tSET NOCOUNT ON;\n" +
|
||||
"\tdeclare @cnt int = 0\n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
"\tif Update(tipo_riep ) \n" +
|
||||
"\tbegin\n" +
|
||||
"\t\tSELECT @cnt = COUNT(*) from ctb_movr inner join inserted on ctb_movr.cod_ccon = inserted.cod_ccon and \n" +
|
||||
"\t\t( (inserted.tipo_riep is null and ctb_movr.cod_anag is not null ) or (inserted.tipo_riep is null and ctb_movr.cod_anag is null ) )\n" +
|
||||
"\tend\n" +
|
||||
"\t \n" +
|
||||
"\t \n" +
|
||||
" IF @cnt > 0\n" +
|
||||
" BEGIN\n" +
|
||||
" THROW 50002, 'Update non consentito: esistono movimenti collegati.', 1;\n" +
|
||||
" RETURN;\n" +
|
||||
" END\n" +
|
||||
"\t\n" +
|
||||
"\tupdate ctb_cont \n" +
|
||||
"\tset cod_cmas = inserted.cod_cmas,\n" +
|
||||
"\t\tcod_cgrp = inserted.cod_cgrp,\n" +
|
||||
"\t\tdescrizione = inserted.descrizione,\n" +
|
||||
"\t\ttipo_riep = inserted.tipo_riep,\n" +
|
||||
"\t\tsaldo_att = inserted.saldo_att,\n" +
|
||||
"\t\tflag_cont_analit = inserted.flag_cont_analit,\n" +
|
||||
"\t\tcod_biva = inserted.cod_biva,\n" +
|
||||
"\t\tcod_jfas = inserted.cod_jfas,\n" +
|
||||
"\t\tcod_csct = inserted.cod_csct,\n" +
|
||||
"\t\tflag_risconto = inserted.flag_risconto,\n" +
|
||||
"\t\tperc_ded = inserted.perc_ded,\n" +
|
||||
"\t\tdiacod = inserted.diacod,\n" +
|
||||
"\t\tdata_ins = inserted.data_ins,\n" +
|
||||
"\t\tdata_mod = inserted.data_mod,\n" +
|
||||
"\t\tflag_attivo = inserted.flag_attivo\n" +
|
||||
"\tfrom ctb_cont inner join inserted on ctb_cont.cod_ccon = inserted.cod_ccon\n" +
|
||||
"\n" +
|
||||
"END");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251201124048 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetupQuery("SI_NO", "SI_NO", "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
createSetup("PICKING", "ACCETTAZIONE_BOLLA", "FLAG_ENABLE_MARK_RECEIVED", "N",
|
||||
"Abilita il tasto nell'avanti elenco per poter settare a true il campo merce_ricevuta in wdtb_doct", false, "SI_NO", false, false,
|
||||
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
|
||||
if (isCustomer(IntegryCustomer.Carelli)) {
|
||||
updateSetupValue("PICKING", "ACCETTAZIONE_BOLLA", "FLAG_ENABLE_MARK_RECEIVED", "S");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251201164935 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("W_DDOCU_TAB_RC", "SETUP", "LOG_PICKING", "N",
|
||||
"Se impostato a S viene salvato un file di log su ogni singola postazione, un file al giorno, con il log dei passaggi nella fase di picking)", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251201180420 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
String value = null;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.RossoGargano_RossoGargano)) {
|
||||
value = "01";
|
||||
}
|
||||
|
||||
createSetupQuery("COD_MDEP", "COD_MDEP", "SELECT COD_MDEP FROM MTB_DEPO ORDER BY 1");
|
||||
createSetup("PVM", "MACCHINARI_PROD", "DEPOSITO_RICAMBI", value,
|
||||
"Deposito sulla quale ci sono i ricambi, usato durante la creazione di ordini di lavoro delle manutenzioni",
|
||||
false, "COD_MDEP", false, false, false,
|
||||
false, false, null, false, "SELECT COD_MDEP FROM MTB_DEPO ORDER BY 1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251202094633 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Dulciar_Dulciar))
|
||||
return;
|
||||
|
||||
executeStatement("update stb_gest_setup set value = 'S' where gest_name = 'DTB_ORDT' and key_section in ('NUOVA_PROCEDURA','DISABLE_TRIGGER_ORDL')");
|
||||
executeStatement("update stb_gest_sync set syncronize = 'R' where gest_name like 'lord%'");
|
||||
executeStatement("update stb_gest_sync set syncronize = 'R' where gest_name like 'pord%'");
|
||||
executeStatement("insert into stb_abil \n" +
|
||||
"select case when gest_name = 'lordi' then 'LG081' else 'AG031' end , user_name, 'S', case when gest_name = 'lordi' then 'lordi_tab' else 'pordi_tab' end from stb_abil \n" +
|
||||
"where gest_name in ('lordi','pordi') and case when gest_name = 'lordi' then 'LG081' else 'AG031' end + user_name not in (select cod_opz + user_name from stb_abil where cod_opz in ('LG081','AG031'))");
|
||||
executeStatement("update stb_abil set flag_abil = 'N' where gest_name in ('lordi','pordi')");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251202140350 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("w_cmovi_rc", "SETUP", "PRINT_QUIETANZA", "S",
|
||||
"chiede e fa stampare la lettera di quietanza", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
|
||||
|
||||
if(isCustomer(IntegryCustomer.Carelli))
|
||||
updateSetupValue("w_cmovi_rc", "SETUP", "PRINT_QUIETANZA", "N");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251202161223 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
|
||||
createOrUpdateView("cvw_saldo_scad", "CREATE VIEW dbo.cvw_saldo_scad\n" +
|
||||
" WITH SCHEMABINDING\n" +
|
||||
" AS\n" +
|
||||
" SELECT ctb_scad.tipo_anag,\n" +
|
||||
" ctb_scad.cod_anag,\n" +
|
||||
" ctb_scad.anno_part,\n" +
|
||||
" ctb_scad.ser_doc,\n" +
|
||||
" ctb_scad.num_doc,\n" +
|
||||
" SUM(ctb_scad.imp_dare) AS dare_scad,\n" +
|
||||
" SUM(ctb_scad.imp_avere) AS avere_scad,\n" +
|
||||
" COUNT_BIG(*) AS id\n" +
|
||||
" FROM dbo.ctb_scad\n" +
|
||||
" GROUP BY ctb_scad.tipo_anag,\n" +
|
||||
" ctb_scad.cod_anag,\n" +
|
||||
" ctb_scad.anno_part,\n" +
|
||||
" ctb_scad.ser_doc,\n" +
|
||||
" ctb_scad.num_doc");
|
||||
executeStatement("CREATE UNIQUE CLUSTERED INDEX ix_cvw_saldo_scad\n" +
|
||||
" ON dbo.cvw_saldo_scad (\n" +
|
||||
" tipo_anag,\n" +
|
||||
" cod_anag,\n" +
|
||||
" anno_part,\n" +
|
||||
" ser_doc,\n" +
|
||||
" num_doc\n" +
|
||||
" );");
|
||||
|
||||
createOrUpdateView("cvw_saldo_part",
|
||||
"CREATE VIEW dbo.cvw_saldo_part\n" +
|
||||
" WITH SCHEMABINDING\n" +
|
||||
"AS\n" +
|
||||
"SELECT ctb_part.tipo_anag,\n" +
|
||||
" ctb_part.cod_anag,\n" +
|
||||
" ctb_part.anno_part,\n" +
|
||||
" ctb_part.ser_doc,\n" +
|
||||
" ctb_part.num_doc,\n" +
|
||||
" SUM(ctb_parr.imp_dare * ctb_part.cambio_divi_cont / ctb_parr.cambio_divi_cont) AS dare_part,\n" +
|
||||
" SUM(ctb_parr.imp_avere * ctb_part.cambio_divi_cont / ctb_parr.cambio_divi_cont) AS avere_part,\n" +
|
||||
" COUNT_BIG(*) AS id\n" +
|
||||
"FROM dbo.ctb_part\n" +
|
||||
" INNER JOIN dbo.ctb_parr\n" +
|
||||
" ON ctb_part.tipo_anag = ctb_parr.tipo_anag AND ctb_part.cod_anag = ctb_parr.cod_anag AND\n" +
|
||||
" ctb_part.anno_part = ctb_parr.anno_part AND ctb_part.ser_doc = ctb_parr.ser_doc AND\n" +
|
||||
" ctb_part.num_doc = ctb_parr.num_doc\n" +
|
||||
"GROUP BY ctb_part.tipo_anag, ctb_part.cod_anag, ctb_part.anno_part, ctb_part.ser_doc, ctb_part.num_doc");
|
||||
executeStatement("CREATE UNIQUE CLUSTERED INDEX ix_cvw_saldo_part\n" +
|
||||
" ON dbo.cvw_saldo_part (\n" +
|
||||
" tipo_anag,\n" +
|
||||
" cod_anag,\n" +
|
||||
" anno_part,\n" +
|
||||
" ser_doc,\n" +
|
||||
" num_doc\n" +
|
||||
" );");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251203085140 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if(isCustomer(IntegryCustomer.RossoGargano))
|
||||
updateSetupValue("w_cmovi_rc", "SETUP", "PRINT_QUIETANZA", "N");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251203121227 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
|
||||
createOrUpdateFunction("f_AggiungiGiorniScad", "CREATE FUNCTION [dbo].[f_AggiungiGiorniScad](@dataIniz DateTime, @giorni int, @ls_dataRif varchar(20)) \n" +
|
||||
"RETURNS dateTime\n" +
|
||||
" begin\n" +
|
||||
"\n" +
|
||||
" declare @ldt_dataInizCalc dateTime\n" +
|
||||
" DECLARE @mesi INT = @giorni / 30;\n" +
|
||||
"\n" +
|
||||
" SELECT @ldt_dataInizCalc = \n" +
|
||||
" CASE WHEN (@giorni % 30) > 0 OR left(@ls_dataRif, 12) = 'DATA FATTURA' THEN \n" +
|
||||
" DATEADD(Day, @giorni , @dataIniz )\n" +
|
||||
" ELSE\n" +
|
||||
" CASE WHEN @ls_dataRif = 'FINE MESE' AND @giorni = 30 AND Datepart(month, @dataIniz) = 1\n" +
|
||||
" THEN\n" +
|
||||
" dbo.f_getLastDayOfMonth(Convert(datetime, Cast(Year(@dataIniz) as varchar) + '/02/01' ))\n" +
|
||||
" ELSE\n" +
|
||||
" CASE WHEN (@giorni % 30) = 0 AND @ls_dataRif = 'FINE MESE' AND Datepart(month, @dataIniz) = 12\n" +
|
||||
" THEN\n" +
|
||||
" dbo.f_getLastDayOfMonth(DATEADD(Month, @mesi , @dataIniz ))\n" +
|
||||
" ELSE\n" +
|
||||
" dbo.f_getLastDayOfMonth(DATEADD(Day, @giorni , @dataIniz ))\n" +
|
||||
" END \n" +
|
||||
" END\n" +
|
||||
" END\n" +
|
||||
" return (@ldt_dataInizCalc)\n" +
|
||||
" end;");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251203165544 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement("exec dbo.DropPrimaryKey 'azienda'\n",
|
||||
"alter table azienda add id tinyint not null default 1;\n",
|
||||
"alter table azienda add constraint pk_azienda primary key (id);\n",
|
||||
"alter table azienda add constraint chk_id_azienda CHECK (id = 1)");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251204131327 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement("alter table mtb_aart_desc Add descrizione_html text",
|
||||
"alter table mtb_aart_equi add flag_equi_anag BIT not null DEFAULT 0"
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251205101442 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
|
||||
executeStatement("alter table srl_activity_type_user add activity_default bit not null default 0;\n",
|
||||
"CREATE UNIQUE INDEX ux_srl_activity_type_user_default\n" +
|
||||
"ON srl_activity_type_user (user_name, flag_tipologia)\n" +
|
||||
"WHERE activity_default = 1;");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,259 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251205111526 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
|
||||
createOrUpdateView("mvw_sitart_udc_det_all","CREATE VIEW [dbo].[mvw_sitart_udc_det_all] AS\n" +
|
||||
"WITH SitMtbColr AS (\n" +
|
||||
" /*Vengono presi tutti i Colli di carico*/\n" +
|
||||
" SELECT mtb_colt.gestione,\n" +
|
||||
" mtb_colt.data_collo,\n" +
|
||||
" mtb_colt.ser_collo,\n" +
|
||||
" mtb_colt.num_collo,\n" +
|
||||
" mtb_colt.segno,\n" +
|
||||
" mtb_colt.cod_anag,\n" +
|
||||
" mtb_colt.cod_vdes,\n" +
|
||||
" mtb_colt.cod_mdep,\n" +
|
||||
" mtb_colr.cod_mart,\n" +
|
||||
" mtb_colr.cod_col,\n" +
|
||||
" mtb_colr.cod_tagl,\n" +
|
||||
" mtb_colr.partita_mag,\n" +
|
||||
" mtb_colr.cod_jcom,\n" +
|
||||
" qta_col,\n" +
|
||||
" num_cnf,\n" +
|
||||
" qta_cnf,\n" +
|
||||
" mtb_colr.peso_netto_kg,\n" +
|
||||
" peso_lordo_kg,\n" +
|
||||
" mtb_colt.posizione,\n" +
|
||||
" mtb_colt.cod_jfas,\n" +
|
||||
" mtb_colt.id_anomalia as id_anomalia\n" +
|
||||
" FROM mtb_colr\n" +
|
||||
" inner join mtb_colt on\n" +
|
||||
" mtb_colt.gestione = mtb_colr.gestione\n" +
|
||||
" AND mtb_colt.data_collo = mtb_colr.data_collo\n" +
|
||||
" AND mtb_colt.num_collo = mtb_colr.num_collo\n" +
|
||||
" AND mtb_colt.ser_collo = mtb_colr.ser_collo\n" +
|
||||
" WHERE mtb_colr.data_collo >= '2020/01/01'\n" +
|
||||
" AND segno = 1\n" +
|
||||
"\n" +
|
||||
" UNION ALL\n" +
|
||||
" /*Vengono presi, a storno, tutti i colli che fanno riferimento ad altri colli di carico*/\n" +
|
||||
" SELECT mtb_colr.gestione_rif,\n" +
|
||||
" mtb_colr.data_collo_rif,\n" +
|
||||
" mtb_colr.ser_collo_rif,\n" +
|
||||
" mtb_colr.num_collo_rif,\n" +
|
||||
" collo_rif.segno,\n" +
|
||||
" collo_rif.cod_anag,\n" +
|
||||
" collo_rif.cod_vdes,\n" +
|
||||
" collo_rif.cod_mdep,\n" +
|
||||
" mtb_colr.cod_mart,\n" +
|
||||
" mtb_colr.cod_col,\n" +
|
||||
" mtb_colr.cod_tagl,\n" +
|
||||
" mtb_colr.partita_mag,\n" +
|
||||
" NULL AS cod_jcom,\n" +
|
||||
" -qta_col,\n" +
|
||||
" -num_cnf,\n" +
|
||||
" qta_cnf,\n" +
|
||||
" -mtb_colr.peso_netto_kg,\n" +
|
||||
" -peso_lordo_kg,\n" +
|
||||
" collo_rif.posizione,\n" +
|
||||
" collo_rif.cod_jfas,\n" +
|
||||
" NULL as id_anomalia\n" +
|
||||
" FROM mtb_colr\n" +
|
||||
" LEFT OUTER JOIN mtb_colt AS collo_rif\n" +
|
||||
" ON mtb_colr.gestione_rif = collo_rif.gestione AND\n" +
|
||||
" mtb_colr.data_collo_rif = collo_rif.data_collo AND\n" +
|
||||
" mtb_colr.num_collo_rif = collo_rif.num_collo AND\n" +
|
||||
" mtb_colr.ser_collo_rif = collo_rif.ser_collo\n" +
|
||||
" WHERE mtb_colr.data_collo >= '2020/01/01'\n" +
|
||||
" AND gestione_rif IS NOT NULL /*and mtb_colt.segno = -1 */\n" +
|
||||
" UNION ALL\n" +
|
||||
" /*Vengono presi anche tutti i colli di scarico non ancora agganciati a documento tranne quelli di scarico a lavorazione perche' il materiale versato nelle linee di produzione si ritiene subito consumato*/\n" +
|
||||
" SELECT mtb_colt.gestione,\n" +
|
||||
" mtb_colt.data_collo,\n" +
|
||||
" mtb_colt.ser_collo,\n" +
|
||||
" mtb_colt.num_collo,\n" +
|
||||
" mtb_colt.segno,\n" +
|
||||
" mtb_colt.cod_anag,\n" +
|
||||
" mtb_colt.cod_vdes,\n" +
|
||||
" mtb_colt.cod_mdep,\n" +
|
||||
" mtb_colr.cod_mart,\n" +
|
||||
" mtb_colr.cod_col,\n" +
|
||||
" mtb_colr.cod_tagl,\n" +
|
||||
" mtb_colr.partita_mag,\n" +
|
||||
" mtb_colr.cod_jcom,\n" +
|
||||
" qta_col,\n" +
|
||||
" num_cnf,\n" +
|
||||
" qta_cnf,\n" +
|
||||
" mtb_colr.peso_netto_kg,\n" +
|
||||
" peso_lordo_kg,\n" +
|
||||
" mtb_colt.posizione,\n" +
|
||||
" mtb_colt.cod_jfas,\n" +
|
||||
" NULL as id_anomalia\n" +
|
||||
" FROM mtb_colr\n" +
|
||||
" inner join mtb_colt on\n" +
|
||||
" mtb_colt.gestione = mtb_colr.gestione\n" +
|
||||
" AND mtb_colt.data_collo = mtb_colr.data_collo\n" +
|
||||
" AND mtb_colt.num_collo = mtb_colr.num_collo\n" +
|
||||
" AND mtb_colt.ser_collo = mtb_colr.ser_collo\n" +
|
||||
" WHERE mtb_colr.data_collo >= '2020/01/01'\n" +
|
||||
" AND segno = -1\n" +
|
||||
" AND cod_dtip IS NULL\n" +
|
||||
" AND mtb_colt.gestione <> 'L'),\n" +
|
||||
" SitMtbColt AS (SELECT SitMtbColr.gestione,\n" +
|
||||
" SitMtbColr.data_collo,\n" +
|
||||
" SitMtbColr.ser_collo,\n" +
|
||||
" SitMtbColr.num_collo,\n" +
|
||||
" SitMtbColr.segno,\n" +
|
||||
" SitMtbColr.cod_mdep,\n" +
|
||||
" SitMtbColr.posizione,\n" +
|
||||
" SitMtbColr.cod_mart,\n" +
|
||||
" SitMtbColr.cod_col,\n" +
|
||||
" SitMtbColr.cod_tagl,\n" +
|
||||
" SitMtbColr.partita_mag,\n" +
|
||||
" mtb_partita_mag.data_scad,\n" +
|
||||
" MAX(SitMtbColr.cod_jcom) AS cod_jcom,\n" +
|
||||
" SUM(qta_col) AS qta_col,\n" +
|
||||
" SUM(num_cnf) AS num_cnf,\n" +
|
||||
" AVG(SitMtbColr.qta_cnf) AS qta_cnf,\n" +
|
||||
" SUM(SitMtbColr.peso_netto_kg) AS peso_netto_kg,\n" +
|
||||
" SUM(peso_lordo_kg) AS peso_lordo_kg,\n" +
|
||||
" SitMtbColr.cod_jfas,\n" +
|
||||
" flag_qta_cnf_fissa,\n" +
|
||||
" MAX(SitMtbColr.id_anomalia) as id_anomalia\n" +
|
||||
" FROM SitMtbColr\n" +
|
||||
" LEFT OUTER JOIN mtb_partita_mag ON SitMtbColr.cod_mart = mtb_partita_mag.cod_mart AND\n" +
|
||||
" SitMtbColr.partita_mag = mtb_partita_mag.partita_mag\n" +
|
||||
" INNER JOIN mtb_aart ON SitMtbColr.cod_mart = mtb_aart.cod_mart\n" +
|
||||
" GROUP BY SitMtbColr.gestione, SitMtbColr.data_collo, SitMtbColr.ser_collo, SitMtbColr.num_collo,\n" +
|
||||
" SitMtbColr.segno, SitMtbColr.cod_mdep,\n" +
|
||||
" SitMtbColr.posizione, SitMtbColr.cod_mart, SitMtbColr.cod_col, SitMtbColr.cod_tagl,\n" +
|
||||
" SitMtbColr.partita_mag,\n" +
|
||||
" mtb_partita_mag.data_scad, SitMtbColr.cod_jfas, mtb_aart.flag_qta_cnf_fissa)\n" +
|
||||
"SELECT gestione,\n" +
|
||||
" data_collo,\n" +
|
||||
" ser_collo,\n" +
|
||||
" num_collo,\n" +
|
||||
" segno,\n" +
|
||||
" cod_mdep,\n" +
|
||||
" SitMtbColt.posizione,\n" +
|
||||
" SitMtbColt.cod_mart,\n" +
|
||||
" cod_col,\n" +
|
||||
" cod_tagl,\n" +
|
||||
" partita_mag,\n" +
|
||||
" data_scad,\n" +
|
||||
" cod_jcom,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN flag_dig = 'S' THEN\n" +
|
||||
" CAST(qta_col AS INT)\n" +
|
||||
" ELSE ROUND(qta_col, cifre_dec)\n" +
|
||||
" END as qta_col,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN flag_dig = 'S' THEN\n" +
|
||||
" CASE\n" +
|
||||
" WHEN flag_dig = 'S' THEN\n" +
|
||||
" CAST(qta_col AS INT)\n" +
|
||||
" ELSE ROUND(qta_col, cifre_dec)\n" +
|
||||
" END / case when SitMtbColt.qta_cnf = 0 then 1 else SitMtbColt.qta_cnf end\n" +
|
||||
" ELSE num_cnf\n" +
|
||||
" END as num_cnf,\n" +
|
||||
" --qta_col,\n" +
|
||||
" --num_cnf,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN SitMtbColt.flag_qta_cnf_fissa = 'S'\n" +
|
||||
" THEN SitMtbColt.qta_cnf\n" +
|
||||
" ELSE qta_col / CASE WHEN num_cnf = 0 THEN 1 ELSE num_cnf END\n" +
|
||||
" END AS qta_cnf,\n" +
|
||||
" peso_netto_kg,\n" +
|
||||
" peso_lordo_kg,\n" +
|
||||
" cod_jfas,\n" +
|
||||
" SitMtbColt.flag_qta_cnf_fissa,\n" +
|
||||
" mtb_unt_mis.flag_dig,\n" +
|
||||
" mtb_unt_mis.cifre_dec,\n" +
|
||||
" SitMtbColt.id_anomalia\n" +
|
||||
"FROM SitMtbColt\n" +
|
||||
" INNER JOIN mtb_aart ON SitMtbColt.cod_mart = mtb_aart.cod_mart\n" +
|
||||
" INNER JOIN mtb_unt_mis ON mtb_aart.unt_mis = mtb_unt_mis.unt_mis");
|
||||
|
||||
|
||||
|
||||
createOrUpdateView("mvw_sitart_udc_det","CREATE VIEW [dbo].[mvw_sitart_udc_det] AS\n" +
|
||||
"SELECT gestione,\n" +
|
||||
" data_collo,\n" +
|
||||
" ser_collo,\n" +
|
||||
" num_collo,\n" +
|
||||
" segno,\n" +
|
||||
" cod_mdep,\n" +
|
||||
" posizione,\n" +
|
||||
" cod_mart,\n" +
|
||||
" cod_col,\n" +
|
||||
" cod_tagl,\n" +
|
||||
" partita_mag,\n" +
|
||||
" data_scad,\n" +
|
||||
" cod_jcom,\n" +
|
||||
" qta_col,\n" +
|
||||
" num_cnf,\n" +
|
||||
" qta_cnf,\n" +
|
||||
" peso_netto_kg,\n" +
|
||||
" peso_lordo_kg,\n" +
|
||||
" cod_jfas,\n" +
|
||||
" id_anomalia\n" +
|
||||
"FROM mvw_sitart_udc_det_all\n" +
|
||||
"WHERE qta_col > 0");
|
||||
|
||||
createOrUpdateView("mvw_sitart_udc_det_inventario","CREATE VIEW [dbo].[mvw_sitart_udc_det_inventario] as\n" +
|
||||
"SELECT UL.gestione,\n" +
|
||||
" data_collo,\n" +
|
||||
" ser_collo,\n" +
|
||||
" num_collo,\n" +
|
||||
" segno,\n" +
|
||||
" UL.cod_mdep,\n" +
|
||||
" UL.posizione,\n" +
|
||||
" mtb_depo_posizioni.priorita,\n" +
|
||||
" mtb_aart.cod_mgrp AS codGruppo,\n" +
|
||||
" mtb_grup.descrizione AS Gruppo,\n" +
|
||||
" mtb_aart.cod_msgr AS CodSgruppo,\n" +
|
||||
" mtb_sgrp.descrizione AS Sottogruppo,\n" +
|
||||
" UL.cod_mart,\n" +
|
||||
" diacod,\n" +
|
||||
" mtb_aart.descrizione_estesa,\n" +
|
||||
" partita_mag,\n" +
|
||||
" UL.cod_jcom,\n" +
|
||||
" jtb_comt.descrizione AS commessa,\n" +
|
||||
" mtb_aart.unt_mis,\n" +
|
||||
" qta_col,\n" +
|
||||
" num_cnf,\n" +
|
||||
" UL.qta_cnf,\n" +
|
||||
" UL.peso_netto_kg,\n" +
|
||||
" UL.peso_lordo_kg,\n" +
|
||||
" UL.cod_jfas,\n" +
|
||||
" UL.id_anomalia\n" +
|
||||
"FROM [mvw_sitart_udc_det] UL\n" +
|
||||
" LEFT OUTER JOIN jtb_comt ON UL.cod_jcom = jtb_comt.cod_jcom\n" +
|
||||
" LEFT OUTER JOIN mtb_depo_posizioni\n" +
|
||||
" on UL.cod_mdep = mtb_depo_posizioni.cod_mdep and UL.posizione = mtb_depo_posizioni.posizione,\n" +
|
||||
" mtb_aart,\n" +
|
||||
" mtb_grup,\n" +
|
||||
" mtb_sgrp\n" +
|
||||
"WHERE UL.cod_mart = mtb_aart.cod_mart\n" +
|
||||
" AND mtb_aart.cod_mgrp = mtb_grup.cod_mgrp\n" +
|
||||
" AND mtb_aart.cod_mgrp = mtb_sgrp.cod_mgrp\n" +
|
||||
" AND mtb_aart.cod_msgr = mtb_sgrp.cod_msgr\n" +
|
||||
" AND qta_col <> 0\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251205130201 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if ( !existsColumn("mtb_depo", "data_iniz_vent" ))
|
||||
executeStatement("ALTER TABLE mtb_depo ADD data_iniz_vent datetime");
|
||||
|
||||
if ( !existsColumn("mtb_depo", "data_fine_vent" ))
|
||||
executeStatement("ALTER TABLE mtb_depo ADD data_fine_vent datetime");
|
||||
|
||||
if ( !existsColumn("ctb_movi", "ventilazione" ))
|
||||
executeStatement("ALTER TABLE ctb_movi ADD ventilazione bit not null default 1");
|
||||
|
||||
if (isCustomer(IntegryCustomer.CapelliMonelli) && isCustomerDb(IntegryCustomerDB.Gramm_GrammUsa)) {
|
||||
executeStatement(
|
||||
"CREATE TABLE [oltb_operregi_log] (data_file DATETIME, prog_file INT, cod_CUA VARCHAR (16), ID_depo NUMERIC (10, 0), num_operaz INT, data_operaz DATETIME, id_err INT, error_text VARCHAR (MAX), tipo_errore INT)",
|
||||
"ALTER TABLE [atb_offt] ADD flag_tipo_off INT",
|
||||
"ALTER TABLE [ctb_varbeni] ADD num_cmov INT",
|
||||
"CREATE TABLE [mtb_list_costo_lisa_data] (id BIGINT, listino VARCHAR (5), data_rif DATETIME, cod_mart VARCHAR (15), cod_art_for VARCHAR (25), cod_promo VARCHAR (10), costo_lisa DECIMAL (20, 5))",
|
||||
"ALTER TABLE [atb_tipi] ADD socio_aziendale BIT",
|
||||
"ALTER TABLE [dtb_dif_bolle] ADD targa VARCHAR (20), posti_pallet INT",
|
||||
"CREATE TABLE [oltb_categorie] (cod_ocat VARCHAR (5), categoria VARCHAR (80))",
|
||||
"ALTER TABLE [ctb_movi] ADD ventilazione BIT",
|
||||
"CREATE TABLE [oltb_macroaree] (Cod_omar VARCHAR (5), acronimo VARCHAR (5), macro_area VARCHAR (80), flag_ObbligOrigSpec VARCHAR (1), flag_DopIgp VARCHAR (1))",
|
||||
"ALTER TABLE [dtb_ord_steps] ADD posizione_out VARCHAR (MAX)",
|
||||
"CREATE TABLE [oltb_origspec] (cod_omar VARCHAR (5), cod_oorspec VARCHAR (5), acronimo VARCHAR (5), origine_spec VARCHAR (80))"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251205154053 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement("DELETE FROM STB_GEST_SETUP WHERE GEST_NAME LIKE '%DOCUMENTI DI VENDITA'");
|
||||
|
||||
createSetup("EXPORT_DOCUMENTI VENDITA", "MD", "ATTIVO", "N",
|
||||
"Inserire S/N per attivare/disattivare il tipo di importazione", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("EXPORT_DOCUMENTI VENDITA", "MD", "EMAIL_FOR_LOG", null,
|
||||
"Inserire il file l'indirizzo email per inviare il log dell'importazione", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("EXPORT_DOCUMENTI VENDITA", "MD", "GG_CANC_FILE", null,
|
||||
"Giorni per la cancellazione dei file dalla cartella di appoggio", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("EXPORT_DOCUMENTI VENDITA", "MD", "IMPORT_REST", "S",
|
||||
"Inserire S/N per attivare/disattivare il salvataggio con i servizi REST", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("EXPORT_DOCUMENTI VENDITA", "MD", "PATH_FILE", null,
|
||||
"Directory dove vengono salvati i file temporanei, se non è configurata i file saranno salvati in c:\\mlSetupWS\\TEMP_EXPORT", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
|
||||
if (!isCustomer(IntegryCustomer.Sardinya)) return;
|
||||
|
||||
updateSetupValue("EXPORT_DOCUMENTI VENDITA", "MD", "ATTIVO", "S",
|
||||
"Inserire S/N per attivare/disattivare il tipo di importazione", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
import it.integry.ems_model.entity.StbGestSetup;
|
||||
|
||||
public class Migration_20251205173303 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
|
||||
StbGestSetup setupMovimentoFiscale = getStbGestSetup("PICKING", "RETTIFICA_GIACENZE", "TIPO_MOVIMENTO_FISCALE");
|
||||
|
||||
deleteSetup("PICKING", "RETTIFICA_GIACENZE", "TIPO_MOVIMENTO_FISCALE");
|
||||
|
||||
createSetup(setupMovimentoFiscale.getGestName(),
|
||||
setupMovimentoFiscale.getSection(),
|
||||
setupMovimentoFiscale.getKeySection() + "_CAR",
|
||||
setupMovimentoFiscale.getValue(),
|
||||
setupMovimentoFiscale.getDescription(),
|
||||
setupMovimentoFiscale.getQueryDefault());
|
||||
|
||||
|
||||
createSetup(setupMovimentoFiscale.getGestName(),
|
||||
setupMovimentoFiscale.getSection(),
|
||||
setupMovimentoFiscale.getKeySection() + "_SCAR",
|
||||
setupMovimentoFiscale.getValue(),
|
||||
setupMovimentoFiscale.getDescription(),
|
||||
setupMovimentoFiscale.getQueryDefault());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251209113110 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
executeStatement("alter table mtb_aart alter column ingredienti varchar(8000)");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251209114959 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement("alter table dbo.mtb_cols add valore varchar(200)");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251209154901 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isDMS())
|
||||
return;
|
||||
|
||||
executeStatement(
|
||||
"insert into mtb_unt_mis ( unt_mis)\n" +
|
||||
"select *\n" +
|
||||
"from (\n" +
|
||||
"select unt_mis\n" +
|
||||
"from mtb_aart\n" +
|
||||
"union\n" +
|
||||
"select unt_mis2\n" +
|
||||
"from mtb_aart\n" +
|
||||
"where unt_mis2 is not null\n" +
|
||||
"union\n" +
|
||||
"select unt_mis3\n" +
|
||||
"from mtb_aart\n" +
|
||||
"where unt_mis3 is not null\n" +
|
||||
") um \n" +
|
||||
"where not exists (select 1 from mtb_unt_mis where mtb_unt_mis.unt_mis = um.unt_mis )",
|
||||
"ALTER TABLE MTB_AART ADD CONSTRAINT FK_MTB_AART_UNT_MIS FOREIGN KEY (UNT_MIS) REFERENCES DBO.MTB_UNT_MIS (UNT_MIS)",
|
||||
"ALTER TABLE MTB_AART ALTER COLUMN UNT_MIS2 VARCHAR(3)",
|
||||
"ALTER TABLE MTB_AART ADD CONSTRAINT FK_MTB_AART_UNT_MIS2 FOREIGN KEY (UNT_MIS2) REFERENCES DBO.MTB_UNT_MIS (UNT_MIS)",
|
||||
"ALTER TABLE MTB_AART ADD CONSTRAINT FK_MTB_AART_UNT_MIS3 FOREIGN KEY (UNT_MIS3) REFERENCES DBO.MTB_UNT_MIS (UNT_MIS)" );
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user