Merge branch 'develop' into feature/Feature-FatturaDiffertita
# Conflicts: # ems-core/src/main/java/it/integry/ems/rules/completing/DocOrdCalTotaliRules.java # ems-core/src/main/java/it/integry/ems/rules/completing/DocumentRules.java
This commit is contained in:
12
.idea/fileTemplates/Entity.java
generated
12
.idea/fileTemplates/Entity.java
generated
@@ -3,6 +3,8 @@
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
|
||||
#parse("File Header.java")
|
||||
@@ -11,9 +13,15 @@ import org.kie.api.definition.type.PropertyReactive;
|
||||
@Table(${NAME}.ENTITY)
|
||||
@JsonTypeName(${NAME}.ENTITY)
|
||||
public class ${NAME} extends EntityBase {
|
||||
|
||||
public static final String ENTITY = "${TABLE}";
|
||||
|
||||
private static final long serialVerionUID = 1L;
|
||||
private final static Logger logger = LogManager.getLogger();
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ${NAME}() {
|
||||
super(logger);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
10
.idea/fileTemplates/EntityChild.java
generated
10
.idea/fileTemplates/EntityChild.java
generated
@@ -3,6 +3,8 @@
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
|
||||
#parse("File Header.java")
|
||||
@@ -12,5 +14,11 @@ import org.kie.api.definition.type.PropertyReactive;
|
||||
public class ${NAME} extends EntityBase {
|
||||
public static final String ENTITY = "${TABLE}";
|
||||
|
||||
#[[$END$]]#
|
||||
private final static Logger logger = LogManager.getLogger();
|
||||
|
||||
public ${NAME}() {
|
||||
super(logger);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
6
.idea/fileTemplates/IntegryMigrationClass.java
generated
6
.idea/fileTemplates/IntegryMigrationClass.java
generated
@@ -1,5 +1,5 @@
|
||||
#if(${PACKAGE_NAME}&&${PACKAGE_NAME}!="")package ${PACKAGE_NAME};#end
|
||||
#parse("File Header.java")
|
||||
#parse("File Header.java")
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
@@ -12,8 +12,6 @@ public class ${NAME} extends BaseMigration implements MigrationModelInterface{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down()throws Exception{
|
||||
|
||||
public void down()throws Exception {
|
||||
}
|
||||
|
||||
}
|
||||
8
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
8
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<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>
|
||||
</profile>
|
||||
</component>
|
||||
5
.idea/jarRepositories.xml
generated
5
.idea/jarRepositories.xml
generated
@@ -6,6 +6,11 @@
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="repo.jenkins-ci.org" />
|
||||
<option name="name" value="repo.jenkins-ci.org" />
|
||||
<option name="url" value="https://repo.jenkins-ci.org/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
|
||||
17
.idea/runConfigurations/KieStaticCompiler.xml
generated
Normal file
17
.idea/runConfigurations/KieStaticCompiler.xml
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="KieStaticCompiler" type="Application" factoryName="Application" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="it.integry.ems_model.rulescompleting.KieStaticCompiler" />
|
||||
<module name="ems-core" />
|
||||
<shortenClasspath name="MANIFEST" />
|
||||
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="it.integry.ems_model.rulescompleting.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
18
.idea/runConfigurations/Tomcat.xml
generated
18
.idea/runConfigurations/Tomcat.xml
generated
@@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tomcat" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local" APPLICATION_SERVER_NAME="Tomcat" ALTERNATIVE_JRE_ENABLED="false" ALTERNATIVE_JRE_PATH="1.8" nameIsGenerated="true">
|
||||
<option name="COMMON_VM_ARGUMENTS" value="-Xms512m -Xmx2048m" />
|
||||
<option name="COMMON_VM_ARGUMENTS" value="-DDISABLE_DROOLS_COMPILE=TRUE -Xms1G -Xmx6G" />
|
||||
<deployment>
|
||||
<artifact name="ems-engine:war exploded">
|
||||
<settings>
|
||||
@@ -82,6 +82,21 @@
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
</SHUTDOWN>
|
||||
</ConfigurationWrapper>
|
||||
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Profile ">
|
||||
<option name="USE_ENV_VARIABLES" value="true" />
|
||||
<STARTUP>
|
||||
<option name="USE_DEFAULT" value="true" />
|
||||
<option name="SCRIPT" value="" />
|
||||
<option name="VM_PARAMETERS" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
</STARTUP>
|
||||
<SHUTDOWN>
|
||||
<option name="USE_DEFAULT" value="true" />
|
||||
<option name="SCRIPT" value="" />
|
||||
<option name="VM_PARAMETERS" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
</SHUTDOWN>
|
||||
</ConfigurationWrapper>
|
||||
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Run">
|
||||
<option name="USE_ENV_VARIABLES" value="true" />
|
||||
<STARTUP>
|
||||
@@ -98,6 +113,7 @@
|
||||
</SHUTDOWN>
|
||||
</ConfigurationWrapper>
|
||||
<method v="2">
|
||||
<option name="RunConfigurationTask" enabled="true" run_configuration_name="KieStaticCompiler" run_configuration_type="Application" />
|
||||
<option name="Make" enabled="true" />
|
||||
<option name="BuildArtifacts" enabled="true">
|
||||
<artifact name="ems-engine:war exploded" />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tomcat #2 (GestSRV)" type="Remote" folderName="Carelli">
|
||||
<configuration default="false" name="Tomcat9Wingest (GestSRV)" type="Remote" folderName="Carelli">
|
||||
<module name="ems-engine" />
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
@@ -1,5 +1,5 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tomcat #1 (GestSRV)" type="Remote" folderName="Carelli">
|
||||
<configuration default="false" name="Tomcat9 (GestSRV)" type="Remote" folderName="Carelli">
|
||||
<module name="ems-engine" />
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
16
.idea/runConfigurations/Tomcat_9__RistoCash_.xml
generated
Normal file
16
.idea/runConfigurations/Tomcat_9__RistoCash_.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tomcat 9 (RistoCash)" type="Remote">
|
||||
<module name="ems-engine" />
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
<option name="SHMEM_ADDRESS" />
|
||||
<option name="HOST" value="127.0.0.1" />
|
||||
<option name="PORT" value="8001" />
|
||||
<option name="AUTO_RESTART" value="false" />
|
||||
<RunnerSettings RunnerId="Debug">
|
||||
<option name="DEBUG_PORT" value="8001" />
|
||||
<option name="LOCAL" value="false" />
|
||||
</RunnerSettings>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -4,7 +4,7 @@
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
<option name="SHMEM_ADDRESS" />
|
||||
<option name="HOST" value="192.168.1.13" />
|
||||
<option name="HOST" value="172.16.10.51" />
|
||||
<option name="PORT" value="8001" />
|
||||
<option name="AUTO_RESTART" value="false" />
|
||||
<RunnerSettings RunnerId="Debug">
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
<option name="SHMEM_ADDRESS" />
|
||||
<option name="HOST" value="localhost" />
|
||||
<option name="HOST" value="192.168.3.16" />
|
||||
<option name="PORT" value="8000" />
|
||||
<option name="AUTO_RESTART" value="false" />
|
||||
<RunnerSettings RunnerId="Debug">
|
||||
|
||||
17
.idea/runConfigurations/Tomcat__FAST_.xml
generated
17
.idea/runConfigurations/Tomcat__FAST_.xml
generated
@@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tomcat (FAST)" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local" APPLICATION_SERVER_NAME="Tomcat" ALTERNATIVE_JRE_ENABLED="false">
|
||||
<option name="COMMON_VM_ARGUMENTS" value="-DDISABLE_DROOLS_COMPILE=TRUE -Xms6G -Xmx6G -XX:MaxPermSize=1G -XX:PermSize=512M" />
|
||||
<option name="COMMON_VM_ARGUMENTS" value="-DDISABLE_DROOLS_COMPILE=TRUE -Xms1G -Xmx6G" />
|
||||
<deployment>
|
||||
<artifact name="ems-engine:war exploded">
|
||||
<settings>
|
||||
@@ -82,6 +82,21 @@
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
</SHUTDOWN>
|
||||
</ConfigurationWrapper>
|
||||
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Profile ">
|
||||
<option name="USE_ENV_VARIABLES" value="true" />
|
||||
<STARTUP>
|
||||
<option name="USE_DEFAULT" value="true" />
|
||||
<option name="SCRIPT" value="" />
|
||||
<option name="VM_PARAMETERS" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
</STARTUP>
|
||||
<SHUTDOWN>
|
||||
<option name="USE_DEFAULT" value="true" />
|
||||
<option name="SCRIPT" value="" />
|
||||
<option name="VM_PARAMETERS" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
</SHUTDOWN>
|
||||
</ConfigurationWrapper>
|
||||
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Run">
|
||||
<option name="USE_ENV_VARIABLES" value="true" />
|
||||
<STARTUP>
|
||||
|
||||
115
build/Jenkinsfile.groovy
Normal file
115
build/Jenkinsfile.groovy
Normal file
@@ -0,0 +1,115 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
options {
|
||||
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
|
||||
disableConcurrentBuilds()
|
||||
}
|
||||
|
||||
stages {
|
||||
stage ('PreBuild Steps (Master)') {
|
||||
when {
|
||||
expression {
|
||||
return env.GIT_BRANCH == "master"
|
||||
}
|
||||
}
|
||||
steps {
|
||||
echo "Creo version tag su Git"
|
||||
bat 'build\\create_build_tag.bat'
|
||||
}
|
||||
}
|
||||
stage('Maven Build') {
|
||||
steps {
|
||||
echo "${WORKSPACE}"
|
||||
withMaven(jdk: 'JDK 17.0.6 x64', traceability: true, maven: 'Maven 3.9.5') {
|
||||
bat(script: 'mvn clean install -t toolchains-jenkins.xml', returnStdout: true)
|
||||
archiveArtifacts(artifacts: 'ems-engine/target/*.war*', onlyIfSuccessful: true)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
stage('Publish Develop') {
|
||||
when {
|
||||
expression {
|
||||
return env.GIT_BRANCH == "develop"
|
||||
}
|
||||
}
|
||||
parallel {
|
||||
stage('Tomcat update') {
|
||||
stages {
|
||||
stage('Update Tomcat 1') {
|
||||
steps {
|
||||
echo "Updating Tomcat9 from ${WORKSPACE}"
|
||||
powershell returnStdout: true, script: "build\\update_tomcat.ps1 -serviceName \"Tomcat9\" -httpPort \"8081\" -updatedArtifactPath \"${WORKSPACE}\\ems-engine\\target\\ems-api.war\""
|
||||
}
|
||||
}
|
||||
stage('Update Tomcat 2') {
|
||||
steps {
|
||||
echo "Updating Tomcat9 from ${WORKSPACE}"
|
||||
powershell returnStdout: true, script: "build\\update_tomcat.ps1 -serviceName \"Tomcat9Backup\" -httpPort \"8082\" -updatedArtifactPath \"${WORKSPACE}\\ems-engine\\target\\ems-api.war\""
|
||||
bat 'curl -k https://devservices.studioml.it/ems-api/updateWMSApp'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Publish Master') {
|
||||
when {
|
||||
expression {
|
||||
return env.GIT_BRANCH == "master"
|
||||
}
|
||||
}
|
||||
parallel {
|
||||
stage('Tomcat update') {
|
||||
stages {
|
||||
stage('Update Tomcat 1') {
|
||||
steps {
|
||||
echo "Updating Tomcat9 from ${WORKSPACE}"
|
||||
sshPublisher(publishers: [sshPublisherDesc(configName: 'Production Linux Tomcat Server (192.168.3.16)', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '''sudo /usr/bin/systemctl stop tomcat9
|
||||
rm -R tomcat9/webapps/ems-api
|
||||
sudo /usr/bin/systemctl start tomcat9
|
||||
|
||||
/home/studioml/./wait_tomcat_startup.sh 8081''', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/tomcat9/webapps', remoteDirectorySDF: false, removePrefix: 'ems-engine/target/', sourceFiles: 'ems-engine/target/*.war*')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
|
||||
}
|
||||
}
|
||||
stage('Update Tomcat 2') {
|
||||
steps {
|
||||
echo "Updating Tomcat9 from ${WORKSPACE}"
|
||||
sshPublisher(publishers: [sshPublisherDesc(configName: 'Production Linux Tomcat Server (192.168.3.16)', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '''sudo /usr/bin/systemctl stop tomcat9backup
|
||||
rm -R tomcat9backup/webapps/ems-api
|
||||
sudo /usr/bin/systemctl start tomcat9backup
|
||||
|
||||
/home/studioml/./wait_tomcat_startup.sh 8082
|
||||
|
||||
sleep 10''', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/tomcat9backup/webapps', remoteDirectorySDF: false, removePrefix: 'ems-engine/target/', sourceFiles: 'ems-engine/target/*.war*')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
|
||||
bat 'curl -k https://services.studioml.it/ems-api/updateWMSApp'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ('Publish on Azure') {
|
||||
steps {
|
||||
azureUpload fileShareName: 'storage-ci', filesPath: 'ems-engine/target/*.war*', removePrefixPath: 'ems-engine/target/', storageCredentialId: '83a86793-c1d6-4776-b20f-1ff652a57fee', storageType: 'filestorage', uploadArtifactsOnlyIfSuccessful: true, verbose: true, virtualPath: 'ems-api'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
post {
|
||||
success {
|
||||
office365ConnectorSend adaptiveCards: true, color: '#008000', message: 'EMS-API è stato compilato con successo', status: 'SUCCESS', webhookUrl: 'https://prod-197.westeurope.logic.azure.com:443/workflows/69a7b8ee3c284175bd6da7127c7eb3cf/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=_-eMfvsQGkIidHWzzlhGFgiZG28ujHZ41QqzuqD9YGw'
|
||||
}
|
||||
unstable {
|
||||
office365ConnectorSend adaptiveCards: true, color: '#FFDE21', message: 'EMS-API è INSTABILE', status: 'UNSTABLE', webhookUrl: 'https://prod-197.westeurope.logic.azure.com:443/workflows/69a7b8ee3c284175bd6da7127c7eb3cf/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=_-eMfvsQGkIidHWzzlhGFgiZG28ujHZ41QqzuqD9YGw'
|
||||
}
|
||||
failure {
|
||||
office365ConnectorSend adaptiveCards: true, color: '#FF2C2C', message: 'Errore di compilazione su EMS-API', status: 'FAILURE', webhookUrl: 'https://prod-197.westeurope.logic.azure.com:443/workflows/69a7b8ee3c284175bd6da7127c7eb3cf/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=_-eMfvsQGkIidHWzzlhGFgiZG28ujHZ41QqzuqD9YGw'
|
||||
}
|
||||
}
|
||||
}
|
||||
43
build/create_build_tag.bat
Normal file
43
build/create_build_tag.bat
Normal file
@@ -0,0 +1,43 @@
|
||||
REM SET YEAR
|
||||
set YEAR=%date:~6,4%
|
||||
|
||||
REM SET MONTH
|
||||
set MONTH=%date:~3,2%
|
||||
if %MONTH% LSS 10 set MONTH=%MONTH:~1,2%
|
||||
if %MONTH% LSS 10 set MONTH=0%MONTH%
|
||||
|
||||
REM SET DAY
|
||||
set DAY=%date:~0,2%
|
||||
if %DAY% LSS 10 set DAY=%DAY:~1,2%
|
||||
if %DAY% LSS 10 set DAY=0%DAY%
|
||||
|
||||
REM SET HOUR
|
||||
set HOUR=%time:~0,2%
|
||||
if %HOUR% LSS 10 set HOUR=%HOUR:~1,2%
|
||||
if %HOUR% LSS 10 set HOUR=0%HOUR%
|
||||
|
||||
REM SET MINUTE
|
||||
set MINUTE=%time:~3,2%
|
||||
if %MINUTE% LSS 10 set MINUTE=%MINUTE:~1,2%
|
||||
if %MINUTE% LSS 10 set MINUTE=0%MINUTE%
|
||||
|
||||
REM SET SECOND
|
||||
set SECOND=%time:~6,2%
|
||||
if %SECOND% LSS 10 set SECOND=%SECOND:~1,2%
|
||||
if %SECOND% LSS 10 set SECOND=0%SECOND%
|
||||
|
||||
set mydate=%YEAR%%MONTH%%DAY%_%HOUR%%MINUTE%%SECOND%
|
||||
|
||||
|
||||
|
||||
echo #spring.profiles.active=@activatedProperties@ > ems-core\src\main\resources\configs\env.properties
|
||||
echo project.version=%mydate% >> ems-core\src\main\resources\configs\env.properties
|
||||
|
||||
|
||||
git add . -A
|
||||
git commit -m "%mydate%"
|
||||
git tag "%mydate%"
|
||||
|
||||
|
||||
git push https://git.studioml.it/Integry/IntegryManagementSystem.git --tags
|
||||
git push https://git.studioml.it/Integry/IntegryManagementSystem.git --all
|
||||
153
build/update_tomcat.ps1
Normal file
153
build/update_tomcat.ps1
Normal file
@@ -0,0 +1,153 @@
|
||||
Param(
|
||||
[string]$serviceName, #Argomento passato dal chiamante
|
||||
[Int32]$httpPort, #Argomento passato dal chiamante
|
||||
[string]$updatedArtifactPath #Argomento passato dal chiamante
|
||||
)
|
||||
|
||||
$max_attempts = 48
|
||||
$attempt = 0
|
||||
$webappsPath = "C:\Program Files\$serviceName\webapps"
|
||||
|
||||
# Funzione per eseguire la chiamata GET e controllare lo status code
|
||||
function Check-Status {
|
||||
try {
|
||||
$request = Invoke-WebRequest -Uri "http://localhost:$httpPort/ems-api/system/ok" -Method Get -ErrorAction Stop
|
||||
$statusCode = $request.StatusCode
|
||||
if ($statusCode -eq 200) {
|
||||
Write-Host "Status code 200 ricevuto, processo completato."
|
||||
exit 0
|
||||
} else {
|
||||
Write-Host "Status code $statusCode ricevuto, continuo a provare..."
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Errore: $_"
|
||||
}
|
||||
}
|
||||
|
||||
# Funzione per cancellare una cartella e un file
|
||||
function Delete-FilesAndFolder
|
||||
{
|
||||
param (
|
||||
[string]$folderPath,
|
||||
[string]$filePath
|
||||
)
|
||||
|
||||
try {
|
||||
# Cancellare la cartella specificata
|
||||
if (Test-Path -Path $folderPath) {
|
||||
Remove-Item -Path $folderPath -Recurse -Force
|
||||
Write-Host "Cartella $folderPath eliminata con successo."
|
||||
} else {
|
||||
Write-Host "La cartella $folderPath non esiste."
|
||||
}
|
||||
|
||||
# Cancellare il file specificato
|
||||
if (Test-Path -Path $filePath) {
|
||||
Remove-Item -Path $filePath -Force
|
||||
Write-Host "File $filePath eliminato con successo."
|
||||
} else {
|
||||
Write-Host "Il file $filePath non esiste."
|
||||
}
|
||||
|
||||
} catch {
|
||||
Write-Host "Errore nella cancellazione di file o cartella: $_"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Funzione per copiare un file
|
||||
function Copy-File {
|
||||
param (
|
||||
[string]$sourceFilePath,
|
||||
[string]$destinationFilePath
|
||||
)
|
||||
|
||||
try {
|
||||
if (Test-Path -Path $sourceFilePath) {
|
||||
Copy-Item -Path $sourceFilePath -Destination $destinationFilePath -Force
|
||||
Write-Host "File copiato da $sourceFilePath a $destinationFilePath con successo."
|
||||
} else {
|
||||
Write-Host "Il file sorgente $sourceFilePath non esiste."
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Errore nella copia del file: $_"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Funzione per stoppare un servizio e attendere che sia completamente fermato
|
||||
function Stop-ServiceAndWait {
|
||||
param (
|
||||
[string]$serviceName
|
||||
)
|
||||
|
||||
# Tentativo di stoppare il servizio
|
||||
try {
|
||||
Write-Host "Sto stoppando il servizio $serviceName..."
|
||||
Stop-Service -Name $serviceName -Force
|
||||
|
||||
# Attesa finché il servizio non viene stoppato
|
||||
$service = Get-Service -Name $serviceName
|
||||
while ($service.Status -ne 'Stopped') {
|
||||
Write-Host "Attendo che il servizio $serviceName si fermi..."
|
||||
Start-Sleep -Seconds 5
|
||||
$service = Get-Service -Name $serviceName
|
||||
}
|
||||
|
||||
Write-Host "Il servizio $serviceName è stato fermato con successo."
|
||||
} catch {
|
||||
Write-Host "Errore nello stoppare il servizio ${serviceName}: $_"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Funzione per avviare nuovamente un servizio e attendere che sia in esecuzione
|
||||
function Start-ServiceAndWait {
|
||||
param (
|
||||
[string]$serviceName
|
||||
)
|
||||
|
||||
try {
|
||||
Write-Host "Sto avviando il servizio $serviceName..."
|
||||
Start-Service -Name $serviceName
|
||||
|
||||
# Attesa finché il servizio non viene avviato
|
||||
$service = Get-Service -Name $serviceName
|
||||
while ($service.Status -ne 'Running') {
|
||||
Write-Host "Attendo che il servizio $serviceName si avvii..."
|
||||
Start-Sleep -Seconds 5
|
||||
$service = Get-Service -Name $serviceName
|
||||
}
|
||||
|
||||
Write-Host "Il servizio $serviceName è stato avviato con successo."
|
||||
|
||||
} catch {
|
||||
Write-Host "Errore nell'avvio del servizio ${serviceName}: $_"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Chiamare la funzione per stoppare il servizio
|
||||
Stop-ServiceAndWait -serviceName $serviceName
|
||||
|
||||
# Subito dopo lo stop, cancellare la cartella e il file
|
||||
$emsApiPath = "$webappsPath\ems-api"
|
||||
$emsWarFilePath = "$webappsPath\ems-api.war"
|
||||
Delete-FilesAndFolder -folderPath $emsApiPath -filePath $emsWarFilePath
|
||||
|
||||
# Chiamare la funzione per copiare il file
|
||||
Write-Host "Copio $updatedArtifactPath in $emsWarFilePath"
|
||||
Copy-File -sourceFilePath $updatedArtifactPath -destinationFilePath $emsWarFilePath
|
||||
|
||||
# Avvia nuovamente il servizio
|
||||
Start-ServiceAndWait -serviceName $serviceName
|
||||
|
||||
# Ciclo fino a quando lo status code non è 200 o superiamo il numero massimo di tentativi
|
||||
while ($attempt -lt $max_attempts) {
|
||||
$attempt++
|
||||
Check-Status
|
||||
Start-Sleep -Seconds 5 # Attendere per 5 secondi prima di fare un altro tentativo
|
||||
}
|
||||
|
||||
Write-Host "Numero massimo di tentativi superato. Nessuna risposta 200 ricevuta."
|
||||
exit 1
|
||||
@@ -61,7 +61,7 @@
|
||||
<classpath/>
|
||||
<argument>it.integry.ems_model.rulescompleting.KieStaticCompiler</argument>
|
||||
<argument>src/main/resources/rules/</argument>
|
||||
<argument>../ems-engine/src/main/webapp/drools/</argument>
|
||||
<argument>../ems-engine/src/main/resources/drools/</argument>
|
||||
</arguments>
|
||||
<systemProperties>
|
||||
<projectProperties/>
|
||||
@@ -115,6 +115,9 @@
|
||||
<mapClasses>asClasses</mapClasses>
|
||||
<mapEnum>asEnum</mapEnum>
|
||||
<optionalProperties>useLibraryDefinition</optionalProperties>
|
||||
<optionalPropertiesDeclaration>questionMarkAndNullableType</optionalPropertiesDeclaration>
|
||||
<sortDeclarations>true</sortDeclarations>
|
||||
<sortTypeDeclarations>true</sortTypeDeclarations>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
@@ -28,7 +28,9 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.sql.Connection;
|
||||
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -24,7 +24,8 @@ public enum EntityImportType {
|
||||
SCONTRINI("SCONTRINI"),
|
||||
MOVIMENTI_CONTABILI("MOVIMENTI CONTABILI"),
|
||||
GRIGLIA_VENDITA("GRIGLIA VENDITA"),
|
||||
GRIGLIA_ACQUISTO("GRIGLIA ACQUISTO");
|
||||
GRIGLIA_ACQUISTO("GRIGLIA ACQUISTO"),
|
||||
SCADENZE("SCADENZE");
|
||||
|
||||
private String text;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import it.integry.ems.settings.Model.AvailableConnectionsModel;
|
||||
import it.integry.ems.settings.Model.SettingsModel;
|
||||
import it.integry.ems.settings.SettingsController;
|
||||
import it.integry.ems.sync.MultiDBTransaction.AdvancedDataSource;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.user.service.UserCacheService;
|
||||
import it.integry.ems_model.entity.Azienda;
|
||||
@@ -19,7 +20,6 @@ import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.util.HashMap;
|
||||
|
||||
@Component
|
||||
@@ -27,7 +27,7 @@ public class EmsCoreDBLoader {
|
||||
|
||||
private final Logger logger = LogManager.getLogger();
|
||||
private MultiDBTransactionManager multiDBTransactionManager;
|
||||
|
||||
|
||||
@Autowired
|
||||
private SetupGest setupGest;
|
||||
|
||||
@@ -90,7 +90,7 @@ public class EmsCoreDBLoader {
|
||||
private void discoverAllConnections() {
|
||||
|
||||
for (AvailableConnectionsModel model : settingsModel.getAvailableConnections()) {
|
||||
if ( !model.getInternalDb() )
|
||||
if (!model.getInternalDb())
|
||||
continue;
|
||||
try {
|
||||
DataSource ds = new DataSource();
|
||||
@@ -114,36 +114,36 @@ public class EmsCoreDBLoader {
|
||||
private void setupAzienda() throws Exception {
|
||||
|
||||
for (final AdvancedDataSource advancedDataSource : multiDBTransactionManager.getActiveConnections()) {
|
||||
try {
|
||||
Connection conn = advancedDataSource.getConnection();
|
||||
if (advancedDataSource.isInternalDb()) {
|
||||
Azienda azienda = Azienda.getDefaultAzienda(conn);
|
||||
try {
|
||||
Connection conn = advancedDataSource.getConnection();
|
||||
if (advancedDataSource.isInternalDb()) {
|
||||
Azienda azienda = Azienda.getDefaultAzienda(conn);
|
||||
|
||||
if (azienda != null) {
|
||||
String applicationDbName = azienda.getApplicationName();
|
||||
String nomeAzienda = azienda.getNomeDitta();
|
||||
if (azienda != null) {
|
||||
String applicationDbName = azienda.getApplicationName();
|
||||
String nomeAzienda = azienda.getNomeDitta();
|
||||
|
||||
if(UtilityString.isNullOrEmpty(applicationDbName)) {
|
||||
throw new Exception("Impostare il campo \"Application Name\"");
|
||||
}
|
||||
|
||||
HashMap<String, String> gestSetupValues =
|
||||
setupGest.getSetupSection(conn, "DATI_AZIENDA", "FATTURAZIONE_ELETTRONICA");
|
||||
|
||||
|
||||
emsDBConst.getConsts(advancedDataSource.getDataSource().getProfile())
|
||||
.setApplicationDbName(applicationDbName)
|
||||
.setNomeAzienda(nomeAzienda)
|
||||
.setAzienda(azienda)
|
||||
.setGestSetupDatiAzienda(gestSetupValues);
|
||||
} else {
|
||||
throw new Exception("Non è stato possibile leggere i dati dalla tabella azienda");
|
||||
if (UtilityString.isNullOrEmpty(applicationDbName)) {
|
||||
throw new Exception("Impostare il campo \"Application Name\"");
|
||||
}
|
||||
|
||||
HashMap<String, String> gestSetupValues =
|
||||
setupGest.getSetupSection(conn, "DATI_AZIENDA", "FATTURAZIONE_ELETTRONICA");
|
||||
|
||||
|
||||
emsDBConst.getConsts(advancedDataSource.getDataSource().getProfile())
|
||||
.setApplicationDbName(applicationDbName)
|
||||
.setNomeAzienda(nomeAzienda)
|
||||
.setAzienda(azienda)
|
||||
.setGestSetupDatiAzienda(gestSetupValues);
|
||||
} else {
|
||||
throw new Exception("Non è stato possibile leggere i dati dalla tabella azienda");
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
logger.error(String.format("Impossibile caricare alcune informazioni dal DB \"%s\". %s", advancedDataSource.getProfileName(), ex.getMessage()));
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
logger.error(String.format("Impossibile caricare alcune informazioni dal DB \"%s\". %s", advancedDataSource.getProfileName(), ex.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -75,7 +75,6 @@ import java.util.regex.Pattern;
|
||||
|
||||
@RestController
|
||||
@Scope("request")
|
||||
|
||||
public class EmsController {
|
||||
|
||||
private final Logger logger = LogManager.getLogger();
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package it.integry.ems.controller;
|
||||
|
||||
import it.integry.ems.response.ServiceRestResponse;
|
||||
import it.integry.ems.service.EntityProcessor;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems_model.entity.WtbJrept;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import net.sf.jasperreports.engine.JasperCompileManager;
|
||||
import net.sf.jasperreports.engine.JasperReport;
|
||||
import net.sf.jasperreports.engine.util.JRSaver;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
||||
@RestController
|
||||
@Scope("request")
|
||||
@RequestMapping("report-management")
|
||||
public class ReportManagementController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private MultiDBTransactionManager multiDBTransactionManager;
|
||||
|
||||
@Autowired
|
||||
private EntityProcessor entityProcessor;
|
||||
|
||||
|
||||
@RequestMapping(value = "/compile/{reportId}", method = RequestMethod.GET)
|
||||
public @ResponseBody ServiceRestResponse compile(@PathVariable("reportId") long reportId) throws Exception {
|
||||
|
||||
WtbJrept wtbJrept = new WtbJrept()
|
||||
.setId(reportId);
|
||||
wtbJrept.setOperation(OperationType.SELECT_OBJECT);
|
||||
|
||||
wtbJrept = entityProcessor.processEntity(wtbJrept, multiDBTransactionManager);
|
||||
|
||||
byte[] jrxml = Base64.decodeBase64(wtbJrept.getB64Jrxml());
|
||||
|
||||
ByteArrayInputStream bais = new ByteArrayInputStream(jrxml);
|
||||
final JasperReport compiledReport = JasperCompileManager.compileReport(bais);
|
||||
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
JRSaver.saveObject(compiledReport, baos);
|
||||
|
||||
wtbJrept.setCompiledJasper(ArrayUtils.toObject(baos.toByteArray()));
|
||||
|
||||
wtbJrept.setOperation(OperationType.UPDATE);
|
||||
entityProcessor.processEntity(wtbJrept, multiDBTransactionManager);
|
||||
|
||||
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package it.integry.ems.datasource;
|
||||
|
||||
import it.integry.ems.settings.Model.AvailableConnectionsModel;
|
||||
import it.integry.ems.settings.Model.SettingsModel;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems_model.config.EmsRestConstants;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityHashMap;
|
||||
@@ -11,7 +12,6 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PreDestroy;
|
||||
import java.io.IOException;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
@@ -57,7 +57,9 @@ public class DataSource {
|
||||
|
||||
private void init() throws SQLException, IOException {
|
||||
|
||||
connection = DriverManager.getConnection(connectionModel.getDbConnectionString(), connectionModel.getUsername(), connectionModel.getPasswordDecrypted());
|
||||
connection = Connection.fromConnection(
|
||||
DriverManager.getConnection(connectionModel.getDbConnectionString(), connectionModel.getUsername(), connectionModel.getPasswordDecrypted())
|
||||
);
|
||||
connection.setTransactionIsolation(java.sql.Connection.TRANSACTION_READ_UNCOMMITTED);
|
||||
connection.setAutoCommit(false);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package it.integry.ems.devices;
|
||||
|
||||
|
||||
import it.integry.ems.service.EntityProcessor;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.user.UserSession;
|
||||
import it.integry.ems_model.entity.StbDevices;
|
||||
@@ -15,7 +16,6 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.context.ContextLoader;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.util.Date;
|
||||
|
||||
@Service
|
||||
@@ -30,7 +30,7 @@ public class DevicesService {
|
||||
|
||||
private final Logger logger = LogManager.getLogger();
|
||||
|
||||
public void register(App application, String deviceId) throws Exception{
|
||||
public void register(App application, String deviceId) throws Exception {
|
||||
MultiDBTransactionManager multiDBTransactionManager = ContextLoader.getCurrentWebApplicationContext().getBean(MultiDBTransactionManager.class);
|
||||
EntityProcessor entityProcessor = ContextLoader.getCurrentWebApplicationContext().getBean(EntityProcessor.class);
|
||||
UserSession userSession = ContextLoader.getCurrentWebApplicationContext().getBean(UserSession.class);
|
||||
@@ -47,7 +47,7 @@ public class DevicesService {
|
||||
boolean exists =
|
||||
UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), selectSql);
|
||||
|
||||
if(!exists) {
|
||||
if (!exists) {
|
||||
StbDevices stbDevices = new StbDevices()
|
||||
.setName(appName)
|
||||
.setIdentificationId(deviceId)
|
||||
|
||||
@@ -3,6 +3,7 @@ package it.integry.ems.dto;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import it.integry.ems.report.dto.JasperDTO;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.entity.DtbDocPdf;
|
||||
import it.integry.ems_model.entity.MtbAartLink;
|
||||
import it.integry.ems_model.entity.MtbUntMis;
|
||||
import it.integry.ems_model.entity.StbActivityFile;
|
||||
@@ -18,6 +19,8 @@ public class CreateZipDTO {
|
||||
|
||||
private List<MtbAartLink> listMtbAartLink;
|
||||
|
||||
private List<DtbDocPdf> listDtbDocPdf;
|
||||
|
||||
private String fileName;
|
||||
|
||||
private SaveMode saveMode = SaveMode.STB_FILES_ATTACHED;
|
||||
@@ -51,6 +54,15 @@ public class CreateZipDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<DtbDocPdf> getListDtbDocPdf() {
|
||||
return listDtbDocPdf;
|
||||
}
|
||||
|
||||
public CreateZipDTO setListDtbDocPdf(List<DtbDocPdf> listDtbDocPdf) {
|
||||
this.listDtbDocPdf = listDtbDocPdf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
@@ -97,11 +97,16 @@ public class EntityHierarchy {
|
||||
|
||||
public static class Field {
|
||||
private java.lang.reflect.Field field;
|
||||
private PK primaryKey;
|
||||
private Identity identity;
|
||||
private SqlField sqlField;
|
||||
private ImportFromParent importFromParent;
|
||||
private ObjectStorage objectStorage;
|
||||
private Blob blob;
|
||||
private Clob clob;
|
||||
private VarBinary varBinary;
|
||||
|
||||
private String fieldName;
|
||||
|
||||
public java.lang.reflect.Field getField() {
|
||||
return field;
|
||||
@@ -109,13 +114,22 @@ public class EntityHierarchy {
|
||||
|
||||
public Field setField(java.lang.reflect.Field field) {
|
||||
this.field = field;
|
||||
this.fieldName = field.getName();
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isPrimaryKey() {
|
||||
return primaryKey != null;
|
||||
}
|
||||
|
||||
public boolean isSqlField() {
|
||||
return sqlField != null;
|
||||
}
|
||||
|
||||
public boolean isImportFromParent() {
|
||||
return importFromParent != null;
|
||||
}
|
||||
|
||||
public boolean isObjectStorage() {
|
||||
return objectStorage != null;
|
||||
}
|
||||
@@ -132,6 +146,17 @@ public class EntityHierarchy {
|
||||
return identity != null;
|
||||
}
|
||||
|
||||
public boolean isVarBinary() { return varBinary != null; }
|
||||
|
||||
public PK getPrimaryKey() {
|
||||
return primaryKey;
|
||||
}
|
||||
|
||||
public Field setPrimaryKey(PK primaryKey) {
|
||||
this.primaryKey = primaryKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Identity getIdentity() {
|
||||
return identity;
|
||||
}
|
||||
@@ -150,6 +175,15 @@ public class EntityHierarchy {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ImportFromParent getImportFromParent() {
|
||||
return importFromParent;
|
||||
}
|
||||
|
||||
public Field setImportFromParent(ImportFromParent importFromParent) {
|
||||
this.importFromParent = importFromParent;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ObjectStorage getObjectStorage() {
|
||||
return objectStorage;
|
||||
}
|
||||
@@ -176,5 +210,18 @@ public class EntityHierarchy {
|
||||
this.clob = clob;
|
||||
return this;
|
||||
}
|
||||
|
||||
public VarBinary getVarBinary() {
|
||||
return varBinary;
|
||||
}
|
||||
|
||||
public Field setVarBinary(VarBinary varBinary) {
|
||||
this.varBinary = varBinary;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFieldName() {
|
||||
return fieldName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
60
ems-core/src/main/java/it/integry/ems/dto/Quartet.java
Normal file
60
ems-core/src/main/java/it/integry/ems/dto/Quartet.java
Normal file
@@ -0,0 +1,60 @@
|
||||
package it.integry.ems.dto;
|
||||
|
||||
public class Quartet<A, B, C, D> {
|
||||
private final A first;
|
||||
private final B second;
|
||||
private final C third;
|
||||
private final D fourth;
|
||||
|
||||
public Quartet(A first, B second, C third, D fourth) {
|
||||
this.first = first;
|
||||
this.second = second;
|
||||
this.third = third;
|
||||
this.fourth = fourth;
|
||||
}
|
||||
|
||||
public A getFirst() {
|
||||
return first;
|
||||
}
|
||||
|
||||
public B getSecond() {
|
||||
return second;
|
||||
}
|
||||
|
||||
public C getThird() {
|
||||
return third;
|
||||
}
|
||||
|
||||
public D getFourth() {
|
||||
return fourth;
|
||||
}
|
||||
|
||||
public A getValue0() {
|
||||
return first;
|
||||
}
|
||||
|
||||
public B getValue1() {
|
||||
return second;
|
||||
}
|
||||
|
||||
public C getValue2() {
|
||||
return third;
|
||||
}
|
||||
|
||||
public D getValue3() {
|
||||
return fourth;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Quartet{" +
|
||||
"first=" + first +
|
||||
", second=" + second +
|
||||
", third=" + third +
|
||||
", fourth=" + fourth +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import it.integry.ems.expansion.RunnableWithReturn;
|
||||
import it.integry.ems.looper.service.LooperService;
|
||||
import it.integry.ems.settings.Model.AvailableConnectionsModel;
|
||||
import it.integry.ems.settings.Model.SettingsModel;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
@@ -13,7 +14,6 @@ import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -46,7 +46,7 @@ public class DynamicCacheService {
|
||||
}, invalidateTimeInMins * 60 * 1000, "dynamic-cache-" + key);
|
||||
}
|
||||
|
||||
public <T>void addDbItem(Keys key, int invalidateTimeInMins, RunnableArgsWithReturn<Connection, T> refreshAction, List<String> dbNames) {
|
||||
public <T> void addDbItem(Keys key, int invalidateTimeInMins, RunnableArgsWithReturn<Connection, T> refreshAction, List<String> dbNames) {
|
||||
List<String> finalDbNames = dbNames.stream().map(String::toLowerCase).collect(Collectors.toList());
|
||||
RunnableWithReturn<Object> internalRefreshAction = () -> {
|
||||
|
||||
@@ -183,7 +183,7 @@ public class DynamicCacheService {
|
||||
return cachedEntityList;
|
||||
}
|
||||
|
||||
public <T>T getDbItem(Keys key, String dbName) {
|
||||
public <T> T getDbItem(Keys key, String dbName) {
|
||||
dbName = dbName.toLowerCase();
|
||||
final HashMap<String, T> cacheObjectByDB = (HashMap<String, T>) cacheData.getOrDefault(key, null);
|
||||
if (cacheObjectByDB == null) return null;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package it.integry.ems.ecedi.enums;
|
||||
|
||||
public enum EuritmoCCIAppIdentifier {
|
||||
CCI37("37"),
|
||||
CCI00("00"),
|
||||
CCI10("10"),
|
||||
CCI17("17"),
|
||||
|
||||
@@ -103,7 +103,7 @@ public class EntityDevelopmentService {
|
||||
javaClass.addAndGetAnnotation(JsonTypeName.class)
|
||||
.addPair("value", new FieldAccessExpr(new NameExpr(javaClassName), "ENTITY"));
|
||||
|
||||
final FieldDeclaration entityField = javaClass.addFieldWithInitializer(String.class, "ENTITY", new StringLiteralExpr(databaseTable.getTableName()), PRIVATE, FINAL, STATIC);
|
||||
final FieldDeclaration entityField = javaClass.addFieldWithInitializer(String.class, "ENTITY", new StringLiteralExpr(databaseTable.getTableName()), PUBLIC, FINAL, STATIC);
|
||||
final FieldDeclaration serialVersionUIDField = javaClass.addFieldWithInitializer(Long.class, "serialVersionUID", new LongLiteralExpr("1L"), PRIVATE, FINAL, STATIC);
|
||||
final FieldDeclaration loggerField = javaClass.addFieldWithInitializer(Logger.class, "logger", new MethodCallExpr("LogManager.getLogger"), PRIVATE, FINAL, STATIC);
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package it.integry.ems.entity_logger.db_schema_manager.component;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.microsoft.sqlserver.jdbc.SQLServerException;
|
||||
import it.integry.ems.entity_logger.db_schema_manager.dto.*;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityHashMap;
|
||||
import it.integry.ems_model.utility.UtilityLocalDate;
|
||||
@@ -10,7 +11,7 @@ import it.integry.ems_model.utility.UtilityString;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.sql.Connection;
|
||||
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
@@ -38,7 +39,7 @@ public class SQLServerDBSchemaManager {
|
||||
}
|
||||
|
||||
public void connect() throws SQLException {
|
||||
mConnection = DriverManager.getConnection(getConnectionString(mHost), mUsername, mPassword);
|
||||
mConnection = Connection.fromConnection(DriverManager.getConnection(getConnectionString(mHost), mUsername, mPassword));
|
||||
mConnection.setTransactionIsolation(java.sql.Connection.TRANSACTION_READ_UNCOMMITTED);
|
||||
mConnection.setAutoCommit(false);
|
||||
}
|
||||
|
||||
@@ -312,6 +312,9 @@ public abstract class BaseEntityExporter implements IEntityExporter {
|
||||
boolean shouldCreateDirectory = "S".equalsIgnoreCase(wtbUserInfo.getFtpCreateDirectory());
|
||||
String directory = UtilityString.isNullOrEmpty(wtbUserInfo.getFtpDirectory()) ? "/" : "/" + wtbUserInfo.getFtpDirectory();
|
||||
|
||||
if (wtbUserInfo.getFtpRetries() == null || wtbUserInfo.getFtpRetries() == 0)
|
||||
throw new Exception("Attenzione valorizzare il numero di tentativi");
|
||||
|
||||
switch (wtbUserInfo.getFtpType()) {
|
||||
case 1:
|
||||
case 3:
|
||||
|
||||
@@ -17,7 +17,8 @@ public enum EntityExportType {
|
||||
RAPPORTINI("RAPPORTINI"),
|
||||
VARIAZIONE_PV("VARIAZIONE PV"),
|
||||
LISTINI_ACQUISTO("LISTINI ACQUISTO"),
|
||||
COLLI("COLLI");
|
||||
COLLI("COLLI"),
|
||||
SCADENZE("SCADENZE");
|
||||
|
||||
private String text;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
|
||||
public class TxtMapper<T> {
|
||||
|
||||
private Logger logger = LogManager.getLogger();
|
||||
private final Logger logger = LogManager.getLogger();
|
||||
|
||||
private String fieldsSplitChar = " ";
|
||||
|
||||
@@ -29,20 +29,10 @@ public class TxtMapper<T> {
|
||||
|
||||
|
||||
public String serialize(T object) {
|
||||
|
||||
Class Tclass = object.getClass();
|
||||
Class<?> Tclass = object.getClass();
|
||||
|
||||
List<Field> declaredFields = Arrays.asList(Tclass.getDeclaredFields());
|
||||
|
||||
List<Field> sortedFields = Stream.of(declaredFields)
|
||||
.filter(x -> x.getAnnotation(DtoField.class) != null && x.getAnnotation(DtoField.class).startPosition() >= 0)
|
||||
.sortBy(x -> x.getAnnotation(DtoField.class).startPosition())
|
||||
.toList();
|
||||
|
||||
sortedFields.addAll(Stream.of(declaredFields)
|
||||
.filter(x -> x.getAnnotation(DtoField.class) != null && x.getAnnotation(DtoField.class).startPosition() < 0)
|
||||
.toList());
|
||||
|
||||
List<Field> sortedFields = sortFields(declaredFields);
|
||||
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
@@ -52,18 +42,7 @@ public class TxtMapper<T> {
|
||||
declaredField.setAccessible(true);
|
||||
|
||||
try {
|
||||
// if(dtoField.startPosition() > stringBuilder.length()) {
|
||||
// int spacesNeeded = dtoField.startPosition() - stringBuilder.length() - 1;
|
||||
// int counter = 0;
|
||||
// do {
|
||||
// stringBuilder.append(" ");
|
||||
// counter ++;
|
||||
// } while (counter < spacesNeeded);
|
||||
//
|
||||
// stringBuilder.append(fieldsSplitChar);
|
||||
// }
|
||||
|
||||
String value = applyDtoAnnotation(declaredField.get(object), dtoField);
|
||||
String value = applyDtoAnnotationForSerialization(declaredField.get(object), dtoField);
|
||||
|
||||
if (value == null) {
|
||||
value = "";
|
||||
@@ -75,12 +54,24 @@ public class TxtMapper<T> {
|
||||
|
||||
if (dtoField.maxLength() > 0 && !UtilityString.isNullOrEmpty(dtoField.fillChar())) {
|
||||
UtilityString.H_POSITION position;
|
||||
String segno = "";
|
||||
int maxLength = dtoField.maxLength();
|
||||
if (declaredField.getType() == Integer.class || declaredField.getType() == BigDecimal.class) {
|
||||
position = UtilityString.H_POSITION.LEFT;
|
||||
if (dtoField.showSign()) {
|
||||
segno = value.substring(0, 1);
|
||||
if (segno.equalsIgnoreCase("-") || segno.equalsIgnoreCase("+"))
|
||||
value = value.substring(1);
|
||||
else
|
||||
segno="+";
|
||||
maxLength = maxLength - 1;
|
||||
}
|
||||
} else {
|
||||
position = UtilityString.H_POSITION.RIGHT;
|
||||
}
|
||||
value = UtilityString.fillString(value, dtoField.fillChar().charAt(0), dtoField.maxLength(), position);
|
||||
|
||||
value = UtilityString.fillString(value, dtoField.fillChar().charAt(0), maxLength, position);
|
||||
value = segno + value;
|
||||
}
|
||||
|
||||
if (ignorePosition)
|
||||
@@ -101,7 +92,7 @@ public class TxtMapper<T> {
|
||||
|
||||
public String serialize(List<T> objectList) {
|
||||
|
||||
if (objectList == null || objectList.size() == 0)
|
||||
if (objectList == null || objectList.isEmpty())
|
||||
return null;
|
||||
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
@@ -109,12 +100,63 @@ public class TxtMapper<T> {
|
||||
for (int i = 0; i < objectList.size(); i++) {
|
||||
stringBuilder.append(serialize(objectList.get(i)));
|
||||
|
||||
if (i < objectList.size() - 1) stringBuilder.append(System.getProperty("line.separator"));
|
||||
if (i < objectList.size() - 1) stringBuilder.append(System.lineSeparator());
|
||||
}
|
||||
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
public T deserialize(String line, Class<T> clazz) {
|
||||
try {
|
||||
T instance = clazz.getDeclaredConstructor().newInstance();
|
||||
List<Field> declaredFields = Arrays.asList(clazz.getDeclaredFields());
|
||||
List<Field> sortedFields = sortFields(declaredFields);
|
||||
|
||||
for (Field field : sortedFields) {
|
||||
DtoField dtoField = field.getAnnotation(DtoField.class);
|
||||
field.setAccessible(true);
|
||||
|
||||
String value = null;
|
||||
if (ignorePosition) {
|
||||
String[] tokens = line.split(fieldsSplitChar);
|
||||
value = tokens[sortedFields.indexOf(field)];
|
||||
} else {
|
||||
int startPosition = dtoField.startPosition();
|
||||
int endPosition = Math.min(line.length(), startPosition + dtoField.maxLength());
|
||||
|
||||
if (startPosition < endPosition && endPosition <= line.length()) {
|
||||
value = line.substring(startPosition, endPosition).trim();
|
||||
}
|
||||
}
|
||||
|
||||
applyDtoAnnotationForDeserialization(field, instance, value, dtoField);
|
||||
}
|
||||
|
||||
return instance;
|
||||
} catch (Exception e) {
|
||||
logger.error("Error during deserialization", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public List<T> deserialize(List<String> lines, Class<T> clazz) {
|
||||
return Stream.of(lines)
|
||||
.map(line -> deserialize(line, clazz))
|
||||
.toList();
|
||||
}
|
||||
|
||||
private List<Field> sortFields(List<Field> declaredFields) {
|
||||
List<Field> sortedFields = Stream.of(declaredFields)
|
||||
.filter(x -> x.getAnnotation(DtoField.class) != null && x.getAnnotation(DtoField.class).startPosition() >= 0)
|
||||
.sortBy(x -> x.getAnnotation(DtoField.class).startPosition())
|
||||
.toList();
|
||||
|
||||
sortedFields.addAll(Stream.of(declaredFields)
|
||||
.filter(x -> x.getAnnotation(DtoField.class) != null && x.getAnnotation(DtoField.class).startPosition() < 0)
|
||||
.toList());
|
||||
|
||||
return sortedFields;
|
||||
}
|
||||
|
||||
public String getFieldsSplitChar() {
|
||||
return fieldsSplitChar;
|
||||
@@ -162,13 +204,11 @@ public class TxtMapper<T> {
|
||||
}
|
||||
|
||||
|
||||
private String applyDtoAnnotation(Object value, DtoField dtoField) {
|
||||
private String applyDtoAnnotationForSerialization(Object value, DtoField dtoField) {
|
||||
if (value != null) {
|
||||
if (!UtilityString.isNullOrEmpty(dtoField.format()) && value instanceof Date) {
|
||||
value = new SimpleDateFormat(dtoField.format()).format(value);
|
||||
} else if (!UtilityString.isNullOrEmpty(dtoField.formula()) && value instanceof BigDecimal) {
|
||||
// String regex = "[0-9]+\\.[0-9]{"+dtoField.scale()+"}+";
|
||||
// if(Pattern.matches(regex, columnValue.toString())
|
||||
value = ((BigDecimal) value).setScale(dtoField.scale(), RoundingMode.HALF_DOWN);
|
||||
String formula = dtoField.formula().replaceAll("this", value.toString());
|
||||
String[] opList = formula.split("\\*");
|
||||
@@ -180,10 +220,13 @@ public class TxtMapper<T> {
|
||||
if (!UtilityString.isNullOrEmpty(dtoField.moltiplicatore())) {
|
||||
value = ((BigDecimal) value).multiply(new BigDecimal(dtoField.moltiplicatore()));
|
||||
}
|
||||
|
||||
value = value.toString();
|
||||
|
||||
if (!dtoField.showFloatPoint()) value = ((String) value).replaceAll("\\.", "").replaceAll(",", "");
|
||||
if (!dtoField.showFloatPoint())
|
||||
value = ((String) value).replaceAll("\\.", "").replaceAll(",", "");
|
||||
else if (!UtilityString.isNullOrEmpty(dtoField.separator()))
|
||||
value = ((String) value).replaceAll("\\.", dtoField.separator()).replaceAll(",", dtoField.separator());
|
||||
|
||||
} else if (value instanceof Integer) {
|
||||
value = value.toString();
|
||||
} else if (value instanceof Boolean) {
|
||||
@@ -193,4 +236,29 @@ public class TxtMapper<T> {
|
||||
|
||||
return value != null ? value.toString() : null;
|
||||
}
|
||||
|
||||
private void applyDtoAnnotationForDeserialization(Field field, T instance, String value, DtoField dtoField) throws Exception {
|
||||
if (!UtilityString.isNullOrEmpty(value)) {
|
||||
Class<?> fieldType = field.getType();
|
||||
|
||||
if (fieldType == Integer.class) {
|
||||
field.set(instance, Integer.parseInt(value));
|
||||
} else if (fieldType == BigDecimal.class) {
|
||||
BigDecimal bigDecimalValue = new BigDecimal(value);
|
||||
if (!UtilityString.isNullOrEmpty(dtoField.moltiplicatore())) {
|
||||
bigDecimalValue = bigDecimalValue.divide(new BigDecimal(dtoField.moltiplicatore()));
|
||||
}
|
||||
field.set(instance, bigDecimalValue.setScale(dtoField.scale(), RoundingMode.HALF_DOWN));
|
||||
} else if (fieldType == Boolean.class) {
|
||||
field.set(instance, value.equalsIgnoreCase(defaultBooleanTrueValue));
|
||||
} else if (fieldType == Date.class) {
|
||||
if (!UtilityString.isNullOrEmpty(dtoField.format())) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(dtoField.format());
|
||||
field.set(instance, sdf.parse(value));
|
||||
}
|
||||
} else {
|
||||
field.set(instance, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import it.integry.ems.response.ServiceRestResponse;
|
||||
import it.integry.ems.service.HttpRestWrapper;
|
||||
import it.integry.ems.settings.Model.AvailableConnectionsModel;
|
||||
import it.integry.ems.settings.Model.SettingsModel;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems.utility.UtilityDebug;
|
||||
import it.integry.ems_model.config.EmsRestConstants;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
@@ -21,7 +22,6 @@ import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@@ -61,19 +61,16 @@ public class LicenseComponent {
|
||||
|
||||
final HashMap<String, String> listAziende = new HashMap<>();
|
||||
|
||||
for (AvailableConnectionsModel model : settingsModel.getAvailableConnections()) {
|
||||
if (model.getInternalDb()) {
|
||||
for (AvailableConnectionsModel model : settingsModel.getAvailableConnections(true)) {
|
||||
DataSource ds = new DataSource();
|
||||
ds.initialize(model.getProfileName());
|
||||
Connection conn = ds.getConnection();
|
||||
|
||||
DataSource ds = new DataSource();
|
||||
ds.initialize(model.getProfileName());
|
||||
Connection conn = ds.getConnection();
|
||||
String sql = "SELECT part_iva FROM azienda WHERE part_iva is not null";
|
||||
String partIva = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||
if (!UtilityString.isNullOrEmpty(partIva)) listAziende.put(model.getProfileName(), partIva);
|
||||
|
||||
String sql = "SELECT part_iva FROM azienda WHERE part_iva is not null";
|
||||
String partIva = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||
if (!UtilityString.isNullOrEmpty(partIva)) listAziende.put(model.getProfileName(), partIva);
|
||||
|
||||
ds.forceClose();
|
||||
}
|
||||
ds.forceClose();
|
||||
}
|
||||
|
||||
String jsonBody = jsonObjectMapper.writeValueAsString(listAziende.values());
|
||||
@@ -89,8 +86,9 @@ public class LicenseComponent {
|
||||
if (response.getEsito() == EsitoType.KO) {
|
||||
throw new Exception(response.getErrorMessage());
|
||||
} else {
|
||||
List<LicenseStatusDTO> licenses = response.getDTO(new TypeReference<List<LicenseStatusDTO>>() {});
|
||||
if(licenses == null) return;
|
||||
List<LicenseStatusDTO> licenses = response.getDTO(new TypeReference<List<LicenseStatusDTO>>() {
|
||||
});
|
||||
if (licenses == null) return;
|
||||
|
||||
listAziende.forEach((key, value) -> {
|
||||
cachedLicenseStatus.remove(key);
|
||||
|
||||
@@ -15,7 +15,9 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.sql.Connection;
|
||||
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
|
||||
import java.sql.DriverManager;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -30,7 +32,7 @@ public class MenuStaticCreator {
|
||||
String username = "sa";
|
||||
String password = "sa";
|
||||
|
||||
Connection connection = DriverManager.getConnection(connectionString, username, password);
|
||||
Connection connection = Connection.fromConnection(DriverManager.getConnection(connectionString, username, password));
|
||||
connection.setTransactionIsolation(java.sql.Connection.TRANSACTION_READ_UNCOMMITTED);
|
||||
connection.setAutoCommit(false);
|
||||
|
||||
|
||||
@@ -26,8 +26,9 @@ public class MenuConfigurationController {
|
||||
|
||||
@RequestMapping(value = "refresh", method = RequestMethod.GET)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse refresh(@RequestParam(CommonConstants.PROFILE_DB) String profileDB) throws Exception {
|
||||
menuConfigurationService.refresh(multiDBTransactionManager.getPrimaryConnection());
|
||||
ServiceRestResponse refresh(@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
||||
@RequestParam(required = false, defaultValue = "false") boolean forceRefresh) throws Exception {
|
||||
menuConfigurationService.refresh(multiDBTransactionManager.getPrimaryConnection(), forceRefresh);
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,9 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.sql.Connection;
|
||||
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static it.integry.ems_model.utility.UtilityDB.executeStatement;
|
||||
@@ -53,7 +55,7 @@ public class MenuConfigurationService {
|
||||
|
||||
for (AdvancedDataSource advancedDataSource : multiDBTransactionManager.getActiveConnections()) {
|
||||
|
||||
if (advancedDataSource.getDataSource().getDbName().equalsIgnoreCase("studioml") || isHistoryDB(advancedDataSource))
|
||||
if (advancedDataSource.getDataSource().getDbName().equalsIgnoreCase("menu") || isHistoryDB(advancedDataSource))
|
||||
continue;
|
||||
|
||||
try {
|
||||
@@ -74,9 +76,9 @@ public class MenuConfigurationService {
|
||||
return historyProfileDB.equalsIgnoreCase(advancedDataSource.getProfileName());
|
||||
}
|
||||
|
||||
public void refresh(Connection connection) throws Exception {
|
||||
public void refresh(Connection connection, boolean forceRefresh) throws Exception {
|
||||
final MenuConfigDTO menuConfig = loadMenuData();
|
||||
internalRefresh(connection, menuConfig);
|
||||
internalRefresh(connection, menuConfig, forceRefresh);
|
||||
}
|
||||
|
||||
private MenuConfigDTO loadMenuData() throws IOException {
|
||||
@@ -91,11 +93,17 @@ public class MenuConfigurationService {
|
||||
}
|
||||
|
||||
private void internalRefresh(Connection connection, MenuConfigDTO menuConfig) throws Exception {
|
||||
internalRefresh(connection, menuConfig, false);
|
||||
}
|
||||
|
||||
private void internalRefresh(Connection connection, MenuConfigDTO menuConfig, boolean forceRefresh) throws Exception {
|
||||
final Azienda azienda = Azienda.getDefaultAzienda(connection);
|
||||
|
||||
int lastMenuUpd = Integer.parseInt(azienda.getLastUpgDbMenu().replace("QM", ""));
|
||||
|
||||
if (lastMenuUpd >= menuConfig.getVersion())
|
||||
return;
|
||||
if (!forceRefresh && lastMenuUpd > 0)
|
||||
if (lastMenuUpd >= menuConfig.getVersion())
|
||||
return;
|
||||
|
||||
executeStatement(connection, "DELETE FROM stb_menu",
|
||||
"EXECUTE dbo.DropForeignKey 'azienda', 'stb_tipo_azienda'",
|
||||
@@ -150,17 +158,17 @@ public class MenuConfigurationService {
|
||||
insertBulkPs.setString(2, stbMenuDto.getDescrizione());
|
||||
insertBulkPs.setString(3, stbMenuDto.getCodParent());
|
||||
|
||||
if(stbMenuDto.getPos() != null) insertBulkPs.setInt(4, stbMenuDto.getPos());
|
||||
if (stbMenuDto.getPos() != null) insertBulkPs.setInt(4, stbMenuDto.getPos());
|
||||
else insertBulkPs.setObject(4, null);
|
||||
|
||||
insertBulkPs.setString(5, stbMenuDto.getTipoAzienda());
|
||||
insertBulkPs.setString(6, stbMenuDto.getFlagAttivo());
|
||||
insertBulkPs.setString(7, stbMenuDto.getUrlDescrizione());
|
||||
|
||||
if(stbMenuDto.getPosTipoAzienda() != null) insertBulkPs.setInt(8, stbMenuDto.getPosTipoAzienda());
|
||||
if (stbMenuDto.getPosTipoAzienda() != null) insertBulkPs.setInt(8, stbMenuDto.getPosTipoAzienda());
|
||||
else insertBulkPs.setObject(8, null);
|
||||
|
||||
if(stbMenuDto.getPosCliente() != null) insertBulkPs.setInt(9, stbMenuDto.getPosCliente());
|
||||
if (stbMenuDto.getPosCliente() != null) insertBulkPs.setInt(9, stbMenuDto.getPosCliente());
|
||||
else insertBulkPs.setObject(9, null);
|
||||
|
||||
insertBulkPs.setString(10, stbMenuDto.getDescrizioneEstesa());
|
||||
@@ -195,7 +203,7 @@ public class MenuConfigurationService {
|
||||
}
|
||||
|
||||
public void generate() throws Exception {
|
||||
try (MultiDBTransactionManager studioMlMultiDb = new MultiDBTransactionManager("INTEGRY")) {
|
||||
try (MultiDBTransactionManager studioMlMultiDb = new MultiDBTransactionManager("MENU")) {
|
||||
MenuStaticCreator.createMenu(studioMlMultiDb.getPrimaryConnection(), UtilityDirs.getDevelopmentMenusFolder());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,10 +7,12 @@ import it.integry.ems.schedule.new_cron_job.service.AutomatedOperationHandlerCom
|
||||
import it.integry.ems.settings.Model.SettingsModel;
|
||||
import it.integry.ems.settings.SettingsController;
|
||||
import it.integry.ems.sync.MultiDBTransaction.AdvancedDataSource;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems.utility.UtilityDebug;
|
||||
import it.integry.ems_model.entity.Azienda;
|
||||
import it.integry.ems_model.entity.StbGestSetup;
|
||||
import it.integry.ems_model.entity.StbGestSetupQuery;
|
||||
import it.integry.ems_model.entity.StbGestSync;
|
||||
import it.integry.ems_model.exception.DataConverterNotFoundException;
|
||||
import it.integry.ems_model.rulescompleting.DroolsDataCompleting;
|
||||
import it.integry.ems_model.types.ApplicationName;
|
||||
@@ -18,13 +20,19 @@ import it.integry.ems_model.types.OperationType;
|
||||
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 org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.web.context.ContextLoader;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.IOException;
|
||||
import java.sql.*;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class BaseMigration implements MigrationModelInterface {
|
||||
@@ -55,11 +63,19 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
return historyProfileDB.equalsIgnoreCase(advancedDataSource.getProfileName());
|
||||
}
|
||||
|
||||
protected boolean isDebug() throws Exception {
|
||||
protected boolean isDebug() {
|
||||
return UtilityDebug.isDebugExecution();
|
||||
}
|
||||
|
||||
|
||||
protected @NotNull List<HashMap<String, Object>> executeQuery(String sql) throws SQLException, IOException {
|
||||
return UtilityDB.executeSimpleQuery(advancedDataSource.getConnection(), sql);
|
||||
}
|
||||
|
||||
protected @NotNull <T> List<T> executeQueryDTO(String sql, Class<T> clazz) throws Exception {
|
||||
return UtilityDB.executeSimpleQueryDTO(advancedDataSource.getConnection(), sql, clazz);
|
||||
}
|
||||
|
||||
protected void executeStatement(String... sqls) throws SQLException, IOException {
|
||||
executeStatement(advancedDataSource.getConnection(), sqls);
|
||||
}
|
||||
@@ -107,6 +123,10 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
alterObject(SqlObjectTypeEnum.VIEW, objectName, createViewSql);
|
||||
}
|
||||
|
||||
protected boolean existsView(String objectName) throws SQLException, IOException {
|
||||
return UtilityDB.<Integer>executeSimpleQueryOnlyFirstRowFirstColumn(advancedDataSource.getConnection(), "SELECT COUNT(*) FROM SYSOBJECTS WHERE id = object_id('" + objectName + "')") > 0;
|
||||
}
|
||||
|
||||
protected void createOrUpdateProcedure(String objectName, String createProcedureSql) throws SQLException, IOException {
|
||||
alterObject(SqlObjectTypeEnum.PROCEDURE, objectName, createProcedureSql);
|
||||
}
|
||||
@@ -126,6 +146,14 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
"\tDROP " + sqlObject.toString() + " " + objectName);
|
||||
}
|
||||
|
||||
protected void createIndex(IndexTableDTO indexTableDTO) throws Exception {
|
||||
UtilityDB.createIndex(advancedDataSource.getConnection(), indexTableDTO);
|
||||
}
|
||||
|
||||
protected void dropIndex(String tableName, String indexName) throws Exception {
|
||||
UtilityDB.dropIndex(advancedDataSource.getConnection(), tableName, indexName);
|
||||
}
|
||||
|
||||
|
||||
protected boolean existsColumn(String tableName, String columnName) throws SQLException, IOException {
|
||||
String schema = null;
|
||||
@@ -143,9 +171,20 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
return val != null && val == 1;
|
||||
}
|
||||
|
||||
protected boolean existColumn(String tableName, String columnName) throws SQLException, IOException {
|
||||
return UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(advancedDataSource.getConnection(),
|
||||
Query.format("SELECT CAST(COUNT(*) AS BIT)\n" +
|
||||
"FROM sys.syscolumns\n" +
|
||||
"WHERE name = %s\n" +
|
||||
" AND OBJECT_NAME(id) = %s", columnName, tableName));
|
||||
}
|
||||
|
||||
protected void renameColumn(String tableName, String oldColumnname, String newColumnName) throws SQLException, IOException {
|
||||
String sql = "exec sp_rename 'dbo." + tableName + "." + oldColumnname + "', " + newColumnName + ", 'COLUMN'";
|
||||
executeStatement(sql);
|
||||
if (existColumn(tableName, oldColumnname)) {
|
||||
String sql =
|
||||
"exec sp_rename 'dbo." + tableName + "." + oldColumnname + "', " + newColumnName + ", 'COLUMN'";
|
||||
executeStatement(sql);
|
||||
}
|
||||
}
|
||||
|
||||
protected void dropColumn(String tableName, String columnName) throws SQLException, IOException {
|
||||
@@ -164,6 +203,7 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
executeStatement(Query.format("ALTER TABLE dbo." + tableName + " ADD DEFAULT (%s) FOR " + columnName, defaultValue));
|
||||
}
|
||||
|
||||
|
||||
protected boolean existsTable(String tableName) throws SQLException, IOException {
|
||||
String schema = null;
|
||||
if (tableName.contains(".")) {
|
||||
@@ -181,8 +221,10 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
}
|
||||
|
||||
protected void dropTable(String tableName) throws SQLException, IOException {
|
||||
String dropSql = "DROP TABLE " + tableName;
|
||||
executeStatement(dropSql);
|
||||
if (existsTable(tableName)) {
|
||||
String dropSql = "DROP TABLE " + tableName;
|
||||
executeStatement(dropSql);
|
||||
}
|
||||
}
|
||||
|
||||
protected void createSetupQuery(String codQuery, String name, String query) throws SQLException, IOException {
|
||||
@@ -448,4 +490,28 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
Azienda currentAzienda = Azienda.getDefaultAzienda(advancedDataSource.getConnection());
|
||||
return currentAzienda.getApplicationNameEnum() == ApplicationName.DMS;
|
||||
}
|
||||
|
||||
protected void enableSaveToRest(String gestName) throws Exception {
|
||||
boolean existRow =
|
||||
UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(advancedDataSource.getConnection(),
|
||||
Query.format("SELECT cast(count(*) as bit) FROM stb_gest_sync WHERE gest_name = %s", gestName));
|
||||
|
||||
StbGestSync gestSync =
|
||||
new StbGestSync()
|
||||
.setGestName(gestName)
|
||||
.setSyncronize("R");
|
||||
if (existRow) {
|
||||
gestSync.setOperation(OperationType.UPDATE);
|
||||
} else {
|
||||
String entityName =
|
||||
UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(advancedDataSource.getConnection(),
|
||||
Query.format("SELECT entity_name FROM stb_menu_opz WHERE gest_name = %s", gestName));
|
||||
gestSync.setEntityName(entityName);
|
||||
gestSync.setOperation(OperationType.INSERT);
|
||||
}
|
||||
|
||||
|
||||
gestSync.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ public enum IntegryCustomer {
|
||||
Agricoper(IntegryCustomerDB.Agricoper_Agricoper,
|
||||
IntegryCustomerDB.Agricoper_IlVisone,
|
||||
IntegryCustomerDB.Agricoper_Luva),
|
||||
|
||||
ATI(IntegryCustomerDB.ATI_Finpart),
|
||||
Auricchio(IntegryCustomerDB.Auricchio_Auricchio,
|
||||
IntegryCustomerDB.Auricchio_AuricchioMiki,
|
||||
IntegryCustomerDB.Auricchio_AuricchioSrl,
|
||||
|
||||
@@ -5,7 +5,7 @@ public enum IntegryCustomerDB {
|
||||
Agricoper_IlVisone("ilvisone"),
|
||||
Agricoper_Luva("ilvisone"),
|
||||
|
||||
|
||||
ATI_Finpart("Finpart"),
|
||||
Auricchio_Auricchio("auricchio"),
|
||||
Auricchio_AuricchioMiki("auricchio_miki"),
|
||||
Auricchio_AuricchioSrl("auricchiosrl"),
|
||||
@@ -171,8 +171,8 @@ public enum IntegryCustomerDB {
|
||||
|
||||
Tempesta_Tempesta("tempesta"),
|
||||
Tempesta_VivaiTempesta("vivaitempesta"),
|
||||
|
||||
|
||||
|
||||
|
||||
Tosca_Ba("tosca_ba"),
|
||||
Tosca_Cz("tosca_cz"),
|
||||
Tosca_Rm("tosca_rm"),
|
||||
|
||||
@@ -5,7 +5,8 @@ import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
import it.integry.ems.settings.Model.AvailableConnectionsModel;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
|
||||
import java.sql.Connection;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.Statement;
|
||||
import java.util.List;
|
||||
@@ -28,7 +29,7 @@ public class Migration_20210721093948 extends BaseMigration implements Migration
|
||||
|
||||
String connectionString = String.format("jdbc:sqlserver://%s;applicationName=%s", dbHost, "EMS Connection");
|
||||
|
||||
Connection connection = DriverManager.getConnection(connectionString, dbUsername, dbPassword);
|
||||
Connection connection = Connection.fromConnection(DriverManager.getConnection(connectionString, dbUsername, dbPassword));
|
||||
|
||||
String sqlSessions = "SELECT conn.session_id " +
|
||||
"FROM sys.dm_exec_sessions AS sess " +
|
||||
|
||||
@@ -5,7 +5,8 @@ import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
import it.integry.ems.settings.Model.AvailableConnectionsModel;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
|
||||
import java.sql.Connection;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.Statement;
|
||||
import java.util.List;
|
||||
@@ -29,7 +30,7 @@ public class Migration_20210924152555 extends BaseMigration implements Migration
|
||||
|
||||
String connectionString = String.format("jdbc:sqlserver://%s;applicationName=%s", dbHost, "EMS Connection");
|
||||
|
||||
Connection connection = DriverManager.getConnection(connectionString, dbUsername, dbPassword);
|
||||
Connection connection = Connection.fromConnection(DriverManager.getConnection(connectionString, dbUsername, dbPassword));
|
||||
|
||||
String sqlSessions = "SELECT conn.session_id " +
|
||||
"FROM sys.dm_exec_sessions AS sess " +
|
||||
|
||||
@@ -13,7 +13,8 @@ import it.integry.ems_model.utility.UtilityString;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.sql.Connection;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -14,7 +14,8 @@ import it.integry.ems_model.utility.UtilityString;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.sql.Connection;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -8,7 +8,9 @@ import it.integry.ems_model.utility.UtilityHashMap;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.IOException;
|
||||
import java.sql.Connection;
|
||||
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -50,8 +52,8 @@ public class Migration_20240212000000 extends BaseMigration implements Migration
|
||||
Long newParentId = getNewGeneratedIdFromOldKey(oldId, oldStbPublications);
|
||||
|
||||
String insertSql = Query.format("INSERT INTO stb_publications_detail " +
|
||||
"(stb_publication_id, entity_name, where_cond_sql, recalc_columns, active, where_cond, ready_to_transmit) " +
|
||||
"VALUES (%s, %s, %s, %s, %s, %s, %s)",
|
||||
"(stb_publication_id, entity_name, where_cond_sql, recalc_columns, active, where_cond, ready_to_transmit) " +
|
||||
"VALUES (%s, %s, %s, %s, %s, %s, %s)",
|
||||
newParentId,
|
||||
entityName,
|
||||
whereCondSql,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
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_20240701154113 extends BaseMigration implements MigrationModelInterface {
|
||||
@@ -10,11 +11,13 @@ public class Migration_20240701154113 extends BaseMigration implements Migration
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
executeStatement("INSERT INTO stb_abil\n" +
|
||||
"select 'IG034', USER_NAME, flag_abil, 'w_ifat_elettroniche_check_dlg'\n" +
|
||||
"from stb_abil\n" +
|
||||
"where cod_opz = 'IR001'\n" +
|
||||
"where cod_opz = 'IR001' and user_name not in (select user_name from stb_abil where cod_opz = 'IG034')\n" +
|
||||
"\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
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_20240715134642 extends BaseMigration implements MigrationModelInterface {
|
||||
@@ -10,6 +11,8 @@ public class Migration_20240715134642 extends BaseMigration implements Migration
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
createOrUpdateTrigger("t_UpdProgMagaT", "CREATE TRIGGER [dbo].[t_UpdProgMagaT]\n" +
|
||||
" ON [dbo].[dtb_ordt]\n" +
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
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_20240723164345 extends BaseMigration implements MigrationModelInterface {
|
||||
@@ -10,6 +11,8 @@ public class Migration_20240723164345 extends BaseMigration implements Migration
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
createOrUpdateTrigger("t_UpdProgMagaT", "CREATE TRIGGER [dbo].[t_UpdProgMagaT]\n" +
|
||||
" ON [dbo].[dtb_ordt]\n" +
|
||||
|
||||
@@ -58,8 +58,8 @@ public class Migration_20240806101405 extends BaseMigration implements Migration
|
||||
" ELSE 0 END AS BIT) AS ricorsione,\n" +
|
||||
" jtb_dist_mate.perc_sfrido,\n" +
|
||||
" jtb_dist_mate.num_fase, \n" +
|
||||
" jtb_dist_mate.flag_pri, \n" +
|
||||
" jtb_dist_mate.note\n" +
|
||||
" Convert(varchar(1), jtb_dist_mate.flag_pri) as flag_pri, \n" +
|
||||
" convert(varchar(1024), jtb_dist_mate.note ) as note \n" +
|
||||
" FROM jtb_dist_mate\n" +
|
||||
" INNER JOIN distinta ON jtb_dist_mate.cod_prod = distinta.cod_mart\n" +
|
||||
" INNER JOIN jtb_cicl ON jtb_dist_mate.cod_prod = jtb_cicl.cod_mart\n" +
|
||||
|
||||
@@ -60,8 +60,8 @@ public class Migration_20240806192343 extends BaseMigration implements Migration
|
||||
" ELSE 0 END AS BIT) AS ricorsione,\n" +
|
||||
" jtb_dist_mate.perc_sfrido,\n" +
|
||||
" jtb_dist_mate.num_fase, \n" +
|
||||
" jtb_dist_mate.flag_pri, \n" +
|
||||
" jtb_dist_mate.note,\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" +
|
||||
|
||||
@@ -60,8 +60,8 @@ public class Migration_20240807132811 extends BaseMigration implements Migration
|
||||
" ELSE 0 END AS BIT) AS ricorsione,\n" +
|
||||
" jtb_dist_mate.perc_sfrido,\n" +
|
||||
" jtb_dist_mate.num_fase, \n" +
|
||||
" jtb_dist_mate.flag_pri, \n" +
|
||||
" jtb_dist_mate.note,\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" +
|
||||
|
||||
@@ -58,8 +58,8 @@ public class Migration_20240807142956 extends BaseMigration implements Migration
|
||||
" ELSE 0 END AS BIT) AS ricorsione,\n" +
|
||||
" jtb_dist_mate.perc_sfrido,\n" +
|
||||
" jtb_dist_mate.num_fase, \n" +
|
||||
" jtb_dist_mate.flag_pri, \n" +
|
||||
" jtb_dist_mate.note,\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" +
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
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_20240807143042 extends BaseMigration implements MigrationModelInterface {
|
||||
@@ -10,6 +11,8 @@ public class Migration_20240807143042 extends BaseMigration implements Migration
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
createOrUpdateProcedure("MRP_UpdateQtaImpProx", "CREATE Procedure [dbo].[MRP_UpdateQtaImpProx](@elencoArticoli varchar(max) = null)\n" +
|
||||
"AS \n" +
|
||||
|
||||
@@ -58,8 +58,8 @@ public class Migration_20240807180842 extends BaseMigration implements Migration
|
||||
" ELSE 0 END AS BIT) AS ricorsione,\n" +
|
||||
" jtb_dist_mate.perc_sfrido,\n" +
|
||||
" jtb_dist_mate.num_fase, \n" +
|
||||
" jtb_dist_mate.flag_pri, \n" +
|
||||
" jtb_dist_mate.note,\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" +
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
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_20240809145906 extends BaseMigration implements MigrationModelInterface {
|
||||
@@ -10,6 +11,8 @@ public class Migration_20240809145906 extends BaseMigration implements Migration
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
createOrUpdateFunction("getMaterialiDistinta", "CREATE FUNCTION [dbo].[getMaterialiDistinta](@codProd VARCHAR(15), @explodeSemilavorati bit)\n" +
|
||||
" RETURNS TABLE\n" +
|
||||
@@ -57,14 +60,14 @@ public class Migration_20240809145906 extends BaseMigration implements Migration
|
||||
" ELSE 0 END AS BIT) AS ricorsione,\n" +
|
||||
" jtb_dist_mate.perc_sfrido,\n" +
|
||||
" jtb_dist_mate.num_fase, \n" +
|
||||
" jtb_dist_mate.flag_pri, \n" +
|
||||
" jtb_dist_mate.note,\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 ON jtb_dist_mate.cod_prod = jtb_cicl.cod_mart\n" +
|
||||
" INNER JOIN mtb_aart ON mtb_aart.cod_mart = jtb_dist_mate.cod_mart \n" +
|
||||
" INNER JOIN mtb_aart ON mtb_aart.cod_mart = jtb_dist_mate.cod_mart\n" +
|
||||
" WHERE distinta.ricorsione = 0 and (distinta.is_root = 1 or distinta.flag_pri = 'S' or @explodeSemilavorati = 1))\n" +
|
||||
"\n" +
|
||||
" SELECT cod_prod,\n" +
|
||||
|
||||
@@ -14,12 +14,14 @@ public class Migration_20240814102149 extends BaseMigration implements Migration
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
executeStatement(
|
||||
"insert into stb_abil\n" +
|
||||
"select stb_menu_opz.cod_opz, user_name, flag_abil, stb_menu_opz.gest_name\n" +
|
||||
"from ( select * from stb_abil where stb_abil.cod_opz = 'TG002' ) stb_abil\n" +
|
||||
"cross apply ( select * from stb_menu_opz where stb_menu_opz.cod_opz ='TG041' ) stb_menu_opz",
|
||||
"update stb_abil set flag_abil = 'N' where stb_abil.cod_opz = 'TG002' ");
|
||||
"cross apply ( select * from stb_menu_opz where stb_menu_opz.cod_opz ='TG041' ) stb_menu_opz");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
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.entity.AtbForn;
|
||||
import it.integry.ems_model.entity.MtbAart;
|
||||
import it.integry.ems_model.entity.VtbClie;
|
||||
import it.integry.ems_model.entity.WtbUsers;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Migration_20240828094457 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
String val = null;
|
||||
if (isCustomer(IntegryCustomer.Tosca)) {
|
||||
val = "01";
|
||||
}
|
||||
createSetup("EDGE_CONN", "SETUP", "COD_ATIP_MP", val, "Codice tipo fornitore materia prima (cassette tbw)", "COD_ATIP");
|
||||
|
||||
if (!isCustomer(IntegryCustomer.Tosca))
|
||||
return;
|
||||
|
||||
String sql = "SELECT * from vtb_clie";
|
||||
List<VtbClie> listaClienti = UtilityDB.executeSimpleQueryDTO(advancedDataSource.getConnection(), sql, VtbClie.class);
|
||||
if (listaClienti.isEmpty())
|
||||
return;
|
||||
|
||||
for (VtbClie clie : listaClienti) {
|
||||
AtbForn forn = new AtbForn();
|
||||
forn
|
||||
.setCodAnag(clie.getCodAnag())
|
||||
.setCodAtip(val)
|
||||
.setOperation(OperationType.INSERT);
|
||||
clie
|
||||
.setOperation(OperationType.DELETE);
|
||||
forn.manageWithParentConnection(advancedDataSource.getConnection(), droolsDataCompleting);
|
||||
clie.manageWithParentConnection(advancedDataSource.getConnection(), droolsDataCompleting);
|
||||
}
|
||||
|
||||
List<String> queryDiacod = new ArrayList<>();
|
||||
//WOOD
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'934' WHERE cod_mart = N'RPC416AW'");
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'935' WHERE cod_mart = N'RPC416WW'");
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'937' WHERE cod_mart = N'RPC4311SW'");
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'942' WHERE cod_mart = N'RPC611AW'");
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'943' WHERE cod_mart = N'RPC613AW'");
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'944' WHERE cod_mart = N'RPC616AW'");
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'946' WHERE cod_mart = N'RPC619AW'");
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'947' WHERE cod_mart = N'RPC622AW'");
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'948' WHERE cod_mart = N'RPC623AW'");
|
||||
//GREEN
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'936' WHERE cod_mart = N'RPC4311'");
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'939' WHERE cod_mart = N'RPC4317'");
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'950' WHERE cod_mart = N'RPC6411'");
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'952' WHERE cod_mart = N'RPC6416'");
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'955' WHERE cod_mart = N'RPC6419'");
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'958' WHERE cod_mart = N'RPC6423'");
|
||||
//MEAT
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'1501' WHERE cod_mart = N'RPC4317M'");
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'1850' WHERE cod_mart = N'RPC6411M'");
|
||||
queryDiacod.add("UPDATE mtb_aart SET diacod = N'957' WHERE cod_mart = N'RPC6419M'");
|
||||
|
||||
queryDiacod.add("INSERT INTO mtb_depo_intercode (cod_forn, intercode, cod_mdep, user_name, cod_vdes, email_ordine) VALUES (N'F0000', N'ACC-00048931',N'CE',NULL, N'01', null);");
|
||||
queryDiacod.add("INSERT INTO mtb_depo_intercode (cod_forn, intercode, cod_mdep, user_name, cod_vdes, email_ordine) VALUES (N'F0000', N'ACC-00063682',N'RM',NULL, N'02', null);");
|
||||
queryDiacod.add("INSERT INTO mtb_depo_intercode (cod_forn, intercode, cod_mdep, user_name, cod_vdes, email_ordine) VALUES (N'F0000', N'ACC-00053786',N'MI',NULL, N'03', null);");
|
||||
queryDiacod.add("INSERT INTO mtb_depo_intercode (cod_forn, intercode, cod_mdep, user_name, cod_vdes, email_ordine) VALUES (N'F0000', N'ACC-00060042',N'RG',NULL, N'04', null);");
|
||||
queryDiacod.add("INSERT INTO mtb_depo_intercode (cod_forn, intercode, cod_mdep, user_name, cod_vdes, email_ordine) VALUES (N'F0000', N'ACC-00055852',N'VR',NULL, N'05', null);");
|
||||
queryDiacod.add("INSERT INTO mtb_depo_intercode (cod_forn, intercode, cod_mdep, user_name, cod_vdes, email_ordine) VALUES (N'F0000', N'ACC-00069093',N'BA',NULL, N'06', null);");
|
||||
queryDiacod.add("INSERT INTO mtb_depo_intercode (cod_forn, intercode, cod_mdep, user_name, cod_vdes, email_ordine) VALUES (N'F0000', N'ACC-00069743',N'CZ',NULL, N'07', null);");
|
||||
queryDiacod.add("INSERT INTO mtb_depo_intercode (cod_forn, intercode, cod_mdep, user_name, cod_vdes, email_ordine) VALUES (N'F0000', N'ACC-00063683',N'FC',NULL, N'08', null);");
|
||||
|
||||
|
||||
for (String updateDiacodSql : queryDiacod) {
|
||||
PreparedStatement updateDefaultFlagPS = advancedDataSource.getConnection().prepareStatement(updateDiacodSql);
|
||||
updateDefaultFlagPS.setQueryTimeout(30);
|
||||
updateDefaultFlagPS.executeUpdate();
|
||||
updateDefaultFlagPS.close();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@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.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240904094248 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
String val = "100";
|
||||
|
||||
if (isCustomer(IntegryCustomer.SaporiVeri)){
|
||||
val = "50";
|
||||
}
|
||||
|
||||
createSetup("ORDIFY", "SETUP", "MAX_SCONTO", val,
|
||||
"Percentuale massima di sconto", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@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.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240904103937 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
String val = "N";
|
||||
|
||||
if (isCustomer(IntegryCustomer.Dulciar)){
|
||||
val = "S";
|
||||
}
|
||||
|
||||
createSetupQuery("SI_NO", "SI_NO", "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
createSetup("ORDIFY", "SETUP", "ABILITA_SECONDO_SCONTO", val,
|
||||
"Permette di abilitare l'inserimento della seconda percentuale di sconto (Setup subordinata a ABILITA_SCONTO)", false, "SI_NO", false, false,
|
||||
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
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;
|
||||
import it.integry.ems.utility.UtilityDebug;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
|
||||
public class Migration_20240906164323 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@@ -9,7 +12,10 @@ public class Migration_20240906164323 extends BaseMigration implements Migration
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
if (UtilityDebug.isDebugExecution() || UtilityDebug.isIntegryServer()) return;
|
||||
executeStatement("update stb_menu set flag_attivo = 'N' where cod_opz in ('vg107', 'ag030','ag031','lg081','lg082', 'vg106', 'ag032')" );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
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_20240909103353 extends BaseMigration implements MigrationModelInterface {
|
||||
@@ -10,6 +11,8 @@ public class Migration_20240909103353 extends BaseMigration implements Migration
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
createOrUpdateFunction("MES_GetWorkOrders", "CREATE FUNCTION [dbo].[MES_GetWorkOrders](@codJfas VARCHAR(50), @dateStart DATE, @dateEnd DATE, @flagEvaso VARCHAR(1),\n" +
|
||||
" @codAnag VARCHAR(5))\n" +
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240909152916 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("PVM", "DOC_INTERNI", "SUGGEST_LOTTI", null,
|
||||
"Suggerisce i lotti già esistenti", false, "SI_NO", false, false,
|
||||
false, false, false, "dtb_tipi", false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
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_20240910101351 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
|
||||
createOrUpdateFunction("getPromozioneVendita", "CREATE FUNCTION [dbo].[getPromozioneVendita] (@dataIniz datetime, @dataFine datetime, @codVlis varchar(5), @codPromo varchar(10), @codMart varchar(15)) RETURNS TABLE AS \n" +
|
||||
" return \n" +
|
||||
" SELECT vtb_list.cod_vlis, \n" +
|
||||
" vtb_list.descrizione, \n" +
|
||||
" vtb_list_data.data_iniz, \n" +
|
||||
" vtb_list_data.data_fine,\n" +
|
||||
" vtb_list_data.cod_promo,\n" +
|
||||
" vtb_list_data.versione, \n" +
|
||||
" vtb_list.cod_divi,\n" +
|
||||
" vtb_list.flag_arr_prz_iva, \n" +
|
||||
" vtb_list.arr_ric,\n" +
|
||||
" vtb_list.flag_list_iva_inclusa,\n" +
|
||||
" vtb_list.flag_lisv_margine, \n" +
|
||||
" mtb_lisv_data.cod_mart as cod_mart, \n" +
|
||||
" mtb_lisv_data.unt_mis_ven as unt_mis_ven,\n" +
|
||||
" mtb_lisv_data.rap_conv as rap_conv, \n" +
|
||||
" mtb_lisv_data.prz_base as prz_base, \n" +
|
||||
" mtb_lisv_data.ricarica as ricarico,\n" +
|
||||
" --dbo.f_calcMargineEffettivo(mtb_lisv_data.prz_base, mtb_lisv_data.prz_vend, mtb_aart.perc_sfrido) as margine_eff,\n" +
|
||||
" --dbo.f_calcRicaricoEffettivo(mtb_lisv_data.prz_base, mtb_lisv_data.prz_vend, mtb_aart.perc_sfrido) as ricarico_eff, \n" +
|
||||
" CASE\n" +
|
||||
" WHEN mtb_lisv_data.prz_vend IS NOT NULL AND mtb_lisv_data.prz_vend <> 0 THEN\n" +
|
||||
" ROUND((ISNULL(mtb_lisv_data.prz_vend, 0) -\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100))) /\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_vend, 0) * 100, 2)\n" +
|
||||
" ELSE 0 END AS margine_eff,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN mtb_lisv_data.prz_base IS NOT NULL AND mtb_lisv_data.prz_base <> 0 THEN\n" +
|
||||
" ROUND((ISNULL(mtb_lisv_data.prz_vend, 0) -\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100))) /\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100)) * 100, 2)\n" +
|
||||
" ELSE 0 END AS ricarico_eff,\n" +
|
||||
" mtb_lisv_data.prz_vend as prz_vend, \n" +
|
||||
" mtb_lisv_data.prz_vend_iva as prz_vend_iva, \n" +
|
||||
" mtb_lisv_data.perc_sco1 as perc_sco1, \n" +
|
||||
" mtb_lisv_data.perc_sco2 as perc_sco2, \n" +
|
||||
" mtb_lisv_data.perc_sco3 as perc_sco3, \n" +
|
||||
" mtb_lisv_data.perc_sco4 as perc_sco4, \n" +
|
||||
" mtb_lisv_data.perc_prov as perc_prov, \n" +
|
||||
" mtb_lisv_data.fisso_prov as fisso_prov, \n" +
|
||||
" mtb_lisv_data.posizione as posizione, \n" +
|
||||
" mtb_lisv_data.perc_gest as perc_gest, \n" +
|
||||
" mtb_lisv_data.val_gest as val_gest, \n" +
|
||||
" mtb_lisv_data.data_agg_prz as data_agg_prz, \n" +
|
||||
" mtb_lisv_data.perc_ispe as perc_ispe, \n" +
|
||||
" mtb_lisv_data.val_ispe as val_ispe, \n" +
|
||||
" mtb_lisv_data.perc_promo as perc_promo, \n" +
|
||||
" mtb_lisv_data.val_promo as val_promo, \n" +
|
||||
" mtb_lisv_data.perc_oneri as perc_oneri, \n" +
|
||||
" mtb_lisv_data.val_oneri as val_oneri, \n" +
|
||||
" mtb_lisv_data.tipo_variazione as tipo_variazione, \n" +
|
||||
" mtb_lisv_data.note as note,\n" +
|
||||
" mtb_lisv_data.aggiornato_da as aggiornato_da,\n" +
|
||||
" mtb_lisv_data.prz_vend * (1 - mtb_lisv_data.perc_sco1/100) * (1 - mtb_lisv_data.perc_sco2/100)* (1 - mtb_lisv_data.perc_sco3/100)* (1 - mtb_lisv_data.perc_sco4/100) as prz_vend_netto,\n" +
|
||||
" vtb_promo.descrizione as 'descr_promo',\n" +
|
||||
" vtb_promo.data_iniz_sell_out,\n" +
|
||||
" vtb_promo.data_fine_sell_out,\n" +
|
||||
" vtb_promo.flag_tipo_promo,\n" +
|
||||
" mtb_lisv_data.sconto_cartoni,\n" +
|
||||
" mtb_lisv_data.sconto_strato,\n" +
|
||||
" mtb_lisv_data.sconto_pedane,\n" +
|
||||
" mtb_lisv_data.giacenza,\n" +
|
||||
" mtb_lisv_data.magg_prz_vend,\n" +
|
||||
" vtb_promo.flag_sconto_contrattuale,\n" +
|
||||
" vtb_promo.intercode_xml_variazioni,\n" +
|
||||
" vtb_list_data.note as note_testata,\n" +
|
||||
" vtb_promo.flag_tipologia\n" +
|
||||
" FROM vtb_list inner join vtb_list_data on vtb_list.cod_vlis = vtb_list_data.cod_vlis\n" +
|
||||
" inner join mtb_lisv_data on vtb_list_data.cod_vlis = mtb_lisv_data.cod_vlis AND vtb_list_data.versione = mtb_lisv_data.versione\n" +
|
||||
" inner join mtb_aart on mtb_lisv_data.cod_mart = mtb_aart.cod_mart\n" +
|
||||
" inner join vtb_promo on vtb_list_data.cod_promo = vtb_promo.cod_promo \n" +
|
||||
" outer apply (select count(*) as conta from vtb_list_data rif where vtb_list_data.cod_vlis = rif.cod_vlis_rif and vtb_list_data.versione = rif.versione ) list_rif\n" +
|
||||
" WHERE (@codMart IS NULL OR mtb_lisv_data.cod_mart = @codMart)\n" +
|
||||
" AND (@codvlis IS NULL OR vtb_list_data.cod_vlis = @codVlis) \n" +
|
||||
" AND vtb_list.cod_vlis_rif IS NULL\n" +
|
||||
" AND (@codPromo IS NULL OR vtb_list_data.cod_promo = @codPromo)\n" +
|
||||
" AND (((@dataFine IS NULL OR ISNULL(@dataIniz, CAST(getDate() as date)) = @dataFine) AND \n" +
|
||||
" ISNULL(@dataIniz, CAST(getDate() as date)) BETWEEN vtb_list_data.data_iniz AND vtb_list_data.data_fine) OR \n" +
|
||||
" (@dataFine IS NOT NULL AND ISNULL(@dataIniz, CAST(getDate() as date)) <> @dataFine AND \n" +
|
||||
" (vtb_list_data.data_iniz BETWEEN ISNULL(@dataIniz, CAST(getDate() as date)) AND @dataFine OR \n" +
|
||||
" vtb_list_data.data_fine BETWEEN ISNULL(@dataIniz, CAST(getDate() as date)) AND @dataFine OR \n" +
|
||||
" ISNULL(@dataIniz, CAST(getDate() as date)) BETWEEN vtb_list_data.data_iniz AND vtb_list_data.data_fine OR\n" +
|
||||
" @dataFine BETWEEN vtb_list_data.data_iniz AND vtb_list_data.data_fine ))) AND\n" +
|
||||
" (vtb_promo.flag_sconto_contrattuale = 'N' OR ( vtb_promo.flag_sconto_contrattuale = 'S' and list_rif.conta = 0 )) \n" +
|
||||
" union\n" +
|
||||
" SELECT vtb_list.cod_vlis, \n" +
|
||||
" vtb_list.descrizione, \n" +
|
||||
" vtb_list_data.data_iniz, \n" +
|
||||
" vtb_list_data.data_fine,\n" +
|
||||
" vtb_list_data.cod_promo,\n" +
|
||||
" vtb_list_data.versione, \n" +
|
||||
" vtb_list.cod_divi,\n" +
|
||||
" vtb_list.flag_arr_prz_iva, \n" +
|
||||
" vtb_list.arr_ric,\n" +
|
||||
" vtb_list.flag_list_iva_inclusa,\n" +
|
||||
" vtb_list.flag_lisv_margine, \n" +
|
||||
" mtb_lisv_data.cod_mart as cod_mart, \n" +
|
||||
" mtb_lisv_data.unt_mis_ven as unt_mis_ven,\n" +
|
||||
" mtb_lisv_data.rap_conv as rap_conv, \n" +
|
||||
" mtb_lisv_data.prz_base as prz_base, \n" +
|
||||
" mtb_lisv_data.ricarica as ricarico,\n" +
|
||||
" --dbo.f_calcMargineEffettivo(mtb_lisv_data.prz_base, mtb_lisv_data.prz_vend, mtb_aart.perc_sfrido) as margine_eff,\n" +
|
||||
" --dbo.f_calcRicaricoEffettivo(mtb_lisv_data.prz_base, mtb_lisv_data.prz_vend, mtb_aart.perc_sfrido) as ricarico_eff, \n" +
|
||||
" CASE\n" +
|
||||
" WHEN mtb_lisv_data.prz_vend IS NOT NULL AND mtb_lisv_data.prz_vend <> 0 THEN\n" +
|
||||
" ROUND((ISNULL(mtb_lisv_data.prz_vend, 0) -\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100))) /\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_vend, 0) * 100, 2)\n" +
|
||||
" ELSE 0 END AS margine_eff,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN mtb_lisv_data.prz_base IS NOT NULL AND mtb_lisv_data.prz_base <> 0 THEN\n" +
|
||||
" ROUND((ISNULL(mtb_lisv_data.prz_vend, 0) -\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100))) /\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100)) * 100, 2)\n" +
|
||||
" ELSE 0 END AS ricarico_eff,\n" +
|
||||
" mtb_lisv_data.prz_vend as prz_vend, \n" +
|
||||
" mtb_lisv_data.prz_vend_iva as prz_vend_iva, \n" +
|
||||
" mtb_lisv_data.perc_sco1 as perc_sco1, \n" +
|
||||
" mtb_lisv_data.perc_sco2 as perc_sco2, \n" +
|
||||
" mtb_lisv_data.perc_sco3 as perc_sco3, \n" +
|
||||
" mtb_lisv_data.perc_sco4 as perc_sco4, \n" +
|
||||
" mtb_lisv_data.perc_prov as perc_prov, \n" +
|
||||
" mtb_lisv_data.fisso_prov as fisso_prov, \n" +
|
||||
" mtb_lisv_data.posizione as posizione, \n" +
|
||||
" mtb_lisv_data.perc_gest as perc_gest, \n" +
|
||||
" mtb_lisv_data.val_gest as val_gest, \n" +
|
||||
" mtb_lisv_data.data_agg_prz as data_agg_prz, \n" +
|
||||
" mtb_lisv_data.perc_ispe as perc_ispe, \n" +
|
||||
" mtb_lisv_data.val_ispe as val_ispe, \n" +
|
||||
" mtb_lisv_data.perc_promo as perc_promo, \n" +
|
||||
" mtb_lisv_data.val_promo as val_promo, \n" +
|
||||
" mtb_lisv_data.perc_oneri as perc_oneri, \n" +
|
||||
" mtb_lisv_data.val_oneri as val_oneri, \n" +
|
||||
" mtb_lisv_data.tipo_variazione as tipo_variazione, \n" +
|
||||
" mtb_lisv_data.note as note,\n" +
|
||||
" mtb_lisv_data.aggiornato_da as aggiornato_da,\n" +
|
||||
" mtb_lisv_data.prz_vend * (1 - mtb_lisv_data.perc_sco1/100) * (1 - mtb_lisv_data.perc_sco2/100)* (1 - mtb_lisv_data.perc_sco3/100)* (1 - mtb_lisv_data.perc_sco4/100) as prz_vend_netto ,\n" +
|
||||
" vtb_promo.descrizione as 'descr_promo',\n" +
|
||||
" vtb_promo.data_iniz_sell_out,\n" +
|
||||
" vtb_promo.data_fine_sell_out,\n" +
|
||||
" vtb_promo.flag_tipo_promo,\n" +
|
||||
" mtb_lisv_data.sconto_cartoni,\n" +
|
||||
" mtb_lisv_data.sconto_strato,\n" +
|
||||
" mtb_lisv_data.sconto_pedane,\n" +
|
||||
" mtb_lisv_data.giacenza,\n" +
|
||||
" mtb_lisv_data.magg_prz_vend,\n" +
|
||||
" vtb_promo.flag_sconto_contrattuale,\n" +
|
||||
" vtb_promo.intercode_xml_variazioni,\n" +
|
||||
" vtb_list_data.note as note_testata,\n" +
|
||||
" vtb_promo.flag_tipologia\n" +
|
||||
" FROM vtb_list inner join vtb_list_data on vtb_list.cod_vlis = vtb_list_data.cod_vlis \n" +
|
||||
" inner join vtb_list_data vtb_list_data_rif on vtb_list_data.cod_vlis_rif = vtb_list_data_rif.cod_vlis and\n" +
|
||||
" vtb_list_data.versione_rif = vtb_list_data_rif.versione \n" +
|
||||
" inner join mtb_lisv_data on vtb_list_data_rif.cod_vlis = mtb_lisv_data.cod_vlis and\n" +
|
||||
" vtb_list_data_rif.versione = mtb_lisv_data.versione \n" +
|
||||
" inner join mtb_aart on mtb_lisv_data.cod_mart = mtb_aart.cod_mart \n" +
|
||||
" inner join vtb_promo on vtb_list_data_rif.cod_promo = vtb_promo.cod_promo \n" +
|
||||
" WHERE (@codMart is null or mtb_lisv_data.cod_mart = @codMart ) and\n" +
|
||||
" (@codvlis is null or vtb_list_data.cod_vlis = @codVlis) and\n" +
|
||||
" ( @codPromo is null or vtb_list_data.cod_promo = @codPromo ) and\n" +
|
||||
" (((@dataFine IS NULL OR ISNULL(@dataIniz, CAST(getDate() as date)) = @dataFine) AND \n" +
|
||||
" ISNULL(@dataIniz, CAST(getDate() as date)) BETWEEN vtb_list_data.data_iniz AND vtb_list_data.data_fine) OR \n" +
|
||||
" (@dataFine IS NOT NULL AND ISNULL(@dataIniz, CAST(getDate() as date)) <> @dataFine AND \n" +
|
||||
" (vtb_list_data.data_iniz BETWEEN ISNULL(@dataIniz, CAST(getDate() as date)) AND @dataFine OR \n" +
|
||||
" vtb_list_data.data_fine BETWEEN ISNULL(@dataIniz, CAST(getDate() as date)) AND @dataFine OR \n" +
|
||||
" ISNULL(@dataIniz, CAST(getDate() as date)) BETWEEN vtb_list_data.data_iniz AND vtb_list_data.data_fine OR\n" +
|
||||
" @dataFine BETWEEN vtb_list_data.data_iniz AND vtb_list_data.data_fine )))");
|
||||
}
|
||||
|
||||
@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.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityDate;
|
||||
|
||||
public class Migration_20240910113729 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
executeStatement("alter table vtb_list_data add \n" +
|
||||
"\tid_listino AS (CONVERT([bigint],[vtb_list_data].[data_iniz])*(10000000)+[vtb_list_data].[versione]) PERSISTED;");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@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.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.dto.IndexTableDTO;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Migration_20240910114320 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
IndexTableDTO indexTableDTO =
|
||||
new IndexTableDTO()
|
||||
.setTableName("vtb_list_data")
|
||||
.setIndexName("ix_vtb_list_data_id_listino")
|
||||
.setColumnsIndex(Arrays.asList(
|
||||
new IndexTableDTO.ColumnIndex("cod_vlis"),
|
||||
new IndexTableDTO.ColumnIndex("id_listino")
|
||||
));
|
||||
createIndex(indexTableDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
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_20240910115321 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
createOrUpdateFunction("getListinoVendita_id", "create FUNCTION [dbo].[getListinoVendita_id](@datavalidita DATETIME, @codvlis VARCHAR(5), @codmart VARCHAR(15))\n" +
|
||||
" RETURNS TABLE AS\n" +
|
||||
" RETURN \n" +
|
||||
" --declare @datavalidita DATETIME, @codvlis VARCHAR(5), @codmart VARCHAR(15)\n" +
|
||||
" SELECT vtb_list.cod_vlis,\n" +
|
||||
" vtb_list.descrizione,\n" +
|
||||
" vtb_list_data.data_iniz AS data_iniz,\n" +
|
||||
" vtb_list_data.versione AS versione,\n" +
|
||||
" vtb_list.cod_divi,\n" +
|
||||
" vtb_list.cambio,\n" +
|
||||
" vtb_list.flag_arr_prz_iva,\n" +
|
||||
" vtb_list.arr_ric,\n" +
|
||||
" vtb_list.flag_list_iva_inclusa,\n" +
|
||||
" vtb_list.flag_lisv_margine,\n" +
|
||||
" vtb_list.flag_add_trasp,\n" +
|
||||
" tmp_list.cod_mart AS 'cod_mart',\n" +
|
||||
" mtb_lisv_data.unt_mis_ven AS unt_mis_ven,\n" +
|
||||
" ISNULL(mtb_lisv_data.rap_conv, 1) AS rap_conv,\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_base, 0) AS prz_base,\n" +
|
||||
" ISNULL(mtb_lisv_data.ricarica, 0) AS ricarico,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN mtb_lisv_data.prz_vend IS NOT NULL AND mtb_lisv_data.prz_vend <> 0 THEN\n" +
|
||||
" ROUND((ISNULL(mtb_lisv_data.prz_vend, 0) -\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100))) /\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_vend, 0) * 100, 2)\n" +
|
||||
" ELSE 0 END AS margine_eff,\n" +
|
||||
" --dbo.f_calcMargineEffettivo(IsNull(mtb_lisv_data.prz_base, 0), IsNull(mtb_lisv_data.prz_vend, 0), mtb_aart.perc_sfrido) as margine_eff,\n" +
|
||||
" --dbo.f_calcRicaricoEffettivo(IsNull(mtb_lisv_data.prz_base, 0), IsNull(mtb_lisv_data.prz_vend, 0), mtb_aart.perc_sfrido) ricarico_eff, \n" +
|
||||
" CASE\n" +
|
||||
" WHEN mtb_lisv_data.prz_base IS NOT NULL AND mtb_lisv_data.prz_base <> 0 THEN\n" +
|
||||
" ROUND((ISNULL(mtb_lisv_data.prz_vend, 0) -\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100))) /\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100)) * 100, 2)\n" +
|
||||
" ELSE 0 END AS ricarico_eff,\n" +
|
||||
"\n" +
|
||||
" ISNULL(mtb_lisv_data.magg_prz_vend, 0) AS magg_prz_vend,\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_vend, 0) AS prz_vend,\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_vend_iva, 0) AS prz_vend_iva,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_sco1, 0) AS perc_sco1,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_sco2, 0) AS perc_sco2,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_sco3, 0) AS perc_sco3,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_sco4, 0) AS perc_sco4,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_prov, 0) AS perc_prov,\n" +
|
||||
" ISNULL(mtb_lisv_data.fisso_prov, 0) AS fisso_prov,\n" +
|
||||
" ISNULL(mtb_lisv_data.posizione, '') AS posizione,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_gest, 0) AS perc_gest,\n" +
|
||||
" ISNULL(mtb_lisv_data.val_gest, 0) AS val_gest,\n" +
|
||||
" mtb_lisv_data.data_agg_prz AS data_agg_prz,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_ispe, 0) AS perc_ispe,\n" +
|
||||
" ISNULL(mtb_lisv_data.val_ispe, 0) AS val_ispe,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_promo, 0) AS perc_promo,\n" +
|
||||
" ISNULL(mtb_lisv_data.val_promo, 0) AS val_promo,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_oneri, 0) AS perc_oneri,\n" +
|
||||
" ISNULL(mtb_lisv_data.val_oneri, 0) AS val_oneri,\n" +
|
||||
" mtb_lisv_data.tipo_variazione AS tipo_variazione,\n" +
|
||||
" mtb_lisv_data.note AS note,\n" +
|
||||
" mtb_lisv_data.aggiornato_da AS aggiornato_da,\n" +
|
||||
" mtb_lisv_data.prz_vend * (1 - mtb_lisv_data.perc_sco1 / 100) * (1 - mtb_lisv_data.perc_sco2 / 100) *\n" +
|
||||
" (1 - mtb_lisv_data.perc_sco3 / 100) *\n" +
|
||||
" (1 - mtb_lisv_data.perc_sco4 / 100) AS prz_vend_netto,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN ISNULL(mtb_lisv_data.colli_pedana, 0) <> 0 THEN mtb_lisv_data.colli_pedana\n" +
|
||||
" ELSE mtb_aart.colli_pedana END AS colli_pedana,\n" +
|
||||
" mtb_lisv_data.cod_tcol_ul AS cod_tcol_ul,\n" +
|
||||
" mtb_lisv_data.cod_tcol_ui AS cod_tcol_ui,\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_vend_sug, 0) AS prz_vend_sug,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN ISNULL(mtb_lisv_data.qta_cnf, 0) <> 0\n" +
|
||||
" AND dbo.getGestSetup('VTB_LIST', 'SETUP', 'QTA_CNF_LISTINO') = 'S' \n" +
|
||||
" THEN mtb_lisv_data.qta_cnf\n" +
|
||||
" ELSE mtb_aart.qta_cnf END AS qta_cnf,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN ISNULL(mtb_lisv_data.colli_strato, 0) <> 0 THEN mtb_lisv_data.colli_strato\n" +
|
||||
" ELSE mtb_aart.colli_strato END AS colli_strato,\n" +
|
||||
" mtb_lisv_data.descrizione_html AS descrizione_html,\n" +
|
||||
" mtb_lisv_data.colli_pedana AS colli_pedana_lisv,\n" +
|
||||
" mtb_lisv_data.qta_cnf AS qta_cnf_lisv,\n" +
|
||||
" mtb_lisv_data.colli_strato AS colli_strato_lisv,\n" +
|
||||
" mtb_lisv_data.sconto_cartoni,\n" +
|
||||
" mtb_lisv_data.sconto_strato,\n" +
|
||||
" mtb_lisv_data.sconto_pedane,\n" +
|
||||
" vtb_list.flag_attivo,\n" +
|
||||
" vtb_list_data.note AS note_testata,\n" +
|
||||
" ISNULL(mtb_lisv_data.flag_prz_bloccato, 'N') AS flag_prz_bloccato,\n" +
|
||||
" vtb_list_data.porto AS porto,\n" +
|
||||
" mtb_lisv_data.system_note,\n" +
|
||||
" mtb_lisv.add_val_spese,\n" +
|
||||
" mtb_lisv.add_ric_spese,\n" +
|
||||
" mtb_lisv.add_sco_spese,\n" +
|
||||
" mtb_aart.flag_incl_listino\n" +
|
||||
" FROM (SELECT vtb_list.cod_vlis AS cod_vlis,\n" +
|
||||
" mtb_lisv_data.cod_mart,\n" +
|
||||
" MAX(vtb_list_data.id_listino) AS max_id_lisv,\n" +
|
||||
" vtb_list.cod_vlis AS 'cod_vlis_rif'\n" +
|
||||
" FROM vtb_list\n" +
|
||||
" INNER JOIN mtb_lisv_data ON vtb_list.cod_vlis = mtb_lisv_data.cod_vlis\n" +
|
||||
" LEFT OUTER JOIN vtb_list_data ON mtb_lisv_data.cod_vlis = vtb_list_data.cod_vlis AND\n" +
|
||||
" mtb_lisv_data.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 IS NULL\n" +
|
||||
" GROUP BY vtb_list.cod_vlis,\n" +
|
||||
" mtb_lisv_data.cod_mart\n" +
|
||||
" UNION\n" +
|
||||
" SELECT vtb_list.cod_vlis AS cod_vlis,\n" +
|
||||
" mtb_lisv_data.cod_mart,\n" +
|
||||
" MAX(vtb_list_data.id_listino) AS max_id_lisv,\n" +
|
||||
" vtb_list.cod_vlis_rif AS 'cod_vlis_rif'\n" +
|
||||
" FROM vtb_list\n" +
|
||||
" INNER JOIN vtb_list_data ON vtb_list.cod_vlis = vtb_list_data.cod_vlis\n" +
|
||||
" INNER JOIN vtb_list_data vtb_list_data_rif\n" +
|
||||
" ON vtb_list_data.versione_rif = vtb_list_data_rif.versione AND\n" +
|
||||
" vtb_list_data.cod_vlis_rif = vtb_list_data_rif.cod_vlis\n" +
|
||||
" INNER JOIN mtb_lisv_data ON vtb_list_data_rif.cod_vlis = mtb_lisv_data.cod_vlis AND\n" +
|
||||
" vtb_list_data_rif.versione = mtb_lisv_data.versione\n" +
|
||||
"\n" +
|
||||
" WHERE vtb_list_data.data_iniz <= ISNULL(@datavalidita, GETDATE())\n" +
|
||||
" AND vtb_list.cod_vlis_rif IS NOT NULL\n" +
|
||||
" GROUP BY vtb_list.cod_vlis,\n" +
|
||||
" mtb_lisv_data.cod_mart,\n" +
|
||||
" vtb_list.cod_vlis_rif) tmp_list\n" +
|
||||
" INNER JOIN vtb_list ON vtb_list.cod_vlis = tmp_list.cod_vlis\n" +
|
||||
" INNER JOIN mtb_lisv\n" +
|
||||
" ON tmp_list.cod_vlis_rif = mtb_lisv.cod_vlis AND tmp_list.cod_mart = mtb_lisv.cod_mart\n" +
|
||||
" INNER JOIN mtb_aart ON tmp_list.cod_mart = mtb_aart.cod_mart\n" +
|
||||
" LEFT OUTER JOIN vtb_list_data ON tmp_list.cod_vlis_rif = vtb_list_data.cod_vlis AND\n" +
|
||||
" tmp_list.max_id_lisv = vtb_list_data.id_listino\n" +
|
||||
" LEFT OUTER JOIN mtb_lisv_data ON vtb_list_data.cod_vlis = mtb_lisv_data.cod_vlis AND\n" +
|
||||
" tmp_list.cod_mart = mtb_lisv_data.cod_mart AND\n" +
|
||||
" vtb_list_data.versione = mtb_lisv_data.versione\n" +
|
||||
"\n" +
|
||||
" WHERE (@codmart IS NULL OR tmp_list.cod_mart = @codmart)\n" +
|
||||
" AND (@codvlis IS NULL OR tmp_list.cod_vlis = @codvlis)");
|
||||
}
|
||||
|
||||
@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_20240910142635 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomer(IntegryCustomer.Biolevante)) return;
|
||||
|
||||
updateSetupValue("W_GANAG_RC", "SETUP", "RETRIEVE_STATUS_CLIENTE", "N");
|
||||
}
|
||||
|
||||
@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.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240910143311 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
executeStatement("alter table gtb_anag add data_mod datetime");
|
||||
}
|
||||
|
||||
@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_20240911183338 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("w_pordi_rc", "SETUP", "CHECK_EXIST_LOTTO", null,
|
||||
"Se impostata a S, durante la generazione degli ordini di produzione da Planning di produzione , verifica se il prodotto-lotto esiste già in ordini precedenti (ultimi 2 mesi) in modo da non modificare la data di scadenza del lotto già esistente. Questa proceudura è attiva solo per chi utilizza il planning di produzione e verrà eliminata quando elimineremo questa gestione", false, null, false, true,
|
||||
false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@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.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240911183436 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Gramm_Gramm))
|
||||
return;
|
||||
|
||||
updateSetupValue("w_pordi_rc", "SETUP", "CHECK_EXIST_LOTTO", "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_20240912154513 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("w_ddocu_ord_rc", "SETUP", "DISATTIVA_ASS_COMM_TESTATA_ORD_ACQ", "N",
|
||||
"Valido solo per le aziende tessili: se impostata a S allora nel caricare un ordine di acquiesto non valorizza automaticamente il codice commessa di testata (Anno stag) quando si carica il primo articolo nell'ordine", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
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_20240912154537 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.FolliesGroup_FolliesGroup))
|
||||
return;
|
||||
|
||||
updateSetupValue("w_ddocu_ord_rc", "SETUP", "DISATTIVA_ASS_COMM_TESTATA_ORD_ACQ", "S",
|
||||
"Valido solo per le aziende tessili: se impostata a S allora nel caricare un ordine di acquiesto non valorizza automaticamente il codice commessa di testata (Anno stag) quando si carica il primo articolo nell'ordine", false, null, false, false, false,
|
||||
false, false, null, false, null);
|
||||
|
||||
executeStatement("DELETE\n" +
|
||||
"FROM stb_gest_setup_depo\n" +
|
||||
"WHERE gest_name = 'w_ddocu_ord_rc'\n" +
|
||||
" AND section = 'SETUP'\n" +
|
||||
" AND key_section = 'DISATTIVA_ASS_COMM_TESTATA_ORD_ACQ'"
|
||||
);
|
||||
|
||||
executeStatement("DELETE\n" +
|
||||
"FROM wtb_gest_setup_user\n" +
|
||||
"WHERE gest_name = 'w_ddocu_ord_rc'\n" +
|
||||
" AND section = 'SETUP'\n" +
|
||||
" AND key_section = 'DISATTIVA_ASS_COMM_TESTATA_ORD_ACQ'"
|
||||
);
|
||||
}
|
||||
|
||||
@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.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240913102433 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", "PICKING_LIBERO", "FLAG_ASK_COMMESSA_LAV", "N",
|
||||
"Se 'S' allora all'apertura del Picking Libero di lavorazione verrà chiesta la commessa", false, "SI_NO", false, false,
|
||||
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
|
||||
createSetup("PICKING", "PRODUZIONE", "FLAG_GENERA_DOC_CAR", "N",
|
||||
"Se 'S' abilita la generazione dei documenti di carico lavorazione. Il codice documento è letto dalla setup W_PORDI_RC > SETUP_DOCUMENTI > COD_DTIP_CAR.", false, "SI_NO", false, false,
|
||||
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
|
||||
createSetup("PICKING", "PRODUZIONE", "FLAG_GENERA_DOC_SCAR", "N",
|
||||
"Se 'S' abilita la generazione dei documenti di scarico lavorazione. Il codice documento è letto dalla setup W_PORDI_RC > SETUP_DOCUMENTI > COD_DTIP_SCAR.", 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,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_20240913112628 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
executeStatement("CREATE TABLE dtb_note_doc (id bigint identity not null,note varchar(8000) not null, \n" +
|
||||
" CONSTRAINT PK_dtb_note_doc PRIMARY KEY (id));\n" +
|
||||
"\n" +
|
||||
"CREATE TABLE drl_tipi_note_doc (cod_dtip varchar(5) not null, id_note bigint not null, id_riga integer not null, \n" +
|
||||
" CONSTRAINT PK_drl_tipi_note_doc PRIMARY KEY (cod_dtip, id_note),\n" +
|
||||
" CONSTRAINT FK_drl_tipi_note_doc_cod FOREIGN KEY (cod_dtip) REFERENCES dtb_tipi(cod_dtip),\n" +
|
||||
" CONSTRAINT FK_drl_tipi_note_doc_id FOREIGN KEY (id_note) REFERENCES dtb_note_doc(id));");
|
||||
}
|
||||
|
||||
@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.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240913135928 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
executeStatement("alter table ctb_cont add data_ins datetime",
|
||||
"alter table ctb_cont add data_mod datetime");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@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.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240913141508 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
executeStatement(
|
||||
"update ctb_cont set data_ins = IsNull(c.data_cmov, '2000/01/01'), data_mod = Isnull(c.data_cmov, '2000/01/01') " +
|
||||
"FROM ctb_cont cross apply (select MIN(data_cmov) as data_cmov from ctb_movt ) c",
|
||||
"alter table ctb_cont alter column data_ins datetime not null",
|
||||
"alter table ctb_cont alter column data_mod datetime not null");
|
||||
}
|
||||
|
||||
@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.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240913144135 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
if (isCustomer(IntegryCustomer.RossoGargano))
|
||||
executeStatement("update ctb_cont set ctb_cont.data_ins = convert(datetime, cast( CL_DATA_INSERIMENTO as varchar),112),\n" +
|
||||
"ctb_cont.data_mod = convert(datetime, cast( CL_DATA_MODIFICA as varchar),112)\n" +
|
||||
"from ctb_cont \n" +
|
||||
"inner join RossoGarganoExchange.dbo.ANAG on ctb_cont.diacod = ANAG.CL_CODICE\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.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240913153037 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if ( !isCustomer(IntegryCustomer.Biolevante)) return;
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
executeStatement("insert into dtb_note_doc \n" +
|
||||
"values ('Eventuali variazioni di IBAN sono da considerarsi valide solo se confermate direttamente dal personale della OLIO LEVANTE SRL a mezzo telefono'),\n" +
|
||||
"('Any changes of IBAN are to be considered valid only if confirmed directly by the staff of OLIO LEVANTE SRL by phone')",
|
||||
"insert into drl_tipi_note_doc\n" +
|
||||
"select cod_dtip, 1, 1\n" +
|
||||
"from dtb_tipi \n" +
|
||||
"where mod_stamp in ('MOD7', 'BOLAC','FAT','MOD10','MOD8','MOD6')\n" +
|
||||
"and gestione = 'v' ",
|
||||
"insert into drl_tipi_note_doc\n" +
|
||||
"select cod_dtip,2, 1\n" +
|
||||
"from dtb_tipi \n" +
|
||||
"where mod_stamp in ('MOD4','FATAC','MOD1','MOD5','MOD2','MOD3')\n" +
|
||||
"and gestione = 'v'\n" +
|
||||
"\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.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240913154727 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
enableSaveToRest("ccont");
|
||||
}
|
||||
|
||||
@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.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240913171829 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("IMPORT_ANAGRAFICHE ARTICOLI", "FOTO", "ATTIVO", "N",
|
||||
"Inserire S/N per attivare/disattivare il tipo di importazione", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_ANAGRAFICHE ARTICOLI", "FOTO", "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("IMPORT_ANAGRAFICHE ARTICOLI", "FOTO", "FILE_FILTER", null,
|
||||
"Inserire il criterio di filtro dei file o il nome del file specifio (seguire la sintassi di java)", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_ANAGRAFICHE ARTICOLI", "FOTO", "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("IMPORT_ANAGRAFICHE ARTICOLI", "FOTO", "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("IMPORT_ANAGRAFICHE ARTICOLI", "FOTO", "LISTENING", "N",
|
||||
"Se LISTENIG = 'N' la procedura di importazione non si potrà mai mettere in ascolto sulla directory perchè nella procedura vengono prese in considerazione più file.", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_ANAGRAFICHE ARTICOLI", "FOTO", "PATH_FILE", null,
|
||||
"Directory contente i file da importare.", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_ANAGRAFICHE ARTICOLI", "FOTO", "PATH_FILE_IMPORTED", null,
|
||||
"Directory dove vengono spostati i file dopo l'importazione.", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@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.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240916161113 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
executeStatement("ALTER TABLE dtb_note_doc ADD data_iniz DATETIME , data_fine DATETIME;");
|
||||
}
|
||||
|
||||
@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.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240916162607 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomer(IntegryCustomer.Smetar)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isCustomer(IntegryCustomer.Cosmapack)) {
|
||||
createSetup("WINACCESS", "SETUP", "MAX_DEVIATION_TIME", null,
|
||||
"Minuti di deviazione massima tra orario di lavoro registrato e quello teorico", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
createSetup("WINACCESS", "SETUP", "COD_DIVI_CONT", null,
|
||||
"Cod. divi cont di default per jtb_rlavt", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
|
||||
createSetup("WINACCESS", "SETUP", "SOLO_COMMESSE_ATTIVE", null,
|
||||
"Indica se mostrare solo le commesse con ordini di lavoro attivi", false, "SI_NO", false, false,
|
||||
false, false, false, null, false);
|
||||
|
||||
createSetup("MES", "REPORT", "RIENTRO", null,
|
||||
"Nome del report da usare per l'etichetta di rientro", false, "REPORT_NAME", false, false,
|
||||
false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@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_20240917092250 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("w_mlupdsrv_config_dlg", "SETUP", "NEW_VERSION", "S",
|
||||
"Se impostato a S avvia la nuova gestione importazione oridne (Ho attivato questa setup , perchè non si riusciva a capire se la vecchia versione veniva o meno utilizzata)", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
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_20240917110039 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Carelli_Winact)) return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
createOrUpdateFunction("steup_getGrigliaVendita", "CREATE FUNCTION [dbo].[steup_getGrigliaVendita](\n" +
|
||||
" @codMdep VARCHAR(5), @codJfas VARCHAR(5)\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) \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_griglia AS cod_madre \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" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT DISTINCT mtb_aart.cod_mart as cod_mart,\n" +
|
||||
" mtb_aart.descrizione,\n" +
|
||||
" mtb_aart.bar_code,\n" +
|
||||
" mtb_aart.cod_msgr,\n" +
|
||||
" mtb_aart.plu,\n" +
|
||||
" mtb_aart.cod_mart AS cod_madre \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 DISTINCT cod_mdep, cod_mart \n" +
|
||||
" FROM carelli.dbo.[getGrigliaAcquisto](null, null, @codMdep, null, null) griglia \n" +
|
||||
" where griglia.tipo_variazione <> 'D' AND \n" +
|
||||
" EXISTS( select cod_mart from carelli.dbo.mtb_aart WHERE mtb_aart.cod_mart = griglia.cod_mart AND mtb_aart.cod_mgrp = '03')) art ON \n" +
|
||||
" mtb_aart.cod_mart = 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" +
|
||||
" \n" +
|
||||
" )");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,282 @@
|
||||
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_20240917110814 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
createOrUpdateFunction("getListinoVendita_id", "CREATE FUNCTION [dbo].[getListinoVendita_id](@datavalidita DATETIME, @codvlis VARCHAR(5), @codmart VARCHAR(15))\n" +
|
||||
" RETURNS TABLE AS\n" +
|
||||
" RETURN \n" +
|
||||
"\n" +
|
||||
" --declare @datavalidita DATETIME, @codvlis VARCHAR(5), @codmart VARCHAR(15)\n" +
|
||||
"\n" +
|
||||
" with lisv AS (\n" +
|
||||
" SELECT vtb_list_data.cod_vlis,\n" +
|
||||
" vtb_list_data.versione,\n" +
|
||||
" vtb_list_data.id_listino as id_listino,\n" +
|
||||
" vtb_list_data.data_iniz,\n" +
|
||||
" vtb_list_data.cod_vlis AS cod_vlis_rif,\n" +
|
||||
" vtb_list_data.versione AS versione_rif\n" +
|
||||
" FROM vtb_list_data \n" +
|
||||
" WHERE vtb_list_data.data_fine IS NULL\n" +
|
||||
" AND vtb_list_data.cod_promo IS NULL \n" +
|
||||
" and vtb_list_data.cod_vlis_rif IS NULL\n" +
|
||||
" UNION\n" +
|
||||
" SELECT vtb_list_data.cod_vlis,\n" +
|
||||
" vtb_list_data.versione,\n" +
|
||||
" vtb_list_data_rif.id_listino,\n" +
|
||||
" vtb_list_data.data_iniz,\n" +
|
||||
" vtb_list_data.cod_vlis_rif AS cod_vlis_rif,\n" +
|
||||
" vtb_list_data.versione_rif AS versione_rif\n" +
|
||||
" FROM vtb_list_data \n" +
|
||||
" INNER JOIN vtb_list_data vtb_list_data_rif on vtb_list_data.cod_vlis_rif = vtb_list_data_rif.cod_vlis and vtb_list_data.versione_rif = vtb_list_data_rif.versione\n" +
|
||||
" WHERE vtb_list_data.data_fine IS NULL\n" +
|
||||
" AND vtb_list_data.cod_promo IS NULL \n" +
|
||||
" \n" +
|
||||
" \n" +
|
||||
" )\n" +
|
||||
"\n" +
|
||||
" , last_lisv AS ( \n" +
|
||||
" SELECT vtb_list.cod_vlis AS cod_vlis,\n" +
|
||||
" mtb_lisv_data.cod_mart,\n" +
|
||||
" MAX(vtb_list_data.id_listino) AS max_id_lisv,\n" +
|
||||
" IsNull(vtb_list_data.cod_vlis_rif, IsNull(vtb_list.cod_vlis_rif, vtb_list.cod_vlis)) AS 'cod_vlis_rif'\n" +
|
||||
" FROM vtb_list\n" +
|
||||
" INNER JOIN mtb_lisv_data ON vtb_list.cod_vlis = mtb_lisv_data.cod_vlis\n" +
|
||||
" LEFT OUTER JOIN lisv vtb_list_data ON mtb_lisv_data.cod_vlis = vtb_list_data.cod_vlis AND\n" +
|
||||
" mtb_lisv_data.versione = vtb_list_data.versione AND\n" +
|
||||
" vtb_list_data.data_iniz <= ISNULL(@datavalidita, GETDATE()) \n" +
|
||||
" GROUP BY vtb_list.cod_vlis,\n" +
|
||||
" mtb_lisv_data.cod_mart,\n" +
|
||||
" IsNull(vtb_list_data.cod_vlis_rif, IsNull(vtb_list.cod_vlis_rif, vtb_list.cod_vlis)) ),\n" +
|
||||
" art as (\n" +
|
||||
" select mtb_aart.cod_mart, mtb_aart.qta_cnf, mtb_aart.perc_sfrido, mtb_aart.colli_pedana, mtb_aart.colli_strato, mtb_aart.flag_incl_listino\n" +
|
||||
" from mtb_aart )\n" +
|
||||
" SELECT vtb_list.cod_vlis,\n" +
|
||||
" vtb_list.descrizione,\n" +
|
||||
" vtb_list_data.data_iniz AS data_iniz,\n" +
|
||||
" vtb_list_data.versione AS versione,\n" +
|
||||
" vtb_list.cod_divi,\n" +
|
||||
" vtb_list.cambio,\n" +
|
||||
" vtb_list.flag_arr_prz_iva,\n" +
|
||||
" vtb_list.arr_ric,\n" +
|
||||
" vtb_list.flag_list_iva_inclusa,\n" +
|
||||
" vtb_list.flag_lisv_margine,\n" +
|
||||
" vtb_list.flag_add_trasp,\n" +
|
||||
" tmp_list.cod_mart AS 'cod_mart',\n" +
|
||||
" mtb_lisv_data.unt_mis_ven AS unt_mis_ven,\n" +
|
||||
" ISNULL(mtb_lisv_data.rap_conv, 1) AS rap_conv,\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_base, 0) AS prz_base,\n" +
|
||||
" ISNULL(mtb_lisv_data.ricarica, 0) AS ricarico,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN mtb_lisv_data.prz_vend IS NOT NULL AND mtb_lisv_data.prz_vend <> 0 THEN\n" +
|
||||
" ROUND((ISNULL(mtb_lisv_data.prz_vend, 0) -\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100))) /\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_vend, 0) * 100, 2)\n" +
|
||||
" ELSE 0 END AS margine_eff,\n" +
|
||||
" \n" +
|
||||
" CASE\n" +
|
||||
" WHEN mtb_lisv_data.prz_base IS NOT NULL AND mtb_lisv_data.prz_base <> 0 THEN\n" +
|
||||
" ROUND((ISNULL(mtb_lisv_data.prz_vend, 0) -\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100))) /\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100)) * 100, 2)\n" +
|
||||
" ELSE 0 END AS ricarico_eff,\n" +
|
||||
" \n" +
|
||||
" ISNULL(mtb_lisv_data.magg_prz_vend, 0) AS magg_prz_vend,\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_vend, 0) AS prz_vend,\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_vend_iva, 0) AS prz_vend_iva,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_sco1, 0) AS perc_sco1,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_sco2, 0) AS perc_sco2,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_sco3, 0) AS perc_sco3,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_sco4, 0) AS perc_sco4,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_prov, 0) AS perc_prov,\n" +
|
||||
" ISNULL(mtb_lisv_data.fisso_prov, 0) AS fisso_prov,\n" +
|
||||
" ISNULL(mtb_lisv_data.posizione, '') AS posizione,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_gest, 0) AS perc_gest,\n" +
|
||||
" ISNULL(mtb_lisv_data.val_gest, 0) AS val_gest,\n" +
|
||||
" mtb_lisv_data.data_agg_prz AS data_agg_prz,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_ispe, 0) AS perc_ispe,\n" +
|
||||
" ISNULL(mtb_lisv_data.val_ispe, 0) AS val_ispe,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_promo, 0) AS perc_promo,\n" +
|
||||
" ISNULL(mtb_lisv_data.val_promo, 0) AS val_promo,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_oneri, 0) AS perc_oneri,\n" +
|
||||
" ISNULL(mtb_lisv_data.val_oneri, 0) AS val_oneri,\n" +
|
||||
" mtb_lisv_data.tipo_variazione AS tipo_variazione,\n" +
|
||||
" mtb_lisv_data.note AS note,\n" +
|
||||
" mtb_lisv_data.aggiornato_da AS aggiornato_da,\n" +
|
||||
" mtb_lisv_data.prz_vend * (1 - mtb_lisv_data.perc_sco1 / 100) * (1 - mtb_lisv_data.perc_sco2 / 100) *\n" +
|
||||
" (1 - mtb_lisv_data.perc_sco3 / 100) *\n" +
|
||||
" (1 - mtb_lisv_data.perc_sco4 / 100) AS prz_vend_netto,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN ISNULL(mtb_lisv_data.colli_pedana, 0) <> 0 THEN mtb_lisv_data.colli_pedana\n" +
|
||||
" ELSE mtb_aart.colli_pedana END AS colli_pedana,\n" +
|
||||
" mtb_lisv_data.cod_tcol_ul AS cod_tcol_ul,\n" +
|
||||
" mtb_lisv_data.cod_tcol_ui AS cod_tcol_ui,\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_vend_sug, 0) AS prz_vend_sug,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN ISNULL(mtb_lisv_data.qta_cnf, 0) <> 0\n" +
|
||||
" AND dbo.getGestSetup('VTB_LIST', 'SETUP', 'QTA_CNF_LISTINO') = 'S' \n" +
|
||||
" THEN mtb_lisv_data.qta_cnf\n" +
|
||||
" ELSE mtb_aart.qta_cnf END AS qta_cnf,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN ISNULL(mtb_lisv_data.colli_strato, 0) <> 0 THEN mtb_lisv_data.colli_strato\n" +
|
||||
" ELSE mtb_aart.colli_strato END AS colli_strato,\n" +
|
||||
" mtb_lisv_data.descrizione_html AS descrizione_html,\n" +
|
||||
" mtb_lisv_data.colli_pedana AS colli_pedana_lisv,\n" +
|
||||
" mtb_lisv_data.qta_cnf AS qta_cnf_lisv,\n" +
|
||||
" mtb_lisv_data.colli_strato AS colli_strato_lisv,\n" +
|
||||
" mtb_lisv_data.sconto_cartoni,\n" +
|
||||
" mtb_lisv_data.sconto_strato,\n" +
|
||||
" mtb_lisv_data.sconto_pedane,\n" +
|
||||
" vtb_list.flag_attivo,\n" +
|
||||
" vtb_list_data.note AS note_testata,\n" +
|
||||
" ISNULL(mtb_lisv_data.flag_prz_bloccato, 'N') AS flag_prz_bloccato,\n" +
|
||||
" vtb_list_data.porto AS porto,\n" +
|
||||
" mtb_lisv_data.system_note,\n" +
|
||||
" mtb_lisv.add_val_spese,\n" +
|
||||
" mtb_lisv.add_ric_spese,\n" +
|
||||
" mtb_lisv.add_sco_spese,\n" +
|
||||
" mtb_aart.flag_incl_listino\n" +
|
||||
" FROM last_lisv tmp_list\n" +
|
||||
" INNER JOIN vtb_list ON vtb_list.cod_vlis = tmp_list.cod_vlis\n" +
|
||||
" INNER JOIN mtb_lisv\n" +
|
||||
" ON tmp_list.cod_vlis_rif = mtb_lisv.cod_vlis AND tmp_list.cod_mart = mtb_lisv.cod_mart\n" +
|
||||
" INNER JOIN art mtb_aart ON tmp_list.cod_mart = mtb_aart.cod_mart\n" +
|
||||
" LEFT OUTER JOIN vtb_list_data ON tmp_list.cod_vlis_rif = vtb_list_data.cod_vlis AND\n" +
|
||||
" tmp_list.max_id_lisv = vtb_list_data.id_listino\n" +
|
||||
" LEFT OUTER JOIN mtb_lisv_data ON vtb_list_data.cod_vlis = mtb_lisv_data.cod_vlis AND\n" +
|
||||
" tmp_list.cod_mart = mtb_lisv_data.cod_mart AND\n" +
|
||||
" vtb_list_data.versione = mtb_lisv_data.versione\n" +
|
||||
"\n" +
|
||||
" WHERE (@codmart IS NULL OR tmp_list.cod_mart = @codmart)\n" +
|
||||
" AND (@codvlis IS NULL OR tmp_list.cod_vlis = @codvlis)");
|
||||
createOrUpdateFunction("getPromozioneVendita_new", "CREATE FUNCTION [dbo].[getPromozioneVendita_new] (@dataIniz datetime, @dataFine datetime, @codVlis varchar(5), @codPromo varchar(10), @codMart varchar(15)) RETURNS TABLE AS \n" +
|
||||
" return \n" +
|
||||
"\n" +
|
||||
"-- declare @dataIniz datetime, @dataFine datetime, @codVlis varchar(5), @codPromo varchar(10), @codMart varchar(15)\n" +
|
||||
"\n" +
|
||||
" with lisv AS (\n" +
|
||||
" SELECT vtb_list_data.cod_vlis,\n" +
|
||||
" vtb_list_data.versione,\n" +
|
||||
" vtb_list_data.id_listino as id_listino,\n" +
|
||||
" vtb_list_data.data_iniz,\n" +
|
||||
" vtb_list_data.cod_vlis AS cod_vlis_rif,\n" +
|
||||
" vtb_list_data.versione AS versione_rif,\n" +
|
||||
" vtb_list_data.cod_promo,\n" +
|
||||
" vtb_list_data.data_fine,\n" +
|
||||
" vtb_list_data.note\n" +
|
||||
" FROM vtb_list_data \n" +
|
||||
" WHERE vtb_list_data.cod_promo IS NOT NULL \n" +
|
||||
" and vtb_list_data.cod_vlis_rif IS NULL\n" +
|
||||
" UNION\n" +
|
||||
" SELECT vtb_list_data.cod_vlis,\n" +
|
||||
" vtb_list_data.versione,\n" +
|
||||
" vtb_list_data_rif.id_listino,\n" +
|
||||
" vtb_list_data.data_iniz,\n" +
|
||||
" vtb_list_data.cod_vlis_rif AS cod_vlis_rif,\n" +
|
||||
" vtb_list_data.versione_rif AS versione_rif,\n" +
|
||||
" vtb_list_data_rif.cod_promo,\n" +
|
||||
" vtb_list_data_rif.data_fine,\n" +
|
||||
" vtb_list_data.note\n" +
|
||||
" FROM vtb_list_data \n" +
|
||||
" INNER JOIN vtb_list_data vtb_list_data_rif on vtb_list_data.cod_vlis_rif = vtb_list_data_rif.cod_vlis and vtb_list_data.versione_rif = vtb_list_data_rif.versione\n" +
|
||||
" WHERE vtb_list_data.cod_promo IS NOT NULL )\n" +
|
||||
" , testata_lisv as (\n" +
|
||||
" select *\n" +
|
||||
" from lisv\n" +
|
||||
" WHERE (@codvlis IS NULL OR lisv.cod_vlis = @codVlis) \n" +
|
||||
" AND (@codPromo IS NULL OR lisv.cod_promo = @codPromo)\n" +
|
||||
" AND (((@dataFine IS NULL OR ISNULL(@dataIniz, cast(GetDate() as DATE)) = @dataFine) AND \n" +
|
||||
" ISNULL(@dataIniz, cast(GetDate() as DATE)) BETWEEN lisv.data_iniz AND lisv.data_fine) OR \n" +
|
||||
" (@dataFine IS NOT NULL AND ISNULL(@dataIniz, cast(GetDate() as DATE)) <> @dataFine AND \n" +
|
||||
" (lisv.data_iniz BETWEEN ISNULL(@dataIniz, cast(GetDate() as DATE)) AND @dataFine OR \n" +
|
||||
" lisv.data_fine BETWEEN ISNULL(@dataIniz, cast(GetDate() as DATE)) AND @dataFine OR \n" +
|
||||
" ISNULL(@dataIniz, cast(GetDate() as DATE)) BETWEEN lisv.data_iniz AND lisv.data_fine OR\n" +
|
||||
" @dataFine BETWEEN lisv.data_iniz AND lisv.data_fine ))) )\n" +
|
||||
" SELECT vtb_list.cod_vlis, \n" +
|
||||
" vtb_list.descrizione, \n" +
|
||||
" vtb_list_data.data_iniz, \n" +
|
||||
" vtb_list_data.data_fine,\n" +
|
||||
" vtb_list_data.cod_promo,\n" +
|
||||
" vtb_list_data.versione, \n" +
|
||||
" vtb_list.cod_divi,\n" +
|
||||
" vtb_list.flag_arr_prz_iva, \n" +
|
||||
" vtb_list.arr_ric,\n" +
|
||||
" vtb_list.flag_list_iva_inclusa,\n" +
|
||||
" vtb_list.flag_lisv_margine, \n" +
|
||||
" mtb_lisv_data.cod_mart as cod_mart, \n" +
|
||||
" mtb_lisv_data.unt_mis_ven as unt_mis_ven,\n" +
|
||||
" mtb_lisv_data.rap_conv as rap_conv, \n" +
|
||||
" mtb_lisv_data.prz_base as prz_base, \n" +
|
||||
" mtb_lisv_data.ricarica as ricarico,\n" +
|
||||
" \n" +
|
||||
" CASE\n" +
|
||||
" WHEN mtb_lisv_data.prz_vend IS NOT NULL AND mtb_lisv_data.prz_vend <> 0 THEN\n" +
|
||||
" ROUND((ISNULL(mtb_lisv_data.prz_vend, 0) -\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100))) /\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_vend, 0) * 100, 2)\n" +
|
||||
" ELSE 0 END AS margine_eff,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN mtb_lisv_data.prz_base IS NOT NULL AND mtb_lisv_data.prz_base <> 0 THEN\n" +
|
||||
" ROUND((ISNULL(mtb_lisv_data.prz_vend, 0) -\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100))) /\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100)) * 100, 2)\n" +
|
||||
" ELSE 0 END AS ricarico_eff,\n" +
|
||||
" mtb_lisv_data.prz_vend as prz_vend, \n" +
|
||||
" mtb_lisv_data.prz_vend_iva as prz_vend_iva, \n" +
|
||||
" mtb_lisv_data.perc_sco1 as perc_sco1, \n" +
|
||||
" mtb_lisv_data.perc_sco2 as perc_sco2, \n" +
|
||||
" mtb_lisv_data.perc_sco3 as perc_sco3, \n" +
|
||||
" mtb_lisv_data.perc_sco4 as perc_sco4, \n" +
|
||||
" mtb_lisv_data.perc_prov as perc_prov, \n" +
|
||||
" mtb_lisv_data.fisso_prov as fisso_prov, \n" +
|
||||
" mtb_lisv_data.posizione as posizione, \n" +
|
||||
" mtb_lisv_data.perc_gest as perc_gest, \n" +
|
||||
" mtb_lisv_data.val_gest as val_gest, \n" +
|
||||
" mtb_lisv_data.data_agg_prz as data_agg_prz, \n" +
|
||||
" mtb_lisv_data.perc_ispe as perc_ispe, \n" +
|
||||
" mtb_lisv_data.val_ispe as val_ispe, \n" +
|
||||
" mtb_lisv_data.perc_promo as perc_promo, \n" +
|
||||
" mtb_lisv_data.val_promo as val_promo, \n" +
|
||||
" mtb_lisv_data.perc_oneri as perc_oneri, \n" +
|
||||
" mtb_lisv_data.val_oneri as val_oneri, \n" +
|
||||
" mtb_lisv_data.tipo_variazione as tipo_variazione, \n" +
|
||||
" mtb_lisv_data.note as note,\n" +
|
||||
" mtb_lisv_data.aggiornato_da as aggiornato_da,\n" +
|
||||
" mtb_lisv_data.prz_vend * (1 - mtb_lisv_data.perc_sco1/100) * (1 - mtb_lisv_data.perc_sco2/100)* (1 - mtb_lisv_data.perc_sco3/100)* (1 - mtb_lisv_data.perc_sco4/100) as prz_vend_netto,\n" +
|
||||
" vtb_promo.descrizione as 'descr_promo',\n" +
|
||||
" vtb_promo.data_iniz_sell_out,\n" +
|
||||
" vtb_promo.data_fine_sell_out,\n" +
|
||||
" vtb_promo.flag_tipo_promo,\n" +
|
||||
" mtb_lisv_data.sconto_cartoni,\n" +
|
||||
" mtb_lisv_data.sconto_strato,\n" +
|
||||
" mtb_lisv_data.sconto_pedane,\n" +
|
||||
" mtb_lisv_data.giacenza,\n" +
|
||||
" mtb_lisv_data.magg_prz_vend,\n" +
|
||||
" vtb_promo.flag_sconto_contrattuale,\n" +
|
||||
" vtb_promo.intercode_xml_variazioni,\n" +
|
||||
" vtb_list_data.note as note_testata,\n" +
|
||||
" vtb_promo.flag_tipologia\n" +
|
||||
" FROM vtb_list inner join testata_lisv vtb_list_data on vtb_list.cod_vlis = vtb_list_data.cod_vlis_rif\n" +
|
||||
" inner join mtb_lisv_data on vtb_list_data.cod_vlis_rif = mtb_lisv_data.cod_vlis AND vtb_list_data.versione_rif = mtb_lisv_data.versione\n" +
|
||||
" inner join mtb_aart on mtb_lisv_data.cod_mart = mtb_aart.cod_mart\n" +
|
||||
" inner join vtb_promo on vtb_list_data.cod_promo = vtb_promo.cod_promo \n" +
|
||||
" WHERE (@codMart IS NULL OR mtb_lisv_data.cod_mart = @codMart)");
|
||||
}
|
||||
|
||||
@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_20240917172212 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomer(IntegryCustomer.Carelli)) return;
|
||||
|
||||
updateSetupValue("IMPORT_RAPPORTINI FG", "MMPOS", "ATTIVO", "N");
|
||||
}
|
||||
|
||||
@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.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240918101510 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement("CREATE TABLE gtb_banc_azi_intercode (\n" +
|
||||
"\tid BIGINT IDENTITY NOT NULL, \n" +
|
||||
"\tcod_banc_azi VARCHAR(5) NOT NULL, \n" +
|
||||
"\tformato VARCHAR(40) NOT NULL, \n" +
|
||||
"\tintercode VARCHAR(40) NOT NULL,\n" +
|
||||
"\tUNIQUE (cod_banc_azi, formato),\n" +
|
||||
"CONSTRAINT PK_gtb_banc_azi_intercode PRIMARY KEY (id),\n" +
|
||||
"CONSTRAINT FK_gtb_banc_azi_intercode FOREIGN KEY (cod_banc_azi) REFERENCES gtb_banc_azi(cod_banc_azi));");
|
||||
}
|
||||
|
||||
@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.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240918124524 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement("CREATE TABLE gtb_tipi_paga_intercode (\n" +
|
||||
"\tid BIGINT IDENTITY NOT NULL, \n" +
|
||||
"\ttipo_paga VARCHAR(10) NOT NULL, \n" +
|
||||
"\tformato VARCHAR(40) NOT NULL, \n" +
|
||||
"\tintercode VARCHAR(40) NOT NULL,\n" +
|
||||
"\tUNIQUE (tipo_paga, formato),\n" +
|
||||
"CONSTRAINT PK_gtb_tipi_paga_intercode PRIMARY KEY (id),\n" +
|
||||
"CONSTRAINT FK_gtb_tipi_paga_intercode FOREIGN KEY (tipo_paga) REFERENCES gtb_tipi_paga(tipo_paga));");
|
||||
}
|
||||
|
||||
@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.MigrationModelInterface;
|
||||
import it.integry.ems_model.utility.dto.IndexTableDTO;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Migration_20240918142402 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
IndexTableDTO indexTableDTO = new IndexTableDTO()
|
||||
.setIndexName("ix_stb_files_attached_2")
|
||||
.setTableName("stb_files_attached")
|
||||
.setColumnsIndex(Arrays.asList(
|
||||
new IndexTableDTO.ColumnIndex("parent_id_attach")))
|
||||
.setColumnsInclude("id_attach", "file_name")
|
||||
.setOverride(true);
|
||||
createIndex(indexTableDTO);
|
||||
|
||||
}
|
||||
|
||||
@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_20240919114540 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
updateSetupValue("DATI_AZIENDA", "FATTURA_ELETTRONICA", "INSERT_DDT", "S");
|
||||
}
|
||||
|
||||
@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.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240919130154 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
dropFunction("getListinoVenditaOld");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,319 @@
|
||||
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;
|
||||
import it.integry.ems_model.entity.WtbJrept;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
|
||||
public class Migration_20240920113346 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
createOrUpdateView("vvw_contratti_vendita", "CREATE VIEW [dbo].[vvw_contratti_vendita] AS\n" +
|
||||
"WITH depo AS (SELECT TOP 1 cod_mdep\n" +
|
||||
" FROM mtb_depo\n" +
|
||||
" WHERE mtb_depo.flag_movimentabile = 'S'\n" +
|
||||
" AND (cod_anag IS NULL OR cod_anag IN (SELECT gtb_anag.cod_anag\n" +
|
||||
" FROM gtb_anag,\n" +
|
||||
" azienda\n" +
|
||||
" WHERE gtb_anag.part_iva = azienda.part_iva))),\n" +
|
||||
" contratto AS (SELECT vtb_offt.cod_anag,\n" +
|
||||
" vtb_offt.cod_vdes,\n" +
|
||||
" vtb_offt.note,\n" +
|
||||
" vtb_offr.id_offerta,\n" +
|
||||
" vtb_offr.cod_mart,\n" +
|
||||
" vtb_offr.unt_mis,\n" +
|
||||
" vtb_offr.descrizione,\n" +
|
||||
" vtb_offr.descrizione_html,\n" +
|
||||
" vtb_offr.json_costi,\n" +
|
||||
" vtb_offr.costo_unt,\n" +
|
||||
" vtb_offr.unt_mis_vend,\n" +
|
||||
" vtb_offr.prz_unt,\n" +
|
||||
" vtb_offr.qta_off,\n" +
|
||||
" vtb_offr.data_iniz_contr,\n" +
|
||||
" vtb_offr.data_fine_contr,\n" +
|
||||
" vtb_offt.cod_paga,\n" +
|
||||
" vtb_offr.perc_sco1,\n" +
|
||||
" vtb_offr.perc_sco2,\n" +
|
||||
" vtb_offr.perc_sco3,\n" +
|
||||
" vtb_offr.perc_sco4,\n" +
|
||||
" vtb_offr.rap_conv_vend,\n" +
|
||||
" vtb_offr.qta_ord,\n" +
|
||||
" vtb_offr.qta_doc\n" +
|
||||
" FROM vtb_offt\n" +
|
||||
" INNER JOIN vtb_offr ON vtb_offt.id_offerta = vtb_offr.id_offerta\n" +
|
||||
" CROSS APPLY [dbo].[getUntMisArticolo](vtb_offr.cod_mart, vtb_offr.unt_mis_vend) um\n" +
|
||||
" WHERE stato_offerta = 3)\n" +
|
||||
"\n" +
|
||||
"SELECT contratto.data_iniz_contr AS data_iniz,\n" +
|
||||
" contratto.data_fine_contr AS data_fine,\n" +
|
||||
" contratto.id_offerta AS id_contratto,\n" +
|
||||
" contratto.note,\n" +
|
||||
" contratto.cod_mart,\n" +
|
||||
" contratto.descrizione AS descrizione_articolo,\n" +
|
||||
" contratto.unt_mis_vend AS unt_mis_ven,\n" +
|
||||
" contratto.qta_off AS qta_vend_contratto,\n" +
|
||||
" contratto.prz_unt AS prz_vend,\n" +
|
||||
" contratto.perc_sco1,\n" +
|
||||
" contratto.perc_sco2,\n" +
|
||||
" contratto.perc_sco3,\n" +
|
||||
" contratto.perc_sco4,\n" +
|
||||
" ISNULL(contratto.qta_ord, 0) AS qta_ord,\n" +
|
||||
" ISNULL(contratto.qta_doc, 0) AS qta_doc,\n" +
|
||||
" gtb_anag.cod_anag,\n" +
|
||||
" gtb_anag.rag_soc,\n" +
|
||||
" gtb_anag.indirizzo,\n" +
|
||||
" gtb_anag.cap,\n" +
|
||||
" gtb_anag.citta,\n" +
|
||||
" gtb_anag.prov,\n" +
|
||||
" gtb_anag.nazione,\n" +
|
||||
" gtb_anag.e_mail,\n" +
|
||||
" gtb_anag.telefono,\n" +
|
||||
" gtb_anag.part_iva,\n" +
|
||||
" ISNULL(giacenza.qta_disp * rap_conv_vend, 0) AS qta_disp,\n" +
|
||||
" (SELECT cod_mdep FROM depo) AS cod_mdep,\n" +
|
||||
" contratto.prz_unt * (1 - contratto.perc_sco1 / 100) * (1 - contratto.perc_sco2 / 100) -\n" +
|
||||
" (1 * contratto.perc_sco3 / 100) *\n" +
|
||||
" (1 - contratto.perc_sco4 / 100) AS prz_vend_netto,\n" +
|
||||
" contratto.cod_paga,\n" +
|
||||
" gtb_paga.descrizione AS descrizione_paga,\n" +
|
||||
" contratto.qta_off -\n" +
|
||||
" ISNULL(contratto.qta_ord, 0) -\n" +
|
||||
" ISNULL(contratto.qta_doc, 0) AS qta_residua,\n" +
|
||||
" ISNULL(contratto.qta_ord + contratto.qta_doc, 0) AS qta_usata,\n" +
|
||||
" contratto.rap_conv_vend AS rap_conv,\n" +
|
||||
" contratto.cod_vdes,\n" +
|
||||
" vd.destinatario,\n" +
|
||||
" vd.indirizzo AS indirizzo_dest,\n" +
|
||||
" vc.cod_vlis\n" +
|
||||
"FROM contratto\n" +
|
||||
" INNER JOIN gtb_anag ON contratto.cod_anag = gtb_anag.cod_anag\n" +
|
||||
" INNER JOIN vtb_clie vc ON contratto.cod_anag = vc.cod_anag\n" +
|
||||
" LEFT OUTER JOIN vtb_dest vd ON contratto.cod_anag = vd.cod_anag AND contratto.cod_vdes = vd.cod_vdes\n" +
|
||||
" LEFT OUTER JOIN gtb_paga ON contratto.cod_paga = gtb_paga.cod_paga\n" +
|
||||
" OUTER APPLY (SELECT SUM(mtb_part.qta_esistente + mtb_part.qta_imp_lav - mtb_part.qta_imp_cli) AS qta_disp\n" +
|
||||
" FROM mtb_part\n" +
|
||||
" INNER JOIN mtb_depo ON mtb_part.cod_mdep = mtb_depo.cod_mdep\n" +
|
||||
" WHERE mtb_depo.flag_movimentabile = 'S'\n" +
|
||||
" AND mtb_part.cod_mart = contratto.cod_mart) giacenza");
|
||||
|
||||
createOrUpdateFunction("pvm_getassortimentoCliente", "CREATE FUNCTION [dbo].[pvm_getassortimentoCliente](\n" +
|
||||
" @codAnag VARCHAR(5), @codVlis VARCHAR(5), @codVdes VARCHAR(5), @dataValidita DATETIME, @viewPromo BIT\n" +
|
||||
")\n" +
|
||||
" RETURNS TABLE\n" +
|
||||
" AS\n" +
|
||||
" RETURN( /*\n" +
|
||||
"\n" +
|
||||
" declare @codAnag VARCHAR(5), @codVlis VARCHAR(5), @dataValidita DATETIME, @viewPromo BIT\n" +
|
||||
" set @codAnag = 'C3355'\n" +
|
||||
" set @codVlis = 'C3355'\n" +
|
||||
" set @dataValidita = '2023/04/04'\n" +
|
||||
" set @viewPromo = 1;\n" +
|
||||
" */\n" +
|
||||
" WITH assortimento AS (SELECT vtb_griglia_art.cod_mart\n" +
|
||||
" FROM vtb_clie\n" +
|
||||
" INNER JOIN vtb_griglia ON vtb_clie.cod_griglia = vtb_griglia.cod_griglia\n" +
|
||||
" INNER JOIN vtb_griglia_art\n" +
|
||||
" ON vtb_griglia.cod_griglia = vtb_griglia_art.cod_griglia AND\n" +
|
||||
" vtb_griglia.data_validita = vtb_griglia_art.data_validita\n" +
|
||||
" WHERE vtb_clie.cod_anag = @codAnag\n" +
|
||||
" AND vtb_griglia.data_validita = (SELECT MAX(g.data_validita)\n" +
|
||||
" FROM vtb_griglia g\n" +
|
||||
" WHERE g.cod_griglia = vtb_clie.cod_griglia\n" +
|
||||
" AND g.data_validita <= ISNULL(@dataValidita, CAST(GETDATE() AS DATE)))),\n" +
|
||||
" lisv AS (SELECT cod_vlis, cod_vlis AS cod_vlis_rif\n" +
|
||||
" FROM vtb_list\n" +
|
||||
" WHERE cod_vlis_rif IS NULL\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT cod_vlis, cod_vlis_rif\n" +
|
||||
" FROM vtb_list\n" +
|
||||
" WHERE cod_vlis_rif IS NOT NULL),\n" +
|
||||
" listino AS (SELECT DISTINCT cod_mart, tipo_variazione\n" +
|
||||
" FROM (SELECT lisv.cod_vlis,\n" +
|
||||
" mtb_lisv.cod_mart,\n" +
|
||||
" LAST_VALUE(CASE\n" +
|
||||
" WHEN vtb_list_data.data_iniz IS NULL THEN NULL\n" +
|
||||
" ELSE mtb_lisv_data.tipo_variazione END)\n" +
|
||||
" OVER (PARTITION BY lisv.cod_vlis, mtb_lisv.cod_mart\n" +
|
||||
" ORDER BY vtb_list_data.data_iniz, CASE WHEN vtb_list_data.cod_promo IS NULL THEN 0 ELSE 1 END, vtb_list_data.versione\n" +
|
||||
" RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS tipo_variazione\n" +
|
||||
" FROM lisv\n" +
|
||||
" INNER JOIN mtb_lisv ON lisv.cod_vlis_rif = mtb_lisv.cod_vlis\n" +
|
||||
" INNER JOIN mtb_lisv_data ON mtb_lisv.cod_vlis = mtb_lisv_data.cod_vlis AND\n" +
|
||||
" mtb_lisv.cod_mart = mtb_lisv_data.cod_mart\n" +
|
||||
" LEFT OUTER JOIN vtb_list_data\n" +
|
||||
" ON mtb_lisv_data.cod_vlis = vtb_list_data.cod_vlis AND\n" +
|
||||
" mtb_lisv_data.versione = vtb_list_data.versione AND\n" +
|
||||
" vtb_list_data.data_iniz <=\n" +
|
||||
" ISNULL(@dataValidita, CAST(GETDATE() AS DATE))\n" +
|
||||
" WHERE lisv.cod_vlis = @codVlis\n" +
|
||||
" AND NOT EXISTS(SELECT cod_mart FROM assortimento)) t\n" +
|
||||
" WHERE (t.tipo_variazione IS NULL OR t.tipo_variazione <> 'D')),\n" +
|
||||
" tmp_lisv AS (SELECT l.cod_mart,\n" +
|
||||
" l.cod_vlis,\n" +
|
||||
" ISNULL(p.data_iniz, l.data_iniz) AS data_iniz,\n" +
|
||||
" ISNULL(p.prz_vend, l.prz_vend) AS prz_vend,\n" +
|
||||
" ISNULL(p.prz_vend_netto, l.prz_vend_netto) AS prz_vend_netto,\n" +
|
||||
" ISNULL(p.perc_sco1, l.perc_sco1) AS perc_sco1,\n" +
|
||||
" ISNULL(p.perc_sco2, l.perc_sco2) AS perc_sco2,\n" +
|
||||
" ISNULL(p.perc_sco3, l.perc_sco3) AS perc_sco3,\n" +
|
||||
" ISNULL(p.perc_sco4, l.perc_sco4) AS perc_sco4,\n" +
|
||||
" CONVERT(NUMERIC(20, 5), 0) AS qta_residua,\n" +
|
||||
" CONVERT(BIGINT, NULL) AS id_contratto,\n" +
|
||||
" ISNULL(p.rap_conv, l.rap_conv) AS rap_conv,\n" +
|
||||
" ISNULL(p.note, l.note) AS note,\n" +
|
||||
" CAST(NULL AS VARCHAR(5)) AS cod_vdes,\n" +
|
||||
" l.cod_tcol_ul AS cod_tcol_ul,\n" +
|
||||
" ISNULL(p.unt_mis_ven, l.unt_mis_ven) AS unt_mis_ven,\n" +
|
||||
" l.colli_pedana AS colli_pedana,\n" +
|
||||
" ISNULL(p.tipo_variazione, l.tipo_variazione) AS tipo_variazione,\n" +
|
||||
" CONVERT(VARCHAR(1), CASE\n" +
|
||||
" WHEN p.cod_promo IS NULL THEN NULL\n" +
|
||||
" ELSE 'P' END) AS tipo_promo,\n" +
|
||||
" CONVERT(VARCHAR(5), NULL) AS cod_paga,\n" +
|
||||
" CONVERT(VARCHAR(5), NULL) AS descr_paga,\n" +
|
||||
" l.porto,\n" +
|
||||
" l.qta_cnf\n" +
|
||||
" FROM dbo.getListinoVendita(@dataValidita, @codVlis, NULL) l\n" +
|
||||
" LEFT OUTER JOIN dbo.getPromozioneVendita(@dataValidita, @dataValidita,\n" +
|
||||
" @codVlis, NULL, NULL) p\n" +
|
||||
" ON l.cod_vlis = p.cod_vlis AND l.cod_mart = p.cod_mart AND\n" +
|
||||
" ISNULL(@viewPromo, 0) = 1\n" +
|
||||
" WHERE l.cod_vlis = @codVlis\n" +
|
||||
" AND l.cod_mart IN (SELECT cod_mart\n" +
|
||||
" FROM assortimento\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT cod_mart\n" +
|
||||
" FROM listino)\n" +
|
||||
" AND l.tipo_variazione <> 'D'\n" +
|
||||
" AND l.tipo_variazione IS NOT NULL\n" +
|
||||
" AND l.flag_attivo = 'S'\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT l.cod_mart,\n" +
|
||||
" l.cod_vlis,\n" +
|
||||
" NULL AS data_iniz,\n" +
|
||||
" NULL AS prz_vend,\n" +
|
||||
" NULL AS prz_vend_netto,\n" +
|
||||
" NULL AS perc_sco1,\n" +
|
||||
" NULL AS perc_sco2,\n" +
|
||||
" NULL AS perc_sco3,\n" +
|
||||
" NULL AS perc_sco4,\n" +
|
||||
" NULL AS qta_residua,\n" +
|
||||
" NULL AS id_contratto,\n" +
|
||||
" um.rap_conv AS rap_conv,\n" +
|
||||
" NULL AS note,\n" +
|
||||
" CAST(NULL AS VARCHAR(5)) AS cod_vdes,\n" +
|
||||
" NULL AS cod_tcol_ul,\n" +
|
||||
" l.unt_mis_ven AS unt_mis_ven,\n" +
|
||||
" NULL AS colli_pedana,\n" +
|
||||
" NULL AS tipo_variazione,\n" +
|
||||
" NULL AS tipo_promo,\n" +
|
||||
" CONVERT(VARCHAR(5), NULL) AS cod_paga,\n" +
|
||||
" CONVERT(VARCHAR(5), NULL) AS descr_paga,\n" +
|
||||
" NULL porto,\n" +
|
||||
" mtb_aart.qta_cnf\n" +
|
||||
" FROM mtb_lisv l\n" +
|
||||
" INNER JOIN listino ON l.cod_mart = listino.cod_mart\n" +
|
||||
" INNER JOIN mtb_aart ON l.cod_mart = mtb_aart.cod_mart\n" +
|
||||
" CROSS APPLY dbo.getUntMisArticolo(l.cod_mart, l.unt_mis_ven) um\n" +
|
||||
" WHERE l.cod_vlis = @codVlis\n" +
|
||||
" AND listino.tipo_variazione IS NULL\n" +
|
||||
" UNION ALL\n" +
|
||||
" SELECT vvw_contratti_vendita.cod_mart,\n" +
|
||||
" NULL AS cod_vlis,\n" +
|
||||
" vvw_contratti_vendita.data_iniz,\n" +
|
||||
" vvw_contratti_vendita.prz_vend,\n" +
|
||||
" ROUND(vvw_contratti_vendita.prz_vend *\n" +
|
||||
" (1 - ISNULL(vvw_contratti_vendita.perc_sco1, 0))\n" +
|
||||
" * (1 - ISNULL(vvw_contratti_vendita.perc_sco2, 0))\n" +
|
||||
" * (1 - ISNULL(vvw_contratti_vendita.perc_sco3, 0))\n" +
|
||||
" * (1 - ISNULL(vvw_contratti_vendita.perc_sco4, 0)),\n" +
|
||||
" 5) AS prz_vend_netto,\n" +
|
||||
" vvw_contratti_vendita.perc_sco1,\n" +
|
||||
" vvw_contratti_vendita.perc_sco2,\n" +
|
||||
" vvw_contratti_vendita.perc_sco3,\n" +
|
||||
" vvw_contratti_vendita.perc_sco4,\n" +
|
||||
" vvw_contratti_vendita.qta_residua,\n" +
|
||||
" vvw_contratti_vendita.id_contratto,\n" +
|
||||
" vvw_contratti_vendita.rap_conv,\n" +
|
||||
" vvw_contratti_vendita.note,\n" +
|
||||
" vvw_contratti_vendita.cod_vdes,\n" +
|
||||
" NULL,\n" +
|
||||
" vvw_contratti_vendita.unt_mis_ven,\n" +
|
||||
" NULL,\n" +
|
||||
" NULL,\n" +
|
||||
" 'C' AS tipo_promo,\n" +
|
||||
" vvw_contratti_vendita.cod_paga,\n" +
|
||||
" vvw_contratti_vendita.descrizione_paga AS descr_paga,\n" +
|
||||
" NULL AS porto,\n" +
|
||||
" mtb_aart.qta_cnf\n" +
|
||||
" FROM vvw_contratti_vendita\n" +
|
||||
" INNER JOIN mtb_aart ON vvw_contratti_vendita.cod_mart = mtb_aart.cod_mart\n" +
|
||||
" WHERE vvw_contratti_vendita.cod_anag = @codAnag\n" +
|
||||
" AND (@codVdes IS NULL OR vvw_contratti_vendita.cod_vdes IS NULL OR\n" +
|
||||
" vvw_contratti_vendita.cod_vdes = @codVdes)\n" +
|
||||
" AND (ISNULL(@dataValidita, CAST(GETDATE() AS DATE)) BETWEEN\n" +
|
||||
" vvw_contratti_vendita.data_iniz AND vvw_contratti_vendita.data_fine)\n" +
|
||||
" AND vvw_contratti_vendita.qta_residua > 0)\n" +
|
||||
"\n" +
|
||||
" SELECT tmp_lisv.cod_mart,\n" +
|
||||
" ISNULL(maa.cod_mart_anag, tmp_lisv.cod_mart) AS cod_mart_anag,\n" +
|
||||
" cod_vlis,\n" +
|
||||
" data_iniz,\n" +
|
||||
" prz_vend,\n" +
|
||||
" prz_vend_netto,\n" +
|
||||
" perc_sco1,\n" +
|
||||
" perc_sco2,\n" +
|
||||
" perc_sco3,\n" +
|
||||
" perc_sco4,\n" +
|
||||
" qta_residua,\n" +
|
||||
" id_contratto,\n" +
|
||||
" rap_conv,\n" +
|
||||
" ISNULL(maa.note, tmp_lisv.note) AS note,\n" +
|
||||
" cod_tcol_ul,\n" +
|
||||
" unt_mis_ven,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN maa.colli_pedana IS NULL OR maa.colli_pedana = 0 THEN tmp_lisv.colli_pedana\n" +
|
||||
" ELSE maa.colli_pedana END AS colli_pedana,\n" +
|
||||
" tipo_variazione,\n" +
|
||||
" tipo_promo,\n" +
|
||||
" cod_paga,\n" +
|
||||
" descr_paga,\n" +
|
||||
" porto,\n" +
|
||||
" qta_cnf,\n" +
|
||||
" CAST(CASE WHEN tmp_lisv.data_iniz IS NULL THEN 0 ELSE 1 END AS BIT) AS art_lisv,\n" +
|
||||
" cod_vdes\n" +
|
||||
" FROM tmp_lisv\n" +
|
||||
" LEFT OUTER JOIN mtb_aart_anag maa\n" +
|
||||
" ON tmp_lisv.cod_mart = maa.cod_mart AND maa.cod_anag = @codAnag)");
|
||||
|
||||
// Prova modifica report in migration
|
||||
// if (isCustomerDb(IntegryCustomerDB.Biolevante_Biolevante)) {
|
||||
// String jrxml = "";
|
||||
// jrxml = Base64.getEncoder().encodeToString(jrxml.getBytes());
|
||||
//
|
||||
// WtbJrept wtbJrept = new WtbJrept()
|
||||
// .setId(15L)
|
||||
// .setB64Jrxml(jrxml);
|
||||
//
|
||||
// wtbJrept.setOperation(OperationType.UPDATE);
|
||||
// wtbJrept.manageWithParentConnection(advancedDataSource.getConnection(), droolsDataCompleting);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
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_20240920165453 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Salpar_MasabaSrl))
|
||||
return;
|
||||
|
||||
createSetup("IMPORT_ORDINI", "PUDDY", "ATTIVO", "S",
|
||||
"Inserire S/N per attivare/disattivare il tipo di importazione", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_ORDINI", "PUDDY", "EMAIL_FOR_LOG", "test@integry.it",
|
||||
"Inserire il file l'indirizzo email per inviare il log dell'importazione", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_ORDINI", "PUDDY", "FILE_FILTER", null,
|
||||
"Inserire il criterio di filtro dei file o il nome del file specifio (seguire la sintassi di java)", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_ORDINI", "PUDDY", "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("IMPORT_ORDINI", "PUDDY", "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("IMPORT_ORDINI", "PUDDY", "LISTENING", "N",
|
||||
"Se LISTENIG = 'N' la procedura di importazione non si potrà mai mettere in ascolto sulla directory perchè nella procedura vengono prese in considerazione più file.", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_ORDINI", "PUDDY", "PATH_FILE", null,
|
||||
"Directory contente i file da importare.", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_ORDINI", "PUDDY", "PATH_FILE_IMPORTED", null,
|
||||
"Directory dove vengono spostati i file dopo l'importazione.", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@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.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240920170705 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Salpar_MasabaSrl))
|
||||
return;
|
||||
|
||||
createSetup("IMPORT_ORDINI", "PUDDY", "PROFILE_DB_VG", "VGALIMENTI",
|
||||
"Profile per la connessione al DB VGAlimenti", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@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.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240923111741 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("IMPORT_COLLI", "DESADV", "ATTIVO", "N",
|
||||
"Inserire S/N per attivare/disattivare il tipo di importazione", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_COLLI", "DESADV", "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("IMPORT_COLLI", "DESADV", "FILE_FILTER", null,
|
||||
"Inserire il criterio di filtro dei file o il nome del file specifio (seguire la sintassi di java)", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_COLLI", "DESADV", "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("IMPORT_COLLI", "DESADV", "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("IMPORT_COLLI", "DESADV", "LISTENING", "N",
|
||||
"Se LISTENIG = 'N' la procedura di importazione non si potrà mai mettere in ascolto sulla directory perchè nella procedura vengono prese in considerazione più file.", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_COLLI", "DESADV", "PATH_FILE", null,
|
||||
"Directory contente i file da importare.", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
createSetup("IMPORT_COLLI", "DESADV", "PATH_FILE_IMPORTED", null,
|
||||
"Directory dove vengono spostati i file dopo l'importazione.", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
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_20240923125840 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB() || !isTextiles())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
executeStatement(
|
||||
"UPDATE Wdtb_ordt\n" +
|
||||
"SET Wdtb_ordt.user_name =\n" +
|
||||
" (SELECT user_name\n" +
|
||||
" FROM stb_user\n" +
|
||||
" WHERE Wdtb_ordt.compilato_da = stb_user.full_name\n" +
|
||||
" AND stb_user.flag_attivo = 'S'\n" +
|
||||
" AND stb_user.key_group = 5)\n" +
|
||||
"FROM wdtb_ordt\n" +
|
||||
"WHERE data_ord >= '2024.1.1'\n" +
|
||||
" AND Wdtb_ordt.user_name IS NULL"
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
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_20240924095921 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
String reportNameSchedaScar = null;
|
||||
String reportNameCertificati = null;
|
||||
String reportNameDettaglioValore = null;
|
||||
String reportNameSchedaVersamento = null;
|
||||
String reportNameSchedaTraspPomodori = null;
|
||||
|
||||
|
||||
if (isCustomer(IntegryCustomer.RossoGargano)) {
|
||||
reportNameSchedaScar = "SchedaGestioneScaricoProdotto";
|
||||
reportNameSchedaVersamento = "SchedaVersamentoProdotto";
|
||||
reportNameSchedaTraspPomodori = "SchedaTrasportiPomodoro";
|
||||
reportNameCertificati = "CertificatoConsegnaIndustrie";
|
||||
reportNameDettaglioValore = "DettaglioMovimentiAValore";
|
||||
}
|
||||
|
||||
|
||||
createSetup("PVM", "PIAN_ACC_ROSSG", "REPORT_NAME_CERTIFICATI", reportNameCertificati, "Nome report stampa certificato", "REPORT_NAME");
|
||||
createSetup("PVM", "PIAN_ACC_ROSSG", "REPORT_NAME_DET_VALORE", reportNameDettaglioValore, "Nome report scheda dettaglio a valore", "REPORT_NAME");
|
||||
createSetup("PVM", "PIAN_ACC_ROSSG", "REPORT_NAME_SCHEDA_SCAR", reportNameSchedaScar, "Nome report scheda gestione scarico prodotti", "REPORT_NAME");
|
||||
createSetup("PVM", "PIAN_ACC_ROSSG", "REPORT_NAME_SCHEDA_VERSAMENTO", reportNameSchedaVersamento, "Nome report Scheda versamento prodotto", "REPORT_NAME");
|
||||
createSetup("PVM", "PIAN_ACC_ROSSG", "REPORT_NAME_SCHEDA_TRASP_POMODORO", reportNameSchedaTraspPomodori, "Nome report Scheda trasporto pomodori", "REPORT_NAME");
|
||||
}
|
||||
|
||||
@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.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240924152410 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
executeStatement("alter table jtb_flav add altre_mansioni varchar(8000)");
|
||||
}
|
||||
|
||||
@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.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240924155208 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Gramm_Gramm))
|
||||
return;
|
||||
|
||||
createSetup("W_VDISKCONAD_DLG", "FILCONAD", "FLAG_VIS_RIF_BOLLA_LISTINO_3115", "S",
|
||||
"Se impostato a S nel generare il file FILCONAD per i documenti con listino 3115 nel file al posto dei riferimenti della fattura verranno specificati i riferimento della bolla", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@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