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}"
|
||||
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?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)])
|
||||
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.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250214112245 extends BaseMigration implements MigrationModelInterface {
|
||||
@@ -11,7 +12,7 @@ public class Migration_20250214112245 extends BaseMigration implements Migration
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomer(IntegryCustomer.RossoGargano))
|
||||
if (isCustomer(IntegryCustomer.RossoGargano) || isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
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.peso_netto_kg_riga) AS 'peso_netto',\n" +
|
||||
" SUM(mvw_colr_sum.peso_lordo_kg_riga) AS 'peso_lordo',\n" +
|
||||
(ignoreTipoPedana?
|
||||
" sum(CONVERT(NUMERIC(20, 5), CASE WHEN [gestione] = 'L' THEN NULL ELSE mvw_colr_sum.colli_pedana END))/count(*) AS 'colli_pedana',\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"
|
||||
) +
|
||||
" 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" +
|
||||
" " + (ignoreTipoPedana?"dtb_ordr.cod_tcol_UL":"mvw_colr_sum.cod_tcol") + " AS 'cod_tcol',\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.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" +
|
||||
" 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" +
|
||||
(ignoreTipoPedana?"":
|
||||
" CASE WHEN [gestione] = 'L' THEN NULL ELSE mvw_colr_sum.colli_pedana END, mvw_colr_sum.cod_tcol,\n"
|
||||
) +
|
||||
" CONVERT(NUMERIC(20, 5), CASE WHEN [gestione] = 'L' THEN NULL ELSE " + (ignoreTipoPedana?"dtb_ordr.colli_pedana":"mvw_colr_sum.colli_pedana") + " END),\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" +
|
||||
" 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" +
|
||||
|
||||
@@ -66,10 +66,12 @@ public class AccountingRules extends QueryRules {
|
||||
}
|
||||
|
||||
public static Integer completeNumProt(Connection connection, CtbMovt entity) throws Exception {
|
||||
Integer annoComp = entity.getAnnoComp();
|
||||
//Integer annoComp = entity.getAnnoComp();
|
||||
String codIreg = entity.getCodIreg();
|
||||
Integer numIreg = entity.getNumIreg();
|
||||
Integer numProt = entity.getNumProt();
|
||||
Date dataCmov = entity.getDataCmov();
|
||||
Integer annoProt = UtilityDate.datePart(Calendar.YEAR, dataCmov);
|
||||
|
||||
if (numIreg == 0) {
|
||||
numIreg = 1;
|
||||
@@ -82,13 +84,13 @@ public class AccountingRules extends QueryRules {
|
||||
+ "FROM ctb_inum "
|
||||
+ "WHERE cod_ireg = " + UtilityDB.valueToString(codIreg) + " AND "
|
||||
+ " num_ireg = " + UtilityDB.valueToString(numIreg) + " AND "
|
||||
+ " anno = " + UtilityDB.valueToString(annoComp);
|
||||
+ " anno = " + UtilityDB.valueToString(annoProt);
|
||||
|
||||
boolean existReg = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||
|
||||
if (existReg) {
|
||||
CallableStatement cs = connection.prepareCall("{call dbo.NextNumProt(?, ?, ?, ?)}");
|
||||
cs.setShort(1, annoComp.shortValue());
|
||||
cs.setShort(1, annoProt.shortValue());
|
||||
cs.setString(2, codIreg);
|
||||
cs.setShort(3, numIreg.shortValue());
|
||||
cs.setInt(4, numProt);
|
||||
@@ -100,7 +102,7 @@ public class AccountingRules extends QueryRules {
|
||||
if (numProt == 0) numProt = 1;
|
||||
CtbInum ctbInum =
|
||||
new CtbInum()
|
||||
.setAnno(annoComp)
|
||||
.setAnno(annoProt)
|
||||
.setCodIreg(codIreg)
|
||||
.setNumIreg(numIreg)
|
||||
.setNumProt(numProt);
|
||||
@@ -1026,15 +1028,14 @@ public class AccountingRules extends QueryRules {
|
||||
if ( ctbMovi.getParent() instanceof CtbMovt) {
|
||||
String sql =
|
||||
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" +
|
||||
"FROM gtb_aliq\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" +
|
||||
" (SELECT segno_liquid FROM ctb_ireg WHERE cod_ireg = %s) registro \n" +
|
||||
"WHERE cod_aliq = %s",
|
||||
((CtbMovt) ctbMovi.getParent()).getCodIreg(),
|
||||
ctbMovi.getCodAliq());
|
||||
|
||||
ventilazione = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||
|
||||
|
||||
} else {
|
||||
ventilazione = ctbMovi.getVentilazione()==null?false:ctbMovi.getVentilazione();
|
||||
}
|
||||
|
||||
@@ -422,9 +422,10 @@ public class AtbOfft extends EntityBase {
|
||||
atbOffr.deleteAllEntities(connection, this);
|
||||
}
|
||||
|
||||
public enum StatoOfferta implements IBaseEnum {
|
||||
|
||||
RICHIESTA_DI_OFFERTA(0), OFFERTA(1), CONTRATTO(2);
|
||||
public enum StatoOfferta implements IBaseEnum<StatoOfferta> {
|
||||
RICHIESTA_DI_OFFERTA(0),
|
||||
OFFERTA(1),
|
||||
CONTRATTO(2);
|
||||
|
||||
private final int value;
|
||||
|
||||
@@ -432,6 +433,23 @@ public class AtbOfft extends EntityBase {
|
||||
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
|
||||
public int getValue() {
|
||||
return value;
|
||||
@@ -443,27 +461,13 @@ public class AtbOfft extends EntityBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object fromInternal(Object val) {
|
||||
public StatoOfferta fromInternal(Object val) {
|
||||
return from(val);
|
||||
}
|
||||
|
||||
public static AtbOfft.StatoOfferta fromValue(int value) {
|
||||
for (AtbOfft.StatoOfferta statoOfferta : AtbOfft.StatoOfferta.values()) {
|
||||
if (statoOfferta.value == 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;
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,9 @@ public class CtbIreg extends EntityBase {
|
||||
@SqlField(value = "flag_iva_da_ventilare", maxLength = 1, nullable = false, defaultObjectValue = "N")
|
||||
private String flagIvaDaVentilare;
|
||||
|
||||
@SqlField(value = "flag_extracee", maxLength = 1, nullable = false, defaultObjectValue = "N")
|
||||
private String flagExtracee;
|
||||
|
||||
@EntityChild
|
||||
private List<CtbInum> ctbInum = new ArrayList<>();
|
||||
|
||||
@@ -58,92 +61,90 @@ public class CtbIreg extends EntityBase {
|
||||
return codIreg;
|
||||
}
|
||||
|
||||
public void setCodIreg(String codIreg) {
|
||||
public CtbIreg setCodIreg(String codIreg) {
|
||||
this.codIreg = codIreg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public void setDescrizione(String descrizione) {
|
||||
public CtbIreg setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagScorporo() {
|
||||
return flagScorporo;
|
||||
}
|
||||
|
||||
public void setFlagScorporo(String flagScorporo) {
|
||||
public CtbIreg setFlagScorporo(String flagScorporo) {
|
||||
this.flagScorporo = flagScorporo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTipoNumerazione() {
|
||||
return tipoNumerazione;
|
||||
}
|
||||
|
||||
public void setTipoNumerazione(String tipoNumerazione) {
|
||||
public CtbIreg setTipoNumerazione(String tipoNumerazione) {
|
||||
this.tipoNumerazione = tipoNumerazione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getSegnoLiquid() {
|
||||
return segnoLiquid;
|
||||
}
|
||||
|
||||
public void setSegnoLiquid(BigDecimal segnoLiquid) {
|
||||
public CtbIreg setSegnoLiquid(BigDecimal segnoLiquid) {
|
||||
this.segnoLiquid = segnoLiquid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagIva() {
|
||||
return flagIva;
|
||||
}
|
||||
|
||||
public void setFlagIva(String flagIva) {
|
||||
public CtbIreg setFlagIva(String flagIva) {
|
||||
this.flagIva = flagIva;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagIvaDaVentilare() {
|
||||
return flagIvaDaVentilare;
|
||||
}
|
||||
|
||||
public void setFlagIvaDaVentilare(String flagIvaDaVentilare) {
|
||||
public CtbIreg setFlagIvaDaVentilare(String 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() {
|
||||
return ctbInum;
|
||||
}
|
||||
|
||||
public void setCtbInum(List<CtbInum> ctbInum) {
|
||||
public CtbIreg setCtbInum(List<CtbInum> ctbInum) {
|
||||
this.ctbInum = ctbInum;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<DtbInum> getDtbInum() {
|
||||
return dtbInum;
|
||||
}
|
||||
|
||||
public void setDtbInum(List<DtbInum> dtbInum) {
|
||||
public CtbIreg setDtbInum(List<DtbInum> dtbInum) {
|
||||
this.dtbInum = dtbInum;
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -237,6 +237,7 @@ public class DtbDoct extends DtbBaseDocT implements EquatableEntityInterface<Dtb
|
||||
@SqlField(value = "sconto2", nullable = false, defaultObjectValue = "0")
|
||||
private BigDecimal sconto2;
|
||||
|
||||
@FireRecalc
|
||||
@SqlField(value = "sconto3", nullable = false, defaultObjectValue = "0")
|
||||
private BigDecimal sconto3;
|
||||
|
||||
@@ -289,7 +290,6 @@ public class DtbDoct extends DtbBaseDocT implements EquatableEntityInterface<Dtb
|
||||
@SqlField(value = "targa_rim", maxLength = 20)
|
||||
private String targaRim;
|
||||
|
||||
@ForceRecalc
|
||||
@SqlField(value = "posti_pallet")
|
||||
private Integer postiPallet;
|
||||
|
||||
|
||||
@@ -49,39 +49,44 @@ public class DtbInum extends EntityBase {
|
||||
return codIreg;
|
||||
}
|
||||
|
||||
public void setCodIreg(String codIreg) {
|
||||
public DtbInum setCodIreg(String codIreg) {
|
||||
this.codIreg = codIreg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumIreg() {
|
||||
return numIreg;
|
||||
}
|
||||
|
||||
public void setNumIreg(Integer numIreg) {
|
||||
public DtbInum setNumIreg(Integer numIreg) {
|
||||
this.numIreg = numIreg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getAnno() {
|
||||
return anno;
|
||||
}
|
||||
|
||||
public void setAnno(Integer anno) {
|
||||
public DtbInum setAnno(Integer anno) {
|
||||
this.anno = anno;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSerDoc() {
|
||||
return serDoc;
|
||||
}
|
||||
|
||||
public void setSerDoc(String serDoc) {
|
||||
public DtbInum setSerDoc(String serDoc) {
|
||||
this.serDoc = serDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumDoc() {
|
||||
return numDoc;
|
||||
}
|
||||
|
||||
public void setNumDoc(Integer numDoc) {
|
||||
public DtbInum setNumDoc(Integer numDoc) {
|
||||
this.numDoc = numDoc;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ end
|
||||
rule "completePartitaMagOrd"
|
||||
when
|
||||
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
|
||||
MtbPartitaMag partitaMag = DocOrdRules.completePartitaMag($ordT.getCodProd(), $ordT.getPartitaMag(), $ordT.getNote());
|
||||
modify ( $ordT ) { setRifPartitaMag(partitaMag) }
|
||||
|
||||
@@ -283,6 +283,18 @@ public class ContabilController {
|
||||
}
|
||||
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)
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
package it.integry.ems.contabil.dto;
|
||||
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
|
||||
public class AutofatturaDTO {
|
||||
@SqlField(value = "num_cmov")
|
||||
private Integer numCmov;
|
||||
private String codDtip;
|
||||
@SqlField(value = "descrizione")
|
||||
private String descrizione;
|
||||
@SqlField(value = "identificativo_sdi")
|
||||
private String identificativoSdi;
|
||||
|
||||
private boolean rigeneraAutofattura;
|
||||
|
||||
public Integer getNumCmov() {
|
||||
return numCmov;
|
||||
}
|
||||
@@ -41,4 +48,13 @@ public class AutofatturaDTO {
|
||||
this.identificativoSdi = identificativoSdi;
|
||||
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 {
|
||||
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<>();
|
||||
|
||||
String sql =
|
||||
@@ -57,7 +68,7 @@ public class AutofatturaService {
|
||||
"dtb_tipi.cod_ccau is not null AND " +
|
||||
"dtb_tipi.tipo_emissione = 'DIRETTA' AND " +
|
||||
"dtb_tipi.cod_dtip in (select cod_dtip FROM dvw_tipi_integrazioni) ",
|
||||
autofatturaDTO.getNumCmov());
|
||||
numCmov);
|
||||
|
||||
DtbDoct dtbDoct = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, DtbDoct.class);
|
||||
|
||||
@@ -69,18 +80,107 @@ public class AutofatturaService {
|
||||
sql =
|
||||
Query.format(
|
||||
"SELECT * FROM crl_movt_rif_cmov WHERE num_cmov_rif = %s",
|
||||
autofatturaDTO.getNumCmov());
|
||||
numCmov);
|
||||
|
||||
CrlMovtRifCmov crlMovtRifCmov = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, CrlMovtRifCmov.class);
|
||||
crlMovtRifCmov.setOperation(OperationType.DELETE);
|
||||
entitylist.add(crlMovtRifCmov);
|
||||
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 {
|
||||
@@ -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")));
|
||||
}
|
||||
|
||||
|
||||
boolean pagaScadenze = false;
|
||||
String codDtip = (String) datiMov.get("cod_dtip");
|
||||
OperationType operationType = OperationType.DELETE_THEN_INSERT;
|
||||
@@ -169,7 +268,18 @@ public class AutofatturaService {
|
||||
}
|
||||
}
|
||||
|
||||
DtbDoct dtbDoct =
|
||||
DtbDoct dtbDoct;
|
||||
if (autofatturaDTO.isRigeneraAutofattura()) {
|
||||
entityList.addAll(cancellaAutofattura((Integer) datiMov.get("num_cmov_rif")));
|
||||
operationType = OperationType.INSERT;
|
||||
dtbDoct =
|
||||
new DtbDoct()
|
||||
.setCodAnag((String) datiMov.get("cod_anag"))
|
||||
.setCodDtip(codDtip)
|
||||
.setDataDoc((Date) datiMov.get("data_cmov"))
|
||||
.setDataReg((Date) datiMov.get("data_cmov"));
|
||||
} else {
|
||||
dtbDoct =
|
||||
new DtbDoct()
|
||||
.setCodAnag((String) datiMov.get("cod_anag"))
|
||||
.setCodDtip(codDtip)
|
||||
@@ -177,8 +287,6 @@ public class AutofatturaService {
|
||||
.setDataReg((Date) datiMov.get("data_cmov"))
|
||||
.setSerDoc((String) datiMov.get("ser_doc"))
|
||||
.setNumDoc((Integer) datiMov.get("num_doc"));
|
||||
|
||||
dtbDoct.setOperation(operationType);
|
||||
String codDtipOld = UtilityHashMap.getValueIfExists(datiMov, "cod_dtip");
|
||||
if (datiMov.get("cod_anag_old") != null ||
|
||||
datiMov.get("data_doc_old") != null ||
|
||||
@@ -191,7 +299,9 @@ public class AutofatturaService {
|
||||
oldPk.put("codDtip", datiMov.get("cod_dtip"));
|
||||
dtbDoct.setOldPk(oldPk);
|
||||
}
|
||||
}
|
||||
dtbDoct.setNumCmovAutofattura(autofatturaDTO.getNumCmov());
|
||||
dtbDoct.setOperation(operationType);
|
||||
|
||||
if (UtilityString.isNullOrEmpty(dtbDoct.getCodMdep())) {
|
||||
sql = "SELECT min(cod_mdep) FROM mtb_depo WHERE flag_movimentabile = 'S'";
|
||||
@@ -255,7 +365,7 @@ public class AutofatturaService {
|
||||
if (entityBase.getException() != null) {
|
||||
multiDBTransactionManager.rollbackAll();
|
||||
throw new Exception(entityBase.getException());
|
||||
} else if (entityBase instanceof DtbDoct) {
|
||||
} else if (entityBase instanceof DtbDoct && entityBase.getOperation() != OperationType.DELETE) {
|
||||
docRet = (DtbDoct) entityBase;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,43 +92,43 @@ public class ColliEviosysImportService {
|
||||
}
|
||||
|
||||
String sql = Query.format(
|
||||
"SELECT TOP 1 dtb_ordt.num_ord,\n" +
|
||||
" dtb_ordt.data_ord,\n" +
|
||||
" dtb_ordt.cod_mdep\n" +
|
||||
"FROM dtb_ordt\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" +
|
||||
" dtb_ordt.gestione = dtb_ordr.gestione\n" +
|
||||
"WHERE cod_anag = %s\n" +
|
||||
"WITH getOrder AS (SELECT dtb_ordr.num_ord,\n" +
|
||||
" dtb_ordr.data_ord,\n" +
|
||||
" dtb_ordr.riga_ord,\n" +
|
||||
" dtb_ordr.cod_mdep,\n" +
|
||||
" DENSE_RANK() OVER (ORDER BY data_cons DESC, dtb_ordt.data_ord, dtb_ordt.num_ord) AS dr\n" +
|
||||
" FROM dtb_ordt\n" +
|
||||
" INNER JOIN dtb_ordr ON dtb_ordt.num_ord = dtb_ordr.num_ord\n" +
|
||||
" AND dtb_ordr.data_ord = dtb_ordt.data_ord\n" +
|
||||
" AND dtb_ordt.gestione = dtb_ordr.gestione\n" +
|
||||
" WHERE cod_anag = %s\n" +
|
||||
" AND dtb_ordt.gestione = 'A'\n" +
|
||||
" AND flag_annulla = 'N'\n" +
|
||||
" AND flag_evaso = 'I'\n" +
|
||||
" AND cod_mart = %s\n" +
|
||||
"GROUP BY dtb_ordt.num_ord, dtb_ordt.data_ord, dtb_ordt.cod_mdep, data_cons\n" +
|
||||
"HAVING MAX(data_cons) <= %s\n" +
|
||||
"ORDER BY data_cons DESC",
|
||||
" AND data_cons <= %s)\n" +
|
||||
"SELECT *\n" +
|
||||
"FROM getOrder\n" +
|
||||
"WHERE dr = 1",
|
||||
codAnag, codMart, new Date()
|
||||
);
|
||||
HashMap<String, Object> returnQuery = UtilityDB.executeSimpleQueryOnlyFirstRow(conn, sql);
|
||||
|
||||
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);
|
||||
DtbOrdr dtbOrdr = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(conn, sql, DtbOrdr.class);
|
||||
|
||||
MtbColr mtbColr = new MtbColr()
|
||||
.setCodMart(codMart)
|
||||
.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()
|
||||
.setDataCollo(LocalDate.now())
|
||||
.setSegno(1)
|
||||
.setGestione("A")
|
||||
.setBarcodeUl(barcodeUl)
|
||||
.setCodMdep(codMdep)
|
||||
.setFiltroOrdini(MtbColtUtils.generaFiltroOrdini(null, dtbOrdrs))
|
||||
.setCodMdep(dtbOrdr.getCodMdep())
|
||||
.setCodAnag(codAnag);
|
||||
|
||||
mtbColt.setMtbColr(new ArrayList<>())
|
||||
@@ -141,20 +141,7 @@ public class ColliEviosysImportService {
|
||||
}
|
||||
}
|
||||
|
||||
for (MtbColt mtbColt : mtbColtList) {
|
||||
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;
|
||||
return entityProcessor.processEntityList(mtbColtList, multiDBTransactionManager, true);
|
||||
}
|
||||
|
||||
private Object cellToString(Cell cell) {
|
||||
|
||||
@@ -452,6 +452,9 @@ public class ColliImportService {
|
||||
dataScad = new Date();
|
||||
}
|
||||
|
||||
String oraProdTemp = line.substring(224, 224 + 4).trim();
|
||||
Integer oraProd = oraProdTemp.isEmpty() ? null : Integer.parseInt(oraProdTemp);
|
||||
|
||||
vebadDesadv.getDettagliLotti()
|
||||
.add(
|
||||
new VebadDesadvDettagliLottiDTO()
|
||||
@@ -469,7 +472,7 @@ public class ColliImportService {
|
||||
.setTranscodifica(line.substring(134, 134 + 20))
|
||||
.setCodStabilimentoProd(line.substring(154, 154 + 20))
|
||||
.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);
|
||||
|
||||
sql = Query.format(
|
||||
"SELECT TOP 1 dtb_ordt.num_ord,\n" +
|
||||
" dtb_ordt.data_ord,\n" +
|
||||
" dtb_ordt.cod_mdep\n" +
|
||||
"FROM dtb_ordt\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" +
|
||||
" dtb_ordt.gestione = dtb_ordr.gestione\n" +
|
||||
"WHERE cod_anag = %s\n" +
|
||||
"WITH getOrder AS (SELECT dtb_ordr.num_ord,\n" +
|
||||
" dtb_ordr.data_ord,\n" +
|
||||
" dtb_ordr.riga_ord,\n" +
|
||||
" DENSE_RANK() OVER (ORDER BY data_cons DESC, dtb_ordt.data_ord, dtb_ordt.num_ord) AS dr\n" +
|
||||
" FROM dtb_ordt\n" +
|
||||
" INNER JOIN dtb_ordr ON dtb_ordt.num_ord = dtb_ordr.num_ord\n" +
|
||||
" AND dtb_ordr.data_ord = dtb_ordt.data_ord\n" +
|
||||
" AND dtb_ordt.gestione = dtb_ordr.gestione\n" +
|
||||
" WHERE cod_anag = %s\n" +
|
||||
" AND dtb_ordt.gestione = 'A'\n" +
|
||||
" AND flag_annulla = 'N'\n" +
|
||||
" AND flag_evaso = 'I'\n" +
|
||||
" AND cod_mart = %s\n" +
|
||||
"GROUP BY dtb_ordt.num_ord, dtb_ordt.data_ord, dtb_ordt.cod_mdep, data_cons\n" +
|
||||
"HAVING MAX(data_cons) <= %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()
|
||||
);
|
||||
HashMap<String, Object> returnQuery = UtilityDB.executeSimpleQueryOnlyFirstRow(conn, sql);
|
||||
|
||||
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());
|
||||
DtbOrdr dtbOrdr = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(conn, sql, DtbOrdr.class);
|
||||
|
||||
MtbColr mtbColr = new MtbColr()
|
||||
.setDataScadPartita(dettagliLotti.getDataScad())
|
||||
.setPartitaMag(dettagliLotti.getLotto())
|
||||
.setCodBarre(dettagliLotti.getGtin())
|
||||
.setNumCnf(new BigDecimal(dettagliLotti.getQtaSscc()))
|
||||
.setCodMart(codMart);
|
||||
.setCodMart(codMart)
|
||||
.setDataOrd(UtilityLocalDate.localDateFromDate(dtbOrdr.getDataOrd()))
|
||||
.setNumOrd(dtbOrdr.getNumOrd())
|
||||
.setRigaOrd(dtbOrdr.getRigaOrd());
|
||||
|
||||
mtbColt.setMtbColr(new ArrayList<>())
|
||||
.getMtbColr()
|
||||
@@ -543,19 +544,6 @@ public class ColliImportService {
|
||||
mtbColts.add(mtbColt);
|
||||
}
|
||||
|
||||
for (MtbColt mtbColt : mtbColts) {
|
||||
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;
|
||||
return entityProcessor.processEntityList(mtbColts, multiDBTransactionManager, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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" +
|
||||
"WHERE mtb_lisa.cod_art_for = " + UtilityDB.valueToString(promozione.getCodArtForn()) + "\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);
|
||||
|
||||
|
||||
@@ -446,7 +446,8 @@ public class ImportListiniAcquistoApuliaCarrefourService {
|
||||
+ " um_frontalino varchar(80),"
|
||||
+ " um_peso varchar(80),"
|
||||
+ " espolodi_dist varchar(80),"
|
||||
+ " partita_iva_forn varchar(80))";
|
||||
+ " partita_iva_forn varchar(80),"
|
||||
+ " altro varchar(max))";
|
||||
}
|
||||
ps = conn.prepareStatement(sql);
|
||||
ps.executeUpdate();
|
||||
|
||||
@@ -305,6 +305,9 @@ public class ProductionPlanService {
|
||||
|
||||
ordLavDTO.setPartite(saveProductionPlanDTO.getPartite());
|
||||
|
||||
// Se il deposito dell'ordine di lavorazione è diverso dal quello della sede
|
||||
// allora siamo in campagna e quindi non accorpiamo prodotto, commessa nello stesso ordine
|
||||
if (depo != null && codMdep.equalsIgnoreCase(depo.getCodMdep())) {
|
||||
sql = Query.format(
|
||||
"SELECT num_ord, qta_prod\n" +
|
||||
"FROM dtb_ordt\n" +
|
||||
@@ -326,6 +329,7 @@ public class ProductionPlanService {
|
||||
.add(UtilityHashMap.getValueIfExists(ordData, "qta_prod"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (numOrdL == null || numOrdL == 0) {
|
||||
operation = OperationType.INSERT;
|
||||
|
||||
@@ -5,11 +5,16 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
public class MRPDailySetupGruppiDTO {
|
||||
@JsonProperty("cod_mgrp")
|
||||
private String codMgrp;
|
||||
|
||||
@JsonProperty("includi_sospesi")
|
||||
private boolean includiSospesi;
|
||||
|
||||
@JsonProperty("agg_imp_prox")
|
||||
private boolean aggImpProx;
|
||||
|
||||
@JsonProperty("includi_budget")
|
||||
private boolean includiBudget;
|
||||
|
||||
public boolean isAggImpProx() {
|
||||
return aggImpProx;
|
||||
}
|
||||
@@ -36,4 +41,13 @@ public class MRPDailySetupGruppiDTO {
|
||||
this.includiSospesi = includiSospesi;
|
||||
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
|
||||
public BigDecimal getFabbisogno(boolean includiSospesi, boolean includiBudget) {
|
||||
BigDecimal fabbisogno = getImpegni();
|
||||
if (includiSospesi) {
|
||||
fabbisogno = fabbisogno.add(getImpegniProx(includiBudget));
|
||||
}
|
||||
fabbisogno = fabbisogno.add(getImpegniProx(includiSospesi, includiBudget));
|
||||
return fabbisogno;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public BigDecimal getImpegniProx(boolean includiBudget) {
|
||||
BigDecimal qtaImpProx = getQtaContrVend().add(getQtaImpProxOrd());
|
||||
public BigDecimal getImpegniProx(boolean includiSospesi, boolean includiBudget) {
|
||||
BigDecimal qtaImpProx = BigDecimal.ZERO;
|
||||
if (includiSospesi)
|
||||
qtaImpProx = getQtaContrVend().add(getQtaImpProxOrd());
|
||||
if (includiBudget)
|
||||
qtaImpProx = qtaImpProx.add(getQtaImpBudget());
|
||||
return qtaImpProx;
|
||||
|
||||
@@ -17,6 +17,8 @@ public class RegisterSupervisorDTO {
|
||||
|
||||
private int supervisorServicePort = 10251;
|
||||
|
||||
private int printQuantity = 1;
|
||||
|
||||
private String lineaType;
|
||||
|
||||
public String getCodJfas() {
|
||||
@@ -76,4 +78,13 @@ public class RegisterSupervisorDTO {
|
||||
this.lineaType = lineaType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getPrintQuantity() {
|
||||
return printQuantity;
|
||||
}
|
||||
|
||||
public RegisterSupervisorDTO setPrintQuantity(int printQuantity) {
|
||||
this.printQuantity = printQuantity;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -814,7 +814,9 @@ public class MesProductionServiceV2 {
|
||||
}
|
||||
|
||||
|
||||
for (int i= 0;i<hmiData.getPrintQuantity();i++){
|
||||
printerService.print(printerName, new ByteArrayInputStream(bytes), "application/pdf", orientation);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
|
||||
@@ -111,6 +111,7 @@ public class MrpDailyMaterialReqService {
|
||||
|
||||
for (MrpDailyMaterialReqDTO art : datiArt) {
|
||||
boolean inclusiSospesi = getSetupIncluseSospesi(art.getCodMgrp(), setupGruppi);
|
||||
boolean includiBudget = getSetupIncludiBudget(art.getCodMgrp(), setupGruppi);
|
||||
List<MrpDailyMaterialReqDetDTO> dettagliArt = UtilityHashMap.getValueIfExists(listArticoli, art.getCodMart());
|
||||
if (dettagliArt == null) continue;
|
||||
|
||||
@@ -200,8 +201,6 @@ public class MrpDailyMaterialReqService {
|
||||
}
|
||||
|
||||
for (MrpDailyMaterialReqDetDTO x : gg.getValue()) {
|
||||
boolean includiBudget = setupGest.getSetupDepoBoolean(multiDBTransactionManager.getPrimaryConnection(), GEST_NAME, SECTION, "ASSEGNA_BUDGET", x.getCodMdep());
|
||||
|
||||
giacenza = giacenza.add(x.getGiacenza());
|
||||
qtaContVend = qtaContVend.add(x.getQtaContrVend());
|
||||
qtaArrivi = qtaArrivi.add(x.getArrivi());
|
||||
@@ -219,7 +218,7 @@ public class MrpDailyMaterialReqService {
|
||||
.addQtaImpegni(x.getImpegni())
|
||||
.addQtaArrivi(x.getArrivi())
|
||||
.addGiacenza(!datiGg.isEmpty() ? datiGg.get(datiGg.size() - 1).getDisponibilita() : x.getGiacenza())
|
||||
.addQtaImpegniProx(x.getImpegniProx(includiBudget));
|
||||
.addQtaImpegniProx(x.getImpegniProx(inclusiSospesi, includiBudget));
|
||||
|
||||
if (depoArt != null)
|
||||
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) {
|
||||
if (datiDepo == null)
|
||||
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.SettingsModel;
|
||||
import it.integry.ems.settings.SettingsController;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.utility.UtilityDebug;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
@@ -135,21 +136,27 @@ public class MrpSetupHandlerService {
|
||||
}
|
||||
|
||||
private List<MRPDailySetupGruppiDTO> getSetupGruppi(MultiDBTransactionManager multiDBTransactionManager) throws Exception {
|
||||
Connection conn = multiDBTransactionManager.getPrimaryConnection();
|
||||
final String gestName = "PVM";
|
||||
final String section = "MRP";
|
||||
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";
|
||||
|
||||
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";
|
||||
|
||||
final String keySectionIncludiBudget = "INCLUDI_BUDGET";
|
||||
String includiBudget = setupGest.getSetup(conn, gestName, section, keySectionIncludiBudget);
|
||||
if (UtilityString.isNullOrEmpty(includiBudget)) includiBudget = "N";
|
||||
|
||||
String sql =
|
||||
Query.format(
|
||||
"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("+ 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" +
|
||||
"SELECT mtb_grup.cod_mgrp, stb_gest_setup_det.key_section, stb_gest_setup_det.value \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" +
|
||||
"PIVOT\n" +
|
||||
"( max(value) \n" +
|
||||
"FOR key_section IN (["+ keySectionAggImpProx +"],["+ keySectionSospesi +"])) AS PivotTable" ,
|
||||
useSosepsi, aggImpProx, gestName, section);
|
||||
"FOR key_section IN (["+ keySectionAggImpProx +"],["+ keySectionSospesi +"],["+ keySectionIncludiBudget +"])) AS PivotTable" ,
|
||||
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 {
|
||||
|
||||
@@ -362,7 +362,8 @@ public class PvmAccettazioneService {
|
||||
if (dtbDoct instanceof WdtbDoct)
|
||||
((WdtbDoct) dtbDoct)
|
||||
.setDataInizTrasp(dataInizTrap)
|
||||
.setOraInizTrasp(oraInizTrasp);
|
||||
.setOraInizTrasp(oraInizTrasp)
|
||||
.setDataReg(dataInizTrap);
|
||||
}
|
||||
|
||||
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" +
|
||||
" -- 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" +
|
||||
" AND flag_evaso <> 'E'\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.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.net.InetAddress;
|
||||
import java.nio.file.Paths;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
@@ -103,24 +102,34 @@ public class WMSGenericController {
|
||||
return ServiceRestResponse.createPositiveResponse(wmsGenericService.getPickingListFromBarcodeOrdine(codBarreBancale));
|
||||
}
|
||||
|
||||
@RequestMapping(value = "updateWMSApp", method = RequestMethod.GET)
|
||||
public ServiceRestResponse updateWMSApp() throws Exception {
|
||||
@GetMapping(value = "updateWMSApp")
|
||||
public ServiceRestResponse updateWMSApp(@RequestParam(required = false) String suffix) throws Exception {
|
||||
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 androidAppFilePath = Paths.get(UtilityDirs.getWebAppPath(), "wms", "android-release.apk").toString();
|
||||
HttpRestWrapper.downloadFile(baseDownloadUrl + "android-release.apk" + azureToken, androidAppFilePath);
|
||||
if (UtilityString.isNullOrEmpty(suffix))
|
||||
suffix = "";
|
||||
else
|
||||
suffix = "-" + suffix;
|
||||
|
||||
|
||||
String androidAppVersionFilePath = Paths.get(UtilityDirs.getWebAppPath(), "wms", "version.txt").toString();
|
||||
HttpRestWrapper.downloadFile(baseDownloadUrl + "version.txt" + azureToken, androidAppVersionFilePath);
|
||||
String androidAppFilePath = Paths.get(UtilityDirs.getWebAppPath(), "wms", "android-release" + suffix + ".apk").toString();
|
||||
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();
|
||||
}
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_CHECK_LATEST_WMS_VERSION_JSON, method = RequestMethod.GET)
|
||||
public Object checkWMSLatestVersionJSON(HttpServletResponse response) throws Exception {
|
||||
String wmsVersionFile = Paths.get(UtilityDirs.getWebAppPath(), "wms", "version.txt").toString();
|
||||
@GetMapping(value = EmsRestConstants.PATH_CHECK_LATEST_WMS_VERSION_JSON)
|
||||
public WMSVersionDTO checkWMSLatestVersionJSON(HttpServletResponse response, @RequestParam(required = false) String suffix) throws Exception {
|
||||
if (UtilityString.isNullOrEmpty(suffix))
|
||||
suffix = "";
|
||||
else
|
||||
suffix = "-" + suffix;
|
||||
|
||||
String wmsVersionFile = Paths.get(UtilityDirs.getWebAppPath(), "wms", "version" + suffix + ".txt").toString();
|
||||
if (new File(wmsVersionFile).exists()) {
|
||||
List<String> lines = UtilityString.splitStringToMultipleLine(IoUtils.readFileAsString(new File(wmsVersionFile)));
|
||||
|
||||
@@ -139,14 +148,13 @@ public class WMSGenericController {
|
||||
WMSVersionDTO wmsVersionDTO = new WMSVersionDTO()
|
||||
.setLatestVersion(versionString)
|
||||
.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);
|
||||
|
||||
if(forcedLine.startsWith("forced=")) {
|
||||
if (forcedLine.startsWith("forced=")) {
|
||||
String forcedValue = forcedLine.replace("forced=", "").trim();
|
||||
boolean forced = Boolean.parseBoolean(forcedValue);
|
||||
wmsVersionDTO.setForced(forced);
|
||||
@@ -156,8 +164,8 @@ public class WMSGenericController {
|
||||
|
||||
return wmsVersionDTO;
|
||||
} else {
|
||||
logger.warn("File version.txt non trovato");
|
||||
response.sendError(404, "File version.txt non trovato");
|
||||
logger.warn("File version" + suffix + ".txt non trovato");
|
||||
response.sendError(404, "File version" + suffix + ".txt non trovato");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2039,7 +2039,7 @@ public class WMSGenericService {
|
||||
boolean gestisciColli = WMSUtility.isGestisciColli(mtbDepo, entityProcessor, multiDBTransactionManager);
|
||||
MtbColt uds = null;
|
||||
|
||||
if (!gestisciColli){
|
||||
if (!gestisciColli) {
|
||||
CreateUDSRequestDTO createUDSRequest = new CreateUDSRequestDTO();
|
||||
createUDSRequest.setCodMdep(mtbDepo.getCodMdep())
|
||||
.setCausaleCollo(CreateUDSRequestDTO.Causale.SCARICO);
|
||||
@@ -2050,7 +2050,7 @@ public class WMSGenericService {
|
||||
for (MtbColt mtbColtToMove : mtbCotlList) {
|
||||
if (dtbDoct != null) {
|
||||
for (MtbColr mtbColr : mtbColtToMove.getMtbColr()) {
|
||||
if(!gestisciColli){
|
||||
if (!gestisciColli) {
|
||||
InsertUDSRowRequestDTO insertUDSRowRequest = new InsertUDSRowRequestDTO();
|
||||
insertUDSRowRequest
|
||||
.setSourceMtbColr(mtbColr)
|
||||
@@ -2143,12 +2143,17 @@ public class WMSGenericService {
|
||||
.setNumColloRif(cloneMtbColr.getNumColloRif())
|
||||
.setSerColloRif(cloneMtbColr.getSerColloRif())
|
||||
.setDataColloRif(cloneMtbColr.getDataColloRif())
|
||||
.setCausale(MtbColr.Causale.VERSAMENTO)
|
||||
.setUtente(requestDataDTO.getUsername())
|
||||
|
||||
.setQtaCol(stornoSourceMtbColr.getQtaCol().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);
|
||||
}
|
||||
|
||||
@@ -2164,13 +2169,18 @@ public class WMSGenericService {
|
||||
cloneMtbColr.setCodJcom(null);
|
||||
}
|
||||
|
||||
if (destinationMtbColt.getGestione().equalsIgnoreCase("V") && destinationMtbColt.getSegno() == -1) {
|
||||
cloneMtbColr.setCausale(null);
|
||||
} else {
|
||||
cloneMtbColr.setCausale(MtbColr.Causale.VERSAMENTO);
|
||||
}
|
||||
|
||||
cloneMtbColr
|
||||
.setGestione(null)
|
||||
.setSerCollo(null)
|
||||
.setNumCollo(null)
|
||||
.setDataCollo(null)
|
||||
.setRiga(null)
|
||||
.setCausale(MtbColr.Causale.VERSAMENTO)
|
||||
.setUtente(requestDataDTO.getUsername());
|
||||
|
||||
mtbColrDestObservableField.add(cloneMtbColr);
|
||||
|
||||
@@ -216,10 +216,8 @@ public class SystemController {
|
||||
|
||||
stbActivitiesToUpdate.forEach
|
||||
(x -> {
|
||||
StbActivity stbActivity = new StbActivity()
|
||||
.setActivityResultId(activityResultId);
|
||||
stbActivity
|
||||
.setOperation(OperationType.UPDATE);
|
||||
x.setActivityResultId(activityResultId);
|
||||
x.setOperation(OperationType.UPDATE);
|
||||
});
|
||||
|
||||
String activityTypeId = "AGGIORNAMENTI SOFTWARE";
|
||||
|
||||
Reference in New Issue
Block a user