Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
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>
|
||||
@@ -0,0 +1,452 @@
|
||||
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.entity.*;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
|
||||
public class Migration_20240930110848 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB() || !isCustomer(IntegryCustomer.Tosca))
|
||||
return;
|
||||
|
||||
updateSetupValue("w_dordi_rc", "CREA_COMMESSA", "AUTO_GENERATE","N");
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Tosca_Cloud)) {
|
||||
executeStatement("SET IDENTITY_INSERT tosca_cloud.dbo.stb_publications ON;");
|
||||
executeStatement("INSERT INTO stb_publications (id, publication_description) VALUES (10, N'Sincronizzazione Anagrafiche');");
|
||||
executeStatement("INSERT INTO stb_publications (id, publication_description) VALUES (11, N'Sincronizzazione impegnato (Triggiano)');");
|
||||
executeStatement("INSERT INTO stb_publications (id, publication_description) VALUES (12, N'Sincronizzazione impegnato (Caserta)');");
|
||||
executeStatement("INSERT INTO stb_publications (id, publication_description) VALUES (13, N'Sincronizzazione impegnato (Catanzaro)');");
|
||||
executeStatement("INSERT INTO stb_publications (id, publication_description) VALUES (14, N'Sincronizzazione impegnato (Forlì-Cesena)');");
|
||||
executeStatement("INSERT INTO stb_publications (id, publication_description) VALUES (15, N'Sincronizzazione impegnato (Milano)');");
|
||||
executeStatement("INSERT INTO stb_publications (id, publication_description) VALUES (16, N'Sincronizzazione impegnato (Ragusa)');");
|
||||
executeStatement("INSERT INTO stb_publications (id, publication_description) VALUES (17, N'Sincronizzazione impegnato (Roma)');");
|
||||
executeStatement("INSERT INTO stb_publications (id, publication_description) VALUES (18, N'Sincronizzazione impegnato (Verona)');");
|
||||
executeStatement("SET IDENTITY_INSERT tosca_cloud.dbo.stb_publications OFF;");
|
||||
|
||||
//<editor-fold desc="Pubblicazione anagrafiche">
|
||||
StbPublications anagPublication = new StbPublications();
|
||||
anagPublication
|
||||
.setId(10L)
|
||||
.setPublicationDescription("Sincronizzazione Anagrafiche");
|
||||
anagPublication.setOperation(OperationType.NO_OP);
|
||||
|
||||
StbPublicationsDetail detailGtbAnag = new StbPublicationsDetail();
|
||||
detailGtbAnag
|
||||
.setActive(true)
|
||||
.setStbPublicationId(10L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(GtbAnag.ENTITY)
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
anagPublication.getStbPublicationsDetails().add(detailGtbAnag);
|
||||
|
||||
StbPublicationsDetail detailVtbDest = new StbPublicationsDetail();
|
||||
detailVtbDest.setActive(true)
|
||||
.setStbPublicationId(10L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(VtbDest.ENTITY)
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
anagPublication.getStbPublicationsDetails().add(detailVtbDest);
|
||||
|
||||
StbPublicationsDetail detailMtbDepo = new StbPublicationsDetail();
|
||||
detailMtbDepo.setActive(true)
|
||||
.setStbPublicationId(10L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(MtbDepo.ENTITY)
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
anagPublication.getStbPublicationsDetails().add(detailMtbDepo);
|
||||
|
||||
StbPublicationsDetail detailVtbClie = new StbPublicationsDetail();
|
||||
detailVtbClie
|
||||
.setActive(true)
|
||||
.setStbPublicationId(10L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(VtbClie.ENTITY)
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
anagPublication.getStbPublicationsDetails().add(detailVtbClie);
|
||||
|
||||
StbPublicationsDetail detailAtbForn = new StbPublicationsDetail();
|
||||
detailAtbForn
|
||||
.setActive(true)
|
||||
.setStbPublicationId(10L)
|
||||
.setEntityName(AtbForn.ENTITY)
|
||||
.setReadyToTransmit(true)
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
anagPublication.getStbPublicationsDetails().add(detailAtbForn);
|
||||
|
||||
anagPublication.manageWithParentConnection(advancedDataSource.getConnection(),droolsDataCompleting);
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Pubblicazione impegnato (Triggiano)">
|
||||
StbPublications impegnatoTriggiano = new StbPublications();
|
||||
impegnatoTriggiano.setId(11L).setPublicationDescription("Sincronizzazione impegnato (Triggiano)");
|
||||
impegnatoTriggiano.setOperation(OperationType.NO_OP);
|
||||
|
||||
StbPublicationsDetail detailDtbOrdtBA = new StbPublicationsDetail();
|
||||
detailDtbOrdtBA
|
||||
.setStbPublicationId(11L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(DtbOrdt.ENTITY)
|
||||
.setWhereCondField("gestione = 'V' AND codMdep = 'BA'")
|
||||
.setActive(true)
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
impegnatoTriggiano.getStbPublicationsDetails().add(detailDtbOrdtBA);
|
||||
|
||||
|
||||
StbPublicationsDetail detailDtbOrdrBA = new StbPublicationsDetail();
|
||||
detailDtbOrdrBA
|
||||
.setStbPublicationId(11L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(DtbOrdr.ENTITY)
|
||||
.setActive(true)
|
||||
.setWhereCondField("gestione = 'V' AND codMdep = 'BA'")
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
impegnatoTriggiano.getStbPublicationsDetails().add(detailDtbOrdrBA);
|
||||
impegnatoTriggiano.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Pubblicazione impegnato (Caserta)">
|
||||
StbPublications impegnatoCaserta = new StbPublications();
|
||||
impegnatoCaserta.setId(12L).setPublicationDescription("Sincronizzazione impegnato (Caserta)");
|
||||
impegnatoCaserta.setOperation(OperationType.NO_OP);
|
||||
|
||||
StbPublicationsDetail detailDtbOrdtCE = new StbPublicationsDetail();
|
||||
detailDtbOrdtCE
|
||||
.setStbPublicationId(12L)
|
||||
.setEntityName(DtbOrdt.ENTITY)
|
||||
.setReadyToTransmit(true)
|
||||
.setWhereCondField("gestione = 'V' AND codMdep = 'CE'")
|
||||
.setActive(true)
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
impegnatoCaserta.getStbPublicationsDetails().add(detailDtbOrdtCE);
|
||||
|
||||
|
||||
StbPublicationsDetail detailDtbOrdrCE = new StbPublicationsDetail();
|
||||
detailDtbOrdrCE
|
||||
.setStbPublicationId(12L)
|
||||
.setEntityName(DtbOrdr.ENTITY)
|
||||
.setReadyToTransmit(true)
|
||||
.setActive(true)
|
||||
.setWhereCondField("gestione = 'V' AND codMdep = 'CE'")
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
impegnatoCaserta.getStbPublicationsDetails().add(detailDtbOrdrCE);
|
||||
impegnatoCaserta.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Pubblicazione impegnato (Catanzaro)">
|
||||
StbPublications impegnatoCatanzaro = new StbPublications();
|
||||
impegnatoCatanzaro.setId(13L).setPublicationDescription("Sincronizzazione impegnato (Catanzaro)");
|
||||
impegnatoCatanzaro.setOperation(OperationType.NO_OP);
|
||||
|
||||
StbPublicationsDetail detailDtbOrdtCZ = new StbPublicationsDetail();
|
||||
detailDtbOrdtCZ
|
||||
.setStbPublicationId(13L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(DtbOrdt.ENTITY)
|
||||
.setWhereCondField("gestione = 'V' AND codMdep = 'CZ'")
|
||||
.setActive(true)
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
impegnatoCatanzaro.getStbPublicationsDetails().add(detailDtbOrdtCZ);
|
||||
|
||||
|
||||
StbPublicationsDetail detailDtbOrdrCZ = new StbPublicationsDetail();
|
||||
detailDtbOrdrCZ
|
||||
.setStbPublicationId(13L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(DtbOrdr.ENTITY)
|
||||
.setActive(true)
|
||||
.setWhereCondField("gestione = 'V' AND codMdep = 'CZ'")
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
impegnatoCatanzaro.getStbPublicationsDetails().add(detailDtbOrdrCZ);
|
||||
impegnatoCatanzaro.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Pubblicazione impegnato (Forlì-Cesena)">
|
||||
StbPublications impegnatoFC = new StbPublications();
|
||||
impegnatoFC.setId(14L).setPublicationDescription("Sincronizzazione impegnato (Forlì-Cesena)");
|
||||
impegnatoFC.setOperation(OperationType.NO_OP);
|
||||
|
||||
StbPublicationsDetail detailDtbOrdtFC = new StbPublicationsDetail();
|
||||
detailDtbOrdtFC
|
||||
.setStbPublicationId(14L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(DtbOrdt.ENTITY)
|
||||
.setWhereCondField("gestione = 'V' AND codMdep = 'FC'")
|
||||
.setActive(true)
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
impegnatoFC.getStbPublicationsDetails().add(detailDtbOrdtFC);
|
||||
|
||||
|
||||
StbPublicationsDetail detailDtbOrdrFC = new StbPublicationsDetail();
|
||||
detailDtbOrdrFC
|
||||
.setStbPublicationId(14L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(DtbOrdr.ENTITY)
|
||||
.setActive(true)
|
||||
.setWhereCondField("gestione = 'V' AND codMdep = 'FC'")
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
impegnatoFC.getStbPublicationsDetails().add(detailDtbOrdrFC);
|
||||
impegnatoFC.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Pubblicazione impegnato (Milano)">
|
||||
StbPublications impegnatoMI = new StbPublications();
|
||||
impegnatoMI.setId(15L).setPublicationDescription("Sincronizzazione impegnato (Milano)");
|
||||
impegnatoMI.setOperation(OperationType.NO_OP);
|
||||
|
||||
StbPublicationsDetail detailDtbOrdtMI = new StbPublicationsDetail();
|
||||
detailDtbOrdtMI
|
||||
.setStbPublicationId(15L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(DtbOrdt.ENTITY)
|
||||
.setWhereCondField("gestione = 'V' AND codMdep = 'MI'")
|
||||
.setActive(true)
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
impegnatoMI.getStbPublicationsDetails().add(detailDtbOrdtMI);
|
||||
|
||||
|
||||
StbPublicationsDetail detailDtbOrdrMI = new StbPublicationsDetail();
|
||||
detailDtbOrdrMI
|
||||
.setStbPublicationId(15L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(DtbOrdr.ENTITY)
|
||||
.setActive(true)
|
||||
.setWhereCondField("gestione = 'V' AND codMdep = 'MI'")
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
impegnatoMI.getStbPublicationsDetails().add(detailDtbOrdrMI);
|
||||
impegnatoMI.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Pubblicazione impegnato (Ragusa)">
|
||||
StbPublications impegnatoRG = new StbPublications();
|
||||
impegnatoRG.setId(16L).setPublicationDescription("Sincronizzazione impegnato (Ragusa)");
|
||||
impegnatoRG.setOperation(OperationType.NO_OP);
|
||||
|
||||
StbPublicationsDetail detailDtbOrdtRG = new StbPublicationsDetail();
|
||||
detailDtbOrdtRG
|
||||
.setStbPublicationId(16L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(DtbOrdt.ENTITY)
|
||||
.setWhereCondField("gestione = 'V' AND codMdep = 'RG'")
|
||||
.setActive(true)
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
impegnatoRG.getStbPublicationsDetails().add(detailDtbOrdtRG);
|
||||
|
||||
|
||||
StbPublicationsDetail detailDtbOrdrRG = new StbPublicationsDetail();
|
||||
detailDtbOrdrRG
|
||||
.setStbPublicationId(16L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(DtbOrdr.ENTITY)
|
||||
.setActive(true)
|
||||
.setWhereCondField("gestione = 'V' AND codMdep = 'RG'")
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
impegnatoRG.getStbPublicationsDetails().add(detailDtbOrdrRG);
|
||||
impegnatoRG.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Pubblicazione impegnato (Roma)">
|
||||
StbPublications impegnatoRoma = new StbPublications();
|
||||
impegnatoRoma.setId(17L).setPublicationDescription("Sincronizzazione impegnato (Roma)");
|
||||
impegnatoRoma.setOperation(OperationType.NO_OP);
|
||||
|
||||
StbPublicationsDetail detailDtbOrdtRM = new StbPublicationsDetail();
|
||||
detailDtbOrdtRM
|
||||
.setStbPublicationId(17L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(DtbOrdt.ENTITY)
|
||||
.setWhereCondField("gestione = 'V' AND codMdep = 'RM'")
|
||||
.setActive(true)
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
impegnatoRoma.getStbPublicationsDetails().add(detailDtbOrdtRM);
|
||||
|
||||
StbPublicationsDetail detailDtbOrdrRM = new StbPublicationsDetail();
|
||||
detailDtbOrdrRM
|
||||
.setStbPublicationId(17L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(DtbOrdr.ENTITY)
|
||||
.setActive(true)
|
||||
.setWhereCondField("gestione = 'V' AND codMdep = 'RM'")
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
impegnatoRoma.getStbPublicationsDetails().add(detailDtbOrdrRM);
|
||||
impegnatoRoma.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Pubblicazione impegnato (Verona)">
|
||||
StbPublications impegnatoVR = new StbPublications();
|
||||
impegnatoVR.setId(18L).setPublicationDescription("Sincronizzazione impegnato (Verona)");
|
||||
impegnatoVR.setOperation(OperationType.NO_OP);
|
||||
|
||||
StbPublicationsDetail detailDtbOrdtVR = new StbPublicationsDetail();
|
||||
detailDtbOrdtVR
|
||||
.setStbPublicationId(18L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(DtbOrdt.ENTITY)
|
||||
.setWhereCondField("gestione = 'V' AND codMdep = 'VR'")
|
||||
.setActive(true)
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
impegnatoVR.getStbPublicationsDetails().add(detailDtbOrdtVR);
|
||||
|
||||
|
||||
StbPublicationsDetail detailDtbOrdrVR = new StbPublicationsDetail();
|
||||
detailDtbOrdrVR
|
||||
.setStbPublicationId(18L)
|
||||
.setReadyToTransmit(true)
|
||||
.setEntityName(DtbOrdr.ENTITY)
|
||||
.setActive(true)
|
||||
.setWhereCondField("gestione = 'V' AND codMdep = 'VR'")
|
||||
.setExportHistory(false)
|
||||
.setOperation(OperationType.INSERT);
|
||||
impegnatoVR.getStbPublicationsDetails().add(detailDtbOrdrVR);
|
||||
impegnatoVR.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
//</editor-fold>
|
||||
} else {
|
||||
//<editor-fold desc="sottoscrizione anagrafiche">
|
||||
StbRemoteSubscription anagSubscription = new StbRemoteSubscription();
|
||||
anagSubscription
|
||||
.setActive(true)
|
||||
.setPublicationId(10L)
|
||||
.setPublicationDescription("Sincronizzazione anagrafiche clienti/fornitori")
|
||||
.setEndpointProtocol("HTTP")
|
||||
.setEndpointHost("4.232.161.31")
|
||||
.setEndpointPort(8080)
|
||||
.setUsernameField("dba")
|
||||
.setPassword("sql")
|
||||
.setProfileDb("TOSCA_CLOUD")
|
||||
.setOperation(OperationType.INSERT);
|
||||
anagSubscription.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
;
|
||||
//</editor-fold>
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Tosca_Ba)) {
|
||||
StbRemoteSubscription syncImpegnatoBa = new StbRemoteSubscription();
|
||||
syncImpegnatoBa.setActive(true)
|
||||
.setPublicationId(11L)
|
||||
.setProfileDb("TOSCA_CLOUD")
|
||||
.setPublicationDescription("Sincronizzazione impengato (Ba)")
|
||||
.setEndpointProtocol("HTTP")
|
||||
.setEndpointHost("4.232.161.31")
|
||||
.setEndpointPort(8080)
|
||||
.setUsernameField("dba")
|
||||
.setPassword("sql")
|
||||
.setOperation(OperationType.INSERT);
|
||||
syncImpegnatoBa.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
} else if (isCustomerDb(IntegryCustomerDB.Tosca_Ce)) {
|
||||
StbRemoteSubscription syncImpegnatoCe = new StbRemoteSubscription();
|
||||
syncImpegnatoCe.setActive(true)
|
||||
.setPublicationId(12L)
|
||||
.setProfileDb("TOSCA_CLOUD")
|
||||
.setPublicationDescription("Sincronizzazione impengato (Caserta)")
|
||||
.setEndpointProtocol("HTTP")
|
||||
.setEndpointHost("4.232.161.31")
|
||||
.setEndpointPort(8080)
|
||||
.setUsernameField("dba")
|
||||
.setPassword("sql")
|
||||
.setOperation(OperationType.INSERT);
|
||||
syncImpegnatoCe.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
} else if (isCustomerDb(IntegryCustomerDB.Tosca_Cz)) {
|
||||
StbRemoteSubscription syncImpegnatoCz = new StbRemoteSubscription();
|
||||
syncImpegnatoCz.setActive(true)
|
||||
.setPublicationId(13L)
|
||||
.setProfileDb("TOSCA_CLOUD")
|
||||
.setPublicationDescription("Sincronizzazione impengato (Catanzaro)")
|
||||
.setEndpointProtocol("HTTP")
|
||||
.setEndpointHost("4.232.161.31")
|
||||
.setEndpointPort(8080)
|
||||
.setUsernameField("dba")
|
||||
.setPassword("sql")
|
||||
.setOperation(OperationType.INSERT);
|
||||
syncImpegnatoCz.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
} else if (isCustomerDb(IntegryCustomerDB.Tosca_Fc)) {
|
||||
StbRemoteSubscription syncImpegnatoFc = new StbRemoteSubscription();
|
||||
syncImpegnatoFc.setActive(true)
|
||||
.setPublicationId(14L)
|
||||
.setProfileDb("TOSCA_CLOUD")
|
||||
.setPublicationDescription("Sincronizzazione impengato (Forlì-Cesena)")
|
||||
.setEndpointProtocol("HTTP")
|
||||
.setEndpointHost("4.232.161.31")
|
||||
.setEndpointPort(8080)
|
||||
.setUsernameField("dba")
|
||||
.setPassword("sql")
|
||||
.setOperation(OperationType.INSERT);
|
||||
syncImpegnatoFc.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
} else if (isCustomerDb(IntegryCustomerDB.Tosca_Mi)) {
|
||||
StbRemoteSubscription syncImpegnatoMi = new StbRemoteSubscription();
|
||||
syncImpegnatoMi.setActive(true)
|
||||
.setPublicationId(15L)
|
||||
.setProfileDb("TOSCA_CLOUD")
|
||||
.setPublicationDescription("Sincronizzazione impengato (Milano)")
|
||||
.setEndpointProtocol("HTTP")
|
||||
.setEndpointHost("4.232.161.31")
|
||||
.setEndpointPort(8080)
|
||||
.setUsernameField("dba")
|
||||
.setPassword("sql")
|
||||
.setOperation(OperationType.INSERT);
|
||||
syncImpegnatoMi.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
} else if (isCustomerDb(IntegryCustomerDB.Tosca_Rg)) {
|
||||
StbRemoteSubscription syncImpegnatoRg = new StbRemoteSubscription();
|
||||
syncImpegnatoRg.setActive(true)
|
||||
.setPublicationId(16L)
|
||||
.setProfileDb("TOSCA_CLOUD")
|
||||
.setPublicationDescription("Sincronizzazione impengato (Ragusa)")
|
||||
.setEndpointProtocol("HTTP")
|
||||
.setEndpointHost("4.232.161.31")
|
||||
.setEndpointPort(8080)
|
||||
.setUsernameField("dba")
|
||||
.setPassword("sql")
|
||||
.setOperation(OperationType.INSERT);
|
||||
syncImpegnatoRg.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
} else if (isCustomerDb(IntegryCustomerDB.Tosca_Rm)) {
|
||||
StbRemoteSubscription syncImpegnatoRm = new StbRemoteSubscription();
|
||||
syncImpegnatoRm.setActive(true)
|
||||
.setPublicationId(17L)
|
||||
.setProfileDb("TOSCA_CLOUD")
|
||||
.setPublicationDescription("Sincronizzazione impengato (Roma)")
|
||||
.setEndpointProtocol("HTTP")
|
||||
.setEndpointHost("4.232.161.31")
|
||||
.setEndpointPort(8080)
|
||||
.setUsernameField("dba")
|
||||
.setPassword("sql")
|
||||
.setOperation(OperationType.INSERT);
|
||||
syncImpegnatoRm.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
} else if (isCustomerDb(IntegryCustomerDB.Tosca_Vr)) {
|
||||
StbRemoteSubscription syncImpegnatoVr = new StbRemoteSubscription();
|
||||
syncImpegnatoVr.setActive(true)
|
||||
.setPublicationId(18L)
|
||||
.setProfileDb("TOSCA_CLOUD")
|
||||
.setPublicationDescription("Sincronizzazione impengato (Verona)")
|
||||
.setEndpointProtocol("HTTP")
|
||||
.setEndpointHost("4.232.161.31")
|
||||
.setEndpointPort(8080)
|
||||
.setUsernameField("dba")
|
||||
.setPassword("sql")
|
||||
.setOperation(OperationType.INSERT);
|
||||
syncImpegnatoVr.manageWithParentConnection(advancedDataSource.getConnection());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@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.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20241001133030 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
|
||||
if (isCustomer(IntegryCustomer.Tosca))
|
||||
updateSetupValue("PICKING","SPEDIZIONE","FLAG_CAN_ADD_EXTRA_ITEMS","S");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,9 +13,7 @@ import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.entity.StbPublicationsDetail;
|
||||
import it.integry.ems_model.entity.StbTransactionLog;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityLocalDate;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import it.integry.ems_model.utility.*;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.josql.Query;
|
||||
@@ -101,35 +99,37 @@ public class AsyncManager {
|
||||
return 0;
|
||||
|
||||
String tableName = entityBase.getTableName().toUpperCase();
|
||||
StbPublicationsDetail activePublication = cachedSetup.get(dbName).stream()
|
||||
List<StbPublicationsDetail> activePublications = cachedSetup.get(dbName).stream()
|
||||
.filter(x -> x.getEntityName().equalsIgnoreCase(tableName))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (activePublication == null)
|
||||
if (UtilityList.isNullOrEmpty(activePublications))
|
||||
return 0;
|
||||
|
||||
//logger.debug("SYNC OFFLINE ABILITATA SU " + tableName);
|
||||
|
||||
List<EntityBase> myObjs = new ArrayList<>();
|
||||
myObjs.add(entityBase);
|
||||
for (StbPublicationsDetail activePublication : activePublications){
|
||||
List<EntityBase> myObjs = new ArrayList<>();
|
||||
myObjs.add(entityBase);
|
||||
|
||||
String selectSql = "SELECT * FROM " + entityBase.getClass().getCanonicalName();
|
||||
if (!UtilityString.isNullOrEmpty(activePublication.getWhereCondField())) {
|
||||
selectSql = selectSql + " WHERE " + activePublication.getWhereCondField();
|
||||
String selectSql = "SELECT * FROM " + entityBase.getClass().getCanonicalName();
|
||||
if (!UtilityString.isNullOrEmpty(activePublication.getWhereCondField())) {
|
||||
selectSql = selectSql + " WHERE " + activePublication.getWhereCondField();
|
||||
}
|
||||
|
||||
// Create a new Query.
|
||||
Query q = new Query();
|
||||
q.parse(selectSql);
|
||||
|
||||
QueryResults qr = q.execute(myObjs);
|
||||
List<?> res = qr.getResults();
|
||||
|
||||
if (res == null || res.isEmpty())
|
||||
continue;
|
||||
|
||||
return activePublication.getStbPublicationId();
|
||||
}
|
||||
|
||||
// Create a new Query.
|
||||
Query q = new Query();
|
||||
q.parse(selectSql);
|
||||
|
||||
QueryResults qr = q.execute(myObjs);
|
||||
List<?> res = qr.getResults();
|
||||
|
||||
if (res == null || res.isEmpty())
|
||||
return 0;
|
||||
|
||||
return activePublication.getStbPublicationId();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ public class AsyncManager {
|
||||
Long tmpTransactionGroupId = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(
|
||||
connection, "SELECT MAX(group_id) AS max_id FROM " + StbTransactionLog.ENTITY);
|
||||
|
||||
tmpTransactionGroupId = tmpTransactionGroupId != 0 ? tmpTransactionGroupId : 0L;
|
||||
tmpTransactionGroupId = UtilityLong.isNull(tmpTransactionGroupId,0L);
|
||||
|
||||
transactionGroupId = Math.max(maxToBeProcessed, tmpTransactionGroupId);
|
||||
} else {
|
||||
|
||||
@@ -943,8 +943,10 @@ public abstract class EntityBase implements Serializable, Cloneable, EntityInter
|
||||
for (EntityBase entityChild : (List<EntityBase>) entityChildRef) {
|
||||
entityChild.setOnlyPkMaster(false);
|
||||
}
|
||||
} else
|
||||
((EntityBase) entityChildRef).setOnlyPkMaster(false);
|
||||
} else {
|
||||
if (entityChildRef != null)
|
||||
((EntityBase) entityChildRef).setOnlyPkMaster(false);
|
||||
}
|
||||
}
|
||||
|
||||
transactionGroupId = AsyncManager.saveNewTransaction(connection, dbName, clonedEntity, publicationId, transactionGroupId);
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package it.integry.ems_model.utility;
|
||||
|
||||
public class UtilityLong {
|
||||
public static Long isNull(Long valOrig, Long valDef) {
|
||||
return valOrig==null?valDef:valOrig;
|
||||
}
|
||||
|
||||
public static boolean isNullOrZero(Long numCollo) {
|
||||
return numCollo == null || numCollo == 0;
|
||||
}
|
||||
|
||||
public static Long stringToLong(String str) {
|
||||
if (!UtilityString.isNullOrEmpty(str)) { return Long.parseLong(str); }
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -24,55 +24,57 @@ public class ScadenzeExporterService {
|
||||
EntityExportResponse<List<FileItem>> entityExportResponse = new EntityExportResponse<>();
|
||||
entityExportResponse.setResponse(new ArrayList<>());
|
||||
|
||||
String sql = "SELECT ISNULL(gtb_tipi_paga_intercode.intercode, ctb_scad.cod_paga) /*leggere da tabella di trascodifica*/ AS 'tipo_pagamento'\n" +
|
||||
" , REPLACE(CAST(\n" +
|
||||
String sql = "SELECT ISNULL(gtb_tipi_paga_intercode.intercode, ctb_scad.cod_paga) /*leggere da tabella di trascodifica*/ AS 'tipo_pagamento',\n" +
|
||||
" REPLACE(\n" +
|
||||
" CAST(\n" +
|
||||
" FORMAT(\n" +
|
||||
" (ctb_scad.imp_dare + ctb_scad.imp_avere),\n" +
|
||||
" IIF(ctb_part.tipo_partita = 0, '-', '+') + '00000000000.000'\n" +
|
||||
" ) AS VARCHAR), '.',\n" +
|
||||
" ',') AS 'importo'\n" +
|
||||
" , gtb_divi.cod_divi AS 'divisa_scadenza'\n" +
|
||||
" , REPLACE(CAST(FORMAT(ctb_part.cambio, '00000.000') AS VARCHAR), '.',\n" +
|
||||
" ',') AS 'cambio'\n" +
|
||||
" , REPLACE(CAST(\n" +
|
||||
" ) AS VARCHAR), '.', ',') AS 'importo',\n" +
|
||||
" gtb_divi.cod_divi AS 'divisa_scadenza',\n" +
|
||||
" REPLACE(\n" +
|
||||
" CAST(\n" +
|
||||
" FORMAT(ctb_part.cambio, '00000.000') AS VARCHAR), '.', ',') AS 'cambio',\n" +
|
||||
" REPLACE(\n" +
|
||||
" CAST(\n" +
|
||||
" FORMAT(\n" +
|
||||
" ((ctb_scad.imp_dare + ctb_scad.imp_avere) / ctb_part.cambio),\n" +
|
||||
" IIF(ctb_part.tipo_partita = 0, '-', '+') + '00000000000.000'\n" +
|
||||
" ) AS VARCHAR), '.',\n" +
|
||||
" ',') AS 'controvalore'\n" +
|
||||
" , '00001' AS 'type'\n" +
|
||||
" , 'N' AS 'raiting'\n" +
|
||||
" , REPLACE(CONVERT(VARCHAR(10), ctb_scad.data_scad, 103), '/', '') AS 'data_scadenza'\n" +
|
||||
" , REPLACE(CONVERT(VARCHAR(10), ctb_scad.data_scad, 103), '/', '') AS 'data_valuta'\n" +
|
||||
" , LEFT(gtb_banc_azi_intercode.intercode, 8) AS 'banca'\n" +
|
||||
" , RIGHT(gtb_banc_azi_intercode.intercode, 4) AS 'rbn'\n" +
|
||||
" , 'N' AS 'bloccata'\n" +
|
||||
" , IIF(ctb_part.tipo_anag = 'F', '0201', '0101') AS 'voce'\n" +
|
||||
" , IIF(diacod > 0, diacod, ctb_anag.cod_ccon + gtb_anag.cod_anag) AS 'piano_dei_conti'\n" +
|
||||
" , gtb_anag.rag_soc AS 'descrizione'\n" +
|
||||
" , ctb_part.cod_abi AS 'ABI'\n" +
|
||||
" , ctb_part.cod_cab AS 'CAB'\n" +
|
||||
" , '' AS 'blank'\n" +
|
||||
" , 'CO' AS 'provenienza'\n" +
|
||||
" , '' AS 'sezione'\n" +
|
||||
" , '' AS 'cambio_della_gestione'\n" +
|
||||
" , CAST(ctb_part.num_doc AS VARCHAR) AS 'numero_doc_origine'\n" +
|
||||
" , ISNULL(CTB_SCAD.INTERCODE,\n" +
|
||||
" ',') AS 'controvalore',\n" +
|
||||
" '00001' AS 'type',\n" +
|
||||
" 'N' AS 'raiting',\n" +
|
||||
" REPLACE(CONVERT(VARCHAR(10), ctb_scad.data_scad, 103), '/', '') AS 'data_scadenza',\n" +
|
||||
" REPLACE(CONVERT(VARCHAR(10), ctb_scad.data_scad, 103), '/', '') AS 'data_valuta',\n" +
|
||||
" LEFT(gtb_banc_azi_intercode.intercode, 8) AS 'banca',\n" +
|
||||
" RIGHT(gtb_banc_azi_intercode.intercode, 4) AS 'rbn',\n" +
|
||||
" 'N' AS 'bloccata',\n" +
|
||||
" IIF(ctb_part.tipo_anag = 'F', '0201', '0101') AS 'voce',\n" +
|
||||
" gtb_anag.diacod AS 'piano_dei_conti',\n" +
|
||||
" gtb_anag.rag_soc AS 'descrizione',\n" +
|
||||
" ctb_part.cod_abi AS 'ABI',\n" +
|
||||
" ctb_part.cod_cab AS 'CAB',\n" +
|
||||
" '' AS 'blank',\n" +
|
||||
" 'CO' AS 'provenienza',\n" +
|
||||
" '' AS 'sezione',\n" +
|
||||
" '' AS 'cambio_della_gestione',\n" +
|
||||
" CAST(ctb_part.num_doc AS VARCHAR) AS 'numero_doc_origine',\n" +
|
||||
" ISNULL(CTB_SCAD.INTERCODE,\n" +
|
||||
" RIGHT(CAST(ctb_part.anno_part AS VARCHAR), 2) +\n" +
|
||||
" IIF(ctb_part.tipo_anag = 'c', FORMAT(ctb_part.num_doc, REPLICATE('0', 5)),\n" +
|
||||
" CAST(ctb_part.num_doc AS VARCHAR) + SPACE(5 - LEN(CAST(ctb_part.num_doc AS VARCHAR)))) +\n" +
|
||||
" FORMAT(ctb_scad.id_riga, '000') +\n" +
|
||||
" FORMAT(DENSE_RANK() OVER (PARTITION BY ctb_part.cod_anag, ctb_part.num_doc ORDER BY ctb_scad.data_doc),\n" +
|
||||
" '000')) AS 'chiave_coge'\n" +
|
||||
" , 'ROSSOGARGA' AS 'azienda'\n" +
|
||||
" , Right(ctb_part.iban,12) AS 'numero_cc'\n" +
|
||||
" , SUBSTRING(ctb_part.iban, 5, 1) AS 'cin'\n" +
|
||||
" , LEFT(ctb_part.iban, 2) AS 'paese'\n" +
|
||||
" , SUBSTRING(ctb_part.iban, 3, 2) AS 'chk_paese'\n" +
|
||||
" , REPLACE(CONVERT(VARCHAR(10), ctb_part.data_doc, 103), '/', '') AS 'data_documento'\n" +
|
||||
" , ctb_parr.des_agg AS 'note'\n" +
|
||||
" , IIF(vtb_clie.cod_anag IS NULL, atb_forn.cod_bic, vtb_clie.cod_bic) AS 'cod_bic'\n" +
|
||||
" , ctb_part.iban\n" +
|
||||
" '000')) AS 'chiave_coge',\n" +
|
||||
" 'ROSSOGARGA' AS 'azienda',\n" +
|
||||
" Right(ctb_part.iban,12) AS 'numero_cc',\n" +
|
||||
" SUBSTRING(ctb_part.iban, 5, 1) AS 'cin',\n" +
|
||||
" LEFT(ctb_part.iban, 2) AS 'paese',\n" +
|
||||
" SUBSTRING(ctb_part.iban, 3, 2) AS 'chk_paese',\n" +
|
||||
" REPLACE(CONVERT(VARCHAR(10), ctb_part.data_doc, 103), '/', '') AS 'data_documento',\n" +
|
||||
" ctb_parr.des_agg AS 'note',\n" +
|
||||
" IIF(vtb_clie.cod_anag IS NULL, atb_forn.cod_bic, vtb_clie.cod_bic) AS 'cod_bic',\n" +
|
||||
" ctb_part.iban\n" +
|
||||
"FROM ctb_part\n" +
|
||||
" INNER JOIN ctb_scad ON ctb_part.tipo_anag = ctb_scad.tipo_anag AND ctb_part.cod_anag = ctb_scad.cod_anag AND\n" +
|
||||
" ctb_part.anno_part = ctb_scad.anno_part AND ctb_part.ser_doc = ctb_scad.ser_doc AND\n" +
|
||||
@@ -97,7 +99,69 @@ public class ScadenzeExporterService {
|
||||
" AND ctb_part.ser_doc = ctb_parr.ser_doc\n" +
|
||||
" AND ctb_part.num_doc = ctb_parr.num_doc\n" +
|
||||
" ORDER BY ctb_parr.data_cmov) ctb_parr\n" +
|
||||
"WHERE ctb_scad.data_pag IS NULL";
|
||||
"WHERE ctb_scad.data_pag IS NULL\n" +
|
||||
"UNION ALL\n" +
|
||||
"SELECT 'RD' /*leggere da tabella di trascodifica*/ AS 'tipo_pagamento',\n" +
|
||||
" REPLACE(\n" +
|
||||
" CAST(\n" +
|
||||
" FORMAT(\n" +
|
||||
" (ctb_movr.imp_dare - ctb_movr.imp_avere),\n" +
|
||||
" IIF(ctb_movr.imp_dare - ctb_movr.imp_avere > 0, '+', '') + '00000000000.000'\n" +
|
||||
" ) AS VARCHAR\n" +
|
||||
" ), '.', ','\n" +
|
||||
" ) AS 'importo',\n" +
|
||||
" ctb_movt.cod_divi_cont AS 'divisa_scadenza',\n" +
|
||||
" REPLACE(\n" +
|
||||
" CAST(\n" +
|
||||
" FORMAT(ctb_movt.cambio_divi_cont, '00000.000') AS VARCHAR\n" +
|
||||
" ), '.', ','\n" +
|
||||
" ) AS 'cambio',\n" +
|
||||
" REPLACE(\n" +
|
||||
" CAST(\n" +
|
||||
" FORMAT(\n" +
|
||||
" (ctb_movr.imp_dare - ctb_movr.imp_avere),\n" +
|
||||
" IIF((ctb_movr.imp_dare - ctb_movr.imp_avere) > 0, '+', '') + '00000000000.000'\n" +
|
||||
" ) AS VARCHAR\n" +
|
||||
" ), '.', ','\n" +
|
||||
" ) AS 'controlvalore',\n" +
|
||||
" '01' AS 'type',\n" +
|
||||
" 'N' AS 'raiting',\n" +
|
||||
" REPLACE(CONVERT(VARCHAR(10), ctb_movt.data_cmov, 103), '/', '') AS 'data_scadenza',\n" +
|
||||
" REPLACE(CONVERT(VARCHAR(10), ctb_movt.data_cmov, 103), '/', '') AS 'data_valuta',\n" +
|
||||
" '' AS 'banca',\n" +
|
||||
" '' AS 'rbn',\n" +
|
||||
" 'N' AS 'bloccata',\n" +
|
||||
" IIF(ctb_movr.tipo_anag = 'F', '0201', '0101') AS 'voce',\n" +
|
||||
" IIF(diacod > 0, diacod, ctb_movr.cod_ccon + ctb_movr.cod_anag) AS 'piano_dei_conti',\n" +
|
||||
" gtb_anag.rag_soc AS 'descrizione',\n" +
|
||||
" '' AS 'ABI',\n" +
|
||||
" '' AS 'CAB',\n" +
|
||||
" '' AS 'blank',\n" +
|
||||
" 'CO' AS 'provenienza',\n" +
|
||||
" '' AS 'sezione',\n" +
|
||||
" '' AS 'cambio_della_gestione',\n" +
|
||||
" ISNULL(ctb_movr_intercode.num_doc_orig, '') AS 'numero_doc_origine',\n" +
|
||||
" IIF(ctb_movr_intercode.intercode IS NOT NULL, ctb_movr_intercode.intercode + FORMAT(\n" +
|
||||
" DENSE_RANK() OVER (PARTITION BY ctb_movr.cod_anag, ctb_movt.num_doc ORDER BY ctb_movt.data_cmov), '000'),\n" +
|
||||
" RIGHT(ctb_movr.num_cmov, LEN(ctb_movr.num_cmov) - 2) + FORMAT(ctb_movr.id_riga, '000') +\n" +
|
||||
" '001') AS chiave_coge,\n" +
|
||||
" 'ROSSOGARGA' AS 'azienda',\n" +
|
||||
" '' AS 'numero_cc',\n" +
|
||||
" '' AS cin,\n" +
|
||||
" '' AS paese,\n" +
|
||||
" '' AS chk_paese,\n" +
|
||||
" REPLACE(CONVERT(VARCHAR(10), ctb_movt.data_cmov, 103), '/', '') AS 'data_documento',\n" +
|
||||
" ctb_movr.des_agg AS 'note',\n" +
|
||||
" '' AS 'cod_bic',\n" +
|
||||
" '' AS 'iban'\n" +
|
||||
"FROM ctb_movr\n" +
|
||||
" INNER JOIN ctb_movt\n" +
|
||||
" ON ctb_movr.num_cmov = ctb_movt.num_cmov\n" +
|
||||
" INNER JOIN gtb_anag ON ctb_movr.cod_anag = gtb_anag.cod_anag\n" +
|
||||
" INNER JOIN ctb_caus ON ctb_movt.cod_ccau = ctb_caus.cod_ccau AND ctb_caus.flag_ap_ch = 'N'\n" +
|
||||
" LEFT OUTER JOIN ctb_movr_intercode ON ctb_movr.num_cmov = ctb_movr_intercode.num_cmov AND\n" +
|
||||
" ctb_movr.id_riga = ctb_movr_intercode.id_riga\n" +
|
||||
"WHERE anno_part IS NULL";
|
||||
List<ScadenzeDocFinanceDTO> scadenzeDocFinance = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, ScadenzeDocFinanceDTO.class);
|
||||
|
||||
TxtMapper<ScadenzeDocFinanceDTO> txtMapper = new TxtMapper<ScadenzeDocFinanceDTO>()
|
||||
|
||||
@@ -36,19 +36,11 @@ public class ToscaSalesService {
|
||||
private EntityProcessor entityProcessor;
|
||||
|
||||
|
||||
public void importOrdiniLavorazione() {
|
||||
|
||||
}
|
||||
|
||||
public void importOrdiniVendita(MultipartFile file) throws Exception {
|
||||
InputStream inputStream = file.getInputStream();
|
||||
|
||||
List<ToscaOrdineVenditaDTO> ordiniDaImportare = parseFile(inputStream);
|
||||
|
||||
List<Date> invalidDates = ordiniDaImportare.stream().map(ToscaOrdineVenditaDTO::getDateTransaction).distinct().filter(d -> d.before(UtilityDate.getStartOfDay(new Date()))).collect(Collectors.toList());
|
||||
if (!UtilityList.isNullOrEmpty(invalidDates))
|
||||
throw new Exception("Caricare l'impegnato per giorni passati non è consentito");
|
||||
|
||||
importAnagrafiche(ordiniDaImportare);
|
||||
|
||||
Map<String, List<ToscaOrdineVenditaDTO>> ordini = ordiniDaImportare.stream().collect(Collectors.groupingBy(ToscaOrdineVenditaDTO::getTransactionNumber));
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ImportListiniAcquistoApuliaCarrefourService {
|
||||
}
|
||||
|
||||
if (UtilityDebug.isDebugExecution() && !UtilityDebug.isIntegryServer()){
|
||||
pathFile = "\\\\serverdb\\BulkFile\\Apulia\\carelli";
|
||||
pathFile = "\\\\serverdb\\BulkFile\\Apulia\\" + multiDBTransactionManager.getPrimaryDatasource().getProfile();
|
||||
}
|
||||
|
||||
//INSERIMENTO DATI DA FILE
|
||||
@@ -312,17 +312,15 @@ public class ImportListiniAcquistoApuliaCarrefourService {
|
||||
" CASE WHEN data_iniz < '2020/01/01' THEN '2020/01/01' ELSE data_iniz END AS data_iniz,\n" +
|
||||
" tipo_variazione\n" +
|
||||
" FROM dbo.getlistinoacquisto([DATA_IMPORT], NULL, NULL, NULL, 'N', NULL) lisa\n" +
|
||||
" LEFT OUTER JOIN (SELECT value_string AS cod_alis\n" +
|
||||
" WHERE lisa.cod_alis LIKE 'AP%'\n" +
|
||||
" AND lisa.tipo_variazione <> 'D'\n" +
|
||||
" AND lisa.tipo_variazione IS NOT NULL\n" +
|
||||
" AND NOT EXISTS (SELECT value_string AS cod_alis\n" +
|
||||
" FROM dbo.parsestringintoarray(\n" +
|
||||
" (SELECT dbo.getgestsetup('IMPORT_[TYPE]',\n" +
|
||||
" '[FORMAT]',\n" +
|
||||
" 'LISTINI_DA_ESCLUDERE')),\n" +
|
||||
" '|')) listini_esclusi\n" +
|
||||
" ON lisa.cod_alis = listini_esclusi.cod_alis\n" +
|
||||
" WHERE lisa.cod_alis LIKE 'AP%'\n" +
|
||||
" AND lisa.tipo_variazione <> 'D'\n" +
|
||||
" AND lisa.tipo_variazione IS NOT NULL\n" +
|
||||
" AND listini_esclusi.cod_alis IS NULL) lisa\n" +
|
||||
" '|') listini_esclusi WHERE lisa.cod_alis = listini_esclusi.value_string)) lisa\n" +
|
||||
" ON apulia.cod_alis = lisa.cod_alis AND apulia.cod_art_for = lisa.cod_art_for\n" +
|
||||
" LEFT OUTER JOIN mtb_lisa ON apulia.cod_alis = mtb_lisa.cod_alis AND apulia.cod_art_for = mtb_lisa.cod_art_for\n" +
|
||||
" LEFT OUTER JOIN mtb_aart ON mtb_lisa.cod_mart = mtb_aart.cod_mart\n" +
|
||||
|
||||
Reference in New Issue
Block a user