Merge branch 'develop' into feature/Feature-CAPELLIMONELLI
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:
@@ -1,7 +1,7 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251027125018 extends BaseMigration implements MigrationModelInterface {
|
||||
@@ -15,7 +15,7 @@ public class Migration_20251027125018 extends BaseMigration implements Migration
|
||||
"Se abilitata blocca se codice a barre già assegnato ad altra referenza", false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
|
||||
if(isCustomerDb(IntegryCustomerDB.Carelli_Carelli)){
|
||||
if(isCustomer(IntegryCustomer.Carelli)){
|
||||
updateSetupValue("MTB_AART", "SETUP", "CHK_EXIST_BARCODE", "S");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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_20251028153054 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetupQuery("SI_NO", "SI_NO", "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
createSetup("PICKING", "PRODUZIONE", "FLAG_SKIP_ASK_VERSAMENTO_AUTOMATICO", "N",
|
||||
"Permette di saltare la domanda relativa all''effettuazione del versamento automatico, eseguendolo direttamente.", 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,92 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251029153203 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
|
||||
createOrUpdateView("[vw_tracciabUDCVend]", "CREATE VIEW [dbo].[vw_tracciabUDCVend] AS\n" +
|
||||
"SELECT mtb_colt.cod_anag AS codAnag,\n" +
|
||||
" gtb_anag.rag_soc AS ragSoc,\n" +
|
||||
" ISNULL(vtb_dest.destinatario, '') AS destinazione,\n" +
|
||||
" ISNULL(vtb_dest.citta, gtb_anag.citta) AS citta,\n" +
|
||||
" ISNULL(vtb_dest.prov, gtb_anag.prov) AS provincia,\n" +
|
||||
" ISNULL(vtb_dest.nazione, gtb_anag.nazione) AS nazione,\n" +
|
||||
" mtb_colt.cod_dtip AS codDtip,\n" +
|
||||
" mtb_colt.data_doc AS dataDoc,\n" +
|
||||
" mtb_colt.ser_doc AS serDoc,\n" +
|
||||
" mtb_colt.num_doc AS numDoc,\n" +
|
||||
" mtb_colr.cod_mart AS codMart,\n" +
|
||||
" mtb_aart.descrizione_estesa AS descrizioneEstesa,\n" +
|
||||
" ISNULL(mtb_partita_mag.partita_mag_prod, mtb_colr.partita_mag) AS lotto,\n" +
|
||||
" mtb_partita_mag.data_prod AS dataLotto,\n" +
|
||||
" IIF(dtb_tipi.segno_qta_scar = -1, mtb_colr.barcode_ul_in, mtb_colr.barcode_ul_out) AS UDCVenduta,\n" +
|
||||
" UDC.data_vers AS dataOraProd,\n" +
|
||||
" UDC.cod_jfas AS LineaProd,\n" +
|
||||
" UDC.num_ord AS numOrdProd,\n" +
|
||||
" UDC.data_ord AS DataOrdProd,\n" +
|
||||
" mtb_aart.unt_mis AS untMis,\n" +
|
||||
" SUM(mtb_colr.qta_col) AS qtaVenduta,\n" +
|
||||
" SUM(mtb_colr.num_cnf) AS colliVenduti,\n" +
|
||||
" vtb_vett.rag_soc AS vettore,\n" +
|
||||
" vtb_viaggi.targa AS Targa,\n" +
|
||||
" vtb_viaggi.num_prenotazione AS num_prenotazione,\n" +
|
||||
" vtb_viaggi.container AS container,\n" +
|
||||
" vtb_viaggi.sigillo AS sigillo,\n" +
|
||||
" vtb_viaggi.nave AS nave,\n" +
|
||||
" vtb_viaggi.id_viaggio AS id_viaggio\n" +
|
||||
" FROM mtb_colt\n" +
|
||||
" INNER JOIN mtb_colr ON mtb_colt.gestione = mtb_colr.gestione AND\n" +
|
||||
" mtb_colt.data_collo = mtb_colr.data_collo AND\n" +
|
||||
" mtb_colt.ser_collo = mtb_colr.ser_collo AND\n" +
|
||||
" mtb_colt.num_collo = mtb_colr.num_collo\n" +
|
||||
" INNER JOIN dtb_tipi ON mtb_colt.cod_dtip = dtb_tipi.cod_dtip\n" +
|
||||
" INNER JOIN gtb_anag ON mtb_colt.cod_anag = gtb_anag.cod_anag\n" +
|
||||
" LEFT OUTER JOIN vtb_dest ON mtb_colt.cod_anag = vtb_dest.cod_anag AND\n" +
|
||||
" mtb_colt.cod_vdes = vtb_dest.cod_vdes\n" +
|
||||
" INNER JOIN mtb_aart ON mtb_colr.cod_mart = mtb_aart.cod_mart\n" +
|
||||
" INNER JOIN mtb_partita_mag ON mtb_colr.cod_mart = mtb_partita_mag.cod_mart AND\n" +
|
||||
" mtb_colr.partita_mag = mtb_partita_mag.partita_mag\n" +
|
||||
" INNER JOIN mtb_colt UDC ON IIF(dtb_tipi.segno_qta_scar = -1, mtb_colr.barcode_ul_in, mtb_colr.barcode_ul_out) =\n" +
|
||||
" UDC.barcode_ul\n" +
|
||||
" LEFT OUTER JOIN dtb_doct on mtb_colt.cod_dtip =dtb_doct.cod_dtip and mtb_colt.data_doc =dtb_doct.data_doc and mtb_colt.ser_doc= dtb_doct.ser_doc and mtb_colt.num_doc= dtb_doct.num_doc\n" +
|
||||
" LEFT OUTER JOIN vtb_viaggi on dtb_doct.id_viaggio=vtb_viaggi.id_viaggio\n" +
|
||||
" LEFT OUTER JOIN vtb_vett on vtb_viaggi.cod_vvet=vtb_vett.cod_vvet\n" +
|
||||
"\n" +
|
||||
"WHERE mtb_colt.gestione = 'V'\n" +
|
||||
" AND dtb_tipi.tipo_emissione = 'DIRETTA'\n" +
|
||||
"GROUP BY mtb_colt.cod_anag, gtb_anag.rag_soc, ISNULL(vtb_dest.destinatario, ''),\n" +
|
||||
" ISNULL(vtb_dest.citta, gtb_anag.citta),\n" +
|
||||
" ISNULL(vtb_dest.prov, gtb_anag.prov),\n" +
|
||||
" ISNULL(vtb_dest.nazione, gtb_anag.nazione),\n" +
|
||||
" mtb_colt.cod_dtip, mtb_colt.data_doc, mtb_colt.ser_doc, mtb_colt.num_doc,\n" +
|
||||
" mtb_colr.cod_mart, mtb_aart.descrizione_estesa,\n" +
|
||||
" ISNULL(mtb_partita_mag.partita_mag_prod, mtb_colr.partita_mag),\n" +
|
||||
" mtb_partita_mag.data_prod,\n" +
|
||||
" mtb_aart.unt_mis,\n" +
|
||||
" IIF(dtb_tipi.segno_qta_scar = -1, mtb_colr.barcode_ul_in, mtb_colr.barcode_ul_out),\n" +
|
||||
" UDC.data_vers,\n" +
|
||||
" UDC.cod_jfas,\n" +
|
||||
" UDC.data_ord,\n" +
|
||||
" UDC.num_ord,\n" +
|
||||
" vtb_vett.rag_soc, \n" +
|
||||
" vtb_viaggi.targa, \n" +
|
||||
" vtb_viaggi.num_prenotazione, \n" +
|
||||
" vtb_viaggi.container, \n" +
|
||||
" vtb_viaggi.sigillo, \n" +
|
||||
" vtb_viaggi.nave, \n" +
|
||||
" vtb_viaggi.id_viaggio");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251029170931 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
|
||||
createOrUpdateFunction("getDettMatricoleDaOrdine", "CREATE Function [dbo].[getDettMatricoleDaOrdine] (@codJcom varchar(10)) \n" +
|
||||
"RETURNS @dettMatricole TABLE( cod_prod varchar(15),\n" +
|
||||
" descrizione_prod varchar(255), \n" +
|
||||
" unt_mis_prod varchar(3),\n" +
|
||||
" qta_inevasa numeric(20,5),\n" +
|
||||
" qta_da_prod numeric(20,5),\n" +
|
||||
" data_ord datetime, \n" +
|
||||
" num_ord integer, \n" +
|
||||
"matricola varchar(20)) AS\n" +
|
||||
"Begin\n" +
|
||||
" declare @codProd varchar(15),\n" +
|
||||
" @descrizioneProd varchar(255), \n" +
|
||||
" @untMisProd varchar(3), \n" +
|
||||
" @qtaInevasa numeric(20,5), \n" +
|
||||
" @qtaProd numeric(20,5), \n" +
|
||||
" @dataOrd datetime, \n" +
|
||||
" @numOrd integer,\n" +
|
||||
" @existMatricola integer,\n" +
|
||||
" @matricola varchar(20),\n" +
|
||||
" @termCons varchar(1024);\n" +
|
||||
"\n" +
|
||||
" Declare crs_prod Cursor LOCAL SCROLL FOR\n" +
|
||||
" select dtb_ordt.cod_prod, \n" +
|
||||
" dtb_ordt.descrizione_prod, \n" +
|
||||
" dtb_ordt.unt_mis_prod, \n" +
|
||||
" dtb_ordt.qta_prod - dtb_ordt.qta_evasa_prod as qta_inevasa, \n" +
|
||||
" convert(numeric(20,5), 0) as qta_da_prod, \n" +
|
||||
" dtb_ordt.data_ord, \n" +
|
||||
" dtb_ordt.num_ord,\n" +
|
||||
" dtb_ordt.term_cons\n" +
|
||||
" from dtb_ordt \n" +
|
||||
" where gestione = 'L' and \n" +
|
||||
" livello = 1 and\n" +
|
||||
" /*flag_evaso_forzato = 'N' and\n" +
|
||||
" flag_evaso_prod = 'I' and */\n" +
|
||||
" dtb_ordt.cod_jcom = @codJcom\n" +
|
||||
"\n" +
|
||||
" OPEN crs_prod \n" +
|
||||
" FETCH NEXT FROM crs_prod INTO @codProd, @descrizioneProd, @untMisProd, @qtaInevasa, @qtaProd, @dataOrd, @numOrd, @termCons\n" +
|
||||
" WHILE @@FETCH_STATUS = 0\n" +
|
||||
" Begin \n" +
|
||||
" IF @termCons IS NOT NULL\n" +
|
||||
" BEGIN\n" +
|
||||
" Declare crs_matricole Cursor LOCAL SCROLL FOR\n" +
|
||||
" select value_string\n" +
|
||||
" from parseStringIntoArray(@termcons, '|') \n" +
|
||||
"\n" +
|
||||
" OPEN crs_matricole \n" +
|
||||
" FETCH NEXT FROM crs_matricole INTO @matricola\n" +
|
||||
" WHILE @@FETCH_STATUS = 0\n" +
|
||||
" Begin\n" +
|
||||
" select @existMatricola = 0\n" +
|
||||
" select @existMatricola = COUNT(*)\n" +
|
||||
" from dtb_ordt, \n" +
|
||||
" dtb_docr inner join (select cod_prod, \n" +
|
||||
" partita_mag \n" +
|
||||
" from dtb_doct \n" +
|
||||
" where cod_dtip = dbo.getGestSetup('IMPORT_DOCUMENTI', 'CARICO_SCARICO_DA_FABB', 'COD_DTIP_SCAR_GIROC'))giroc on giroc.cod_prod = dtb_docr.cod_mart and\n" +
|
||||
" giroc.partita_mag = dtb_docr.matricola, \n" +
|
||||
" dtb_tipi\n" +
|
||||
" where dtb_docr.data_ord = dtb_ordt.data_ord and\n" +
|
||||
" dtb_docr.num_ord = dtb_ordt.num_ord and\n" +
|
||||
" dtb_ordt.gestione = 'L' and \n" +
|
||||
" dtb_docr.cod_dtip = dtb_tipi.cod_dtip and\n" +
|
||||
" dtb_tipi.tipo_emissione = 'DIRETTA' and\n" +
|
||||
" dtb_tipi.segno_qta_car = 1 and\n" +
|
||||
" dtb_ordt.livello = 1 and\n" +
|
||||
" dtb_ordt.data_ord = @dataOrd and\n" +
|
||||
" dtb_ordt.num_ord = @numOrd and\n" +
|
||||
" dtb_docr.matricola = @matricola;\n" +
|
||||
" \n" +
|
||||
"\n" +
|
||||
" IF @existMatricola = 0\n" +
|
||||
" insert into @dettMatricole \n" +
|
||||
" select @codProd, @descrizioneProd, @untMisProd, @qtaInevasa, @qtaProd, @dataOrd, @numOrd, @matricola\n" +
|
||||
"\n" +
|
||||
" FETCH NEXT FROM crs_matricole INTO @matricola\n" +
|
||||
" end \n" +
|
||||
" close crs_matricole\n" +
|
||||
" deallocate crs_matricole \n" +
|
||||
" END\n" +
|
||||
" ELSE\n" +
|
||||
" insert into @dettMatricole \n" +
|
||||
" select @codProd, @descrizioneProd, @untMisProd, @qtaInevasa, @qtaProd, @dataOrd, @numOrd, null\n" +
|
||||
"\n" +
|
||||
" FETCH NEXT FROM crs_prod INTO @codProd, @descrizioneProd, @untMisProd, @qtaInevasa, @qtaProd, @dataOrd, @numOrd, @termCons\n" +
|
||||
" end \n" +
|
||||
" close crs_prod\n" +
|
||||
" deallocate crs_prod \n" +
|
||||
"\n" +
|
||||
" return\n" +
|
||||
"end");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.entity.JtbCiclCq;
|
||||
import it.integry.ems_model.entity.JtbCiclCqValori;
|
||||
import it.integry.ems_model.entity._enum.TipoValore;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Migration_20251029181607 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement(
|
||||
"EXEC sp_updateextendedproperty 'MS_Description',\n" +
|
||||
" 'Valori possibili: 0 -> Testo, 1 -> Boolean, 2 -> Intero, 3 -> Decimale, 4 -> Date, 5 -> Datetime, 6 -> Time, 7 -> DropdownList',\n" +
|
||||
" 'SCHEMA', 'dbo', 'TABLE', 'jtb_cicl_cq', 'COLUMN', 'tipo_valore';",
|
||||
"EXEC sp_updateextendedproperty 'MS_Description',\n" +
|
||||
" 'Valori possibili: 0 -> Testo, 1 -> Boolean, 2 -> Intero, 3 -> Decimale, 4 -> Date, 5 -> Datetime, 6 -> Time, 7 -> DropdownList',\n" +
|
||||
" 'SCHEMA', 'dbo', 'TABLE', 'dtb_ord_cq', 'COLUMN', 'tipo_valore';"
|
||||
);
|
||||
|
||||
dropChecks("jtb_cicl_cq", "tipo_valore");
|
||||
dropChecks("dtb_ord_cq", "tipo_valore");
|
||||
|
||||
executeStatement(
|
||||
"ALTER TABLE jtb_cicl_cq\n" +
|
||||
" ADD CHECK ([tipo_valore] = 0 OR [tipo_valore] = 1 OR [tipo_valore] = 2 OR [tipo_valore] = 3 OR [tipo_valore] = 4 OR\n" +
|
||||
" [tipo_valore] = 5 OR [tipo_valore] = 6 OR [tipo_valore] = 7);",
|
||||
"ALTER TABLE dtb_ord_cq\n" +
|
||||
" ADD CHECK ([tipo_valore] = 0 OR [tipo_valore] = 1 OR [tipo_valore] = 2 OR [tipo_valore] = 3 OR [tipo_valore] = 4 OR\n" +
|
||||
" [tipo_valore] = 5 OR [tipo_valore] = 6 OR [tipo_valore] = 7);",
|
||||
"CREATE TABLE jtb_cicl_cq_valori\n" +
|
||||
"(\n" +
|
||||
" id BIGINT IDENTITY\n" +
|
||||
" CONSTRAINT jtb_cicl_cq_valori_pk\n" +
|
||||
" PRIMARY KEY,\n" +
|
||||
" descrizione VARCHAR(255) NOT NULL,\n" +
|
||||
" valori VARCHAR(MAX) NOT NULL\n" +
|
||||
");",
|
||||
"ALTER TABLE jtb_cicl_cq\n" +
|
||||
" ADD id_valori BIGINT\n" +
|
||||
" CONSTRAINT jtb_cicl_cq_jtb_cicl_cq_valori_id_fk\n" +
|
||||
" REFERENCES dbo.jtb_cicl_cq_valori;",
|
||||
"ALTER TABLE dtb_ord_cq\n" +
|
||||
" ADD id_valori BIGINT\n" +
|
||||
" CONSTRAINT dtb_ord_cq_jtb_cicl_cq_valori_id_fk\n" +
|
||||
" REFERENCES dbo.jtb_cicl_cq_valori;"
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
import it.integry.ems_model.entity.JtbCiclCq;
|
||||
import it.integry.ems_model.entity.JtbCiclCqValori;
|
||||
import it.integry.ems_model.entity._enum.TipoValore;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityList;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Migration_20251030093449 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Gramm_Gramm)) {
|
||||
return;
|
||||
}
|
||||
|
||||
JtbCiclCqValori jtbCiclCqValori = new JtbCiclCqValori()
|
||||
.setDescrizione("Tipologia Fermi Macchina")
|
||||
.setValori("FERMO MACCHINA|CAMBIO FORMATO|CAMBIO COLORE|PULIZIA|ATTESA PRODOTTO");
|
||||
|
||||
jtbCiclCqValori.setOperation(OperationType.INSERT);
|
||||
|
||||
jtbCiclCqValori.manageWithParentConnection(connection);
|
||||
|
||||
String sql =
|
||||
"SELECT DISTINCT cod_prod, num_fase, MAX(id_riga) + 1 AS id_riga\n" +
|
||||
"FROM jtb_cicl_cq\n" +
|
||||
"WHERE tipologia = 'FERMI_MACCHINA'\n" +
|
||||
"GROUP BY cod_prod, num_fase";
|
||||
|
||||
List<JtbCiclCq> jtbCiclCqList = UtilityDB.executeSimpleQueryDTO(connection, sql, JtbCiclCq.class);
|
||||
|
||||
if (UtilityList.isNullOrEmpty(jtbCiclCqList)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (JtbCiclCq jtbCiclCq : jtbCiclCqList) {
|
||||
jtbCiclCq
|
||||
.setControllo("Tipologia")
|
||||
.setNumRip(0)
|
||||
.setTipologia("FERMI_MACCHINA")
|
||||
.setTipoValore(TipoValore.DROPDOWNLIST)
|
||||
.setIdValori(jtbCiclCqValori.getId());
|
||||
|
||||
jtbCiclCq.setOperation(OperationType.INSERT);
|
||||
|
||||
jtbCiclCq.manageWithParentConnection(connection);
|
||||
}
|
||||
}
|
||||
|
||||
@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_20251031092657 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement("alter table dtb_tipi add flag_delete_plk bit not null default 0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251031094727 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if(isCustomer(IntegryCustomer.RossoGargano)) {
|
||||
executeStatement("insert into stb_abil\n" +
|
||||
"select stb_menu_opz.cod_opz, user_name, flag_abil, stb_menu_opz.gest_name\n" +
|
||||
"from ( select * from stb_abil where stb_abil.cod_opz = 'VR011' ) stb_abil\n" +
|
||||
"cross apply ( select * from stb_menu_opz where stb_menu_opz.cod_opz ='VR131' ) stb_menu_opz");
|
||||
}
|
||||
}
|
||||
|
||||
@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_20251031100008 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement("exec sp_rename 'dtb_tipi.flag_delete_plk', 'flag_delete_pkl'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251031120553 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createOrUpdateFunction("f_suggestEAN13","CREATE FUNCTION [dbo].[f_suggestEAN13](@precode VARCHAR(12))\n" +
|
||||
" RETURNS VARCHAR(13)\n" +
|
||||
" AS\n" +
|
||||
" BEGIN\n" +
|
||||
"\n" +
|
||||
" DECLARE @ean13 VARCHAR(13);\n" +
|
||||
"\n" +
|
||||
" IF LEN(@precode) = 12\n" +
|
||||
" BEGIN\n" +
|
||||
" SELECT @ean13 = CONCAT(@precode, dbo.getCheckDigitEan13(@precode))\n" +
|
||||
" END;\n" +
|
||||
" ELSE\n" +
|
||||
" BEGIN\n" +
|
||||
" WITH ean AS (SELECT MAX(CAST((RIGHT(\n" +
|
||||
" LEFT(cod_barre, LEN(cod_barre) - 1),\n" +
|
||||
" (LEN(cod_barre) - LEN(@precode) - 1))) AS NUMERIC)) AS maxValue\n" +
|
||||
"\n" +
|
||||
" FROM mvw_barcode\n" +
|
||||
" WHERE cod_barre LIKE @precode + '%'\n" +
|
||||
" AND LEN(cod_barre) = 13\n" +
|
||||
" AND ISNUMERIC(RIGHT(cod_barre, LEN(cod_barre) - LEN(@precode))) = 1)\n" +
|
||||
" SELECT @ean13 = CONCAT(@precode,\n" +
|
||||
" RIGHT(FORMAT((ISNULL(maxValue, 0) + 1), REPLICATE('0', 12)), 12 - LEN(@precode)))\n" +
|
||||
" FROM ean;\n" +
|
||||
"\n" +
|
||||
" SELECT @ean13 = CONCAT(@ean13, dbo.getCheckDigitEan13(@ean13))\n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
" END\n" +
|
||||
" RETURN @ean13;\n" +
|
||||
" END\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251031122121 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("W_CSITUAZ_CNTECONCOMM_DISP", "DATAWINDOW", "D_CSIT_CNTECONCOMM_REP", null,
|
||||
null, false, null, false, false,
|
||||
false, false, false, null, false, null);
|
||||
|
||||
if(isCustomer(IntegryCustomer.Smetar)){
|
||||
updateSetupValue("W_CSITUAZ_CNTECONCOMM_DISP", "DATAWINDOW", "D_CSIT_CNTECONCOMM_REP", "d_csit_cnteconcomm_smetar_rep");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
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_20251031125910 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if(isCustomer(IntegryCustomer.Gramm)) {
|
||||
createOrUpdateView("[OlapFermiMacchina]", "CREATE view [dbo].[OlapFermiMacchina] as \n" +
|
||||
"\n" +
|
||||
" \n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
" WITH controlli_qualita AS (SELECT [Data Inizio],[Data Fine], [Operatore], [Tipologia], [Descrizione del Fermo] as Note, gestione, data_ord, num_ord, num_rip\n" +
|
||||
" FROM (\n" +
|
||||
" select controllo, valore_ril, DTB_ORDT.gestione, dtb_ordt.data_ord, dtb_ordt.num_ord, dtb_ord_cqr.num_rip\n" +
|
||||
" \n" +
|
||||
"from dtb_ord_cqr inner join dtb_ord_cq on dtb_ord_cqr.gestione=dtb_ord_cq.gestione and \n" +
|
||||
" dtb_ord_cqr.data_ord=dtb_ord_cq.data_ord and dtb_ord_cqr.num_ord=dtb_ord_cq.num_ord \n" +
|
||||
" and dtb_ord_cqr.id_riga=dtb_ord_cq.id_riga\n" +
|
||||
" inner join dtb_ordt on dtb_ord_cqr.gestione=dtb_ordt.gestione and \n" +
|
||||
" dtb_ord_cqr.data_ord=dtb_ordt.data_ord and \n" +
|
||||
" dtb_ord_cqr.num_ord=dtb_ordt.num_ord\n" +
|
||||
" \n" +
|
||||
"where dtb_ord_cqr.gestione='L' and dtb_ord_cqr.data_ord >'2024/10/01' and dtb_ordt.cod_mdep in('34','01','33')\n" +
|
||||
" ) cq\n" +
|
||||
" PIVOT\n" +
|
||||
" (max(valore_ril)\n" +
|
||||
" FOR controllo IN ([Data Inizio],[Data Fine], [Operatore],[Tipologia],[Descrizione del Fermo])\n" +
|
||||
" ) AS pivottable)\n" +
|
||||
"\n" +
|
||||
"select dtb_ordt.cod_mdep,\n" +
|
||||
" dtb_ord_steps.cod_jfas,\n" +
|
||||
" dtb_ordt.data_ord, \n" +
|
||||
" dtb_ordt.num_ord,\n" +
|
||||
" dtb_ordt.cod_prod,\n" +
|
||||
" mtb_aart.descrizione,\n" +
|
||||
" mtb_aart.marchio,\n" +
|
||||
" dtb_ordt.partita_mag,\n" +
|
||||
" dtb_ordt.unt_mis_prod,\n" +
|
||||
" dtb_ordt.qta_evasa_prod,\n" +
|
||||
" try_convert(datetime, controlli_qualita.[Data Inizio], 103) as Data_inz_fermo,\n" +
|
||||
" try_convert(datetime, controlli_qualita.[Data Fine], 103) as Data_fine_fermo,\n" +
|
||||
" controlli_qualita.Operatore,\n" +
|
||||
" controlli_qualita.Note,\n" +
|
||||
" SUM(\n" +
|
||||
" CASE\n" +
|
||||
" WHEN TRY_CONVERT(datetime, controlli_qualita.[Data Inizio], 103) IS NOT NULL\n" +
|
||||
" AND TRY_CONVERT(datetime, controlli_qualita.[Data Fine], 103) IS NOT NULL\n" +
|
||||
" THEN DATEDIFF(\n" +
|
||||
" MINUTE,\n" +
|
||||
" TRY_CONVERT(datetime, controlli_qualita.[Data Inizio], 103),\n" +
|
||||
" TRY_CONVERT(datetime, controlli_qualita.[Data Fine], 103)\n" +
|
||||
" )\n" +
|
||||
" ELSE 0\n" +
|
||||
" END\n" +
|
||||
") AS min_lav, -- min_fermo (non è stato cambiato il nome del campo perchè ci sono diversi report che leggono da questa vista)\n" +
|
||||
"\n" +
|
||||
"0 AS h_lav,\n" +
|
||||
"\n" +
|
||||
"SUM(\n" +
|
||||
" CASE\n" +
|
||||
" WHEN TRY_CONVERT(datetime, controlli_qualita.[Data Inizio], 103) IS NOT NULL\n" +
|
||||
" AND TRY_CONVERT(datetime, controlli_qualita.[Data Fine], 103) IS NOT NULL\n" +
|
||||
" THEN DATEDIFF(\n" +
|
||||
" HOUR,\n" +
|
||||
" TRY_CONVERT(datetime, controlli_qualita.[Data Inizio], 103),\n" +
|
||||
" TRY_CONVERT(datetime, controlli_qualita.[Data Fine], 103)\n" +
|
||||
" )\n" +
|
||||
" ELSE 0\n" +
|
||||
" END\n" +
|
||||
") OVER (PARTITION BY dtb_ordt.gestione, dtb_ordt.data_ord, dtb_ordt.num_ord) AS h_fermo,\n" +
|
||||
"\n" +
|
||||
"controlli_qualita.Tipologia\n" +
|
||||
"\n" +
|
||||
" \n" +
|
||||
"from controlli_qualita inner join dtb_ordt on controlli_qualita.gestione=dtb_ordt.gestione and \n" +
|
||||
" controlli_qualita.data_ord=dtb_ordt.data_ord and \n" +
|
||||
" controlli_qualita.num_ord=dtb_ordt.num_ord\n" +
|
||||
" \n" +
|
||||
" inner join mtb_aart on dtb_ordt.cod_prod=mtb_aart.cod_mart\n" +
|
||||
" left outer join ( select num_ord, data_ord, gestione, cod_jfas\n" +
|
||||
" from \n" +
|
||||
" (select num_ord, data_ord, gestione, data_iniz, cod_jfas,\n" +
|
||||
" ROW_NUMBER() OVER (PARTITION BY gestione, data_ord, num_ord ORDER BY data_iniz ASC) AS num\n" +
|
||||
" from dtb_ord_steps\n" +
|
||||
" where data_iniz IS NOT NULL) step\n" +
|
||||
" where num='1') dtb_ord_steps ON dtb_ordt.gestione = dtb_ord_steps.gestione\n" +
|
||||
" AND dtb_ordt.data_ord = dtb_ord_steps.data_ord\n" +
|
||||
" AND dtb_ordt.num_ord = dtb_ord_steps.num_ord\n" +
|
||||
"where dtb_ordt.gestione='L' and dtb_ordt.data_ord>'2024/10/01' and dtb_ordt.cod_mdep in('34','01','33') \n" +
|
||||
"\n" +
|
||||
"group by dtb_ordt.cod_mdep,\n" +
|
||||
" dtb_ord_steps.cod_jfas,\n" +
|
||||
" dtb_ordt.data_ord, \n" +
|
||||
" dtb_ordt.num_ord,\n" +
|
||||
" dtb_ordt.cod_prod,\n" +
|
||||
" mtb_aart.descrizione,\n" +
|
||||
" mtb_aart.marchio,\n" +
|
||||
" dtb_ordt.partita_mag,\n" +
|
||||
" dtb_ordt.unt_mis_prod,\n" +
|
||||
" dtb_ordt.qta_prod,\n" +
|
||||
" dtb_ordt.qta_evasa_prod,\n" +
|
||||
" controlli_qualita.[Data Inizio],\n" +
|
||||
" controlli_qualita.[Data Fine],\n" +
|
||||
" controlli_qualita.Operatore,\n" +
|
||||
" controlli_qualita.Note,\n" +
|
||||
" dtb_ordt.gestione,\n" +
|
||||
" controlli_qualita.Tipologia");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251031162801 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Levanplast_Levanplast))
|
||||
return;
|
||||
|
||||
updateSetupValue("W_ARICEZIONE_MERCE_INS_NEW_COLLO_DLG", "SETUP", "AGGIORNA_DATA_SCAD_PARTITA_MAG", "S",
|
||||
"Se impostata a S in fase di ricezione merce la data di scadenza della partita verrà aggiornata a data ricezione + gg_scad ove presente", false, null, false, false, false,
|
||||
false, false, null, false, null);
|
||||
|
||||
executeStatement("DELETE\n" +
|
||||
"FROM stb_gest_setup_depo\n" +
|
||||
"WHERE gest_name = 'W_ARICEZIONE_MERCE_INS_NEW_COLLO_DLG'\n" +
|
||||
" AND section = 'SETUP'\n" +
|
||||
" AND key_section = 'AGGIORNA_DATA_SCAD_PARTITA_MAG'"
|
||||
);
|
||||
|
||||
executeStatement("DELETE\n" +
|
||||
"FROM wtb_gest_setup_user\n" +
|
||||
"WHERE gest_name = 'W_ARICEZIONE_MERCE_INS_NEW_COLLO_DLG'\n" +
|
||||
" AND section = 'SETUP'\n" +
|
||||
" AND key_section = 'AGGIORNA_DATA_SCAD_PARTITA_MAG'"
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251031163348 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement("INSERT INTO stb_gest_setup VALUES (\n" +
|
||||
"\t'W_ARICEZIONE_MERCE_INS_NEW_COLLO_DLG',\n" +
|
||||
"\t'SETUP',\n" +
|
||||
"\t'AGGIORNA_DATA_SCAD_PARTITA_MAG',\n" +
|
||||
"\t'S',\n" +
|
||||
"\t'Se impostata a S in fase di ricezione merce la data di scadenza della partita verrà aggiornata a data ricezione + gg_scad ove presente',\n" +
|
||||
"\t'N',\n" +
|
||||
"\tNULL,\n" +
|
||||
"\t'N',\n" +
|
||||
"\t'2025-10-31 16:28:03.000',\n" +
|
||||
"\t'Database Administrator',\n" +
|
||||
"\t'N',\n" +
|
||||
"\t'N',\n" +
|
||||
"\t'N',\n" +
|
||||
"\t'N',\n" +
|
||||
"\tNULL,\n" +
|
||||
"\t0);\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.sql.*;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.*;
|
||||
|
||||
@@ -145,7 +146,7 @@ public class AccountingRules extends QueryRules {
|
||||
}
|
||||
|
||||
|
||||
public static Integer getAnnoComp(Connection conn, Date dataCmov) throws SQLException {
|
||||
public static Integer getAnnoComp(Connection conn, LocalDate dataCmov) throws SQLException {
|
||||
if (dataCmov == null)
|
||||
return UtilityLocalDate.getNow().getYear();
|
||||
|
||||
@@ -157,6 +158,10 @@ public class AccountingRules extends QueryRules {
|
||||
return UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||
}
|
||||
|
||||
public static Integer getAnnoComp(Connection conn, Date dataCmov) throws SQLException {
|
||||
return getAnnoComp(conn, UtilityLocalDate.localDateFromDate(dataCmov));
|
||||
}
|
||||
|
||||
public static String getCodBiva(Connection connection, String codAnag) throws Exception {
|
||||
String sql =
|
||||
" SELECT ctb_biva.cod_biva " +
|
||||
@@ -718,13 +723,20 @@ public class AccountingRules extends QueryRules {
|
||||
Query.format(
|
||||
"SELECT cast(count(*) as bit) " +
|
||||
" FROM ctb_parr " +
|
||||
" WHERE cod_anag = %s AND " +
|
||||
" WHERE num_cmov = %S AND " +
|
||||
"cod_anag = %s AND " +
|
||||
"tipo_anag = %s AND " +
|
||||
"anno_part = %s AND " +
|
||||
"ser_doc = %s AND " +
|
||||
"num_doc = %s AND " +
|
||||
"id_riga = %s ",
|
||||
ctbMovr.getCodAnag(), ctbMovr.getTipoAnag(), ctbMovr.getAnnoPart(), ctbMovr.getSerDoc(), ctbMovr.getNumDoc(), ctbMovr.getIdRiga());
|
||||
ctbMovr.getNumCmov(),
|
||||
ctbMovr.getCodAnag(),
|
||||
ctbMovr.getTipoAnag(),
|
||||
ctbMovr.getAnnoPart(),
|
||||
ctbMovr.getSerDoc(),
|
||||
ctbMovr.getNumDoc(),
|
||||
ctbMovr.getIdRiga());
|
||||
|
||||
boolean existRow = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||
|
||||
|
||||
@@ -35,6 +35,9 @@ public class ServiceCallAutomatedOperationDTO extends BaseScheduledOperationDTO
|
||||
@OperationField(password = true)
|
||||
private String password;
|
||||
|
||||
@OperationField()
|
||||
private String logErrorEmail;
|
||||
|
||||
|
||||
public RequestMethod getMethodType() {
|
||||
return methodType;
|
||||
@@ -103,4 +106,13 @@ public class ServiceCallAutomatedOperationDTO extends BaseScheduledOperationDTO
|
||||
this.password = password;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLogErrorEmail() {
|
||||
return logErrorEmail;
|
||||
}
|
||||
|
||||
public ServiceCallAutomatedOperationDTO setLogErrorEmail(String logErrorEmail) {
|
||||
this.logErrorEmail = logErrorEmail;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
package it.integry.ems.schedule.new_cron_job.dto.operations.runners;
|
||||
|
||||
import it.integry.ems._context.ApplicationContextProvider;
|
||||
import it.integry.ems.schedule.new_cron_job.dto.operations.ServiceCallAutomatedOperationDTO;
|
||||
import it.integry.ems.service.HttpRestWrapper;
|
||||
import it.integry.ems.service.MailService;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import org.springframework.web.context.ContextLoader;
|
||||
|
||||
import javax.ws.rs.client.Entity;
|
||||
import java.util.Collections;
|
||||
|
||||
public class ServiceCallScheduledOperationRunner extends BaseScheduledOperationRunner<ServiceCallAutomatedOperationDTO> {
|
||||
|
||||
@@ -13,14 +18,38 @@ public class ServiceCallScheduledOperationRunner extends BaseScheduledOperationR
|
||||
|
||||
final HttpRestWrapper httpRestWrapper = ContextLoader.getCurrentWebApplicationContext().getBean(HttpRestWrapper.class);
|
||||
|
||||
final Object internalGetResponse = httpRestWrapper.callInternalMethod(getDtoInstance().getProfileDb(),
|
||||
getDtoInstance().getMethodName(),
|
||||
getDtoInstance().getUsername(),
|
||||
getDtoInstance().getMethodType(),
|
||||
getDtoInstance().parseQueryParams(),
|
||||
Entity.json(getDtoInstance().getBody())
|
||||
);
|
||||
try {
|
||||
final Object internalGetResponse = httpRestWrapper.callInternalMethod(getDtoInstance().getProfileDb(),
|
||||
getDtoInstance().getMethodName(),
|
||||
getDtoInstance().getUsername(),
|
||||
getDtoInstance().getMethodType(),
|
||||
getDtoInstance().parseQueryParams(),
|
||||
Entity.json(getDtoInstance().getBody())
|
||||
);
|
||||
|
||||
} catch (Exception e) {
|
||||
handleErrorEmailNotification(e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
private void handleErrorEmailNotification(Exception e) throws Exception {
|
||||
if (!UtilityString.isNullOrEmpty(getDtoInstance().getLogErrorEmail())) {
|
||||
try (MultiDBTransactionManager multiDBTransactionManager = new MultiDBTransactionManager(getDtoInstance().getProfileDb())) {
|
||||
|
||||
MailService mailService = ApplicationContextProvider.getApplicationContext().getBean(MailService.class);
|
||||
|
||||
|
||||
mailService.sendErrorMail(multiDBTransactionManager.getPrimaryConnection(),
|
||||
getDtoInstance().getLogErrorEmail(),
|
||||
"Errore operazione pianificata (" + getDtoInstance().getName() + ")",
|
||||
getDtoInstance().getName(),
|
||||
null,
|
||||
null, null,
|
||||
Collections.singletonList(e)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -40,6 +40,7 @@ import org.springframework.web.context.ContextLoader;
|
||||
|
||||
import javax.activation.DataHandler;
|
||||
import javax.activation.DataSource;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.mail.*;
|
||||
import javax.mail.internet.*;
|
||||
import javax.mail.util.ByteArrayDataSource;
|
||||
@@ -395,7 +396,10 @@ public class MailService {
|
||||
}
|
||||
|
||||
public void sendErrorMail(Connection connection, String emailDestination, String mailTitle, String action,
|
||||
List<EntityBase> entitiesList, List<EmailFileAttachment> attachments, List<AnomalieDTO> anomalie, List<Exception> customExceptions) throws Exception {
|
||||
@Nullable List<EntityBase> entitiesList,
|
||||
@Nullable List<EmailFileAttachment> attachments,
|
||||
@Nullable List<AnomalieDTO> anomalie,
|
||||
@Nullable List<Exception> customExceptions) throws Exception {
|
||||
|
||||
if (UtilityString.isNullOrEmpty(emailDestination)) {
|
||||
return;
|
||||
|
||||
@@ -176,7 +176,7 @@ public class UtilityUser {
|
||||
throw new Exception("Attenzione la nuova password non può coincidere con quella attuale.");
|
||||
|
||||
int passwordLen = 8;
|
||||
if (newPassword.length() <= passwordLen)
|
||||
if (newPassword.length() < passwordLen)
|
||||
throw new Exception(String.format("Attenzione la password deve essere lunga almeno %s caratteri.", passwordLen));
|
||||
|
||||
// validationPasswordChar(newPassword, Caratteri.UPPER);
|
||||
|
||||
@@ -1043,7 +1043,7 @@ public class GeneraOrdLav {
|
||||
// ---------------------------------------------------------------------------
|
||||
// CONTROLLI DI QUALITA' ASSOCIATI ALLA DISTINTA
|
||||
// ---------------------------------------------------------------------------
|
||||
addControlliQualità(ordT, conn, artDist);
|
||||
addControlliQualita(ordT, conn, artDist);
|
||||
|
||||
// -------------------------------------------------
|
||||
// DISEGNI ORDINE DI LAVORAZIONE
|
||||
@@ -1317,38 +1317,52 @@ public class GeneraOrdLav {
|
||||
}
|
||||
}
|
||||
|
||||
private static void addControlliQualità(DtbOrdt ordT, Connection conn, List<ExplodeDistDTO> artDist) throws SQLException {
|
||||
private static void addControlliQualita(DtbOrdt ordT, Connection conn, List<ExplodeDistDTO> artDist) throws Exception {
|
||||
List<DtbOrdCq> listOrdCQ = new ArrayList<>();
|
||||
|
||||
for (ExplodeDistDTO art : artDist) {
|
||||
String sql =
|
||||
Query.format(
|
||||
"SELECT jtb_cicl_cq.num_fase, "
|
||||
+ " jtb_cicl_cq.controllo, "
|
||||
+ " jtb_cicl_cq.valore_rif, "
|
||||
+ " jtb_cicl_cq.num_rip, "
|
||||
+ " jtb_cicl_cq.tipologia, "
|
||||
+ " jtb_cicl_cq.tipo_valore "
|
||||
+ "FROM jtb_cicl_cq "
|
||||
+ "WHERE jtb_cicl_cq.cod_prod = %s "
|
||||
+ "ORDER BY jtb_cicl_cq.id_riga ",
|
||||
"SELECT jtb_cicl_cq.num_fase,\n" +
|
||||
" jtb_cicl_cq.controllo,\n" +
|
||||
" jtb_cicl_cq.valore_rif,\n" +
|
||||
" jtb_cicl_cq.num_rip,\n" +
|
||||
" jtb_cicl_cq.tipologia,\n" +
|
||||
" jtb_cicl_cq.tipo_valore,\n" +
|
||||
" jtb_cicl_cq.id_valori\n" +
|
||||
"FROM jtb_cicl_cq\n" +
|
||||
"WHERE jtb_cicl_cq.cod_prod = %s\n" +
|
||||
"ORDER BY jtb_cicl_cq.id_riga",
|
||||
art.getCodProd());
|
||||
List<HashMap<String, Object>> datiCQ = UtilityDB.executeSimpleQuery(conn, sql);
|
||||
for (HashMap<String, Object> cq : datiCQ) {
|
||||
Integer numFase = UtilityHashMap.getValueIfExists(cq, "num_fase");
|
||||
|
||||
List<JtbCiclCq> jtbCiclCqList = UtilityDB.executeSimpleQueryDTO(conn, sql, JtbCiclCq.class);
|
||||
|
||||
if (UtilityList.isNullOrEmpty(jtbCiclCqList)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (JtbCiclCq cq : jtbCiclCqList) {
|
||||
Integer numFase = cq.getNumFase();
|
||||
|
||||
numFase = art.getNumFase() + numFase - 1;
|
||||
|
||||
DtbOrdCq ordCQ =
|
||||
new DtbOrdCq()
|
||||
.setControllo(UtilityHashMap.getValueIfExists(cq, "controllo"))
|
||||
.setValoreRif(UtilityHashMap.getValueIfExists(cq, "valore_rif"))
|
||||
.setNumRip(UtilityHashMap.getValueIfExists(cq, "num_rip"))
|
||||
.setTipologia(UtilityHashMap.getValueIfExists(cq, "tipologia"))
|
||||
.setTipoValore(TipoValore.from(UtilityHashMap.getValueIfExists(cq, "tipo_valore")))
|
||||
.setControllo(cq.getControllo())
|
||||
.setValoreRif(cq.getValoreRif())
|
||||
.setNumRip(cq.getNumRip())
|
||||
.setTipologia(cq.getTipologia())
|
||||
.setTipoValore(cq.getTipoValore())
|
||||
.setIdValori(cq.getIdValori())
|
||||
.setNumFase(numFase);
|
||||
|
||||
ordCQ.setOperation(OperationType.INSERT);
|
||||
|
||||
listOrdCQ.add(ordCQ);
|
||||
}
|
||||
}
|
||||
if (listOrdCQ != null && !listOrdCQ.isEmpty())
|
||||
|
||||
if (!listOrdCQ.isEmpty())
|
||||
ordT.setDtbOrdCq(listOrdCQ);
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ public class ProductionBusinessLogic {
|
||||
Integer durataFasiPrec = 0;
|
||||
Date dataIniz = null, dataFine = null;
|
||||
String classNameOrdProd = "W_PORDI_RC", activityIDRoot = null, activityTypeID = null, flagTipologia = null, sql;
|
||||
StbActivity activity = new StbActivity();
|
||||
StbActivity activity;
|
||||
List<StbActivity> activityList = new ArrayList<StbActivity>();
|
||||
SetupGest setup = new SetupGest();
|
||||
PreparedStatement ps = null;
|
||||
@@ -851,23 +851,25 @@ public class ProductionBusinessLogic {
|
||||
// CONTROLLI DI QUALITA' ASSOCIATI ALLA DISTINTA
|
||||
// ---------------------------------------------------------------------------
|
||||
sql =
|
||||
"SELECT jtb_cicl_cq.num_fase, "
|
||||
+ " jtb_cicl_cq.controllo, "
|
||||
+ " jtb_cicl_cq.valore_rif, "
|
||||
+ " jtb_cicl_cq.num_rip, "
|
||||
+ " jtb_cicl_cq.tipologia, "
|
||||
+ " jtb_cicl_cq.tipo_valore "
|
||||
+ "FROM jtb_cicl_cq "
|
||||
+ "WHERE jtb_cicl_cq.cod_prod = " + UtilityDB.valueToString(codProd) + " "
|
||||
+ "ORDER BY jtb_cicl_cq.id_riga ";
|
||||
ps = conn.prepareStatement(sql);
|
||||
rs = ps.executeQuery();
|
||||
while (rs.next()) {
|
||||
int numFase = rs.getInt("num_fase");
|
||||
String controllo = rs.getString("controllo");
|
||||
String valoreRif = rs.getString("valore_rif");
|
||||
int numRip = rs.getInt("num_rip");
|
||||
String tipologia = rs.getString("tipologia");
|
||||
"SELECT jtb_cicl_cq.num_fase,\n"
|
||||
+ " jtb_cicl_cq.controllo,\n"
|
||||
+ " jtb_cicl_cq.valore_rif,\n"
|
||||
+ " jtb_cicl_cq.num_rip,\n"
|
||||
+ " jtb_cicl_cq.tipologia,\n"
|
||||
+ " jtb_cicl_cq.tipo_valore,\n"
|
||||
+ " jtb_cicl_cq.id_valori\n"
|
||||
+ "FROM jtb_cicl_cq\n"
|
||||
+ "WHERE jtb_cicl_cq.cod_prod = " + UtilityDB.valueToString(codProd) + "\n"
|
||||
+ "ORDER BY jtb_cicl_cq.id_riga\n";
|
||||
|
||||
List<JtbCiclCq> jtbCiclCqList = UtilityDB.executeSimpleQueryDTO(conn, sql, JtbCiclCq.class);
|
||||
|
||||
for (JtbCiclCq cq : jtbCiclCqList) {
|
||||
int numFase = cq.getNumFase();
|
||||
String controllo = cq.getControllo();
|
||||
String valoreRif = cq.getValoreRif();
|
||||
int numRip = cq.getNumRip();
|
||||
String tipologia = cq.getTipologia();
|
||||
datiDist.setIdRigaContrCQ(datiDist.getIdRigaContrCQ() + 1);
|
||||
|
||||
// Inserimento controllo di qualità nell'ordine di lavorazione
|
||||
@@ -879,7 +881,8 @@ public class ProductionBusinessLogic {
|
||||
ordCQ.setNumRip(numRip);
|
||||
ordCQ.setNumFase(numFase);
|
||||
ordCQ.setTipologia(tipologia);
|
||||
ordCQ.setTipoValore(TipoValore.from(rs.getShort("tipo_valore")));
|
||||
ordCQ.setTipoValore(cq.getTipoValore());
|
||||
ordCQ.setIdValori(cq.getIdValori());
|
||||
if (isRoot) {
|
||||
ordCQ.setNumFase(numFase + datiDist.getNumFase());
|
||||
} else {
|
||||
@@ -891,8 +894,6 @@ public class ProductionBusinessLogic {
|
||||
ordT.getDtbOrdCq().add(ordCQ);
|
||||
//((DtbOrdr) dtbOrdr).getOrdLav().getDtbOrdCq().add(ordCQ);
|
||||
}
|
||||
rs.close();
|
||||
ps.close();
|
||||
|
||||
// -------------------------------------------------
|
||||
// DISEGNI ORDINE DI LAVORAZIONE
|
||||
|
||||
@@ -11,8 +11,8 @@ import org.apache.logging.log4j.Logger;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Master
|
||||
@@ -36,7 +36,7 @@ public class DtbFatturePassive extends EntityBase {
|
||||
private String idAttach;
|
||||
|
||||
@SqlField(value = "data_doc")
|
||||
private Date dataDoc;
|
||||
private LocalDate dataDoc;
|
||||
|
||||
@SqlField(value = "iban", maxLength = 40)
|
||||
private String iban;
|
||||
@@ -77,11 +77,11 @@ public class DtbFatturePassive extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataDoc() {
|
||||
public LocalDate getDataDoc() {
|
||||
return dataDoc;
|
||||
}
|
||||
|
||||
public DtbFatturePassive setDataDoc(Date dataDoc) {
|
||||
public DtbFatturePassive setDataDoc(LocalDate dataDoc) {
|
||||
this.dataDoc = dataDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.apache.logging.log4j.Logger;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@PropertyReactive
|
||||
@Table(DtbFatturePassiveScad.ENTITY)
|
||||
@@ -31,7 +31,7 @@ public class DtbFatturePassiveScad extends EntityBase {
|
||||
private String idAttach;
|
||||
|
||||
@SqlField(value = "data_scad", nullable = false)
|
||||
private Date dataScad;
|
||||
private LocalDate dataScad;
|
||||
|
||||
@SqlField(value = "importo", nullable = false)
|
||||
private BigDecimal importo;
|
||||
@@ -52,11 +52,11 @@ public class DtbFatturePassiveScad extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataScad() {
|
||||
public LocalDate getDataScad() {
|
||||
return dataScad;
|
||||
}
|
||||
|
||||
public DtbFatturePassiveScad setDataScad(Date dataScad) {
|
||||
public DtbFatturePassiveScad setDataScad(LocalDate dataScad) {
|
||||
this.dataScad = dataScad;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -67,6 +67,10 @@ public class DtbOrdCq extends EntityBase {
|
||||
@SqlField(value = "tipo_valore", nullable = false, defaultObjectValue = "0")
|
||||
private TipoValore tipoValore;
|
||||
|
||||
@FK(tableName = "jtb_cicl_cq_valori", columnName = "id")
|
||||
@SqlField(value = "id_valori")
|
||||
private Long idValori;
|
||||
|
||||
@EntityChild
|
||||
private List<DtbOrdCqr> dtbOrdCqr = new ArrayList<>();
|
||||
|
||||
@@ -200,6 +204,15 @@ public class DtbOrdCq extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Long getIdValori() {
|
||||
return idValori;
|
||||
}
|
||||
|
||||
public DtbOrdCq setIdValori(Long idValori) {
|
||||
this.idValori = idValori;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkPreSave() throws Exception {
|
||||
for (DtbOrdCqr dtbOrdCqr : getDtbOrdCqr()) {
|
||||
|
||||
@@ -219,6 +219,9 @@ public class DtbTipi extends EntityBase {
|
||||
@SqlField(value = "cod_paga", maxLength = 5)
|
||||
private String codPaga;
|
||||
|
||||
@SqlField(value = "flag_delete_pkl", nullable = false, defaultObjectValue = "0")
|
||||
private Boolean flagDeletePkl;
|
||||
|
||||
@EntityChild
|
||||
private List<DtbTipiAnag> dtbTipiAnag = new ArrayList<>();
|
||||
|
||||
@@ -866,6 +869,15 @@ public class DtbTipi extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getFlagDeletePkl() {
|
||||
return flagDeletePkl;
|
||||
}
|
||||
|
||||
public DtbTipi setFlagDeletePkl(Boolean flagDeletePkl) {
|
||||
this.flagDeletePkl = flagDeletePkl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<DrlTipiReport> getDrlTipiReport() {
|
||||
return drlTipiReport;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package it.integry.ems_model.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import it.integry.ems_model.annotation.PK;
|
||||
import it.integry.ems_model.annotation.SqlDetailId;
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
import it.integry.ems_model.annotation.Table;
|
||||
import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -50,6 +47,10 @@ public class JtbCiclCq extends EntityBase {
|
||||
@SqlField(value = "tipo_valore", nullable = false, defaultObjectValue = "0")
|
||||
private TipoValore tipoValore;
|
||||
|
||||
@FK(tableName = "jtb_cicl_cq_valori", columnName = "id")
|
||||
@SqlField(value = "id_valori")
|
||||
private Long idValori;
|
||||
|
||||
public JtbCiclCq() {
|
||||
super(logger);
|
||||
}
|
||||
@@ -58,56 +59,63 @@ public class JtbCiclCq extends EntityBase {
|
||||
return codProd;
|
||||
}
|
||||
|
||||
public void setCodProd(String codProd) {
|
||||
public JtbCiclCq setCodProd(String codProd) {
|
||||
this.codProd = codProd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getIdRiga() {
|
||||
return idRiga;
|
||||
}
|
||||
|
||||
public void setIdRiga(Integer idRiga) {
|
||||
public JtbCiclCq setIdRiga(Integer idRiga) {
|
||||
this.idRiga = idRiga;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumFase() {
|
||||
return numFase;
|
||||
}
|
||||
|
||||
public void setNumFase(Integer numFase) {
|
||||
public JtbCiclCq setNumFase(Integer numFase) {
|
||||
this.numFase = numFase;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getControllo() {
|
||||
return controllo;
|
||||
}
|
||||
|
||||
public void setControllo(String controllo) {
|
||||
public JtbCiclCq setControllo(String controllo) {
|
||||
this.controllo = controllo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String tipologia() {
|
||||
public String getTipologia() {
|
||||
return tipologia;
|
||||
}
|
||||
|
||||
public void setTipologia(String tipologia) {
|
||||
public JtbCiclCq setTipologia(String tipologia) {
|
||||
this.tipologia = tipologia;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getValoreRif() {
|
||||
return valoreRif;
|
||||
}
|
||||
|
||||
public void setValoreRif(String valoreRif) {
|
||||
public JtbCiclCq setValoreRif(String valoreRif) {
|
||||
this.valoreRif = valoreRif;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumRip() {
|
||||
return numRip;
|
||||
}
|
||||
|
||||
public void setNumRip(Integer numRip) {
|
||||
public JtbCiclCq setNumRip(Integer numRip) {
|
||||
this.numRip = numRip;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TipoValore getTipoValore() {
|
||||
@@ -118,4 +126,13 @@ public class JtbCiclCq extends EntityBase {
|
||||
this.tipoValore = tipoValore;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Long getIdValori() {
|
||||
return idValori;
|
||||
}
|
||||
|
||||
public JtbCiclCq setIdValori(Long idValori) {
|
||||
this.idValori = idValori;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package it.integry.ems_model.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
|
||||
@Master
|
||||
@PropertyReactive
|
||||
@Table(JtbCiclCqValori.ENTITY)
|
||||
@JsonTypeName(JtbCiclCqValori.ENTITY)
|
||||
public class JtbCiclCqValori extends EntityBase {
|
||||
public static final String ENTITY = "jtb_cicl_cq_valori";
|
||||
|
||||
private static final Logger logger = LogManager.getLogger();
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@PK
|
||||
@Identity
|
||||
@SqlField(value = "id", nullable = false)
|
||||
private Long id;
|
||||
|
||||
@SqlField(value = "descrizione", nullable = false, maxLength = 255)
|
||||
private String descrizione;
|
||||
|
||||
@SqlField(value = "valori", nullable = false)
|
||||
private String valori;
|
||||
|
||||
public JtbCiclCqValori() {
|
||||
super(logger);
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public JtbCiclCqValori setId(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public JtbCiclCqValori setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getValori() {
|
||||
return valori;
|
||||
}
|
||||
|
||||
public JtbCiclCqValori setValori(String valori) {
|
||||
this.valori = valori;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@@ -34,7 +36,7 @@ public class NtbVariazioniExportLog extends EntityBase {
|
||||
private String codVlis;
|
||||
|
||||
@SqlField(value = "data_export")
|
||||
private Date dataExport;
|
||||
private LocalDateTime dataExport;
|
||||
|
||||
@SqlField(value = "json_string", maxLength = -1)
|
||||
private String jsonString;
|
||||
@@ -66,11 +68,11 @@ public class NtbVariazioniExportLog extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataExport() {
|
||||
public LocalDateTime getDataExport() {
|
||||
return dataExport;
|
||||
}
|
||||
|
||||
public NtbVariazioniExportLog setDataExport(Date dataExport) {
|
||||
public NtbVariazioniExportLog setDataExport(LocalDateTime dataExport) {
|
||||
this.dataExport = dataExport;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,8 @@ public enum TipoValore implements IBaseEnum<TipoValore> {
|
||||
DECIMALE((short) 3),
|
||||
DATE((short) 4),
|
||||
DATETIME((short) 5),
|
||||
TIME((short) 6);
|
||||
TIME((short) 6),
|
||||
DROPDOWNLIST((short) 7);
|
||||
|
||||
private final short value;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package it.integry.ems_model.utility;
|
||||
import it.integry.ems_model.config.EmsRestConstants;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.xml.datatype.XMLGregorianCalendar;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.*;
|
||||
@@ -90,6 +91,20 @@ public class UtilityLocalDate {
|
||||
.toLocalDate();
|
||||
}
|
||||
|
||||
public static LocalDate localDateFromXmlGregorian(XMLGregorianCalendar xmlDate) {
|
||||
if (xmlDate == null) {
|
||||
return null;
|
||||
}
|
||||
return xmlDate.toGregorianCalendar().toZonedDateTime().toLocalDate();
|
||||
}
|
||||
|
||||
public static LocalDateTime localDateTimeFromXmlGregorian(XMLGregorianCalendar xmlDate) {
|
||||
if (xmlDate == null) {
|
||||
return null;
|
||||
}
|
||||
return xmlDate.toGregorianCalendar().toZonedDateTime().toLocalDateTime();
|
||||
}
|
||||
|
||||
public static LocalDateTime localDateTimeFromDate(Date dateToConvert) {
|
||||
if (dateToConvert == null) return null;
|
||||
|
||||
@@ -200,6 +215,8 @@ public class UtilityLocalDate {
|
||||
return localDateTime.plusHours(hourToAdd).plusMinutes(minuteToAdd).plusSeconds(secondToAdd);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static LocalDate getNextDayOfWeeek(LocalDate localDate, DayOfWeek dayOfWeek) {
|
||||
if (localDate == null || dayOfWeek == null) {
|
||||
return null;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -155,3 +155,15 @@ then
|
||||
setEffectiveEndtime($entity.getEffectiveEndtime() == null?LocalDateTime.now(): $entity.getEffectiveEndtime()) }
|
||||
end
|
||||
|
||||
rule "completeOraAndUserModifier"
|
||||
no-loop
|
||||
when
|
||||
eval(completeRulesEnabled)
|
||||
$entity : StbActivity(operation != OperationType.DELETE)
|
||||
then
|
||||
modify ( $entity ) {
|
||||
setOraModAct(LocalDateTime.now()),
|
||||
setUserModifier(username)
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package it.integry.ems.activity.controller;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.activity.dto.SteUPEntryDTO;
|
||||
import it.integry.ems.activity.dto.SteUpScoreDTO;
|
||||
@@ -12,9 +13,12 @@ import it.integry.ems.response.StatusResponse;
|
||||
import it.integry.ems.service.LoginService;
|
||||
import it.integry.ems.service.dto.LoginAziendaDTO;
|
||||
import it.integry.ems.status.ServiceChecker;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.utility.UtilityDirs;
|
||||
import it.integry.ems_model.config.EmsRestConstants;
|
||||
import it.integry.ems_model.entity.StbActivity;
|
||||
import it.integry.ems_model.utility.UtilityDate;
|
||||
import it.integry.ems_model.utility.Query;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityHashMap;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -25,11 +29,14 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.file.Files;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@RestController
|
||||
@Scope(value = "request")
|
||||
@@ -46,6 +53,8 @@ public class SteUPController {
|
||||
private ServiceChecker serviceChecker;
|
||||
@Autowired
|
||||
private RequestDataDTO requestDataDTO;
|
||||
@Autowired
|
||||
private MultiDBTransactionManager multiDBTransactionManager;
|
||||
|
||||
@RequestMapping(value = "/status", method = RequestMethod.GET)
|
||||
public @ResponseBody
|
||||
@@ -377,10 +386,63 @@ public class SteUPController {
|
||||
public @ResponseBody
|
||||
ServiceRestResponse deleteInspections(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd",fallbackPatterns = "yyyy/MM/dd") Date dataInizio,
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd",fallbackPatterns = "yyyy/MM/dd") Date dataFine) throws Exception {
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd", fallbackPatterns = "yyyy/MM/dd") Date dataInizio,
|
||||
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd", fallbackPatterns = "yyyy/MM/dd") Date dataFine) throws Exception {
|
||||
|
||||
steUPService.deleteInspections(dataInizio, dataFine);
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "recuperoIspezioni", method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse recuperoIspezioni(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
||||
@RequestParam String pathFile,
|
||||
@RequestParam String userName) {
|
||||
|
||||
|
||||
if ( !pathFile.endsWith("\\")) pathFile = pathFile + "\\";
|
||||
pathFile = pathFile + userName;
|
||||
File fileInput = new File(pathFile);
|
||||
Pattern pattern = Pattern.compile(".*json", Pattern.CASE_INSENSITIVE);
|
||||
File[] filesList = fileInput.listFiles((dir, name) -> pattern.matcher(name).matches());
|
||||
for (File file : filesList) {
|
||||
try {
|
||||
String json = new String(Files.readAllBytes(file.toPath()));
|
||||
SteUPEntryDTO entry = new ObjectMapper().readValue(json, SteUPEntryDTO.class);
|
||||
String query = "";
|
||||
if (entry.getParentActivityId() == null) {
|
||||
query = Query.format(
|
||||
"update stb_activity \n" +
|
||||
"set effective_time = %s \n" +
|
||||
"where activity_type_id = %s\n" +
|
||||
"AND cod_jfas = %s\n" +
|
||||
"AND EXISTS (SELECT * FROM WTB_DEPO WHERE WTB_DEPO.cod_mdep = %s AND WTB_DEPO.user_name = stb_activity.user_name )\n" +
|
||||
"AND user_creator = %s",
|
||||
entry.getDataCreation(),
|
||||
entry.getActivityTypeId(),
|
||||
entry.getCodJfas(),
|
||||
entry.getCodMdep(),
|
||||
userName);
|
||||
} else {
|
||||
query = Query.format(
|
||||
"update stb_activity \n" +
|
||||
"set effective_time = %s \n" +
|
||||
"where parent_activity_id = %s\n" +
|
||||
"AND activity_type_id = %s\n" +
|
||||
"AND cod_jfas = %s\n" +
|
||||
"AND user_creator = %s",
|
||||
entry.getDataCreation(),
|
||||
entry.getParentActivityId(),
|
||||
entry.getActivityTypeId(),
|
||||
entry.getCodJfas(),
|
||||
userName);
|
||||
}
|
||||
UtilityDB.executeStatement(multiDBTransactionManager.getPrimaryConnection(), query);
|
||||
} catch (Exception e) {
|
||||
logger.error(request.getRequestURI(), e);
|
||||
}
|
||||
}
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
}
|
||||
}
|
||||
@@ -709,7 +709,7 @@ public class ActivityService {
|
||||
String fullname = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||
|
||||
String title = String.format("Nuova attività pianificata su: %s", commessa);
|
||||
String message = String.format("Ti è stata pianificata un'attività da: %s (#%s)", fullname, newStbActivity.getActivityId());
|
||||
String message = String.format("Ti è stata pianificata un'attività da: %s (#%s)", requestDataDTO.getUsername(), newStbActivity.getActivityId());
|
||||
if (attvitaHelpDesk) {
|
||||
message = String.format("Il ticket #%s è stato pianificato all'utente %s", newStbActivity.getActivityId(), newStbActivity.getUserName());
|
||||
}
|
||||
|
||||
@@ -111,8 +111,8 @@ public class SteUPService {
|
||||
String userNamePv = null;
|
||||
String sql = "SELECT wtb_users.user_name " +
|
||||
"FROM mtb_depo INNER JOIN wtb_depo ON wtb_depo.cod_mdep = mtb_depo.cod_mdep " +
|
||||
" INNER JOIN wtb_users ON wtb_depo.user_name = wtb_users.user_name AND " +
|
||||
" wtb_users.key_group = 10 ";
|
||||
" INNER JOIN stb_user ON wtb_depo.user_name = stb_user.user_name AND " +
|
||||
" stb_user.key_group = 10 ";
|
||||
sql = UtilityDB.addwhereCond(sql, "mtb_depo.cod_mdep = " + UtilityDB.valueToString(codMdep), false);
|
||||
Object result = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||
if (result != null) {
|
||||
@@ -456,7 +456,7 @@ public class SteUPService {
|
||||
String codJfas = entry.getCodJfas();
|
||||
String codCmac = entry.getCodCmac();
|
||||
String md5User = entry.getMd5User();
|
||||
LocalDate dataCreation = UtilityString.parseLocalDate(entry.getDataCreation());
|
||||
LocalDateTime dataCreation = UtilityString.parseLocalDateTime(entry.getDataCreation());
|
||||
|
||||
|
||||
if (UtilityString.isNullOrEmpty(activityTypeId))
|
||||
@@ -494,7 +494,7 @@ public class SteUPService {
|
||||
.setUserModifier(userNameCreator)
|
||||
.setActivityTypeId(activityTypeIdIspezione)
|
||||
.setOraInsAct(now)
|
||||
.setEffectiveTime(dataCreation.atStartOfDay());
|
||||
.setEffectiveTime(dataCreation);
|
||||
flag_isNewIspezione = true;
|
||||
} else { // AGGIORNO ORA ULTIMA MODIFICA
|
||||
|
||||
@@ -529,7 +529,7 @@ public class SteUPService {
|
||||
}
|
||||
activityItem.setPersonaRif(entry.getPersonaRif());
|
||||
activityItem.setPriorita(entry.getPriorita());
|
||||
activityItem.setEffectiveTime(dataCreation.atStartOfDay());
|
||||
activityItem.setEffectiveTime(dataCreation);
|
||||
|
||||
List<String> barcodes = entry.getBarcodes();
|
||||
|
||||
|
||||
@@ -501,6 +501,6 @@ public class MovimentiContabiliDocfinanceDTO {
|
||||
.setCodCcau(mov.getCausaleCoge())
|
||||
.setDescrizioneCaus(String.valueOf(mov.hashCode()))
|
||||
.setNumDoc(Integer.valueOf(mov.getMovimento()))
|
||||
.setRifImport(mov.getAnnoCoge() + "_" + mov.getMovimento() + "_" + mov.getNumeroRitornoCoge());
|
||||
.setRifImport(mov.getAnnoCoge() + "_" + mov.getMovimento() + "_" + mov.getProgressivo() + "_" + mov.getNumeroRitornoCoge());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import it.integry.ems_model.entity.*;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityDate;
|
||||
import it.integry.ems_model.utility.UtilityLocalDate;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import org.springframework.web.context.ContextLoader;
|
||||
|
||||
@@ -18,6 +19,7 @@ import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
@@ -32,7 +34,7 @@ public class PassiveInvoiceRecapObject {
|
||||
private String codAnag;
|
||||
private String ragSoc;
|
||||
private String numDoc;
|
||||
private Date date;
|
||||
private LocalDate date;
|
||||
private BigDecimal totDoc;
|
||||
private String description;
|
||||
private String iban;
|
||||
@@ -73,7 +75,7 @@ public class PassiveInvoiceRecapObject {
|
||||
FatturaElettronicaBodyType body = invoice.getFatturaElettronicaBody().get(0);
|
||||
String codDtip = body.getDatiGenerali().getDatiGeneraliDocumento().getTipoDocumento().value();
|
||||
String numdoc = body.getDatiGenerali().getDatiGeneraliDocumento().getNumero();
|
||||
Date dataDoc = body.getDatiGenerali().getDatiGeneraliDocumento().getData().toGregorianCalendar().getTime();
|
||||
LocalDate dataDoc = UtilityLocalDate.localDateFromXmlGregorian(body.getDatiGenerali().getDatiGeneraliDocumento().getData());
|
||||
|
||||
query = "SELECT top 1 gtb_anag.cod_anag " +
|
||||
"FROM gtb_anag INNER JOIN atb_forn ON gtb_anag.cod_anag = atb_forn.cod_anag " +
|
||||
@@ -121,7 +123,7 @@ public class PassiveInvoiceRecapObject {
|
||||
object.setCodDtip(body.getDatiGenerali().getDatiGeneraliDocumento().getTipoDocumento());
|
||||
object.setNumDoc(body.getDatiGenerali().getDatiGeneraliDocumento().getNumero());
|
||||
|
||||
Date dataDoc = body.getDatiGenerali().getDatiGeneraliDocumento().getData().toGregorianCalendar().getTime();
|
||||
LocalDate dataDoc = UtilityLocalDate.localDateFromXmlGregorian(body.getDatiGenerali().getDatiGeneraliDocumento().getData());
|
||||
BigDecimal totDoc = body.getDatiGenerali().getDatiGeneraliDocumento().getImportoTotaleDocumento();
|
||||
if (UtilityString.isNullOrEmpty(totDoc)) totDoc = BigDecimal.ZERO;
|
||||
if (body.getDatiGenerali().getDatiGeneraliDocumento().getDatiRitenuta() != null) {
|
||||
@@ -188,17 +190,17 @@ public class PassiveInvoiceRecapObject {
|
||||
List<DtbFatturePassiveScad> scadenze =
|
||||
Stream.of(dati.getDettaglioPagamento())
|
||||
.withoutNulls()
|
||||
.filter(x -> x.getDataScadenzaPagamento() != null && x.getDataScadenzaPagamento().toGregorianCalendar().getTime().after(minDataScad))
|
||||
.filter(x ->
|
||||
x.getDataScadenzaPagamento() != null &&
|
||||
x.getDataScadenzaPagamento().toGregorianCalendar().getTime().after(minDataScad))
|
||||
.map(x -> {
|
||||
Date dataScad = x.getDataScadenzaPagamento().toGregorianCalendar().getTime();
|
||||
LocalDate dataScad = UtilityLocalDate.localDateFromXmlGregorian(x.getDataScadenzaPagamento());
|
||||
DtbFatturePassiveScad scad = new DtbFatturePassiveScad()
|
||||
.setDataScad(dataScad)
|
||||
.setImporto(x.getImportoPagamento().abs())
|
||||
.setCodPagaFe(x.getModalitaPagamento().value());
|
||||
scad.setOperation(OperationType.INSERT);
|
||||
|
||||
return scad;
|
||||
|
||||
}
|
||||
|
||||
)
|
||||
@@ -340,11 +342,11 @@ public class PassiveInvoiceRecapObject {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDate() {
|
||||
public LocalDate getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public PassiveInvoiceRecapObject setDate(Date date) {
|
||||
public PassiveInvoiceRecapObject setDate(LocalDate date) {
|
||||
this.date = date;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -28,10 +28,7 @@ import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.entity.*;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.Query;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityHashMap;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import it.integry.ems_model.utility.*;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
@@ -440,7 +437,7 @@ public class PassiveInvoiceService {
|
||||
DtbFatturePassive fatturePassive = new DtbFatturePassive()
|
||||
.setIdAttach(parentActivityId)
|
||||
.setPartIva(UtilityHashMap.<String>getValueIfExists(additionalInfo, PART_IVA_KEY))
|
||||
.setDataDoc(dataDoc_FP)
|
||||
.setDataDoc(UtilityLocalDate.localDateFromDate(dataDoc_FP))
|
||||
.setNumDoc(numDoc_FP)
|
||||
.setTotDoc(UtilityHashMap.<BigDecimal>getValueIfExists(additionalInfo, TOT_DOC_KEY))
|
||||
.setIban(iban)
|
||||
|
||||
@@ -30,6 +30,7 @@ public class CreateUDCProduzioneRequestDTO {
|
||||
|
||||
private String annotazioni;
|
||||
private String codDtipProvv;
|
||||
private String preparatoDa;
|
||||
|
||||
private int numEtich = 0;
|
||||
|
||||
@@ -222,4 +223,13 @@ public class CreateUDCProduzioneRequestDTO {
|
||||
this.codDtipProvv = codDtipProvv;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPreparatoDa() {
|
||||
return preparatoDa;
|
||||
}
|
||||
|
||||
public CreateUDCProduzioneRequestDTO setPreparatoDa(String preparatoDa) {
|
||||
this.preparatoDa = preparatoDa;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -790,7 +790,8 @@ public class MesProductionServiceV2 {
|
||||
.setRifOrd(request.getRifOrd())
|
||||
.setDataVersamento(request.getCustomDataVersamento())
|
||||
.setCodDtipProvv(request.getCodDtipProvv())
|
||||
.setOrders(orders));
|
||||
.setOrders(orders))
|
||||
.setPreparatoDa(request.getPreparatoDa());
|
||||
|
||||
final InsertUDCRowResponseDTO insertUDCRowResponse = wmsAccettazioneService.insertUDCRow(new InsertUDCRowRequestDTO()
|
||||
.setTargetMtbColt(createdUdc)
|
||||
@@ -1179,7 +1180,8 @@ public class MesProductionServiceV2 {
|
||||
.setCodAnag(ordineLav.getCodAnag())
|
||||
.setPosizione(dto.getCodJfas())
|
||||
.setCodTcol(ordineLav.getCodTcolUl())
|
||||
.setRifOrd(ordineLav.getRifOrd());
|
||||
.setRifOrd(ordineLav.getRifOrd())
|
||||
.setPreparatoDa(dto.getPreparatoDa());
|
||||
|
||||
if (dto.getDataCollo() != null) {
|
||||
createUdcRequest.setCustomDataCollo(dto.getDataCollo());
|
||||
|
||||
@@ -856,7 +856,6 @@ public class VariazioniPvService {
|
||||
" cod_mdep,\n" +
|
||||
" MAX(data_ins) AS last_ins\n" +
|
||||
" FROM doc\n" +
|
||||
" WHERE data_reg <= '2025/10/14'\n" +
|
||||
" GROUP BY cod_mdep, cod_mart),\n" +
|
||||
" last_doc_tot AS (SELECT doc.*\n" +
|
||||
" FROM max_doc\n" +
|
||||
|
||||
@@ -160,7 +160,7 @@ public class MmposServices {
|
||||
"FROM venduto\n" +
|
||||
" INNER JOIN relaz_pdv_mag\n" +
|
||||
" ON venduto._codazienda = relaz_pdv_mag._codazienda AND venduto._codpv = relaz_pdv_mag._codpv\n" +
|
||||
"WHERE venduto.fltrans NOT IN ('FS', 'PC', 'SS', 'IP', 'VO', 'BB', 'CP')\n" +
|
||||
"WHERE venduto.fltrans NOT IN ('FS', 'PC', 'SS', 'IP', 'VO', 'BB', 'CP', 'RS')\n" +
|
||||
"ORDER BY idx\n";
|
||||
sql = UtilityDB.addwhereCond(sql, whereCond, false);
|
||||
|
||||
@@ -263,9 +263,7 @@ public class MmposServices {
|
||||
multiDBTransactionManager.commitAll();
|
||||
entityReturn.add(ntbDoct);
|
||||
} catch (Exception e) {
|
||||
if (!(e instanceof EntityException && ((EntityException) e).getSqlErrorCode() == 2627)) {
|
||||
anomalie.add(ScontriniImporterUtilities.setAnomalia(e));
|
||||
}
|
||||
anomalie.add(ScontriniImporterUtilities.setAnomalia(e));
|
||||
multiDBTransactionManager.rollbackAll();
|
||||
}
|
||||
}
|
||||
@@ -387,10 +385,10 @@ public class MmposServices {
|
||||
NtbDocr ntbDocr = new NtbDocr();
|
||||
righe.add(ntbDocr);
|
||||
ntbDocr
|
||||
.setBarCode(row.getCodice().trim())
|
||||
.setCodMart(row.getCodInter().trim())
|
||||
.setReparto(row.getCodRep().trim())
|
||||
.setDescrizione(row.getDesRidot().trim());
|
||||
.setBarCode(row.getCodice() != null ? row.getCodice().trim() : null)
|
||||
.setCodMart(row.getCodInter() != null ? row.getCodInter().trim() : null)
|
||||
.setReparto(row.getCodRep() != null ? row.getCodRep().trim() : null)
|
||||
.setDescrizione(row.getDesRidot() != null ? row.getDesRidot().trim() : null);
|
||||
|
||||
String promozione = row.getKeysRef();
|
||||
|
||||
@@ -524,7 +522,8 @@ public class MmposServices {
|
||||
}
|
||||
|
||||
String opTrans = row.getOpTrans();
|
||||
if (!UtilityString.isNullOrEmpty(opTrans) && !opTrans.toUpperCase().startsWith("ORD")) {
|
||||
if (!UtilityString.isNullOrEmpty(opTrans) &&
|
||||
!opTrans.toUpperCase().startsWith("ORD") ) {
|
||||
ntbDocr.setCausaleReso(opTrans);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,11 +35,7 @@ public class ScontriniImporterUtilities {
|
||||
return AnomalieDTO.warning(e.getMessage());
|
||||
} else if (e instanceof FileNotFoundException) {
|
||||
return AnomalieDTO.error(e);
|
||||
} else {
|
||||
return AnomalieDTO.error(e);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
return AnomalieDTO.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import it.integry.ems.export.base.EntityExportResponse;
|
||||
import it.integry.ems.file_formatter.csv.CsvMapper;
|
||||
import it.integry.ems.retail.dto.ZucchettiHrDTO;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.utility.UtilityDirs;
|
||||
import it.integry.ems.utility.UtilityFile;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.utility.Query;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
@@ -175,7 +177,7 @@ public class ScontriniZucchettiExportServices {
|
||||
|
||||
|
||||
if ( !dati.isEmpty()) {
|
||||
String fileName = "Forecast_" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".csv";
|
||||
String fileName = UtilityDirs.getDirectoryExport(multiDBTransactionManager.getPrimaryConnection().getDbName(), type, format) + "//" + "Forecast_" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".csv";
|
||||
File file = new File(fileName);
|
||||
|
||||
CsvMapper<ZucchettiHrDTO> mapper = new CsvMapper<>();
|
||||
|
||||
@@ -217,7 +217,7 @@ public class VariazioniPvExportServices {
|
||||
}
|
||||
NtbVariazioniExportLog ntbVariazioniExportLog =
|
||||
new NtbVariazioniExportLog()
|
||||
.setDataExport(new Date())
|
||||
.setDataExport(UtilityLocalDate.getNowTime())
|
||||
.setCodVlis(variazioniPvDTO.getCodVlis())
|
||||
.setFormatFile(format)
|
||||
.setJsonString(json)
|
||||
|
||||
@@ -280,7 +280,7 @@ public class GiacenzaService {
|
||||
" isNull(SUM(movimenti.qta_car * art.qta_std) , 0) + IsNull(giac.qta_iniz, 0) as qta_car,\n" +
|
||||
" isNull(SUM(movimenti.qta_scar * art.qta_std), 0) as qta_scar,\n" +
|
||||
" getdate() as data_ins,\n" +
|
||||
" min(COALESCE(giac.data_reg, movimenti.data_car, getdate())) as data_reg\n" +
|
||||
" min(COALESCE(giac.data_reg, movimenti.data_car, DATEADD(WEEK, -1, getdate()))) as data_reg\n" +
|
||||
"FROM movimenti\n" +
|
||||
" INNER JOIN art ON movimenti.cod_mart = art.cod_mart\n" +
|
||||
" LEFT OUTER JOIN carelli_giacenza_prog giac ON giac.cod_mdep = movimenti.cod_mdep AND giac.cod_mart = art.cod_mart_mov\n" +
|
||||
|
||||
@@ -188,6 +188,9 @@ public class RecuperoScontriniService {
|
||||
if (listScontrini.size() > 0)
|
||||
listaCond.add(
|
||||
"(" + whereCond + " AND venduto.n_scontr in (" + UtilityDB.listValueToString(listScontrini) + ") AND fltrans not in ('UP','UC', 'EP') ) ");
|
||||
else
|
||||
listaCond.add(
|
||||
"(" + whereCond + " AND fltrans not in ('UP','UC', 'EP') ) ");
|
||||
|
||||
if (maxIdScontr != null)
|
||||
listaCond.add(
|
||||
|
||||
@@ -23,6 +23,7 @@ public class CreateUDCRequestDTO {
|
||||
|
||||
private String barcodeUl;
|
||||
private String codDtipProvv;
|
||||
private String preparatoDa;
|
||||
|
||||
private List<CreateUDCRequestOrderDTO> orders;
|
||||
|
||||
@@ -161,4 +162,13 @@ public class CreateUDCRequestDTO {
|
||||
this.codVdes = codVdes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPreparatoDa() {
|
||||
return preparatoDa;
|
||||
}
|
||||
|
||||
public CreateUDCRequestDTO setPreparatoDa(String preparatoDa) {
|
||||
this.preparatoDa = preparatoDa;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2007,22 +2007,19 @@ public class WMSGenericService {
|
||||
}
|
||||
|
||||
public void spostaUL(SpostaUlRequestDTO requestDTO) throws Exception {
|
||||
|
||||
if (UtilityString.isNullOrEmpty(requestDTO.getCodMdep())) {
|
||||
if (UtilityString.isNullOrEmpty(requestDTO.getCodMdep()))
|
||||
throw new Exception("Nessun deposito di arrivo selezionato");
|
||||
}
|
||||
|
||||
List<MtbColt> mtbCotlList = requestDTO.getMtbColtsToMove();
|
||||
mtbCotlList.stream().peek(x -> x.setOperation(OperationType.SELECT));
|
||||
entityProcessor.processEntityList(mtbCotlList, true);
|
||||
List<String> codMdeps = mtbCotlList.stream().map(MtbColt::getCodMdep).distinct().collect(Collectors.toList());
|
||||
|
||||
if (codMdeps.isEmpty()) {
|
||||
if (codMdeps.isEmpty())
|
||||
throw new Exception("Nessun deposito di partenza selezionato!");
|
||||
}
|
||||
if (codMdeps.size() > 1) {
|
||||
|
||||
if (codMdeps.size() > 1)
|
||||
throw new Exception("Le UL selezionate provengono da depositi differenti");
|
||||
}
|
||||
|
||||
MtbDepo mtbDepo = new MtbDepo();
|
||||
mtbDepo.setCodMdep(requestDTO.getCodMdep())
|
||||
@@ -2040,9 +2037,8 @@ public class WMSGenericService {
|
||||
|
||||
entityProcessor.processEntity(mtbDepoPosizioni, multiDBTransactionManager);
|
||||
|
||||
if (mtbDepoPosizioni.getCodMdep() == null || mtbDepoPosizioni.getPosizione() == null) {
|
||||
if (mtbDepoPosizioni.getCodMdep() == null || mtbDepoPosizioni.getPosizione() == null)
|
||||
throw new Exception("La posizione " + requestDTO.getPosizione() + " non esiste nel deposito " + requestDTO.getCodMdep());
|
||||
}
|
||||
}
|
||||
|
||||
List<EntityBase> entitiesToSave = new ArrayList<>();
|
||||
@@ -2104,6 +2100,24 @@ public class WMSGenericService {
|
||||
}
|
||||
|
||||
for (MtbColt mtbColtToMove : mtbCotlList) {
|
||||
MtbDepoPosizioni posizioneMtbColToMove = new MtbDepoPosizioni()
|
||||
.setCodMdep(mtbColtToMove.getCodMdep())
|
||||
.setPosizione(mtbColtToMove.getPosizione());
|
||||
posizioneMtbColToMove.setOperation(OperationType.SELECT_OBJECT);
|
||||
|
||||
entityProcessor.processEntity(posizioneMtbColToMove, multiDBTransactionManager);
|
||||
|
||||
if (posizioneMtbColToMove.isFlagMonoCollo() &&
|
||||
!posizioneMtbColToMove.getCodMdep().equalsIgnoreCase(requestDTO.getCodMdep())
|
||||
) {
|
||||
throw new Exception(
|
||||
String.format(
|
||||
"Impossibile spostare il collo mono UL N.(%s) in un deposito differente da quello di partenza",
|
||||
mtbColtToMove.getNumCollo()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (dtbDoct != null) {
|
||||
for (MtbColr mtbColr : mtbColtToMove.getMtbColr()) {
|
||||
if (!gestisciColli) {
|
||||
@@ -3043,10 +3057,10 @@ public class WMSGenericService {
|
||||
|
||||
public String getEtichettaUL(MtbColt ul) throws Exception {
|
||||
ul.setOperation(OperationType.SELECT_OBJECT);
|
||||
entityProcessor.processEntity(ul,true,multiDBTransactionManager);
|
||||
entityProcessor.processEntity(ul, true, multiDBTransactionManager);
|
||||
|
||||
//<editor-fold desc="Etichetta SSCC per le ul create da ordine di lavorazione">
|
||||
if (ul.getGestione().equalsIgnoreCase("L")&& ul.getSegno() == 1 && ul.getOrdine() != null){
|
||||
if (ul.getGestione().equalsIgnoreCase("L") && ul.getSegno() == 1 && ul.getOrdine() != null) {
|
||||
String reportName = wmsLavorazioneService.getEtichettaSSCCOrdine(ul.getOrdine());
|
||||
if (UtilityString.hasContent(reportName))
|
||||
return reportName;
|
||||
@@ -3054,8 +3068,8 @@ public class WMSGenericService {
|
||||
//</editor-fold>
|
||||
|
||||
//<editor-fold desc="Etichetta anonima per colli con serie UL">
|
||||
if (ul.getSerCollo().equalsIgnoreCase("UL")){
|
||||
String reportName = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(),"PICKING","SETUP","REPORT_NAME_ETICHETTA_ANONIMA");
|
||||
if (ul.getSerCollo().equalsIgnoreCase("UL")) {
|
||||
String reportName = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), "PICKING", "SETUP", "REPORT_NAME_ETICHETTA_ANONIMA");
|
||||
if (UtilityString.hasContent(reportName))
|
||||
return reportName;
|
||||
}
|
||||
|
||||
@@ -605,7 +605,7 @@ public class WMSLavorazioneService {
|
||||
.setCodMdep(createUDCRequestDTO.getCodMdep())
|
||||
.setCodVdes(createUDCRequestDTO.getCodVdes())
|
||||
.setOraInizPrep(new Date())
|
||||
.setPreparatoDa(requestDataDTO.getUsername())
|
||||
.setPreparatoDa(UtilityString.isNull(createUDCRequestDTO.getPreparatoDa(),requestDataDTO.getUsername()))
|
||||
.setPosizione(UtilityString.isNull(createUDCRequestDTO.getPosizione(), defaultPosizioneColliAccettazione))
|
||||
.setCodTcol(createUDCRequestDTO.getCodTcol())
|
||||
.setCodJfas(createUDCRequestDTO.getCodJfas())
|
||||
|
||||
@@ -9,8 +9,6 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.google.common.base.Joiner;
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.dto.ExtendedStbActivity;
|
||||
import it.integry.ems.dto.Result;
|
||||
import it.integry.ems.expansion.RunnableArgsReturnThrowable;
|
||||
import it.integry.ems.file_sharer.IFileSharerAttachment;
|
||||
import it.integry.ems.file_sharer.sharers.email.EmailFileAttachment;
|
||||
import it.integry.ems.javabeans.RequestDataDTO;
|
||||
@@ -19,7 +17,6 @@ import it.integry.ems.license.LicenseStatusDTO;
|
||||
import it.integry.ems.report.dto.JasperDTO;
|
||||
import it.integry.ems.report.dto.PairsDTO;
|
||||
import it.integry.ems.response.*;
|
||||
import it.integry.ems.retail.ReportVariazioni.dto.VariazioniDettaglioDTO;
|
||||
import it.integry.ems.rules.completing.ConfigActivityRules;
|
||||
import it.integry.ems.service.*;
|
||||
import it.integry.ems.service.dto.CustomEmailDTO;
|
||||
@@ -36,9 +33,7 @@ import it.integry.ems.system.exception.NotValidLicenseException;
|
||||
import it.integry.ems.system.request.SystemChangePasswordRequest;
|
||||
import it.integry.ems.system.request.SystemLoginRequest;
|
||||
import it.integry.ems.system.service.SystemService;
|
||||
import it.integry.ems.utility.UtilityDirs;
|
||||
import it.integry.ems.utility.UtilityEntity;
|
||||
import it.integry.ems.utility.UtilityFile;
|
||||
import it.integry.ems.utility.UtilityPrinter;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.config.EmsRestConstants;
|
||||
@@ -56,7 +51,6 @@ import it.integry.firebase.dto.apns.ApsDTO;
|
||||
import it.integry.firebase.service.NotificationService;
|
||||
import it.integry.security.cache.SecretKeyCacheComponent;
|
||||
import it.integry.security.dto.LoginRequestDTO;
|
||||
import kotlin.Triple;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
@@ -73,14 +67,11 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.file.Paths;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -261,7 +252,7 @@ public class SystemController {
|
||||
|
||||
if (!existAct) {
|
||||
LocalDateTime endDate = LocalDateTime.now();
|
||||
LocalDateTime startDate = endDate.minusHours(15);
|
||||
LocalDateTime startDate = endDate.minusMinutes(15);
|
||||
sql =
|
||||
"SELECT activity_id, activity_description " +
|
||||
" FROM stb_activity " +
|
||||
@@ -1483,78 +1474,7 @@ public class SystemController {
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration) throws Exception {
|
||||
|
||||
|
||||
String sql = "SELECT dtb_doct.num_doc,\n" +
|
||||
" dtb_doct.data_doc,\n" +
|
||||
" dtb_doct.cod_anag,\n" +
|
||||
" dtb_doct.cod_dtip,\n" +
|
||||
" dtb_doct.ser_doc\n" +
|
||||
"FROM dtb_doct\n" +
|
||||
" INNER JOIN dtb_tipi ON dtb_doct.cod_dtip = dtb_tipi.cod_dtip\n" +
|
||||
"WHERE dtb_doct.data_doc BETWEEN '2023/01/01' AND '2023-12-31'--BETWEEN '2024/01/01' AND GETDATE()\n" +
|
||||
" AND dtb_doct.gestione = 'V'\n" +
|
||||
" AND dtb_tipi.tipo_emissione = 'DIRETTA'\n" +
|
||||
" AND dtb_tipi.segno_qta_scar <> 0\n" +
|
||||
"ORDER BY dtb_doct.data_doc, dtb_doct.num_doc";
|
||||
|
||||
final List<HashMap<String, Object>> documents = UtilityDB.executeSimpleQuery(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||
|
||||
final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH-mm-ss")
|
||||
.withZone(ZoneId.systemDefault());
|
||||
|
||||
String tempDir = Paths.get(UtilityDirs.getTempDirectoryPath(), "vgalimenti-export-" + dateTimeFormatter.format(LocalDateTime.now())).toString();
|
||||
|
||||
List<RunnableArgsReturnThrowable<Triple<String, String, List<VariazioniDettaglioDTO>>>> calls = new ArrayList<>();
|
||||
|
||||
|
||||
for (HashMap<String, Object> document : documents) {
|
||||
String codAnag = UtilityHashMap.getValueIfExists(document, "cod_anag");
|
||||
String serDoc = UtilityHashMap.getValueIfExists(document, "ser_doc");
|
||||
Integer numDoc = UtilityHashMap.getValueIfExists(document, "num_doc");
|
||||
Date dataDoc = UtilityHashMap.getValueIfExists(document, "data_doc");
|
||||
String codDtip = UtilityHashMap.getValueIfExists(document, "cod_dtip");
|
||||
|
||||
calls.add(() -> {
|
||||
try {
|
||||
ArrayList<PairsDTO> params = new ArrayList<>();
|
||||
|
||||
params.add(new PairsDTO("cod_anag", codAnag));
|
||||
params.add(new PairsDTO("ser_doc", serDoc));
|
||||
params.add(new PairsDTO("num_doc", numDoc));
|
||||
params.add(new PairsDTO("data_doc", dataDoc));
|
||||
params.add(new PairsDTO("cod_dtip", codDtip));
|
||||
|
||||
JasperDTO jasperDTO = new JasperDTO()
|
||||
.setParams(params)
|
||||
.setReportId(20L);
|
||||
|
||||
final byte[] bytes = reportProcessor.processReport(jasperDTO);
|
||||
|
||||
UtilityFile.saveFile(tempDir, String.format("%s_%s_%s_%d_%s.pdf",
|
||||
UtilityDate.formatDate(dataDoc, "yyyyMMdd"),
|
||||
codDtip,
|
||||
serDoc,
|
||||
numDoc,
|
||||
codAnag
|
||||
), bytes);
|
||||
|
||||
} catch (Exception ex) {
|
||||
throw new RuntimeException(new Exception("Errore durante la generazione del pdf per il DDT [" +
|
||||
"num_doc: " + numDoc + ", " +
|
||||
"data_doc: " + dataDoc + ", " +
|
||||
"ser_doc: " + serDoc + ", " +
|
||||
"cod_anag: " + codAnag + ", " +
|
||||
"cod_dtip: " + codDtip + "] " + ex.getMessage()));
|
||||
}
|
||||
|
||||
// break;
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
final ArrayList<Result<Triple<String, String, List<VariazioniDettaglioDTO>>>> results = UtilityThread.executeParallel(calls, 10);
|
||||
|
||||
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
return ServiceRestResponse.createNegativeResponse("Errore super graveeeee");
|
||||
}
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_STB_EMAIL_CONTENT_FATTURE_PASSIVE_DELETER, method = RequestMethod.POST)
|
||||
|
||||
Reference in New Issue
Block a user