Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -68,7 +68,7 @@ public class FoodProcessRestService {
|
||||
return target.proxy(FoodProcessClient.class);
|
||||
}
|
||||
|
||||
public Object importArticles(ImportArticlesRequest importArticlesRequest) throws Exception {
|
||||
public ImportArticlesResponse importArticles(ImportArticlesRequest importArticlesRequest) throws Exception {
|
||||
if (UtilityList.isNullOrEmpty(importArticlesRequest.getArticles())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -65,13 +65,11 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
}
|
||||
|
||||
protected void executeStatement(Connection connection, String... sqls) throws SQLException {
|
||||
Statement statement = connection.createStatement();
|
||||
|
||||
for (String sql : sqls) {
|
||||
statement.execute(sql);
|
||||
try (Statement statement = connection.createStatement()) {
|
||||
for (String sql : sqls) {
|
||||
statement.execute(sql);
|
||||
}
|
||||
}
|
||||
|
||||
statement.close();
|
||||
}
|
||||
|
||||
protected long executeInsertStatement(String sql) throws SQLException {
|
||||
@@ -125,7 +123,7 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
|
||||
private void dropObject(SqlObjectTypeEnum sqlObject, String objectName) throws SQLException, IOException {
|
||||
executeStatement("IF EXISTS (SELECT * FROM SYSOBJECTS WHERE id = object_id('" + objectName + "'))\r\n" +
|
||||
"\tDROP " + sqlObject.toString() + " " + objectName);
|
||||
"\tDROP " + sqlObject.toString() + " " + objectName);
|
||||
}
|
||||
|
||||
|
||||
@@ -163,7 +161,7 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
" AND OBJECT_NAME(id) = %s\n" +
|
||||
" AND cdefault <> 0", columnName, tableName));
|
||||
if (!existDefault)
|
||||
executeStatement(Query.format("ALTER TABLE dbo." + tableName + " ADD DEFAULT (%s) FOR "+ columnName, defaultValue));
|
||||
executeStatement(Query.format("ALTER TABLE dbo." + tableName + " ADD DEFAULT (%s) FOR " + columnName, defaultValue));
|
||||
}
|
||||
|
||||
protected boolean existsTable(String tableName) throws SQLException, IOException {
|
||||
@@ -195,11 +193,11 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
String sql = Query.format("SELECT cast(count(*) as bit) FROM stb_gest_setup_query WHERE cod_query = %s", codQuery);
|
||||
boolean existQuery = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(advancedDataSource.getConnection(), sql);
|
||||
|
||||
if ( existQuery )
|
||||
if (existQuery)
|
||||
executeStatement(Query.format("UPDATE stb_gest_setup_query SET query_default = %S, description = %S WHERE cod_query = %s ",
|
||||
query, name, codQuery));
|
||||
else
|
||||
executeStatement(Query.format("INSERT INTO stb_gest_setup_query (cod_query, query_default, description)"+
|
||||
executeStatement(Query.format("INSERT INTO stb_gest_setup_query (cod_query, query_default, description)" +
|
||||
" VALUES (%s, %s, %s);", codQuery, query, name));
|
||||
}
|
||||
|
||||
@@ -281,14 +279,14 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
|
||||
protected void createSetup(String gestName, String section, String keySection, String value, String description, boolean flagSync,
|
||||
String codQuery, boolean flagUserView, boolean flagSetupDepo, boolean flagSetupUserWeb,
|
||||
boolean flagTipoJson, boolean flagTipoColore, String tipoSetup, boolean flagMultiValue ) throws Exception {
|
||||
createSetup(gestName, section,keySection, value, description, flagSync, codQuery, flagUserView, flagSetupDepo,
|
||||
boolean flagTipoJson, boolean flagTipoColore, String tipoSetup, boolean flagMultiValue) throws Exception {
|
||||
createSetup(gestName, section, keySection, value, description, flagSync, codQuery, flagUserView, flagSetupDepo,
|
||||
flagSetupUserWeb, flagTipoJson, flagTipoColore, tipoSetup, flagMultiValue, null);
|
||||
}
|
||||
|
||||
protected void createSetup(String gestName, String section, String keySection, String value, String description, boolean flagSync,
|
||||
String codQuery, boolean flagUserView, boolean flagSetupDepo, boolean flagSetupUserWeb,
|
||||
boolean flagTipoJson, boolean flagTipoColore, String tipoSetup, boolean flagMultiValue,
|
||||
boolean flagTipoJson, boolean flagTipoColore, String tipoSetup, boolean flagMultiValue,
|
||||
String query) throws Exception {
|
||||
if (existsSetup(gestName, section, keySection))
|
||||
return;
|
||||
@@ -309,13 +307,13 @@ public abstract class BaseMigration implements MigrationModelInterface {
|
||||
ps.setString(3, keySection);
|
||||
ps.setString(4, value);
|
||||
ps.setString(5, description);
|
||||
ps.setString(6, (flagSync?"S":"N"));
|
||||
ps.setString(6, (flagSync ? "S" : "N"));
|
||||
ps.setString(7, codQuery);
|
||||
ps.setString(8, (flagUserView?"S":"N"));
|
||||
ps.setString(9, (flagSetupDepo?"S":"N"));
|
||||
ps.setString(10, (flagSetupUserWeb?"S":"N"));
|
||||
ps.setString(11, (flagTipoJson?"S":"N"));
|
||||
ps.setString(12, (flagTipoColore?"S":"N"));
|
||||
ps.setString(8, (flagUserView ? "S" : "N"));
|
||||
ps.setString(9, (flagSetupDepo ? "S" : "N"));
|
||||
ps.setString(10, (flagSetupUserWeb ? "S" : "N"));
|
||||
ps.setString(11, (flagTipoJson ? "S" : "N"));
|
||||
ps.setString(12, (flagTipoColore ? "S" : "N"));
|
||||
ps.setString(13, tipoSetup);
|
||||
ps.setBoolean(14, flagMultiValue);
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ public enum IntegryCustomer {
|
||||
IntegryCustomerDB.Didonna_Diba,
|
||||
IntegryCustomerDB.Didonna_MediimpexLiq,
|
||||
IntegryCustomerDB.Didonna_DibaLiq),
|
||||
|
||||
DMS(IntegryCustomerDB.Siciliani_DMS),
|
||||
DolceBonta(IntegryCustomerDB.DolceBonta_DolceBo,
|
||||
IntegryCustomerDB.DolceBonta_Emanuela),
|
||||
Dulciar(IntegryCustomerDB.Dulciar_Dulciar,
|
||||
|
||||
@@ -52,6 +52,7 @@ public enum IntegryCustomerDB {
|
||||
Didonna_MediimpexLiq("mediimpexliq"),
|
||||
Didonna_DibaLiq("dibaliq"),
|
||||
|
||||
Siciliani_DMS("DMS"),
|
||||
|
||||
DolceBonta_DolceBo("dolce_bo"),
|
||||
DolceBonta_Emanuela("emanuela"),
|
||||
|
||||
@@ -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_20240701145633 extends BaseMigration implements MigrationModelInterface {
|
||||
@@ -11,6 +12,9 @@ public class Migration_20240701145633 extends BaseMigration implements Migration
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
executeStatement("ALTER TABLE vtb_dest ADD part_iva_legale varchar(20)",
|
||||
"ALTER TABLE vtb_dest ADD cod_fisc_legale varchar(16)");
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240701154550 extends BaseMigration implements MigrationModelInterface {
|
||||
@@ -10,6 +11,8 @@ public class Migration_20240701154550 extends BaseMigration implements Migration
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
createOrUpdateFunction("ordify_getElencoClienti", "CREATE FUNCTION [dbo].[ordify_getElencoClienti]\n" +
|
||||
"( \n" +
|
||||
|
||||
@@ -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_20240702174551 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("PICKING", "SPEDIZIONE", "FLAG_USE_COLLI_PEDANA", "N", "Questo flag permette, durante il picking, di proporre automaticamente la qta dei colli pedana presente nell'anagrafica articolo. Questa setup prevale su FLAG_USE_QTA_ORD se entrambe attive.", false, "SI_NO", false, false, false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ public class Migration_20240702185913 extends BaseMigration implements Migration
|
||||
if (!isCustomerDb(IntegryCustomerDB.Gramm_Gramm))
|
||||
return;
|
||||
|
||||
createSetup("IMPORT_DOCUMENTI_TRASPORTO", "ROTUNNO", "ATTIVO", "S", "Inserire S/N per attivare/disattivare il tipo di importazione", false, null, false, false, false, false, false, null, false, null);
|
||||
updateSetupValue("IMPORT_DOCUMENTI_TRASPORTO", "ROTUNNO", "ATTIVO", "S");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240703115340 extends BaseMigration implements MigrationModelInterface {
|
||||
@@ -10,6 +11,8 @@ public class Migration_20240703115340 extends BaseMigration implements Migration
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
createOrUpdateFunction("getPromozioneVendita", "CREATE FUNCTION [dbo].[getPromozioneVendita] (@dataIniz datetime, @dataFine datetime, @codVlis varchar(5), @codPromo varchar(10), @codMart varchar(15)) RETURNS TABLE AS \n" +
|
||||
" return \n" +
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240703150654 extends BaseMigration implements MigrationModelInterface {
|
||||
@@ -10,6 +11,9 @@ public class Migration_20240703150654 extends BaseMigration implements Migration
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
executeStatement("ALTER TABLE dtb_ordr_pian_prod\n" +
|
||||
" ADD data_esportazione DATETIME;");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240704103600 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
|
||||
createSetup("w_ddocu_rc", "LOAD_ORD", "FLAG_ESCLUDI_ORDINE_PADRE", "N", "Se impostato a S allora viene visulizzato un check che per default esclude gli ordini di lavorazione che hanno livello =1, item_id e termine di consegna valorizzato (Termine di consegna = elenco matricole)", false, null, false, false, false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240704103638 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Maggio_MaggioSrl))
|
||||
return;
|
||||
|
||||
createSetup("w_ddocu_rc", "LOAD_ORD", "FLAG_ESCLUDI_ORDINE_PADRE", "S", "Se impostato a S allora viene visulizzato un check che per default esclude gli ordini di lavorazione che hanno livello =1, item_id e termine di consegna valorizzato (Termine di consegna = elenco matricole)", false, null, false, false, false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@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_20240704164353 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("w_afabbt_rc", "GENERA_ORDINI", "ASSEGNA_PARTITA_MAG_PROD", "N", "Se impostata a S nella gestione degli ordini la partita viene valorizzata sui semilavorati con il codice commessa", false, null, false, false, false, false, false, null, false, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240704164406 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Maggio_MaggioSrl))
|
||||
return;
|
||||
|
||||
updateSetupValue("w_afabbt_rc", "GENERA_ORDINI", "ASSEGNA_PARTITA_MAG_PROD", "S");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
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_20240704185802 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Siciliani_DMS))
|
||||
return;
|
||||
|
||||
createOrUpdateFunction("getListinoVenditaPedane", "CREATE FUNCTION [dbo].[getListinoVenditaPedane](@datavalidita DATETIME, @codvlis VARCHAR(5), @codmart VARCHAR(15), @pedane INT)\n" +
|
||||
" RETURNS TABLE AS\n" +
|
||||
" RETURN\n" +
|
||||
" WITH trasp AS (SELECT mtb_lisv_data_spese.cod_vlis,\n" +
|
||||
" mtb_lisv_data_spese.versione,\n" +
|
||||
" mtb_lisv_data_spese.cod_spes,\n" +
|
||||
" mtb_lisv_data_spese.perc_ricarico,\n" +
|
||||
" mtb_lisv_data_spese.val_ricarico,\n" +
|
||||
" mtb_lisv_data_spese.perc_sconto,\n" +
|
||||
" mtb_lisv_data_spese.da,\n" +
|
||||
" mtb_lisv_data_spese.a\n" +
|
||||
" FROM (SELECT cod_vlis,\n" +
|
||||
" MAX(CASE\n" +
|
||||
" WHEN vtb_list_data.versione IS NULL THEN NULL\n" +
|
||||
" ELSE CONVERT(VARCHAR(10), vtb_list_data.data_iniz, 111) + ' ' +\n" +
|
||||
" REPLICATE('0', 5 - LEN(vtb_list_data.versione)) +\n" +
|
||||
" CONVERT(VARCHAR(5), vtb_list_data.versione) END) AS max_lisv\n" +
|
||||
" FROM vtb_list_data\n" +
|
||||
" WHERE vtb_list_data.data_iniz <= ISNULL(@datavalidita, CAST(GETDATE() AS DATE))\n" +
|
||||
" GROUP BY cod_vlis) t\n" +
|
||||
" INNER JOIN vtb_list_data ON t.cod_vlis = vtb_list_data.cod_vlis AND\n" +
|
||||
" CONVERT(INT, RIGHT(t.max_lisv, 5)) = vtb_list_data.versione\n" +
|
||||
" INNER JOIN mtb_lisv_data_spese\n" +
|
||||
" ON vtb_list_data.cod_vlis = mtb_lisv_data_spese.cod_vlis AND\n" +
|
||||
" vtb_list_data.versione = mtb_lisv_data_spese.versione)\n" +
|
||||
"\n" +
|
||||
" SELECT list.*,\n" +
|
||||
" trasp.cod_spes,\n" +
|
||||
" trasp.perc_ricarico,\n" +
|
||||
" trasp.val_ricarico,\n" +
|
||||
" trasp.perc_sconto,\n" +
|
||||
" trasp.da,\n" +
|
||||
" trasp.a,\n" +
|
||||
" (list.prz_vend +\n" +
|
||||
" IIF(list.flag_add_trasp = 1,\n" +
|
||||
" ((ISNULL(val_ricarico, 0)) * list.add_val_spese) /\n" +
|
||||
" IIF(ISNULL(list.colli_pedana, 1) = 0, 1, list.colli_pedana), 0)) +\n" +
|
||||
" ((ISNULL(perc_ricarico, 0) * list.add_ric_spese * list.prz_vend) / 100) *\n" +
|
||||
" (1 - (ISNULL(perc_sconto, 0) * list.add_sco_spese) / 100) prz_vend_trasp\n" +
|
||||
" FROM getlistinovendita(@datavalidita, @codvlis, @codmart) list\n" +
|
||||
" LEFT OUTER JOIN trasp ON list.cod_vlis = trasp.cod_vlis AND\n" +
|
||||
" (@pedane IS NULL OR @pedane BETWEEN da AND a OR\n" +
|
||||
" (@pedane IS NOT NULL AND da = 0 AND a = 0))");
|
||||
}
|
||||
|
||||
@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.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240705100954 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("PVM", "MODELLINI", "ESTIMATED_END_DATE_DAYS", null,
|
||||
"Giorni aggiunti alla data fine stimata.", null);
|
||||
|
||||
createSetup("PVM", "MODELLINI", "DISABLE_VERIFY", null,
|
||||
"Utenti che non necessitano la verifica manuale di richieste verifica delle attività",
|
||||
"SI_NO", false, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20240705103421 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
executeStatement("create table mtb_sch_tec_var \n" +
|
||||
"(cod_var varchar(5) not null,\n" +
|
||||
"descrizione varchar(255) null ) ",
|
||||
|
||||
"alter table mtb_sch_tec_var add constraint pk_mtb_sch_tec_var primary key (cod_var) ",
|
||||
|
||||
"create table mtb_sch_tec_sett\n" +
|
||||
"(cod_sch varchar(5) not null,\n" +
|
||||
"descrizione varchar(255) null ) ",
|
||||
|
||||
"alter table mtb_sch_tec_sett add constraint pk_mtb_sch_tec_sett primary key (cod_sch) ",
|
||||
|
||||
"create table mtb_sch_tec_setr\n" +
|
||||
"(cod_sch varchar(5) not null,\n" +
|
||||
"cod_var varchar(5) not null,\n" +
|
||||
"descrizione varchar(8000) not null, \n" +
|
||||
"descrizione_eng varchar(8000) null) ",
|
||||
|
||||
"alter table mtb_sch_tec_setr add constraint pk_mtb_sch_tec_setr primary key (cod_sch, cod_var) ",
|
||||
|
||||
"alter table mtb_sch_tec_setr ADD CONSTRAINT fk_mtb_sch_tec_setr_mtb_sch_tec_sett FOREIGN KEY (cod_sch) REFERENCES mtb_sch_tec_sett(cod_sch) ",
|
||||
|
||||
"alter table mtb_sch_tec_setr ADD CONSTRAINT fk_mtb_sch_tec_setr_mtb_sch_tec_var FOREIGN KEY (cod_var) REFERENCES mtb_sch_tec_var(cod_var); ");
|
||||
}
|
||||
|
||||
@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_20240705153031 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
executeStatement("create table mrl_aart_sch_tec_set\n" +
|
||||
"(id BIGINT PRIMARY KEY NOT NULL IDENTITY,\n" +
|
||||
"cod_mart varchar(15) NOT NULL,\n" +
|
||||
"cod_sch varchar(5) NOT NULL) " ,
|
||||
"update stb_gest_sync set syncronize ='R' where gest_name ='msch_tec_set'; ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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_20240708160542 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
executeStatement( "alter table mtb_aart_link add id_attach varchar(40);");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package it.integry.ems_model.entity;
|
||||
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.annotation.Master;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
import it.integry.ems_model.annotation.Table;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import it.integry.ems_model.annotation.PK;
|
||||
import it.integry.ems_model.annotation.Identity;
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
|
||||
@Master()
|
||||
@PropertyReactive()
|
||||
@Table(value = MrlAartSchTecSet.ENTITY)
|
||||
@JsonTypeName(value = MrlAartSchTecSet.ENTITY)
|
||||
public class MrlAartSchTecSet extends EntityBase {
|
||||
|
||||
public final static String ENTITY = "mrl_aart_sch_tec_set";
|
||||
|
||||
private final static long serialVersionUID = 1L;
|
||||
|
||||
@PK()
|
||||
@Identity()
|
||||
@SqlField(value = "id", nullable = false)
|
||||
private Long id;
|
||||
|
||||
@SqlField(value = "cod_mart", maxLength = 15, nullable = false)
|
||||
private String codMart;
|
||||
|
||||
@SqlField(value = "cod_sch", maxLength = 5, nullable = false)
|
||||
private String codSch;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public MrlAartSchTecSet setId(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public MrlAartSchTecSet setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodSch() {
|
||||
return codSch;
|
||||
}
|
||||
|
||||
public MrlAartSchTecSet setCodSch(String codSch) {
|
||||
this.codSch = codSch;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ public class MtbSchTecSetr extends EntityBase {
|
||||
@SqlField(value = "cod_sch")
|
||||
private String codSch;
|
||||
|
||||
@PK
|
||||
@SqlField(value = "cod_var")
|
||||
private String codVar;
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
||||
package it.integry.ems.activity.controller;
|
||||
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.activity.dto.InsertUserAbsenceRequestDTO;
|
||||
import it.integry.ems.activity.dto.UserAbsenceRequestDTO;
|
||||
import it.integry.ems.activity.service.UserAbsenceService;
|
||||
import it.integry.ems.javabeans.RequestDataDTO;
|
||||
import it.integry.ems.response.ServiceRestResponse;
|
||||
@@ -46,10 +46,28 @@ public class UserAbsenceController {
|
||||
|
||||
@PreAuthorize("isAuthenticated()")
|
||||
@RequestMapping(value = "/register", method = RequestMethod.POST)
|
||||
public ServiceRestResponse registerAssenze(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@RequestBody List<InsertUserAbsenceRequestDTO> userAbsences) throws Exception {
|
||||
userAbsenceService.registerAssenze(userAbsences, requestDataDTO.getUsername());
|
||||
public ServiceRestResponse registerAbsence(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@RequestBody List<UserAbsenceRequestDTO> userAbsences) throws Exception {
|
||||
userAbsenceService.registerAbsence(userAbsences, requestDataDTO.getUsername());
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
}
|
||||
|
||||
@PreAuthorize("isAuthenticated()")
|
||||
@RequestMapping(value = "/modify", method = RequestMethod.POST)
|
||||
public ServiceRestResponse modifyAbsence(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@RequestBody UserAbsenceRequestDTO absence) throws Exception {
|
||||
userAbsenceService.modifyAbsence(absence, requestDataDTO.getUsername());
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
}
|
||||
|
||||
@PreAuthorize("isAuthenticated()")
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
||||
public ServiceRestResponse deleteAbsence(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@RequestBody UserAbsenceRequestDTO absence) throws Exception {
|
||||
userAbsenceService.deleteAbsence(absence, requestDataDTO.getUsername());
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package it.integry.ems.activity.dto;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
public class InsertUserAbsenceRequestDTO {
|
||||
public class UserAbsenceRequestDTO {
|
||||
|
||||
private LocalDate dataInizio;
|
||||
private LocalDate dataFine;
|
||||
@@ -14,7 +14,7 @@ public class InsertUserAbsenceRequestDTO {
|
||||
return dataInizio;
|
||||
}
|
||||
|
||||
public InsertUserAbsenceRequestDTO setDataInizio(LocalDate dataInizio) {
|
||||
public UserAbsenceRequestDTO setDataInizio(LocalDate dataInizio) {
|
||||
this.dataInizio = dataInizio;
|
||||
return this;
|
||||
}
|
||||
@@ -23,7 +23,7 @@ public class InsertUserAbsenceRequestDTO {
|
||||
return dataFine;
|
||||
}
|
||||
|
||||
public InsertUserAbsenceRequestDTO setDataFine(LocalDate dataFine) {
|
||||
public UserAbsenceRequestDTO setDataFine(LocalDate dataFine) {
|
||||
this.dataFine = dataFine;
|
||||
return this;
|
||||
}
|
||||
@@ -32,7 +32,7 @@ public class InsertUserAbsenceRequestDTO {
|
||||
return giustificativo;
|
||||
}
|
||||
|
||||
public InsertUserAbsenceRequestDTO setGiustificativo(String giustificativo) {
|
||||
public UserAbsenceRequestDTO setGiustificativo(String giustificativo) {
|
||||
this.giustificativo = giustificativo;
|
||||
return this;
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public class InsertUserAbsenceRequestDTO {
|
||||
return note;
|
||||
}
|
||||
|
||||
public InsertUserAbsenceRequestDTO setNote(String note) {
|
||||
public UserAbsenceRequestDTO setNote(String note) {
|
||||
this.note = note;
|
||||
return this;
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package it.integry.ems.activity.service;
|
||||
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.activity.dto.AssenzaDTO;
|
||||
import it.integry.ems.activity.dto.InsertUserAbsenceRequestDTO;
|
||||
import it.integry.ems.activity.dto.UserAbsenceRequestDTO;
|
||||
import it.integry.ems.exception.PrimaryDatabaseNotPresentException;
|
||||
import it.integry.ems.javabeans.RequestDataDTO;
|
||||
import it.integry.ems.service.EntityProcessor;
|
||||
@@ -69,14 +69,13 @@ public class UserAbsenceService {
|
||||
return UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, JtbGiustifica.class);
|
||||
}
|
||||
|
||||
|
||||
public void registerAssenze(List<InsertUserAbsenceRequestDTO> assenzeList, String username) throws Exception {
|
||||
public void registerAbsence(List<UserAbsenceRequestDTO> assenzeList, String username) throws Exception {
|
||||
String codJflav = userService.retrieveCodJflav(username);
|
||||
String fullname = requestDataDTO.getUser().getFullname();
|
||||
|
||||
List<JtbRLavt> jtbRLavtList = new ArrayList<>();
|
||||
|
||||
for (InsertUserAbsenceRequestDTO assenzaItem : assenzeList) {
|
||||
for (UserAbsenceRequestDTO assenzaItem : assenzeList) {
|
||||
|
||||
if (assenzaItem.getDataInizio() == null) throw new Exception("Errore nella data inizio");
|
||||
if (assenzaItem.getDataFine() == null) throw new Exception("Errore nella data fine");
|
||||
@@ -113,8 +112,20 @@ public class UserAbsenceService {
|
||||
|
||||
mailService.sendMail("amministrazione@integry.it", "m.morelli@integry.it", subject, message);
|
||||
}
|
||||
}
|
||||
|
||||
public void modifyAbsence(UserAbsenceRequestDTO assenza, String username) throws Exception {
|
||||
String codJflav = userService.retrieveCodJflav(username);
|
||||
String fullname = requestDataDTO.getUser().getFullname();
|
||||
|
||||
if (assenza.getDataInizio() == null) throw new Exception("Errore nella data inizio");
|
||||
}
|
||||
|
||||
public void deleteAbsence(UserAbsenceRequestDTO assenza, String username) throws Exception {
|
||||
String codJflav = userService.retrieveCodJflav(username);
|
||||
String fullname = requestDataDTO.getUser().getFullname();
|
||||
|
||||
if (assenza.getDataInizio() == null) throw new Exception("Errore nella data inizio");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ public class DocumentDasExport {
|
||||
dettaglioMerci.setGrossWeight(item.getGrossWeight());
|
||||
dettaglioMerci.setNetWeight(item.getNetWeight());
|
||||
dettaglioMerci.setDensity(item.getDensity());
|
||||
dettaglioMerci.setVolume(item.getVolume());
|
||||
dettaglioMerci.setVolume(item.getQuantity());
|
||||
dettaglioMerci.setCommercialDescription(item.getCommercialDescription());
|
||||
dettaglioMerci.setLanguageCommercialDescription(item.getLanguage());
|
||||
dettaglioMerci.setVolume(item.getVolume());
|
||||
|
||||
@@ -1195,7 +1195,10 @@ public class ProductionPlanService {
|
||||
businessPartners.forEach(businessPartner -> businessPartner.setIsCustomer(true));
|
||||
|
||||
ImportBusinessPartnersRequest importBusinessPartnersRequest = new ImportBusinessPartnersRequest()
|
||||
.setBusinessPartners(businessPartners.stream().map(BusinessPartnerData::toBusinessPartner).collect(Collectors.toList()));
|
||||
.setBusinessPartners(Stream.of(businessPartners)
|
||||
.distinctBy(BusinessPartnerData::getId)
|
||||
.map(BusinessPartnerData::toBusinessPartner)
|
||||
.toList());
|
||||
|
||||
returnData.add(foodProcessClient.importBusinessPartners(importBusinessPartnersRequest));
|
||||
}
|
||||
@@ -1256,7 +1259,10 @@ public class ProductionPlanService {
|
||||
|
||||
if (!UtilityList.isNullOrEmpty(packagingMaterials)) {
|
||||
importPackagingMaterialsRequest.getPackagingMaterials()
|
||||
.addAll(packagingMaterials.stream().map(PackagingMaterialData::toPackagingMaterial).collect(Collectors.toList()));
|
||||
.addAll(Stream.of(packagingMaterials)
|
||||
.distinctBy(PackagingMaterialData::getId)
|
||||
.map(PackagingMaterialData::toPackagingMaterial)
|
||||
.toList());
|
||||
}
|
||||
|
||||
// Import secondary packaging
|
||||
@@ -1284,7 +1290,10 @@ public class ProductionPlanService {
|
||||
|
||||
if (!UtilityList.isNullOrEmpty(secondaryPackagingMaterials)) {
|
||||
importPackagingMaterialsRequest.getPackagingMaterials()
|
||||
.addAll(secondaryPackagingMaterials.stream().map(PackagingMaterialData::toPackagingMaterial).collect(Collectors.toList()));
|
||||
.addAll(Stream.of(secondaryPackagingMaterials)
|
||||
.distinctBy(PackagingMaterialData::getId)
|
||||
.map(PackagingMaterialData::toPackagingMaterial)
|
||||
.toList());
|
||||
}
|
||||
|
||||
// Import tertiary packaging
|
||||
@@ -1308,7 +1317,10 @@ public class ProductionPlanService {
|
||||
|
||||
if (!UtilityList.isNullOrEmpty(tertiaryPackagingMaterials)) {
|
||||
importPackagingMaterialsRequest.getPackagingMaterials()
|
||||
.addAll(tertiaryPackagingMaterials.stream().map(PackagingMaterialData::toPackagingMaterial).collect(Collectors.toList()));
|
||||
.addAll(Stream.of(tertiaryPackagingMaterials)
|
||||
.distinctBy(PackagingMaterialData::getId)
|
||||
.map(PackagingMaterialData::toPackagingMaterial)
|
||||
.toList());
|
||||
}
|
||||
|
||||
if (!importPackagingMaterialsRequest.getPackagingMaterials().isEmpty()) {
|
||||
|
||||
@@ -121,8 +121,8 @@ public class SystemMigrationService {
|
||||
if (!UtilityString.isNullOrEmpty(setup.getQueryDefault())){
|
||||
operation =
|
||||
formatSetup(
|
||||
"createSetupQuery(%s, %s, %s, %s);",
|
||||
setup.getCodQuery(),setup.getCodQuery(),setup.getQueryDefault(), false);
|
||||
"createSetupQuery(%s, %s, %s);",
|
||||
setup.getCodQuery(),setup.getCodQuery(),setup.getQueryDefault());
|
||||
classBuilder.append("\t\t" + operation)
|
||||
.append("\r\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user