Merge remote-tracking branch 'origin/develop' into develop
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
This commit is contained in:
16
.idea/runConfigurations/Tomcat9__1__DBServer_.xml
generated
Normal file
16
.idea/runConfigurations/Tomcat9__1__DBServer_.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Tomcat9 #1 (DBServer)" type="Remote" folderName="Lamonarca">
|
||||||
|
<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="192.168.1.7" />
|
||||||
|
<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>
|
||||||
@@ -49,6 +49,7 @@ pipeline {
|
|||||||
echo "Updating Tomcat9 from ${WORKSPACE}"
|
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\""
|
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'
|
bat 'curl -k https://devservices.studioml.it/ems-api/updateWMSApp'
|
||||||
|
bat 'curl -k https://devservices.studioml.it/ems-api/updateWMSApp?suffix=beta'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,6 +87,7 @@ sudo /usr/bin/systemctl start tomcat9backup
|
|||||||
|
|
||||||
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)])
|
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'
|
bat 'curl -k https://services.studioml.it/ems-api/updateWMSApp'
|
||||||
|
bat 'curl -k https://services.studioml.it/ems-api/updateWMSApp?suffix=beta'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package it.integry.ems.migration.model;
|
|||||||
|
|
||||||
import it.integry.ems.migration._base.BaseMigration;
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
import it.integry.ems.migration._base.IntegryCustomer;
|
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.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
public class Migration_20250214112245 extends BaseMigration implements MigrationModelInterface {
|
public class Migration_20250214112245 extends BaseMigration implements MigrationModelInterface {
|
||||||
@@ -11,7 +12,7 @@ public class Migration_20250214112245 extends BaseMigration implements Migration
|
|||||||
if (isHistoryDB())
|
if (isHistoryDB())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (isCustomer(IntegryCustomer.RossoGargano))
|
if (isCustomer(IntegryCustomer.RossoGargano) || isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
executeStatement("update stb_menu set flag_attivo = 'N' where cod_opz = 'lr069'");
|
executeStatement("update stb_menu set flag_attivo = 'N' where cod_opz = 'lr069'");
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250219120547 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
executeStatement("UPDATE stb_gest_setup SET description = 'Nel raggruppare gli articoli presenti nei colli ignora tipo pedana e colli per pedana del collo e li prende dall''ordine'" +
|
||||||
|
" WHERE gest_name = 'w_ddocu_rc' AND section = 'LOAD_COLLI' AND key_section = 'IGNORA_TIPO_PEDANA'");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250221090218 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
executeStatement(
|
||||||
|
"alter table ctb_ireg add flag_extracee varchar(1) not null default 'N'");
|
||||||
|
}
|
||||||
|
|
||||||
|
@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.IntegryCustomer;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250221104043 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("SEPA", "BONIFICI", "CREATE_READ_ONLY_FILE", "N",
|
||||||
|
"Crea il file sepa in sola lettura", false, "SI_NO", false, false,
|
||||||
|
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||||
|
createSetup("SEPA", "SDD", "CREATE_READ_ONLY_FILE", "N",
|
||||||
|
"Crea il file sepa in sola lettura", false, "SI_NO", false, false,
|
||||||
|
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||||
|
|
||||||
|
|
||||||
|
if (isCustomer(IntegryCustomer.Carelli))
|
||||||
|
updateSetupValue("SEPA", "BONIFICI", "CREATE_READ_ONLY_FILE", "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_20250221131613 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
executeStatement("UPDATE stb_gest_setup\n" +
|
||||||
|
"SET tipo_setup = 'mtb_grup', key_section = 'INCLUDI_BUDGET', flag_setup_depo = 'N'\n" +
|
||||||
|
"WHERE gest_name = 'PVM'\n" +
|
||||||
|
" AND section = 'MRP'\n" +
|
||||||
|
" AND key_section = 'ASSEGNA_BUDGET'");
|
||||||
|
}
|
||||||
|
|
||||||
|
@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_20250224114817 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (existsTable("apuliac_agg_prz_csv") && !existColumn("apuliac_agg_prz_csv", "altro")){
|
||||||
|
executeStatement("alter table apuliac_agg_prz_csv add altro varchar(max)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.IntegryCustomer;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250224145759 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
createSetup("PVM","MONITORAGGIO_LINEE_V2","REIMPOSTA_LOTTO_ORDINE_RIPIANIFICATO","N","Se impostato sul deposito di destinazione dell'ordine ripianificato ne azzera il lotto in testata costringendo alla reimpostazione dello stesso prima dell'avvio dell'ordine",false,"SI_NO",false,true,false,false,false,null,false);
|
||||||
|
if (isCustomer(IntegryCustomer.Gramm))
|
||||||
|
executeStatement("INSERT INTO stb_gest_setup_depo VALUES ('01',\t'PVM',\t'MONITORAGGIO_LINEE_V2',\t'REIMPOSTA_LOTTO_ORDINE_RIPIANIFICATO',\t'S',\t'N');");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
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_20250224165212 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||||
|
return;
|
||||||
|
|
||||||
|
createOrUpdateFunction("getEffettiCliente",
|
||||||
|
"CREATE FUNCTION [dbo].[getEffettiCliente](\n" +
|
||||||
|
" @codAnag varchar(5), @viewAllDist varchar(1)\n" +
|
||||||
|
")\n" +
|
||||||
|
" RETURNS TABLE as\n" +
|
||||||
|
" return(SELECT ctb_scad.cod_anag,\n" +
|
||||||
|
" ctb_scad.data_scad,\n" +
|
||||||
|
" case\n" +
|
||||||
|
" when DateAdd(day, -2, ctb_scad.data_scad) <= Cast(getDate() as date) THEN 'R'\n" +
|
||||||
|
" ELSE 'S' END as tipo_scad_effetto,\n" +
|
||||||
|
" (ctb_scad.imp_dare * ctb_part.tipo_partita - (1 - ctb_part.tipo_partita) *\n" +
|
||||||
|
" ctb_scad.imp_avere) AS Importo,\n" +
|
||||||
|
" gtb_paga.tipo_paga,\n" +
|
||||||
|
" ctb_scad.data_doc,\n" +
|
||||||
|
" ctb_scad.ser_doc,\n" +
|
||||||
|
" ctb_scad.num_doc\n" +
|
||||||
|
" FROM ctb_scad\n" +
|
||||||
|
" inner join vtb_riba on ctb_scad.tipo_anag = vtb_riba.tipo_anag AND\n" +
|
||||||
|
" ctb_scad.cod_anag = vtb_riba.cod_anag AND\n" +
|
||||||
|
" ctb_scad.data_doc = vtb_riba.data_doc AND\n" +
|
||||||
|
" ctb_scad.ser_doc = vtb_riba.ser_doc AND\n" +
|
||||||
|
" ctb_scad.num_doc = vtb_riba.num_doc AND\n" +
|
||||||
|
" ctb_scad.id_riga = vtb_riba.num_scad\n" +
|
||||||
|
" inner join ctb_part on ctb_scad.tipo_anag = ctb_part.tipo_anag AND\n" +
|
||||||
|
" ctb_scad.cod_anag = ctb_part.cod_anag AND\n" +
|
||||||
|
" ctb_scad.data_doc = ctb_part.data_doc AND\n" +
|
||||||
|
" ctb_scad.ser_doc = ctb_part.ser_doc AND\n" +
|
||||||
|
" ctb_scad.num_doc = ctb_part.num_doc\n" +
|
||||||
|
" inner join vtb_dist on vtb_dist.rif_dist = vtb_riba.rif_dist AND\n" +
|
||||||
|
" vtb_dist.data_dist = vtb_riba.data_dist\n" +
|
||||||
|
" inner join gtb_paga on ctb_scad.cod_paga = gtb_paga.cod_paga\n" +
|
||||||
|
" WHERE ctb_scad.cod_anag = @codAnag\n" +
|
||||||
|
" AND ctb_scad.data_pag is not null\n" +
|
||||||
|
" AND DateAdd(day, 5, ctb_scad.data_scad) > Cast(getDate() as date)\n" +
|
||||||
|
" AND (@viewAllDist = 'S' or vtb_dist.num_cmov is not 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.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250225115502 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("W_CMOD_UNICO_RC", "SETUP", "ESCLUDI_FORFETTARI", "S",
|
||||||
|
null, 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,26 @@
|
|||||||
|
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_20250225124406 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!existColumn("mtb_aart", "flag_stampa_docu_vend"))
|
||||||
|
executeStatement(
|
||||||
|
"alter table mtb_aart add flag_stampa_docu_vend bit not null default 1");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250225162629 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!isCustomerDb(IntegryCustomerDB.RistoCash_RistoCash))
|
||||||
|
return;
|
||||||
|
|
||||||
|
executeStatement("update stb_gest_setup set value = 'S' where gest_name = 'W_VDOCU_PAGA_DLG' and section = 'SETUP' and key_section = 'SAVE_REST'");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250226123236 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
executeStatement("update stb_gest_setup set value ='S' where gest_name ='W_CGIRORISCONTI_DLG' and section ='SETUP' and key_section ='USE_REST_SERVICE'");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -611,13 +611,8 @@ public class LoadColliService {
|
|||||||
" SUM(mvw_colr_sum.num_cnf) AS 'num_cnf',\n" +
|
" SUM(mvw_colr_sum.num_cnf) AS 'num_cnf',\n" +
|
||||||
" SUM(mvw_colr_sum.peso_netto_kg_riga) AS 'peso_netto',\n" +
|
" SUM(mvw_colr_sum.peso_netto_kg_riga) AS 'peso_netto',\n" +
|
||||||
" SUM(mvw_colr_sum.peso_lordo_kg_riga) AS 'peso_lordo',\n" +
|
" SUM(mvw_colr_sum.peso_lordo_kg_riga) AS 'peso_lordo',\n" +
|
||||||
(ignoreTipoPedana?
|
" CONVERT(NUMERIC(20, 5), CASE WHEN [gestione] = 'L' THEN NULL ELSE " + (ignoreTipoPedana?"dtb_ordr.colli_pedana":"mvw_colr_sum.colli_pedana") + " END) AS 'colli_pedana',\n" +
|
||||||
" sum(CONVERT(NUMERIC(20, 5), CASE WHEN [gestione] = 'L' THEN NULL ELSE mvw_colr_sum.colli_pedana END))/count(*) AS 'colli_pedana',\n" +
|
" " + (ignoreTipoPedana?"dtb_ordr.cod_tcol_UL":"mvw_colr_sum.cod_tcol") + " AS 'cod_tcol',\n" +
|
||||||
" null AS 'cod_tcol',\n"
|
|
||||||
:
|
|
||||||
" CONVERT(NUMERIC(20, 5), CASE WHEN [gestione] = 'L' THEN NULL ELSE mvw_colr_sum.colli_pedana END) AS 'colli_pedana',\n" +
|
|
||||||
" mvw_colr_sum.cod_tcol AS 'cod_tcol',\n"
|
|
||||||
) +
|
|
||||||
" mvw_colr_sum.cod_dtip_comp AS 'cod_dtip_comp',\n" +
|
" mvw_colr_sum.cod_dtip_comp AS 'cod_dtip_comp',\n" +
|
||||||
" mvw_colr_sum.data_doc_comp AS 'data_doc_comp',\n" +
|
" mvw_colr_sum.data_doc_comp AS 'data_doc_comp',\n" +
|
||||||
" mvw_colr_sum.ser_doc_comp AS 'ser_doc_comp',\n" +
|
" mvw_colr_sum.ser_doc_comp AS 'ser_doc_comp',\n" +
|
||||||
@@ -655,9 +650,8 @@ public class LoadColliService {
|
|||||||
" mtb_aart.flag_stato, dtb_ordr.cod_art_for, mvw_kit.flag_kit, dtb_ordr.cod_jcom,\n" +
|
" mtb_aart.flag_stato, dtb_ordr.cod_art_for, mvw_kit.flag_kit, dtb_ordr.cod_jcom,\n" +
|
||||||
" ISNULL(dtb_ordr.unt_ord2, mtb_aart.unt_mis2), ISNULL(dtb_ordr.unt_ord3, mtb_aart.unt_mis3), mtb_aart.tara_kg,\n" +
|
" ISNULL(dtb_ordr.unt_ord2, mtb_aart.unt_mis2), ISNULL(dtb_ordr.unt_ord3, mtb_aart.unt_mis3), mtb_aart.tara_kg,\n" +
|
||||||
" dtb_ordr.cod_kit, dtb_ordr.cod_alis, dtb_ordr.note,\n" +
|
" dtb_ordr.cod_kit, dtb_ordr.cod_alis, dtb_ordr.note,\n" +
|
||||||
(ignoreTipoPedana?"":
|
" CONVERT(NUMERIC(20, 5), CASE WHEN [gestione] = 'L' THEN NULL ELSE " + (ignoreTipoPedana?"dtb_ordr.colli_pedana":"mvw_colr_sum.colli_pedana") + " END),\n" +
|
||||||
" CASE WHEN [gestione] = 'L' THEN NULL ELSE mvw_colr_sum.colli_pedana END, mvw_colr_sum.cod_tcol,\n"
|
" " + (ignoreTipoPedana?"dtb_ordr.cod_tcol_UL":"mvw_colr_sum.cod_tcol") + ",\n" +
|
||||||
) +
|
|
||||||
" mtb_aart.flag_qta_cnf_fissa, dtb_ordr.cod_mart, mvw_colr_sum.cod_dtip_comp, mvw_colr_sum.data_doc_comp,\n" +
|
" mtb_aart.flag_qta_cnf_fissa, dtb_ordr.cod_mart, mvw_colr_sum.cod_dtip_comp, mvw_colr_sum.data_doc_comp,\n" +
|
||||||
" mvw_colr_sum.ser_doc_comp, mvw_colr_sum.num_doc_comp, mvw_colr_sum.id_riga_doc_comp, dtb_ordr.id_contratto,\n" +
|
" mvw_colr_sum.ser_doc_comp, mvw_colr_sum.num_doc_comp, mvw_colr_sum.id_riga_doc_comp, dtb_ordr.id_contratto,\n" +
|
||||||
" dtb_ordr.riga_ord, mvw_colr_sum.cod_jcom\n" +
|
" dtb_ordr.riga_ord, mvw_colr_sum.cod_jcom\n" +
|
||||||
|
|||||||
@@ -66,10 +66,12 @@ public class AccountingRules extends QueryRules {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Integer completeNumProt(Connection connection, CtbMovt entity) throws Exception {
|
public static Integer completeNumProt(Connection connection, CtbMovt entity) throws Exception {
|
||||||
Integer annoComp = entity.getAnnoComp();
|
//Integer annoComp = entity.getAnnoComp();
|
||||||
String codIreg = entity.getCodIreg();
|
String codIreg = entity.getCodIreg();
|
||||||
Integer numIreg = entity.getNumIreg();
|
Integer numIreg = entity.getNumIreg();
|
||||||
Integer numProt = entity.getNumProt();
|
Integer numProt = entity.getNumProt();
|
||||||
|
Date dataCmov = entity.getDataCmov();
|
||||||
|
Integer annoProt = UtilityDate.datePart(Calendar.YEAR, dataCmov);
|
||||||
|
|
||||||
if (numIreg == 0) {
|
if (numIreg == 0) {
|
||||||
numIreg = 1;
|
numIreg = 1;
|
||||||
@@ -82,13 +84,13 @@ public class AccountingRules extends QueryRules {
|
|||||||
+ "FROM ctb_inum "
|
+ "FROM ctb_inum "
|
||||||
+ "WHERE cod_ireg = " + UtilityDB.valueToString(codIreg) + " AND "
|
+ "WHERE cod_ireg = " + UtilityDB.valueToString(codIreg) + " AND "
|
||||||
+ " num_ireg = " + UtilityDB.valueToString(numIreg) + " AND "
|
+ " num_ireg = " + UtilityDB.valueToString(numIreg) + " AND "
|
||||||
+ " anno = " + UtilityDB.valueToString(annoComp);
|
+ " anno = " + UtilityDB.valueToString(annoProt);
|
||||||
|
|
||||||
boolean existReg = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
boolean existReg = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||||
|
|
||||||
if (existReg) {
|
if (existReg) {
|
||||||
CallableStatement cs = connection.prepareCall("{call dbo.NextNumProt(?, ?, ?, ?)}");
|
CallableStatement cs = connection.prepareCall("{call dbo.NextNumProt(?, ?, ?, ?)}");
|
||||||
cs.setShort(1, annoComp.shortValue());
|
cs.setShort(1, annoProt.shortValue());
|
||||||
cs.setString(2, codIreg);
|
cs.setString(2, codIreg);
|
||||||
cs.setShort(3, numIreg.shortValue());
|
cs.setShort(3, numIreg.shortValue());
|
||||||
cs.setInt(4, numProt);
|
cs.setInt(4, numProt);
|
||||||
@@ -100,7 +102,7 @@ public class AccountingRules extends QueryRules {
|
|||||||
if (numProt == 0) numProt = 1;
|
if (numProt == 0) numProt = 1;
|
||||||
CtbInum ctbInum =
|
CtbInum ctbInum =
|
||||||
new CtbInum()
|
new CtbInum()
|
||||||
.setAnno(annoComp)
|
.setAnno(annoProt)
|
||||||
.setCodIreg(codIreg)
|
.setCodIreg(codIreg)
|
||||||
.setNumIreg(numIreg)
|
.setNumIreg(numIreg)
|
||||||
.setNumProt(numProt);
|
.setNumProt(numProt);
|
||||||
@@ -1026,15 +1028,14 @@ public class AccountingRules extends QueryRules {
|
|||||||
if ( ctbMovi.getParent() instanceof CtbMovt) {
|
if ( ctbMovi.getParent() instanceof CtbMovt) {
|
||||||
String sql =
|
String sql =
|
||||||
Query.format(
|
Query.format(
|
||||||
"SELECT CAST(IIF((SELECT segno_liquid FROM ctb_ireg WHERE cod_ireg = %s) = -1 AND flag_iva_acq_merci = 'S', 1, 0) AS BIT)\n" +
|
"SELECT CAST(IIF((registro.segno_liquid = -1 AND flag_iva_acq_merci = 'S') OR ( registro.segno_liquid = 1 AND flag_iva_da_ventilare = 'S'), 1, 0) AS BIT)\n" +
|
||||||
"FROM gtb_aliq\n" +
|
"FROM gtb_aliq,\n" +
|
||||||
|
" (SELECT segno_liquid FROM ctb_ireg WHERE cod_ireg = %s) registro \n" +
|
||||||
"WHERE cod_aliq = %s",
|
"WHERE cod_aliq = %s",
|
||||||
((CtbMovt) ctbMovi.getParent()).getCodIreg(),
|
((CtbMovt) ctbMovi.getParent()).getCodIreg(),
|
||||||
ctbMovi.getCodAliq());
|
ctbMovi.getCodAliq());
|
||||||
|
|
||||||
ventilazione = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
ventilazione = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ventilazione = ctbMovi.getVentilazione()==null?false:ctbMovi.getVentilazione();
|
ventilazione = ctbMovi.getVentilazione()==null?false:ctbMovi.getVentilazione();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -422,9 +422,10 @@ public class AtbOfft extends EntityBase {
|
|||||||
atbOffr.deleteAllEntities(connection, this);
|
atbOffr.deleteAllEntities(connection, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum StatoOfferta implements IBaseEnum {
|
public enum StatoOfferta implements IBaseEnum<StatoOfferta> {
|
||||||
|
RICHIESTA_DI_OFFERTA(0),
|
||||||
RICHIESTA_DI_OFFERTA(0), OFFERTA(1), CONTRATTO(2);
|
OFFERTA(1),
|
||||||
|
CONTRATTO(2);
|
||||||
|
|
||||||
private final int value;
|
private final int value;
|
||||||
|
|
||||||
@@ -432,6 +433,23 @@ public class AtbOfft extends EntityBase {
|
|||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static StatoOfferta from(Object value) {
|
||||||
|
int castValue;
|
||||||
|
|
||||||
|
if (value instanceof String) {
|
||||||
|
castValue = Integer.parseInt(value.toString());
|
||||||
|
} else {
|
||||||
|
castValue = (int) value;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (StatoOfferta b : StatoOfferta.values()) {
|
||||||
|
if (b.value == castValue)
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@JsonValue
|
@JsonValue
|
||||||
public int getValue() {
|
public int getValue() {
|
||||||
return value;
|
return value;
|
||||||
@@ -443,27 +461,13 @@ public class AtbOfft extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object fromInternal(Object val) {
|
public StatoOfferta fromInternal(Object val) {
|
||||||
return from(val);
|
return from(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AtbOfft.StatoOfferta fromValue(int value) {
|
@Override
|
||||||
for (AtbOfft.StatoOfferta statoOfferta : AtbOfft.StatoOfferta.values()) {
|
public String toString() {
|
||||||
if (statoOfferta.value == value) {
|
return String.valueOf(value);
|
||||||
return statoOfferta;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static AtbOfft.StatoOfferta from(Object value) {
|
|
||||||
int castValue = (int) value;
|
|
||||||
for (AtbOfft.StatoOfferta statoOfferta : AtbOfft.StatoOfferta.values()) {
|
|
||||||
if (statoOfferta.value == castValue) {
|
|
||||||
return statoOfferta;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ public class CtbIreg extends EntityBase {
|
|||||||
@SqlField(value = "flag_iva_da_ventilare", maxLength = 1, nullable = false, defaultObjectValue = "N")
|
@SqlField(value = "flag_iva_da_ventilare", maxLength = 1, nullable = false, defaultObjectValue = "N")
|
||||||
private String flagIvaDaVentilare;
|
private String flagIvaDaVentilare;
|
||||||
|
|
||||||
|
@SqlField(value = "flag_extracee", maxLength = 1, nullable = false, defaultObjectValue = "N")
|
||||||
|
private String flagExtracee;
|
||||||
|
|
||||||
@EntityChild
|
@EntityChild
|
||||||
private List<CtbInum> ctbInum = new ArrayList<>();
|
private List<CtbInum> ctbInum = new ArrayList<>();
|
||||||
|
|
||||||
@@ -58,92 +61,90 @@ public class CtbIreg extends EntityBase {
|
|||||||
return codIreg;
|
return codIreg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCodIreg(String codIreg) {
|
public CtbIreg setCodIreg(String codIreg) {
|
||||||
this.codIreg = codIreg;
|
this.codIreg = codIreg;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescrizione() {
|
public String getDescrizione() {
|
||||||
return descrizione;
|
return descrizione;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDescrizione(String descrizione) {
|
public CtbIreg setDescrizione(String descrizione) {
|
||||||
this.descrizione = descrizione;
|
this.descrizione = descrizione;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFlagScorporo() {
|
public String getFlagScorporo() {
|
||||||
return flagScorporo;
|
return flagScorporo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFlagScorporo(String flagScorporo) {
|
public CtbIreg setFlagScorporo(String flagScorporo) {
|
||||||
this.flagScorporo = flagScorporo;
|
this.flagScorporo = flagScorporo;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTipoNumerazione() {
|
public String getTipoNumerazione() {
|
||||||
return tipoNumerazione;
|
return tipoNumerazione;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTipoNumerazione(String tipoNumerazione) {
|
public CtbIreg setTipoNumerazione(String tipoNumerazione) {
|
||||||
this.tipoNumerazione = tipoNumerazione;
|
this.tipoNumerazione = tipoNumerazione;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getSegnoLiquid() {
|
public BigDecimal getSegnoLiquid() {
|
||||||
return segnoLiquid;
|
return segnoLiquid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSegnoLiquid(BigDecimal segnoLiquid) {
|
public CtbIreg setSegnoLiquid(BigDecimal segnoLiquid) {
|
||||||
this.segnoLiquid = segnoLiquid;
|
this.segnoLiquid = segnoLiquid;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFlagIva() {
|
public String getFlagIva() {
|
||||||
return flagIva;
|
return flagIva;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFlagIva(String flagIva) {
|
public CtbIreg setFlagIva(String flagIva) {
|
||||||
this.flagIva = flagIva;
|
this.flagIva = flagIva;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFlagIvaDaVentilare() {
|
public String getFlagIvaDaVentilare() {
|
||||||
return flagIvaDaVentilare;
|
return flagIvaDaVentilare;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFlagIvaDaVentilare(String flagIvaDaVentilare) {
|
public CtbIreg setFlagIvaDaVentilare(String flagIvaDaVentilare) {
|
||||||
this.flagIvaDaVentilare = flagIvaDaVentilare;
|
this.flagIvaDaVentilare = flagIvaDaVentilare;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagExtracee() {
|
||||||
|
return flagExtracee;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CtbIreg setFlagExtracee(String flagExtracee) {
|
||||||
|
this.flagExtracee = flagExtracee;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<CtbInum> getCtbInum() {
|
public List<CtbInum> getCtbInum() {
|
||||||
return ctbInum;
|
return ctbInum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCtbInum(List<CtbInum> ctbInum) {
|
public CtbIreg setCtbInum(List<CtbInum> ctbInum) {
|
||||||
this.ctbInum = ctbInum;
|
this.ctbInum = ctbInum;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<DtbInum> getDtbInum() {
|
public List<DtbInum> getDtbInum() {
|
||||||
return dtbInum;
|
return dtbInum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDtbInum(List<DtbInum> dtbInum) {
|
public CtbIreg setDtbInum(List<DtbInum> dtbInum) {
|
||||||
this.dtbInum = dtbInum;
|
this.dtbInum = dtbInum;
|
||||||
}
|
return this;
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void insertChilds() throws Exception {
|
|
||||||
for (CtbInum ctbInum : getCtbInum()) {
|
|
||||||
ctbInum.manageWithParentConnection(connection, ctbInum.getOperation(), dataCompleting, entityHolder);
|
|
||||||
}
|
|
||||||
for (DtbInum dtbInum : getDtbInum()) {
|
|
||||||
dtbInum.manageWithParentConnection(connection, dtbInum.getOperation(), dataCompleting, entityHolder);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void updateChilds() throws Exception {
|
|
||||||
for (CtbInum ctbInum : getCtbInum()) {
|
|
||||||
ctbInum.manageWithParentConnection(connection, ctbInum.getOperation(), dataCompleting, entityHolder);
|
|
||||||
}
|
|
||||||
for (DtbInum dtbInum : getDtbInum()) {
|
|
||||||
dtbInum.manageWithParentConnection(connection, dtbInum.getOperation(), dataCompleting, entityHolder);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -237,6 +237,7 @@ public class DtbDoct extends DtbBaseDocT implements EquatableEntityInterface<Dtb
|
|||||||
@SqlField(value = "sconto2", nullable = false, defaultObjectValue = "0")
|
@SqlField(value = "sconto2", nullable = false, defaultObjectValue = "0")
|
||||||
private BigDecimal sconto2;
|
private BigDecimal sconto2;
|
||||||
|
|
||||||
|
@FireRecalc
|
||||||
@SqlField(value = "sconto3", nullable = false, defaultObjectValue = "0")
|
@SqlField(value = "sconto3", nullable = false, defaultObjectValue = "0")
|
||||||
private BigDecimal sconto3;
|
private BigDecimal sconto3;
|
||||||
|
|
||||||
@@ -289,7 +290,6 @@ public class DtbDoct extends DtbBaseDocT implements EquatableEntityInterface<Dtb
|
|||||||
@SqlField(value = "targa_rim", maxLength = 20)
|
@SqlField(value = "targa_rim", maxLength = 20)
|
||||||
private String targaRim;
|
private String targaRim;
|
||||||
|
|
||||||
@ForceRecalc
|
|
||||||
@SqlField(value = "posti_pallet")
|
@SqlField(value = "posti_pallet")
|
||||||
private Integer postiPallet;
|
private Integer postiPallet;
|
||||||
|
|
||||||
|
|||||||
@@ -49,39 +49,44 @@ public class DtbInum extends EntityBase {
|
|||||||
return codIreg;
|
return codIreg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCodIreg(String codIreg) {
|
public DtbInum setCodIreg(String codIreg) {
|
||||||
this.codIreg = codIreg;
|
this.codIreg = codIreg;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getNumIreg() {
|
public Integer getNumIreg() {
|
||||||
return numIreg;
|
return numIreg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNumIreg(Integer numIreg) {
|
public DtbInum setNumIreg(Integer numIreg) {
|
||||||
this.numIreg = numIreg;
|
this.numIreg = numIreg;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getAnno() {
|
public Integer getAnno() {
|
||||||
return anno;
|
return anno;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAnno(Integer anno) {
|
public DtbInum setAnno(Integer anno) {
|
||||||
this.anno = anno;
|
this.anno = anno;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSerDoc() {
|
public String getSerDoc() {
|
||||||
return serDoc;
|
return serDoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSerDoc(String serDoc) {
|
public DtbInum setSerDoc(String serDoc) {
|
||||||
this.serDoc = serDoc;
|
this.serDoc = serDoc;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getNumDoc() {
|
public Integer getNumDoc() {
|
||||||
return numDoc;
|
return numDoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNumDoc(Integer numDoc) {
|
public DtbInum setNumDoc(Integer numDoc) {
|
||||||
this.numDoc = numDoc;
|
this.numDoc = numDoc;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ end
|
|||||||
rule "completePartitaMagOrd"
|
rule "completePartitaMagOrd"
|
||||||
when
|
when
|
||||||
eval(completeRulesEnabled)
|
eval(completeRulesEnabled)
|
||||||
$ordT: DtbOrdt(partitaMag != null && gestione == "L" && !DocOrdRules.checkIfPartitaExist(conn, getCodProd(), getPartitaMag()))
|
$ordT: DtbOrdt(partitaMag != null && partitaMag != "[NULL]" && gestione == "L" && !DocOrdRules.checkIfPartitaExist(conn, getCodProd(), getPartitaMag()))
|
||||||
then
|
then
|
||||||
MtbPartitaMag partitaMag = DocOrdRules.completePartitaMag($ordT.getCodProd(), $ordT.getPartitaMag(), $ordT.getNote());
|
MtbPartitaMag partitaMag = DocOrdRules.completePartitaMag($ordT.getCodProd(), $ordT.getPartitaMag(), $ordT.getNote());
|
||||||
modify ( $ordT ) { setRifPartitaMag(partitaMag) }
|
modify ( $ordT ) { setRifPartitaMag(partitaMag) }
|
||||||
|
|||||||
@@ -283,6 +283,18 @@ public class ContabilController {
|
|||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
|
|
||||||
|
}@RequestMapping(value = "rigeneraAutofattura", method = RequestMethod.POST)
|
||||||
|
public @ResponseBody
|
||||||
|
ServiceRestResponse rigeneraAutofattura(HttpServletRequest request,
|
||||||
|
@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||||
|
@RequestParam Date dataInizio,
|
||||||
|
@RequestParam String codIreg,
|
||||||
|
@RequestParam String codIregAutoFat,
|
||||||
|
@RequestParam Integer numDocFirst,
|
||||||
|
@RequestParam Integer numProtFirst) throws Exception {
|
||||||
|
|
||||||
|
return ServiceRestResponse.createPositiveResponse(autofatturaService.rigeneraAutofatture(dataInizio,codIreg, codIregAutoFat, numDocFirst, numProtFirst));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "cancellaAutofattura", method = RequestMethod.POST)
|
@RequestMapping(value = "cancellaAutofattura", method = RequestMethod.POST)
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
package it.integry.ems.contabil.dto;
|
package it.integry.ems.contabil.dto;
|
||||||
|
|
||||||
|
import it.integry.ems_model.annotation.SqlField;
|
||||||
|
|
||||||
public class AutofatturaDTO {
|
public class AutofatturaDTO {
|
||||||
|
@SqlField(value = "num_cmov")
|
||||||
private Integer numCmov;
|
private Integer numCmov;
|
||||||
private String codDtip;
|
private String codDtip;
|
||||||
|
@SqlField(value = "descrizione")
|
||||||
private String descrizione;
|
private String descrizione;
|
||||||
|
@SqlField(value = "identificativo_sdi")
|
||||||
private String identificativoSdi;
|
private String identificativoSdi;
|
||||||
|
|
||||||
|
private boolean rigeneraAutofattura;
|
||||||
|
|
||||||
public Integer getNumCmov() {
|
public Integer getNumCmov() {
|
||||||
return numCmov;
|
return numCmov;
|
||||||
}
|
}
|
||||||
@@ -41,4 +48,13 @@ public class AutofatturaDTO {
|
|||||||
this.identificativoSdi = identificativoSdi;
|
this.identificativoSdi = identificativoSdi;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isRigeneraAutofattura() {
|
||||||
|
return rigeneraAutofattura;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AutofatturaDTO setRigeneraAutofattura(boolean rigeneraAutofattura) {
|
||||||
|
this.rigeneraAutofattura = rigeneraAutofattura;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,17 @@ public class AutofatturaService {
|
|||||||
|
|
||||||
|
|
||||||
public List<EntityBase> cancellaAutofattura(AutofatturaDTO autofatturaDTO) throws Exception {
|
public List<EntityBase> cancellaAutofattura(AutofatturaDTO autofatturaDTO) throws Exception {
|
||||||
|
List<EntityBase> entitylist = cancellaAutofattura(autofatturaDTO.getNumCmov());
|
||||||
|
|
||||||
|
List<EntityBase> entityRet = entityProcessor.processEntityList(entitylist, true);
|
||||||
|
|
||||||
|
UtilityEntity.throwEntitiesException(entityRet);
|
||||||
|
|
||||||
|
return entityRet;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<EntityBase> cancellaAutofattura(Integer numCmov) throws Exception {
|
||||||
List<EntityBase> entitylist = new ArrayList<>();
|
List<EntityBase> entitylist = new ArrayList<>();
|
||||||
|
|
||||||
String sql =
|
String sql =
|
||||||
@@ -57,7 +68,7 @@ public class AutofatturaService {
|
|||||||
"dtb_tipi.cod_ccau is not null AND " +
|
"dtb_tipi.cod_ccau is not null AND " +
|
||||||
"dtb_tipi.tipo_emissione = 'DIRETTA' AND " +
|
"dtb_tipi.tipo_emissione = 'DIRETTA' AND " +
|
||||||
"dtb_tipi.cod_dtip in (select cod_dtip FROM dvw_tipi_integrazioni) ",
|
"dtb_tipi.cod_dtip in (select cod_dtip FROM dvw_tipi_integrazioni) ",
|
||||||
autofatturaDTO.getNumCmov());
|
numCmov);
|
||||||
|
|
||||||
DtbDoct dtbDoct = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, DtbDoct.class);
|
DtbDoct dtbDoct = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, DtbDoct.class);
|
||||||
|
|
||||||
@@ -69,18 +80,107 @@ public class AutofatturaService {
|
|||||||
sql =
|
sql =
|
||||||
Query.format(
|
Query.format(
|
||||||
"SELECT * FROM crl_movt_rif_cmov WHERE num_cmov_rif = %s",
|
"SELECT * FROM crl_movt_rif_cmov WHERE num_cmov_rif = %s",
|
||||||
autofatturaDTO.getNumCmov());
|
numCmov);
|
||||||
|
|
||||||
CrlMovtRifCmov crlMovtRifCmov = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, CrlMovtRifCmov.class);
|
CrlMovtRifCmov crlMovtRifCmov = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, CrlMovtRifCmov.class);
|
||||||
crlMovtRifCmov.setOperation(OperationType.DELETE);
|
crlMovtRifCmov.setOperation(OperationType.DELETE);
|
||||||
entitylist.add(crlMovtRifCmov);
|
entitylist.add(crlMovtRifCmov);
|
||||||
entitylist.add(dtbDoct);
|
entitylist.add(dtbDoct);
|
||||||
|
return entitylist;
|
||||||
|
|
||||||
List<EntityBase> entityRet = entityProcessor.processEntityList(entitylist, true);
|
}
|
||||||
|
|
||||||
UtilityEntity.throwEntitiesException(entityRet);
|
public List<EntityBase> rigeneraAutofatture(Date dataInizio,
|
||||||
|
String codIreg,
|
||||||
|
String codIregAutoFat,
|
||||||
|
Integer numDocFirst,
|
||||||
|
Integer numProtFirst) throws Exception {
|
||||||
|
|
||||||
return entityRet;
|
|
||||||
|
String sql =
|
||||||
|
Query.format("SELECT cod_dtip, Cast(num_ireg as int) as num_ireg, dare_avere, serie FROM dtb_tipi WHERE cod_ireg = %s and flag_gestione_speciale = 1 and flag_attivo = 'S' ", codIregAutoFat);
|
||||||
|
|
||||||
|
List<HashMap<String, Object>> tipiDocumento = UtilityDB.executeSimpleQuery(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||||
|
|
||||||
|
if ( tipiDocumento == null || tipiDocumento.isEmpty() )
|
||||||
|
throw new Exception(String.format("Nessun tipo documento trovato per il registro %s", codIreg));
|
||||||
|
|
||||||
|
Integer anno = UtilityDate.getYear(dataInizio);
|
||||||
|
|
||||||
|
CtbIreg ctbIreg = new CtbIreg()
|
||||||
|
.setCodIreg(codIregAutoFat);
|
||||||
|
|
||||||
|
for (HashMap<String, Object> documento : tipiDocumento) {
|
||||||
|
Integer numIreg = (Integer) documento.get("num_ireg");
|
||||||
|
String serie = (String) documento.get("serie");
|
||||||
|
if (ctbIreg.getCtbInum().stream().noneMatch(x->x.getNumIreg().equals(numIreg))) {
|
||||||
|
CtbInum ctbInum = new CtbInum()
|
||||||
|
.setAnno(anno)
|
||||||
|
.setNumIreg(numIreg)
|
||||||
|
.setNumProt(numProtFirst);
|
||||||
|
ctbInum.setOperation(OperationType.UPDATE);
|
||||||
|
ctbIreg.getCtbInum().add(ctbInum);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ctbIreg.getDtbInum().stream().noneMatch(x->x.getNumIreg().equals(numIreg) && ((String) x.getSerDoc()).equalsIgnoreCase(serie))) {
|
||||||
|
DtbInum dtbInum = new DtbInum()
|
||||||
|
.setAnno(anno)
|
||||||
|
.setNumIreg(numIreg)
|
||||||
|
.setSerDoc(serie)
|
||||||
|
.setNumDoc(numDocFirst);
|
||||||
|
dtbInum.setOperation(OperationType.UPDATE);
|
||||||
|
ctbIreg.getDtbInum().add(dtbInum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
entityProcessor.processEntity(ctbIreg, multiDBTransactionManager);
|
||||||
|
|
||||||
|
sql =
|
||||||
|
Query.format(
|
||||||
|
"SELECT ctb_movt.num_cmov,\n" +
|
||||||
|
" dtb_docr.descrizione_estesa as descrizione,\n" +
|
||||||
|
" dtb_docr.note AS identificativo_sdi, \n" +
|
||||||
|
" CAST(ctb_caus.segno_ireg as int) as segno_ireg \n" +
|
||||||
|
"FROM ctb_movt\n" +
|
||||||
|
" INNER JOIN crl_movt_rif_cmov ON ctb_movt.num_cmov = crl_movt_rif_cmov.num_cmov\n" +
|
||||||
|
" INNER JOIN ctb_caus ON ctb_movt.cod_ccau = ctb_caus.cod_ccau\n" +
|
||||||
|
" INNER JOIN dtb_doct ON crl_movt_rif_cmov.num_cmov_rif = dtb_doct.num_cmov\n" +
|
||||||
|
" INNER JOIN dtb_docr ON dtb_doct.cod_anag = dtb_docr.cod_anag AND dtb_doct.cod_dtip = dtb_docr.cod_dtip AND\n" +
|
||||||
|
" dtb_doct.data_doc = dtb_docr.data_doc AND dtb_doct.ser_doc = dtb_docr.ser_doc AND\n" +
|
||||||
|
" dtb_doct.num_doc = dtb_docr.num_doc\n" +
|
||||||
|
"WHERE ctb_movt.data_cmov BETWEEN %s AND DateFromParts( %s, 12, 31)\n" +
|
||||||
|
" AND ctb_movt.cod_ireg = %s\n" +
|
||||||
|
"ORDER BY ctb_movt.data_cmov, ctb_movt.num_prot",
|
||||||
|
dataInizio, anno, codIreg);
|
||||||
|
|
||||||
|
List<HashMap<String, Object>> listaMov = UtilityDB.executeSimpleQuery(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||||
|
|
||||||
|
List<EntityBase> entityBaseList = new ArrayList<>();
|
||||||
|
for (HashMap<String, Object> mov : listaMov) {
|
||||||
|
String dareAvere;
|
||||||
|
if (UtilityHashMap.<Integer>getValueIfExists(mov, "segno_ireg") < 0) {
|
||||||
|
dareAvere = "A";
|
||||||
|
} else {
|
||||||
|
dareAvere = "D";
|
||||||
|
}
|
||||||
|
String codDtip = (String) tipiDocumento.stream()
|
||||||
|
.filter(x->((String) x.get("dare_avere"))
|
||||||
|
.equalsIgnoreCase(dareAvere)).map(x->x.get("cod_dtip"))
|
||||||
|
.findFirst().orElse(null);
|
||||||
|
if ( UtilityString.isNullOrEmpty(codDtip) ) {
|
||||||
|
throw new Exception(String.format("Tipo documento non configurato per la registrazione delle ",
|
||||||
|
dareAvere.equalsIgnoreCase("D")?"fatture":"note credito"));
|
||||||
|
}
|
||||||
|
|
||||||
|
AutofatturaDTO autofatturaDTO =
|
||||||
|
new AutofatturaDTO().setCodDtip(codDtip)
|
||||||
|
.setNumCmov((Integer) mov.get("num_cmov"))
|
||||||
|
.setDescrizione((String) mov.get("descrizione"))
|
||||||
|
.setIdentificativoSdi((String) mov.get("identificativo_sdi"))
|
||||||
|
.setRigeneraAutofattura(true);
|
||||||
|
entityBaseList.add(generaAutofattura(autofatturaDTO));
|
||||||
|
}
|
||||||
|
return entityBaseList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityBase generaAutofattura(AutofatturaDTO autofatturaDTO) throws Exception {
|
public EntityBase generaAutofattura(AutofatturaDTO autofatturaDTO) throws Exception {
|
||||||
@@ -144,7 +244,6 @@ public class AutofatturaService {
|
|||||||
throw new Exception(String.format("Attenzione sul cliente %s non è stata inserita la modalità di pagamento, impossibile procedere", datiMov.get("cod_anag")));
|
throw new Exception(String.format("Attenzione sul cliente %s non è stata inserita la modalità di pagamento, impossibile procedere", datiMov.get("cod_anag")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
boolean pagaScadenze = false;
|
boolean pagaScadenze = false;
|
||||||
String codDtip = (String) datiMov.get("cod_dtip");
|
String codDtip = (String) datiMov.get("cod_dtip");
|
||||||
OperationType operationType = OperationType.DELETE_THEN_INSERT;
|
OperationType operationType = OperationType.DELETE_THEN_INSERT;
|
||||||
@@ -169,29 +268,40 @@ public class AutofatturaService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DtbDoct dtbDoct =
|
DtbDoct dtbDoct;
|
||||||
new DtbDoct()
|
if (autofatturaDTO.isRigeneraAutofattura()) {
|
||||||
.setCodAnag((String) datiMov.get("cod_anag"))
|
entityList.addAll(cancellaAutofattura((Integer) datiMov.get("num_cmov_rif")));
|
||||||
.setCodDtip(codDtip)
|
operationType = OperationType.INSERT;
|
||||||
.setDataDoc((Date) datiMov.get("data_cmov"))
|
dtbDoct =
|
||||||
.setDataReg((Date) datiMov.get("data_cmov"))
|
new DtbDoct()
|
||||||
.setSerDoc((String) datiMov.get("ser_doc"))
|
.setCodAnag((String) datiMov.get("cod_anag"))
|
||||||
.setNumDoc((Integer) datiMov.get("num_doc"));
|
.setCodDtip(codDtip)
|
||||||
|
.setDataDoc((Date) datiMov.get("data_cmov"))
|
||||||
dtbDoct.setOperation(operationType);
|
.setDataReg((Date) datiMov.get("data_cmov"));
|
||||||
String codDtipOld = UtilityHashMap.getValueIfExists(datiMov, "cod_dtip");
|
} else {
|
||||||
if (datiMov.get("cod_anag_old") != null ||
|
dtbDoct =
|
||||||
datiMov.get("data_doc_old") != null ||
|
new DtbDoct()
|
||||||
(codDtipOld != null && !codDtipOld.equalsIgnoreCase(autofatturaDTO.getCodDtip()))) {
|
.setCodAnag((String) datiMov.get("cod_anag"))
|
||||||
HashMap<String, Object> oldPk = new HashMap<>();
|
.setCodDtip(codDtip)
|
||||||
if (datiMov.get("cod_anag_old") != null) oldPk.put("codAnag", datiMov.get("cod_anag_old"));
|
.setDataDoc((Date) datiMov.get("data_cmov"))
|
||||||
if (datiMov.get("data_doc_old") != null)
|
.setDataReg((Date) datiMov.get("data_cmov"))
|
||||||
oldPk.put("dataDoc", new SimpleDateFormat(CommonConstants.DATE_FORMAT_DMY).format(datiMov.get("data_doc_old")));
|
.setSerDoc((String) datiMov.get("ser_doc"))
|
||||||
if (datiMov.get("cod_dtip") != null && !datiMov.get("cod_dtip").equals(codDtip))
|
.setNumDoc((Integer) datiMov.get("num_doc"));
|
||||||
oldPk.put("codDtip", datiMov.get("cod_dtip"));
|
String codDtipOld = UtilityHashMap.getValueIfExists(datiMov, "cod_dtip");
|
||||||
dtbDoct.setOldPk(oldPk);
|
if (datiMov.get("cod_anag_old") != null ||
|
||||||
|
datiMov.get("data_doc_old") != null ||
|
||||||
|
(codDtipOld != null && !codDtipOld.equalsIgnoreCase(autofatturaDTO.getCodDtip()))) {
|
||||||
|
HashMap<String, Object> oldPk = new HashMap<>();
|
||||||
|
if (datiMov.get("cod_anag_old") != null) oldPk.put("codAnag", datiMov.get("cod_anag_old"));
|
||||||
|
if (datiMov.get("data_doc_old") != null)
|
||||||
|
oldPk.put("dataDoc", new SimpleDateFormat(CommonConstants.DATE_FORMAT_DMY).format(datiMov.get("data_doc_old")));
|
||||||
|
if (datiMov.get("cod_dtip") != null && !datiMov.get("cod_dtip").equals(codDtip))
|
||||||
|
oldPk.put("codDtip", datiMov.get("cod_dtip"));
|
||||||
|
dtbDoct.setOldPk(oldPk);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dtbDoct.setNumCmovAutofattura(autofatturaDTO.getNumCmov());
|
dtbDoct.setNumCmovAutofattura(autofatturaDTO.getNumCmov());
|
||||||
|
dtbDoct.setOperation(operationType);
|
||||||
|
|
||||||
if (UtilityString.isNullOrEmpty(dtbDoct.getCodMdep())) {
|
if (UtilityString.isNullOrEmpty(dtbDoct.getCodMdep())) {
|
||||||
sql = "SELECT min(cod_mdep) FROM mtb_depo WHERE flag_movimentabile = 'S'";
|
sql = "SELECT min(cod_mdep) FROM mtb_depo WHERE flag_movimentabile = 'S'";
|
||||||
@@ -255,7 +365,7 @@ public class AutofatturaService {
|
|||||||
if (entityBase.getException() != null) {
|
if (entityBase.getException() != null) {
|
||||||
multiDBTransactionManager.rollbackAll();
|
multiDBTransactionManager.rollbackAll();
|
||||||
throw new Exception(entityBase.getException());
|
throw new Exception(entityBase.getException());
|
||||||
} else if (entityBase instanceof DtbDoct) {
|
} else if (entityBase instanceof DtbDoct && entityBase.getOperation() != OperationType.DELETE) {
|
||||||
docRet = (DtbDoct) entityBase;
|
docRet = (DtbDoct) entityBase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,43 +92,43 @@ public class ColliEviosysImportService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String sql = Query.format(
|
String sql = Query.format(
|
||||||
"SELECT TOP 1 dtb_ordt.num_ord,\n" +
|
"WITH getOrder AS (SELECT dtb_ordr.num_ord,\n" +
|
||||||
" dtb_ordt.data_ord,\n" +
|
" dtb_ordr.data_ord,\n" +
|
||||||
" dtb_ordt.cod_mdep\n" +
|
" dtb_ordr.riga_ord,\n" +
|
||||||
"FROM dtb_ordt\n" +
|
" dtb_ordr.cod_mdep,\n" +
|
||||||
" INNER JOIN dbo.dtb_ordr ON dtb_ordt.num_ord = dtb_ordr.num_ord AND dtb_ordr.data_ord = dtb_ordt.data_ord AND\n" +
|
" DENSE_RANK() OVER (ORDER BY data_cons DESC, dtb_ordt.data_ord, dtb_ordt.num_ord) AS dr\n" +
|
||||||
" dtb_ordt.gestione = dtb_ordr.gestione\n" +
|
" FROM dtb_ordt\n" +
|
||||||
"WHERE cod_anag = %s\n" +
|
" INNER JOIN dtb_ordr ON dtb_ordt.num_ord = dtb_ordr.num_ord\n" +
|
||||||
" AND dtb_ordt.gestione = 'A'\n" +
|
" AND dtb_ordr.data_ord = dtb_ordt.data_ord\n" +
|
||||||
" AND flag_annulla = 'N'\n" +
|
" AND dtb_ordt.gestione = dtb_ordr.gestione\n" +
|
||||||
" AND flag_evaso = 'I'\n" +
|
" WHERE cod_anag = %s\n" +
|
||||||
" AND cod_mart = %s\n" +
|
" AND dtb_ordt.gestione = 'A'\n" +
|
||||||
"GROUP BY dtb_ordt.num_ord, dtb_ordt.data_ord, dtb_ordt.cod_mdep, data_cons\n" +
|
" AND flag_annulla = 'N'\n" +
|
||||||
"HAVING MAX(data_cons) <= %s\n" +
|
" AND flag_evaso = 'I'\n" +
|
||||||
"ORDER BY data_cons DESC",
|
" AND cod_mart = %s\n" +
|
||||||
|
" AND data_cons <= %s)\n" +
|
||||||
|
"SELECT *\n" +
|
||||||
|
"FROM getOrder\n" +
|
||||||
|
"WHERE dr = 1",
|
||||||
codAnag, codMart, new Date()
|
codAnag, codMart, new Date()
|
||||||
);
|
);
|
||||||
HashMap<String, Object> returnQuery = UtilityDB.executeSimpleQueryOnlyFirstRow(conn, sql);
|
DtbOrdr dtbOrdr = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(conn, sql, DtbOrdr.class);
|
||||||
|
|
||||||
codMdep = returnQuery.get("cod_mdep").toString();
|
|
||||||
|
|
||||||
DtbOrdr ordr = new DtbOrdr();
|
|
||||||
ordr.setDataOrd((Date) returnQuery.get("data_ord")).setGestione("A").setNumOrd((Integer) returnQuery.get("num_ord"));
|
|
||||||
List<DtbOrdr> dtbOrdrs = new ArrayList<>();
|
|
||||||
dtbOrdrs.add(ordr);
|
|
||||||
|
|
||||||
MtbColr mtbColr = new MtbColr()
|
MtbColr mtbColr = new MtbColr()
|
||||||
.setCodMart(codMart)
|
.setCodMart(codMart)
|
||||||
.setPartitaMag(lotto)
|
.setPartitaMag(lotto)
|
||||||
.setQtaCol(UtilityString.stringToBigDecimal(qta));
|
.setQtaCol(UtilityString.stringToBigDecimal(qta))
|
||||||
|
.setCodMart(codMart)
|
||||||
|
.setDataOrd(UtilityLocalDate.localDateFromDate(dtbOrdr.getDataOrd()))
|
||||||
|
.setNumOrd(dtbOrdr.getNumOrd())
|
||||||
|
.setRigaOrd(dtbOrdr.getRigaOrd());;
|
||||||
|
|
||||||
MtbColt mtbColt = new MtbColt()
|
MtbColt mtbColt = new MtbColt()
|
||||||
.setDataCollo(LocalDate.now())
|
.setDataCollo(LocalDate.now())
|
||||||
.setSegno(1)
|
.setSegno(1)
|
||||||
.setGestione("A")
|
.setGestione("A")
|
||||||
.setBarcodeUl(barcodeUl)
|
.setBarcodeUl(barcodeUl)
|
||||||
.setCodMdep(codMdep)
|
.setCodMdep(dtbOrdr.getCodMdep())
|
||||||
.setFiltroOrdini(MtbColtUtils.generaFiltroOrdini(null, dtbOrdrs))
|
|
||||||
.setCodAnag(codAnag);
|
.setCodAnag(codAnag);
|
||||||
|
|
||||||
mtbColt.setMtbColr(new ArrayList<>())
|
mtbColt.setMtbColr(new ArrayList<>())
|
||||||
@@ -141,20 +141,7 @@ public class ColliEviosysImportService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (MtbColt mtbColt : mtbColtList) {
|
return entityProcessor.processEntityList(mtbColtList, multiDBTransactionManager, true);
|
||||||
entityProcessor.processEntity(mtbColt, multiDBTransactionManager);
|
|
||||||
|
|
||||||
List<MtbColt> colDistributed = distribuzioneColliService.distribuzioneRigheColloNew(new FiltroDistribuzioneColloDTO()
|
|
||||||
.setDataCollo(mtbColt.getDataCollo())
|
|
||||||
.setSerCollo(mtbColt.getSerCollo())
|
|
||||||
.setGestione(mtbColt.getGestione())
|
|
||||||
.setNumCollo(mtbColt.getNumCollo())
|
|
||||||
.setCriterioDistribuzione("U"), true);
|
|
||||||
|
|
||||||
entityBases.addAll(entityProcessor.processEntityList(colDistributed, multiDBTransactionManager, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
return entityBases;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Object cellToString(Cell cell) {
|
private Object cellToString(Cell cell) {
|
||||||
|
|||||||
@@ -452,6 +452,9 @@ public class ColliImportService {
|
|||||||
dataScad = new Date();
|
dataScad = new Date();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String oraProdTemp = line.substring(224, 224 + 4).trim();
|
||||||
|
Integer oraProd = oraProdTemp.isEmpty() ? null : Integer.parseInt(oraProdTemp);
|
||||||
|
|
||||||
vebadDesadv.getDettagliLotti()
|
vebadDesadv.getDettagliLotti()
|
||||||
.add(
|
.add(
|
||||||
new VebadDesadvDettagliLottiDTO()
|
new VebadDesadvDettagliLottiDTO()
|
||||||
@@ -469,7 +472,7 @@ public class ColliImportService {
|
|||||||
.setTranscodifica(line.substring(134, 134 + 20))
|
.setTranscodifica(line.substring(134, 134 + 20))
|
||||||
.setCodStabilimentoProd(line.substring(154, 154 + 20))
|
.setCodStabilimentoProd(line.substring(154, 154 + 20))
|
||||||
.setDescStabilimentoProd(line.substring(174, 174 + 50))
|
.setDescStabilimentoProd(line.substring(174, 174 + 50))
|
||||||
.setOraProd(Integer.parseInt(line.substring(224, 224 + 4)))
|
.setOraProd(oraProd)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -503,38 +506,36 @@ public class ColliImportService {
|
|||||||
String codMart = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
String codMart = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||||
|
|
||||||
sql = Query.format(
|
sql = Query.format(
|
||||||
"SELECT TOP 1 dtb_ordt.num_ord,\n" +
|
"WITH getOrder AS (SELECT dtb_ordr.num_ord,\n" +
|
||||||
" dtb_ordt.data_ord,\n" +
|
" dtb_ordr.data_ord,\n" +
|
||||||
" dtb_ordt.cod_mdep\n" +
|
" dtb_ordr.riga_ord,\n" +
|
||||||
"FROM dtb_ordt\n" +
|
" DENSE_RANK() OVER (ORDER BY data_cons DESC, dtb_ordt.data_ord, dtb_ordt.num_ord) AS dr\n" +
|
||||||
" INNER JOIN dbo.dtb_ordr ON dtb_ordt.num_ord = dtb_ordr.num_ord AND dtb_ordr.data_ord = dtb_ordt.data_ord AND\n" +
|
" FROM dtb_ordt\n" +
|
||||||
" dtb_ordt.gestione = dtb_ordr.gestione\n" +
|
" INNER JOIN dtb_ordr ON dtb_ordt.num_ord = dtb_ordr.num_ord\n" +
|
||||||
"WHERE cod_anag = %s\n" +
|
" AND dtb_ordr.data_ord = dtb_ordt.data_ord\n" +
|
||||||
" AND dtb_ordt.gestione = 'A'\n" +
|
" AND dtb_ordt.gestione = dtb_ordr.gestione\n" +
|
||||||
" AND flag_annulla = 'N'\n" +
|
" WHERE cod_anag = %s\n" +
|
||||||
" AND flag_evaso = 'I'\n" +
|
" AND dtb_ordt.gestione = 'A'\n" +
|
||||||
" AND cod_mart = %s\n" +
|
" AND flag_annulla = 'N'\n" +
|
||||||
"GROUP BY dtb_ordt.num_ord, dtb_ordt.data_ord, dtb_ordt.cod_mdep, data_cons\n" +
|
" AND flag_evaso = 'I'\n" +
|
||||||
"HAVING MAX(data_cons) <= %s\n" +
|
" AND cod_mart = %s\n" +
|
||||||
"ORDER BY data_cons DESC",
|
" AND data_cons <= %s)\n" +
|
||||||
|
"SELECT *\n" +
|
||||||
|
"FROM getOrder\n" +
|
||||||
|
"WHERE dr = 1",
|
||||||
codAnag, codMart, vebadDesadv.getTestataDoc().getDataDDT()
|
codAnag, codMart, vebadDesadv.getTestataDoc().getDataDDT()
|
||||||
);
|
);
|
||||||
HashMap<String, Object> returnQuery = UtilityDB.executeSimpleQueryOnlyFirstRow(conn, sql);
|
DtbOrdr dtbOrdr = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(conn, sql, DtbOrdr.class);
|
||||||
|
|
||||||
DtbOrdr ordr = new DtbOrdr();
|
|
||||||
ordr.setDataOrd((Date) returnQuery.get("data_ord")).setGestione("A").setNumOrd((Integer) returnQuery.get("num_ord"));
|
|
||||||
List<DtbOrdr> dtbOrdrs = new ArrayList<>();
|
|
||||||
dtbOrdrs.add(ordr);
|
|
||||||
|
|
||||||
mtbColt.setFiltroOrdini(MtbColtUtils.generaFiltroOrdini(null, dtbOrdrs))
|
|
||||||
.setCodMdep(returnQuery.get("cod_mdep").toString());
|
|
||||||
|
|
||||||
MtbColr mtbColr = new MtbColr()
|
MtbColr mtbColr = new MtbColr()
|
||||||
.setDataScadPartita(dettagliLotti.getDataScad())
|
.setDataScadPartita(dettagliLotti.getDataScad())
|
||||||
.setPartitaMag(dettagliLotti.getLotto())
|
.setPartitaMag(dettagliLotti.getLotto())
|
||||||
.setCodBarre(dettagliLotti.getGtin())
|
.setCodBarre(dettagliLotti.getGtin())
|
||||||
.setNumCnf(new BigDecimal(dettagliLotti.getQtaSscc()))
|
.setNumCnf(new BigDecimal(dettagliLotti.getQtaSscc()))
|
||||||
.setCodMart(codMart);
|
.setCodMart(codMart)
|
||||||
|
.setDataOrd(UtilityLocalDate.localDateFromDate(dtbOrdr.getDataOrd()))
|
||||||
|
.setNumOrd(dtbOrdr.getNumOrd())
|
||||||
|
.setRigaOrd(dtbOrdr.getRigaOrd());
|
||||||
|
|
||||||
mtbColt.setMtbColr(new ArrayList<>())
|
mtbColt.setMtbColr(new ArrayList<>())
|
||||||
.getMtbColr()
|
.getMtbColr()
|
||||||
@@ -543,19 +544,6 @@ public class ColliImportService {
|
|||||||
mtbColts.add(mtbColt);
|
mtbColts.add(mtbColt);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (MtbColt mtbColt : mtbColts) {
|
return entityProcessor.processEntityList(mtbColts, multiDBTransactionManager, true);
|
||||||
entityProcessor.processEntity(mtbColt, multiDBTransactionManager);
|
|
||||||
|
|
||||||
List<MtbColt> colDistributed = distribuzioneColliService.distribuzioneRigheColloNew(new FiltroDistribuzioneColloDTO()
|
|
||||||
.setDataCollo(mtbColt.getDataCollo())
|
|
||||||
.setSerCollo(mtbColt.getSerCollo())
|
|
||||||
.setGestione(mtbColt.getGestione())
|
|
||||||
.setNumCollo(mtbColt.getNumCollo())
|
|
||||||
.setCriterioDistribuzione("U"), true);
|
|
||||||
|
|
||||||
entityBases.addAll(entityProcessor.processEntityList(colDistributed, multiDBTransactionManager, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
return entityBases;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,7 +88,13 @@ public class ImportApuliaPromoService {
|
|||||||
" INNER JOIN mtb_lisa art ON mtb_lisa.cod_barre = art.cod_barre AND mtb_lisa.cod_alis = art.cod_alis\n" +
|
" INNER JOIN mtb_lisa art ON mtb_lisa.cod_barre = art.cod_barre AND mtb_lisa.cod_alis = art.cod_alis\n" +
|
||||||
"WHERE mtb_lisa.cod_art_for = " + UtilityDB.valueToString(promozione.getCodArtForn()) + "\n" +
|
"WHERE mtb_lisa.cod_art_for = " + UtilityDB.valueToString(promozione.getCodArtForn()) + "\n" +
|
||||||
" AND mtb_lisa.cod_alis = " + UtilityDB.valueToString(codAlis) + "\n" +
|
" AND mtb_lisa.cod_alis = " + UtilityDB.valueToString(codAlis) + "\n" +
|
||||||
" AND mtb_lisa.cod_barre is not null \n";
|
" AND mtb_lisa.cod_barre is not null \n" +
|
||||||
|
"SELECT art.cod_mart, art.cod_art_for\n" +
|
||||||
|
"FROM mtb_lisa\n" +
|
||||||
|
" INNER JOIN mtb_lisa art ON mtb_lisa.descr_art_forn = art.descr_art_forn AND mtb_lisa.cod_alis = art.cod_alis\n" +
|
||||||
|
"WHERE mtb_lisa.cod_art_for = " + UtilityDB.valueToString(promozione.getCodArtForn()) + "\n" +
|
||||||
|
" AND mtb_lisa.cod_alis = " + UtilityDB.valueToString(codAlis) + "\n" +
|
||||||
|
" AND mtb_lisa.descr_art_forn is not null \n";
|
||||||
|
|
||||||
List<MtbLisaData> mtbLisaData = new ResultSetMapper().mapQuerySetToList(multiDBTransactionManager.getPrimaryConnection(), sql, MtbLisaData.class, OperationType.INSERT_OR_UPDATE);
|
List<MtbLisaData> mtbLisaData = new ResultSetMapper().mapQuerySetToList(multiDBTransactionManager.getPrimaryConnection(), sql, MtbLisaData.class, OperationType.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
|
|||||||
@@ -446,7 +446,8 @@ public class ImportListiniAcquistoApuliaCarrefourService {
|
|||||||
+ " um_frontalino varchar(80),"
|
+ " um_frontalino varchar(80),"
|
||||||
+ " um_peso varchar(80),"
|
+ " um_peso varchar(80),"
|
||||||
+ " espolodi_dist varchar(80),"
|
+ " espolodi_dist varchar(80),"
|
||||||
+ " partita_iva_forn varchar(80))";
|
+ " partita_iva_forn varchar(80),"
|
||||||
|
+ " altro varchar(max))";
|
||||||
}
|
}
|
||||||
ps = conn.prepareStatement(sql);
|
ps = conn.prepareStatement(sql);
|
||||||
ps.executeUpdate();
|
ps.executeUpdate();
|
||||||
|
|||||||
@@ -305,25 +305,29 @@ public class ProductionPlanService {
|
|||||||
|
|
||||||
ordLavDTO.setPartite(saveProductionPlanDTO.getPartite());
|
ordLavDTO.setPartite(saveProductionPlanDTO.getPartite());
|
||||||
|
|
||||||
sql = Query.format(
|
// Se il deposito dell'ordine di lavorazione è diverso dal quello della sede
|
||||||
"SELECT num_ord, qta_prod\n" +
|
// allora siamo in campagna e quindi non accorpiamo prodotto, commessa nello stesso ordine
|
||||||
"FROM dtb_ordt\n" +
|
if (depo != null && codMdep.equalsIgnoreCase(depo.getCodMdep())) {
|
||||||
"WHERE cod_jcom = %s\n" +
|
sql = Query.format(
|
||||||
" AND cod_prod = %s\n" +
|
"SELECT num_ord, qta_prod\n" +
|
||||||
" AND data_ord = %s",
|
"FROM dtb_ordt\n" +
|
||||||
saveProductionPlanDTO.getCodJcom(),
|
"WHERE cod_jcom = %s\n" +
|
||||||
saveProductionPlanDTO.getCodProd(),
|
" AND cod_prod = %s\n" +
|
||||||
saveProductionPlanDTO.getDataOrd()
|
" AND data_ord = %s",
|
||||||
);
|
saveProductionPlanDTO.getCodJcom(),
|
||||||
|
saveProductionPlanDTO.getCodProd(),
|
||||||
|
saveProductionPlanDTO.getDataOrd()
|
||||||
|
);
|
||||||
|
|
||||||
if (numOrdL == null || numOrdL == 0) {
|
if (numOrdL == null || numOrdL == 0) {
|
||||||
HashMap<String, Object> ordData = UtilityDB.executeSimpleQueryOnlyFirstRow(multiDBTransactionManager.getPrimaryConnection(), sql);
|
HashMap<String, Object> ordData = UtilityDB.executeSimpleQueryOnlyFirstRow(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||||
|
|
||||||
if (ordData != null) {
|
if (ordData != null) {
|
||||||
numOrdL = UtilityHashMap.getValueIfExists(ordData, "num_ord");
|
numOrdL = UtilityHashMap.getValueIfExists(ordData, "num_ord");
|
||||||
|
|
||||||
qtaProd = (qtaProd != null ? qtaProd : BigDecimal.ZERO)
|
qtaProd = (qtaProd != null ? qtaProd : BigDecimal.ZERO)
|
||||||
.add(UtilityHashMap.getValueIfExists(ordData, "qta_prod"));
|
.add(UtilityHashMap.getValueIfExists(ordData, "qta_prod"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,11 +5,16 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
public class MRPDailySetupGruppiDTO {
|
public class MRPDailySetupGruppiDTO {
|
||||||
@JsonProperty("cod_mgrp")
|
@JsonProperty("cod_mgrp")
|
||||||
private String codMgrp;
|
private String codMgrp;
|
||||||
|
|
||||||
@JsonProperty("includi_sospesi")
|
@JsonProperty("includi_sospesi")
|
||||||
private boolean includiSospesi;
|
private boolean includiSospesi;
|
||||||
|
|
||||||
@JsonProperty("agg_imp_prox")
|
@JsonProperty("agg_imp_prox")
|
||||||
private boolean aggImpProx;
|
private boolean aggImpProx;
|
||||||
|
|
||||||
|
@JsonProperty("includi_budget")
|
||||||
|
private boolean includiBudget;
|
||||||
|
|
||||||
public boolean isAggImpProx() {
|
public boolean isAggImpProx() {
|
||||||
return aggImpProx;
|
return aggImpProx;
|
||||||
}
|
}
|
||||||
@@ -36,4 +41,13 @@ public class MRPDailySetupGruppiDTO {
|
|||||||
this.includiSospesi = includiSospesi;
|
this.includiSospesi = includiSospesi;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isIncludiBudget() {
|
||||||
|
return includiBudget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MRPDailySetupGruppiDTO setIncludiBudget(boolean includiBudget) {
|
||||||
|
this.includiBudget = includiBudget;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -351,15 +351,15 @@ public class MrpDailyMaterialReqDetDTO {
|
|||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public BigDecimal getFabbisogno(boolean includiSospesi, boolean includiBudget) {
|
public BigDecimal getFabbisogno(boolean includiSospesi, boolean includiBudget) {
|
||||||
BigDecimal fabbisogno = getImpegni();
|
BigDecimal fabbisogno = getImpegni();
|
||||||
if (includiSospesi) {
|
fabbisogno = fabbisogno.add(getImpegniProx(includiSospesi, includiBudget));
|
||||||
fabbisogno = fabbisogno.add(getImpegniProx(includiBudget));
|
|
||||||
}
|
|
||||||
return fabbisogno;
|
return fabbisogno;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public BigDecimal getImpegniProx(boolean includiBudget) {
|
public BigDecimal getImpegniProx(boolean includiSospesi, boolean includiBudget) {
|
||||||
BigDecimal qtaImpProx = getQtaContrVend().add(getQtaImpProxOrd());
|
BigDecimal qtaImpProx = BigDecimal.ZERO;
|
||||||
|
if (includiSospesi)
|
||||||
|
qtaImpProx = getQtaContrVend().add(getQtaImpProxOrd());
|
||||||
if (includiBudget)
|
if (includiBudget)
|
||||||
qtaImpProx = qtaImpProx.add(getQtaImpBudget());
|
qtaImpProx = qtaImpProx.add(getQtaImpBudget());
|
||||||
return qtaImpProx;
|
return qtaImpProx;
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ public class RegisterSupervisorDTO {
|
|||||||
|
|
||||||
private int supervisorServicePort = 10251;
|
private int supervisorServicePort = 10251;
|
||||||
|
|
||||||
|
private int printQuantity = 1;
|
||||||
|
|
||||||
private String lineaType;
|
private String lineaType;
|
||||||
|
|
||||||
public String getCodJfas() {
|
public String getCodJfas() {
|
||||||
@@ -76,4 +78,13 @@ public class RegisterSupervisorDTO {
|
|||||||
this.lineaType = lineaType;
|
this.lineaType = lineaType;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPrintQuantity() {
|
||||||
|
return printQuantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RegisterSupervisorDTO setPrintQuantity(int printQuantity) {
|
||||||
|
this.printQuantity = printQuantity;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -814,7 +814,9 @@ public class MesProductionServiceV2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
printerService.print(printerName, new ByteArrayInputStream(bytes), "application/pdf", orientation);
|
for (int i= 0;i<hmiData.getPrintQuantity();i++){
|
||||||
|
printerService.print(printerName, new ByteArrayInputStream(bytes), "application/pdf", orientation);
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ public class MrpDailyMaterialReqService {
|
|||||||
|
|
||||||
for (MrpDailyMaterialReqDTO art : datiArt) {
|
for (MrpDailyMaterialReqDTO art : datiArt) {
|
||||||
boolean inclusiSospesi = getSetupIncluseSospesi(art.getCodMgrp(), setupGruppi);
|
boolean inclusiSospesi = getSetupIncluseSospesi(art.getCodMgrp(), setupGruppi);
|
||||||
|
boolean includiBudget = getSetupIncludiBudget(art.getCodMgrp(), setupGruppi);
|
||||||
List<MrpDailyMaterialReqDetDTO> dettagliArt = UtilityHashMap.getValueIfExists(listArticoli, art.getCodMart());
|
List<MrpDailyMaterialReqDetDTO> dettagliArt = UtilityHashMap.getValueIfExists(listArticoli, art.getCodMart());
|
||||||
if (dettagliArt == null) continue;
|
if (dettagliArt == null) continue;
|
||||||
|
|
||||||
@@ -200,8 +201,6 @@ public class MrpDailyMaterialReqService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (MrpDailyMaterialReqDetDTO x : gg.getValue()) {
|
for (MrpDailyMaterialReqDetDTO x : gg.getValue()) {
|
||||||
boolean includiBudget = setupGest.getSetupDepoBoolean(multiDBTransactionManager.getPrimaryConnection(), GEST_NAME, SECTION, "ASSEGNA_BUDGET", x.getCodMdep());
|
|
||||||
|
|
||||||
giacenza = giacenza.add(x.getGiacenza());
|
giacenza = giacenza.add(x.getGiacenza());
|
||||||
qtaContVend = qtaContVend.add(x.getQtaContrVend());
|
qtaContVend = qtaContVend.add(x.getQtaContrVend());
|
||||||
qtaArrivi = qtaArrivi.add(x.getArrivi());
|
qtaArrivi = qtaArrivi.add(x.getArrivi());
|
||||||
@@ -219,7 +218,7 @@ public class MrpDailyMaterialReqService {
|
|||||||
.addQtaImpegni(x.getImpegni())
|
.addQtaImpegni(x.getImpegni())
|
||||||
.addQtaArrivi(x.getArrivi())
|
.addQtaArrivi(x.getArrivi())
|
||||||
.addGiacenza(!datiGg.isEmpty() ? datiGg.get(datiGg.size() - 1).getDisponibilita() : x.getGiacenza())
|
.addGiacenza(!datiGg.isEmpty() ? datiGg.get(datiGg.size() - 1).getDisponibilita() : x.getGiacenza())
|
||||||
.addQtaImpegniProx(x.getImpegniProx(includiBudget));
|
.addQtaImpegniProx(x.getImpegniProx(inclusiSospesi, includiBudget));
|
||||||
|
|
||||||
if (depoArt != null)
|
if (depoArt != null)
|
||||||
addDisponibilitaDepo((String) gg.getKey().get("codMdep"), depoArt, x.getDisponibilita(inclusiSospesi, includiArrivi, includiBudget));
|
addDisponibilitaDepo((String) gg.getKey().get("codMdep"), depoArt, x.getDisponibilita(inclusiSospesi, includiArrivi, includiBudget));
|
||||||
@@ -303,6 +302,14 @@ public class MrpDailyMaterialReqService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean getSetupIncludiBudget(String codMgrp, List<MRPDailySetupGruppiDTO> setupGruppiDTO) {
|
||||||
|
return
|
||||||
|
Boolean.TRUE.equals(Stream.of(setupGruppiDTO).filter(x -> x.getCodMgrp().equalsIgnoreCase(codMgrp))
|
||||||
|
.findFirst()
|
||||||
|
.map(MRPDailySetupGruppiDTO::isIncludiBudget).orElse(true));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isSottoScorta(List<MRPDailyDatiDepoDTO> datiDepo) {
|
private boolean isSottoScorta(List<MRPDailyDatiDepoDTO> datiDepo) {
|
||||||
if (datiDepo == null)
|
if (datiDepo == null)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import it.integry.ems.production.dto.MRP.MRPDailySetupSottogruppiDTO;
|
|||||||
import it.integry.ems.settings.Model.AvailableConnectionsModel;
|
import it.integry.ems.settings.Model.AvailableConnectionsModel;
|
||||||
import it.integry.ems.settings.Model.SettingsModel;
|
import it.integry.ems.settings.Model.SettingsModel;
|
||||||
import it.integry.ems.settings.SettingsController;
|
import it.integry.ems.settings.SettingsController;
|
||||||
|
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||||
import it.integry.ems.utility.UtilityDebug;
|
import it.integry.ems.utility.UtilityDebug;
|
||||||
import it.integry.ems_model.service.SetupGest;
|
import it.integry.ems_model.service.SetupGest;
|
||||||
@@ -135,21 +136,27 @@ public class MrpSetupHandlerService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private List<MRPDailySetupGruppiDTO> getSetupGruppi(MultiDBTransactionManager multiDBTransactionManager) throws Exception {
|
private List<MRPDailySetupGruppiDTO> getSetupGruppi(MultiDBTransactionManager multiDBTransactionManager) throws Exception {
|
||||||
|
Connection conn = multiDBTransactionManager.getPrimaryConnection();
|
||||||
final String gestName = "PVM";
|
final String gestName = "PVM";
|
||||||
final String section = "MRP";
|
final String section = "MRP";
|
||||||
final String keySectionSospesi = "USE_SOSPESI";
|
final String keySectionSospesi = "USE_SOSPESI";
|
||||||
String useSosepsi = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), gestName, section, keySectionSospesi);
|
String useSosepsi = setupGest.getSetup(conn, gestName, section, keySectionSospesi);
|
||||||
if (UtilityString.isNullOrEmpty(useSosepsi)) useSosepsi = "N";
|
if (UtilityString.isNullOrEmpty(useSosepsi)) useSosepsi = "N";
|
||||||
|
|
||||||
final String keySectionAggImpProx = "AGGIORNA_IMP_PROX";
|
final String keySectionAggImpProx = "AGGIORNA_IMP_PROX";
|
||||||
String aggImpProx = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), gestName, section, keySectionAggImpProx);
|
String aggImpProx = setupGest.getSetup(conn, gestName, section, keySectionAggImpProx);
|
||||||
if (UtilityString.isNullOrEmpty(aggImpProx)) aggImpProx = "N";
|
if (UtilityString.isNullOrEmpty(aggImpProx)) aggImpProx = "N";
|
||||||
|
|
||||||
|
final String keySectionIncludiBudget = "INCLUDI_BUDGET";
|
||||||
|
String includiBudget = setupGest.getSetup(conn, gestName, section, keySectionIncludiBudget);
|
||||||
|
if (UtilityString.isNullOrEmpty(includiBudget)) includiBudget = "N";
|
||||||
|
|
||||||
String sql =
|
String sql =
|
||||||
Query.format(
|
Query.format(
|
||||||
"SELECT cod_mgrp, \n" +
|
"SELECT cod_mgrp, \n" +
|
||||||
"CAST(CASE WHEN IsNull("+ keySectionSospesi +", %s) = 'S' THEN 1 ELSE 0 END as BIT) as includi_sospesi, \n" +
|
"CAST(CASE WHEN IsNull("+ keySectionSospesi +", %s) = 'S' THEN 1 ELSE 0 END as BIT) as includi_sospesi, \n" +
|
||||||
"CAST(CASE WHEN IsNull("+ keySectionAggImpProx +", %s) = 'S' THEN 1 ELSE 0 END as BIT) as agg_imp_prox\n" +
|
"CAST(CASE WHEN IsNull("+ keySectionAggImpProx +", %s) = 'S' THEN 1 ELSE 0 END as BIT) as agg_imp_prox, \n" +
|
||||||
|
"CAST(CASE WHEN IsNull("+ keySectionIncludiBudget +", %s) = 'S' THEN 1 ELSE 0 END as BIT) as includi_budget\n" +
|
||||||
"FROM (\n" +
|
"FROM (\n" +
|
||||||
"SELECT mtb_grup.cod_mgrp, stb_gest_setup_det.key_section, stb_gest_setup_det.value \n" +
|
"SELECT mtb_grup.cod_mgrp, stb_gest_setup_det.key_section, stb_gest_setup_det.value \n" +
|
||||||
"FROM mtb_grup\n" +
|
"FROM mtb_grup\n" +
|
||||||
@@ -160,10 +167,10 @@ public class MrpSetupHandlerService {
|
|||||||
" mtb_grup.cod_mgrp = stb_gest_setup_det.val_col_rif) t\n" +
|
" mtb_grup.cod_mgrp = stb_gest_setup_det.val_col_rif) t\n" +
|
||||||
"PIVOT\n" +
|
"PIVOT\n" +
|
||||||
"( max(value) \n" +
|
"( max(value) \n" +
|
||||||
"FOR key_section IN (["+ keySectionAggImpProx +"],["+ keySectionSospesi +"])) AS PivotTable" ,
|
"FOR key_section IN (["+ keySectionAggImpProx +"],["+ keySectionSospesi +"],["+ keySectionIncludiBudget +"])) AS PivotTable" ,
|
||||||
useSosepsi, aggImpProx, gestName, section);
|
useSosepsi, aggImpProx, includiBudget, gestName, section);
|
||||||
|
|
||||||
return UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, MRPDailySetupGruppiDTO.class);
|
return UtilityDB.executeSimpleQueryDTO(conn, sql, MRPDailySetupGruppiDTO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<MRPDailySetupSottogruppiDTO> getSetupSottogruppi(MultiDBTransactionManager multiDBTransactionManager) throws Exception {
|
private List<MRPDailySetupSottogruppiDTO> getSetupSottogruppi(MultiDBTransactionManager multiDBTransactionManager) throws Exception {
|
||||||
|
|||||||
@@ -362,7 +362,8 @@ public class PvmAccettazioneService {
|
|||||||
if (dtbDoct instanceof WdtbDoct)
|
if (dtbDoct instanceof WdtbDoct)
|
||||||
((WdtbDoct) dtbDoct)
|
((WdtbDoct) dtbDoct)
|
||||||
.setDataInizTrasp(dataInizTrap)
|
.setDataInizTrasp(dataInizTrap)
|
||||||
.setOraInizTrasp(oraInizTrasp);
|
.setOraInizTrasp(oraInizTrasp)
|
||||||
|
.setDataReg(dataInizTrap);
|
||||||
}
|
}
|
||||||
|
|
||||||
private WdtbDocr insertRowBolla(AccettazioneDTO.Articoli articolo, Integer idRiga, String partitaMag, BigDecimal qtaDoc, BigDecimal valUnt) throws Exception {
|
private WdtbDocr insertRowBolla(AccettazioneDTO.Articoli articolo, Integer idRiga, String partitaMag, BigDecimal qtaDoc, BigDecimal valUnt) throws Exception {
|
||||||
|
|||||||
@@ -739,7 +739,7 @@ public class GiacenzaService {
|
|||||||
" )\n" +
|
" )\n" +
|
||||||
" )\n" +
|
" )\n" +
|
||||||
" -- prendiamo i soli ordini del SECCO, sarà da modificare quando inizieranno ad ordinare anche altri (es. APULD)\n" +
|
" -- prendiamo i soli ordini del SECCO, sarà da modificare quando inizieranno ad ordinare anche altri (es. APULD)\n" +
|
||||||
" AND t.listino IN (" + UtilityDB.listValueToString(listini) + ")\n" +
|
( listini != null && !listini.isEmpty() ?" AND t.listino IN (" + UtilityDB.listValueToString(listini) + ")\n":"") +
|
||||||
" -- ordine non ancora evaso\n" +
|
" -- ordine non ancora evaso\n" +
|
||||||
" AND flag_evaso <> 'E'\n" +
|
" AND flag_evaso <> 'E'\n" +
|
||||||
" -- filtro solamente un Pdv\n" +
|
" -- filtro solamente un Pdv\n" +
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.net.InetAddress;
|
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
@@ -103,24 +102,34 @@ public class WMSGenericController {
|
|||||||
return ServiceRestResponse.createPositiveResponse(wmsGenericService.getPickingListFromBarcodeOrdine(codBarreBancale));
|
return ServiceRestResponse.createPositiveResponse(wmsGenericService.getPickingListFromBarcodeOrdine(codBarreBancale));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "updateWMSApp", method = RequestMethod.GET)
|
@GetMapping(value = "updateWMSApp")
|
||||||
public ServiceRestResponse updateWMSApp() throws Exception {
|
public ServiceRestResponse updateWMSApp(@RequestParam(required = false) String suffix) throws Exception {
|
||||||
String baseDownloadUrl = "https://jnxuo98bbuecrmbkciijvpkg.file.core.windows.net/storage-ci/wms/";
|
String baseDownloadUrl = "https://jnxuo98bbuecrmbkciijvpkg.file.core.windows.net/storage-ci/wms/";
|
||||||
String azureToken = "?sv=2022-11-02&ss=bf&srt=sco&sp=r&se=2030-11-04T17:45:57Z&st=2024-11-04T09:45:57Z&spr=https&sig=CGxbbC08xuvAz%2B6k2C6HDq6e9UGitb0lnbbsWeRG%2FiU%3D";
|
String azureToken = "?sv=2022-11-02&ss=bf&srt=sco&sp=r&se=2030-11-04T17:45:57Z&st=2024-11-04T09:45:57Z&spr=https&sig=CGxbbC08xuvAz%2B6k2C6HDq6e9UGitb0lnbbsWeRG%2FiU%3D";
|
||||||
|
|
||||||
String androidAppFilePath = Paths.get(UtilityDirs.getWebAppPath(), "wms", "android-release.apk").toString();
|
if (UtilityString.isNullOrEmpty(suffix))
|
||||||
HttpRestWrapper.downloadFile(baseDownloadUrl + "android-release.apk" + azureToken, androidAppFilePath);
|
suffix = "";
|
||||||
|
else
|
||||||
|
suffix = "-" + suffix;
|
||||||
|
|
||||||
|
|
||||||
String androidAppVersionFilePath = Paths.get(UtilityDirs.getWebAppPath(), "wms", "version.txt").toString();
|
String androidAppFilePath = Paths.get(UtilityDirs.getWebAppPath(), "wms", "android-release" + suffix + ".apk").toString();
|
||||||
HttpRestWrapper.downloadFile(baseDownloadUrl + "version.txt" + azureToken, androidAppVersionFilePath);
|
HttpRestWrapper.downloadFile(baseDownloadUrl + "android-release" + suffix + ".apk" + azureToken, androidAppFilePath);
|
||||||
|
|
||||||
|
String androidAppVersionFilePath = Paths.get(UtilityDirs.getWebAppPath(), "wms", "version" + suffix + ".txt").toString();
|
||||||
|
HttpRestWrapper.downloadFile(baseDownloadUrl + "version" + suffix + ".txt" + azureToken, androidAppVersionFilePath);
|
||||||
|
|
||||||
return ServiceRestResponse.createPositiveResponse();
|
return ServiceRestResponse.createPositiveResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = EmsRestConstants.PATH_CHECK_LATEST_WMS_VERSION_JSON, method = RequestMethod.GET)
|
@GetMapping(value = EmsRestConstants.PATH_CHECK_LATEST_WMS_VERSION_JSON)
|
||||||
public Object checkWMSLatestVersionJSON(HttpServletResponse response) throws Exception {
|
public WMSVersionDTO checkWMSLatestVersionJSON(HttpServletResponse response, @RequestParam(required = false) String suffix) throws Exception {
|
||||||
String wmsVersionFile = Paths.get(UtilityDirs.getWebAppPath(), "wms", "version.txt").toString();
|
if (UtilityString.isNullOrEmpty(suffix))
|
||||||
|
suffix = "";
|
||||||
|
else
|
||||||
|
suffix = "-" + suffix;
|
||||||
|
|
||||||
|
String wmsVersionFile = Paths.get(UtilityDirs.getWebAppPath(), "wms", "version" + suffix + ".txt").toString();
|
||||||
if (new File(wmsVersionFile).exists()) {
|
if (new File(wmsVersionFile).exists()) {
|
||||||
List<String> lines = UtilityString.splitStringToMultipleLine(IoUtils.readFileAsString(new File(wmsVersionFile)));
|
List<String> lines = UtilityString.splitStringToMultipleLine(IoUtils.readFileAsString(new File(wmsVersionFile)));
|
||||||
|
|
||||||
@@ -139,14 +148,13 @@ public class WMSGenericController {
|
|||||||
WMSVersionDTO wmsVersionDTO = new WMSVersionDTO()
|
WMSVersionDTO wmsVersionDTO = new WMSVersionDTO()
|
||||||
.setLatestVersion(versionString)
|
.setLatestVersion(versionString)
|
||||||
.setLatestVersionCode(versionCode)
|
.setLatestVersionCode(versionCode)
|
||||||
.setUrl("http://" + InetAddress.getLocalHost().getHostAddress() + ":8080" + emsProperties.getRootApi() + "/wms/android-release.apk");
|
.setUrl("/wms/android-release" + suffix + ".apk");
|
||||||
|
|
||||||
|
|
||||||
|
if (lines.size() > 2) {
|
||||||
if(lines.size() > 2) {
|
|
||||||
String forcedLine = lines.get(2);
|
String forcedLine = lines.get(2);
|
||||||
|
|
||||||
if(forcedLine.startsWith("forced=")) {
|
if (forcedLine.startsWith("forced=")) {
|
||||||
String forcedValue = forcedLine.replace("forced=", "").trim();
|
String forcedValue = forcedLine.replace("forced=", "").trim();
|
||||||
boolean forced = Boolean.parseBoolean(forcedValue);
|
boolean forced = Boolean.parseBoolean(forcedValue);
|
||||||
wmsVersionDTO.setForced(forced);
|
wmsVersionDTO.setForced(forced);
|
||||||
@@ -156,8 +164,8 @@ public class WMSGenericController {
|
|||||||
|
|
||||||
return wmsVersionDTO;
|
return wmsVersionDTO;
|
||||||
} else {
|
} else {
|
||||||
logger.warn("File version.txt non trovato");
|
logger.warn("File version" + suffix + ".txt non trovato");
|
||||||
response.sendError(404, "File version.txt non trovato");
|
response.sendError(404, "File version" + suffix + ".txt non trovato");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -630,7 +638,7 @@ public class WMSGenericController {
|
|||||||
@RequestMapping(value = "wms/rientroMerce", method = RequestMethod.POST)
|
@RequestMapping(value = "wms/rientroMerce", method = RequestMethod.POST)
|
||||||
public @ResponseBody
|
public @ResponseBody
|
||||||
ServiceRestResponse rientroMerce(@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
ServiceRestResponse rientroMerce(@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
||||||
@RequestBody RientroMerceRequestDTO rientroMerceRequestDTO) throws Exception {
|
@RequestBody RientroMerceRequestDTO rientroMerceRequestDTO) throws Exception {
|
||||||
|
|
||||||
wmsGenericService.rientroMerce(rientroMerceRequestDTO);
|
wmsGenericService.rientroMerce(rientroMerceRequestDTO);
|
||||||
return ServiceRestResponse.createPositiveResponse();
|
return ServiceRestResponse.createPositiveResponse();
|
||||||
@@ -639,7 +647,7 @@ public class WMSGenericController {
|
|||||||
@RequestMapping(value = "wms/updateTipoUL", method = RequestMethod.POST)
|
@RequestMapping(value = "wms/updateTipoUL", method = RequestMethod.POST)
|
||||||
public @ResponseBody
|
public @ResponseBody
|
||||||
ServiceRestResponse updateTipoUL(@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
ServiceRestResponse updateTipoUL(@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
||||||
@RequestBody UpdateTipoULRequestDTO updateTipoULRequest) throws Exception {
|
@RequestBody UpdateTipoULRequestDTO updateTipoULRequest) throws Exception {
|
||||||
|
|
||||||
wmsGenericService.cambiaTipoUL(updateTipoULRequest);
|
wmsGenericService.cambiaTipoUL(updateTipoULRequest);
|
||||||
return ServiceRestResponse.createPositiveResponse();
|
return ServiceRestResponse.createPositiveResponse();
|
||||||
|
|||||||
@@ -2039,10 +2039,10 @@ public class WMSGenericService {
|
|||||||
boolean gestisciColli = WMSUtility.isGestisciColli(mtbDepo, entityProcessor, multiDBTransactionManager);
|
boolean gestisciColli = WMSUtility.isGestisciColli(mtbDepo, entityProcessor, multiDBTransactionManager);
|
||||||
MtbColt uds = null;
|
MtbColt uds = null;
|
||||||
|
|
||||||
if (!gestisciColli){
|
if (!gestisciColli) {
|
||||||
CreateUDSRequestDTO createUDSRequest = new CreateUDSRequestDTO();
|
CreateUDSRequestDTO createUDSRequest = new CreateUDSRequestDTO();
|
||||||
createUDSRequest.setCodMdep(mtbDepo.getCodMdep())
|
createUDSRequest.setCodMdep(mtbDepo.getCodMdep())
|
||||||
.setCausaleCollo(CreateUDSRequestDTO.Causale.SCARICO);
|
.setCausaleCollo(CreateUDSRequestDTO.Causale.SCARICO);
|
||||||
|
|
||||||
uds = wmsLavorazioneService.createUDS(createUDSRequest);
|
uds = wmsLavorazioneService.createUDS(createUDSRequest);
|
||||||
}
|
}
|
||||||
@@ -2050,7 +2050,7 @@ public class WMSGenericService {
|
|||||||
for (MtbColt mtbColtToMove : mtbCotlList) {
|
for (MtbColt mtbColtToMove : mtbCotlList) {
|
||||||
if (dtbDoct != null) {
|
if (dtbDoct != null) {
|
||||||
for (MtbColr mtbColr : mtbColtToMove.getMtbColr()) {
|
for (MtbColr mtbColr : mtbColtToMove.getMtbColr()) {
|
||||||
if(!gestisciColli){
|
if (!gestisciColli) {
|
||||||
InsertUDSRowRequestDTO insertUDSRowRequest = new InsertUDSRowRequestDTO();
|
InsertUDSRowRequestDTO insertUDSRowRequest = new InsertUDSRowRequestDTO();
|
||||||
insertUDSRowRequest
|
insertUDSRowRequest
|
||||||
.setSourceMtbColr(mtbColr)
|
.setSourceMtbColr(mtbColr)
|
||||||
@@ -2143,12 +2143,17 @@ public class WMSGenericService {
|
|||||||
.setNumColloRif(cloneMtbColr.getNumColloRif())
|
.setNumColloRif(cloneMtbColr.getNumColloRif())
|
||||||
.setSerColloRif(cloneMtbColr.getSerColloRif())
|
.setSerColloRif(cloneMtbColr.getSerColloRif())
|
||||||
.setDataColloRif(cloneMtbColr.getDataColloRif())
|
.setDataColloRif(cloneMtbColr.getDataColloRif())
|
||||||
.setCausale(MtbColr.Causale.VERSAMENTO)
|
|
||||||
.setUtente(requestDataDTO.getUsername())
|
.setUtente(requestDataDTO.getUsername())
|
||||||
|
|
||||||
.setQtaCol(stornoSourceMtbColr.getQtaCol().multiply(new BigDecimal(-1)))
|
.setQtaCol(stornoSourceMtbColr.getQtaCol().multiply(new BigDecimal(-1)))
|
||||||
.setNumCnf(stornoSourceMtbColr.getNumCnf().multiply(new BigDecimal(-1)));
|
.setNumCnf(stornoSourceMtbColr.getNumCnf().multiply(new BigDecimal(-1)));
|
||||||
|
|
||||||
|
if (destinationMtbColt.getGestione().equalsIgnoreCase("V") && destinationMtbColt.getSegno() == -1) {
|
||||||
|
stornoSourceMtbColr.setCausale(null);
|
||||||
|
} else {
|
||||||
|
stornoSourceMtbColr.setCausale(MtbColr.Causale.VERSAMENTO);
|
||||||
|
}
|
||||||
|
|
||||||
mtbColrSourceObservableField.add(stornoSourceMtbColr);
|
mtbColrSourceObservableField.add(stornoSourceMtbColr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2164,13 +2169,18 @@ public class WMSGenericService {
|
|||||||
cloneMtbColr.setCodJcom(null);
|
cloneMtbColr.setCodJcom(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (destinationMtbColt.getGestione().equalsIgnoreCase("V") && destinationMtbColt.getSegno() == -1) {
|
||||||
|
cloneMtbColr.setCausale(null);
|
||||||
|
} else {
|
||||||
|
cloneMtbColr.setCausale(MtbColr.Causale.VERSAMENTO);
|
||||||
|
}
|
||||||
|
|
||||||
cloneMtbColr
|
cloneMtbColr
|
||||||
.setGestione(null)
|
.setGestione(null)
|
||||||
.setSerCollo(null)
|
.setSerCollo(null)
|
||||||
.setNumCollo(null)
|
.setNumCollo(null)
|
||||||
.setDataCollo(null)
|
.setDataCollo(null)
|
||||||
.setRiga(null)
|
.setRiga(null)
|
||||||
.setCausale(MtbColr.Causale.VERSAMENTO)
|
|
||||||
.setUtente(requestDataDTO.getUsername());
|
.setUtente(requestDataDTO.getUsername());
|
||||||
|
|
||||||
mtbColrDestObservableField.add(cloneMtbColr);
|
mtbColrDestObservableField.add(cloneMtbColr);
|
||||||
|
|||||||
@@ -216,10 +216,8 @@ public class SystemController {
|
|||||||
|
|
||||||
stbActivitiesToUpdate.forEach
|
stbActivitiesToUpdate.forEach
|
||||||
(x -> {
|
(x -> {
|
||||||
StbActivity stbActivity = new StbActivity()
|
x.setActivityResultId(activityResultId);
|
||||||
.setActivityResultId(activityResultId);
|
x.setOperation(OperationType.UPDATE);
|
||||||
stbActivity
|
|
||||||
.setOperation(OperationType.UPDATE);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
String activityTypeId = "AGGIORNAMENTI SOFTWARE";
|
String activityTypeId = "AGGIORNAMENTI SOFTWARE";
|
||||||
|
|||||||
Reference in New Issue
Block a user