Merge branch 'master' into feature/RefactoringGestioneColli
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:
@@ -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_20251013103907 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement("ALTER TABLE stb_activity ADD extra_project BIT DEFAULT 0 NOT NULL",
|
||||
"ALTER TABLE stb_activity ADD view_in_meeting BIT DEFAULT 0 NOT NULL");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
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_20251014182929 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Gramm_Gramm))
|
||||
return;
|
||||
|
||||
executeStatement("INSERT INTO stb_gest_setup VALUES (\n" +
|
||||
" 'w_vedi_invoic_dlg',\n" +
|
||||
" 'SASU',\n" +
|
||||
" 'NAI_NAZIONE_PARTIVA',\n" +
|
||||
" 'S',\n" +
|
||||
" NULL,\n" +
|
||||
" 'N',\n" +
|
||||
" NULL,\n" +
|
||||
" 'N',\n" +
|
||||
" '2025-10-14 18:17:28.000',\n" +
|
||||
" 'Administrator',\n" +
|
||||
" 'N',\n" +
|
||||
" 'N',\n" +
|
||||
" 'N',\n" +
|
||||
" 'N',\n" +
|
||||
" NULL,\n" +
|
||||
" 0)");
|
||||
|
||||
executeStatement("INSERT INTO stb_gest_setup VALUES (\n" +
|
||||
" 'w_vedi_invoic_dlg',\n" +
|
||||
" 'SASU_CORA',\n" +
|
||||
" 'NAI_NAZIONE_PARTIVA',\n" +
|
||||
" 'S',\n" +
|
||||
" NULL,\n" +
|
||||
" 'N',\n" +
|
||||
" NULL,\n" +
|
||||
" 'N',\n" +
|
||||
" '2025-10-14 18:17:28.000',\n" +
|
||||
" 'Administrator',\n" +
|
||||
" 'N',\n" +
|
||||
" 'N',\n" +
|
||||
" 'N',\n" +
|
||||
" 'N',\n" +
|
||||
" NULL,\n" +
|
||||
" 0)");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20251015125141 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement(";alter table mtb_lisv add flag_primario bit default 0 not null");
|
||||
|
||||
createOrUpdateFunction("getListinoVendita", "CREATE FUNCTION [dbo].[getListinoVendita](@datavalidita DATETIME, @codvlis VARCHAR(5), @codmart VARCHAR(15))\n" +
|
||||
" RETURNS TABLE AS\n" +
|
||||
" RETURN\n" +
|
||||
" SELECT vtb_list.cod_vlis,\n" +
|
||||
" vtb_list.descrizione,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN tmp_list.max_lisv IS NULL THEN NULL\n" +
|
||||
" ELSE CONVERT(DATETIME, LEFT(tmp_list.max_lisv, 10)) END AS data_iniz,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN tmp_list.max_lisv IS NULL THEN NULL\n" +
|
||||
" ELSE CONVERT(INT, RIGHT(tmp_list.max_lisv, 4)) END AS versione,\n" +
|
||||
" vtb_list.cod_divi,\n" +
|
||||
" vtb_list.cambio,\n" +
|
||||
" vtb_list.flag_arr_prz_iva,\n" +
|
||||
" vtb_list.arr_ric,\n" +
|
||||
" vtb_list.flag_list_iva_inclusa,\n" +
|
||||
" vtb_list.flag_lisv_margine,\n" +
|
||||
" vtb_list.flag_add_trasp,\n" +
|
||||
" tmp_list.cod_mart AS 'cod_mart',\n" +
|
||||
" mtb_lisv_data.unt_mis_ven AS unt_mis_ven,\n" +
|
||||
" ISNULL(mtb_lisv_data.rap_conv, 1) AS rap_conv,\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_base, 0) AS prz_base,\n" +
|
||||
" ISNULL(mtb_lisv_data.ricarica, 0) AS ricarico,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN mtb_lisv_data.prz_vend IS NOT NULL AND mtb_lisv_data.prz_vend <> 0 THEN\n" +
|
||||
" ROUND((ISNULL(mtb_lisv_data.prz_vend, 0) -\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100))) /\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_vend, 0) * 100, 2)\n" +
|
||||
" ELSE 0 END AS margine_eff,\n" +
|
||||
" --dbo.f_calcMargineEffettivo(IsNull(mtb_lisv_data.prz_base, 0), IsNull(mtb_lisv_data.prz_vend, 0), mtb_aart.perc_sfrido) as margine_eff,\n" +
|
||||
" --dbo.f_calcRicaricoEffettivo(IsNull(mtb_lisv_data.prz_base, 0), IsNull(mtb_lisv_data.prz_vend, 0), mtb_aart.perc_sfrido) ricarico_eff, \n" +
|
||||
" CASE\n" +
|
||||
" WHEN mtb_lisv_data.prz_base IS NOT NULL AND mtb_lisv_data.prz_base <> 0 THEN\n" +
|
||||
" ROUND((ISNULL(mtb_lisv_data.prz_vend, 0) -\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100))) /\n" +
|
||||
" (ISNULL(mtb_lisv_data.prz_base, 0) / (1 - mtb_aart.perc_sfrido / 100)) * 100, 2)\n" +
|
||||
" ELSE 0 END AS ricarico_eff,\n" +
|
||||
"\n" +
|
||||
" ISNULL(mtb_lisv_data.magg_prz_vend, 0) AS magg_prz_vend,\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_vend, 0) AS prz_vend,\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_vend_iva, 0) AS prz_vend_iva,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_sco1, 0) AS perc_sco1,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_sco2, 0) AS perc_sco2,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_sco3, 0) AS perc_sco3,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_sco4, 0) AS perc_sco4,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_prov, 0) AS perc_prov,\n" +
|
||||
" ISNULL(mtb_lisv_data.fisso_prov, 0) AS fisso_prov,\n" +
|
||||
" ISNULL(mtb_lisv_data.posizione, '') AS posizione,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_gest, 0) AS perc_gest,\n" +
|
||||
" ISNULL(mtb_lisv_data.val_gest, 0) AS val_gest,\n" +
|
||||
" mtb_lisv_data.data_agg_prz AS data_agg_prz,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_ispe, 0) AS perc_ispe,\n" +
|
||||
" ISNULL(mtb_lisv_data.val_ispe, 0) AS val_ispe,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_promo, 0) AS perc_promo,\n" +
|
||||
" ISNULL(mtb_lisv_data.val_promo, 0) AS val_promo,\n" +
|
||||
" ISNULL(mtb_lisv_data.perc_oneri, 0) AS perc_oneri,\n" +
|
||||
" ISNULL(mtb_lisv_data.val_oneri, 0) AS val_oneri,\n" +
|
||||
" mtb_lisv_data.tipo_variazione AS tipo_variazione,\n" +
|
||||
" mtb_lisv_data.note AS note,\n" +
|
||||
" mtb_lisv_data.aggiornato_da AS aggiornato_da,\n" +
|
||||
" mtb_lisv_data.prz_vend * (1 - mtb_lisv_data.perc_sco1 / 100) * (1 - mtb_lisv_data.perc_sco2 / 100) *\n" +
|
||||
" (1 - mtb_lisv_data.perc_sco3 / 100) *\n" +
|
||||
" (1 - mtb_lisv_data.perc_sco4 / 100) AS prz_vend_netto,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN ISNULL(mtb_lisv_data.colli_pedana, 0) <> 0 THEN mtb_lisv_data.colli_pedana\n" +
|
||||
" ELSE mtb_aart.colli_pedana END AS colli_pedana,\n" +
|
||||
" mtb_lisv_data.cod_tcol_ul AS cod_tcol_ul,\n" +
|
||||
" mtb_lisv_data.cod_tcol_ui AS cod_tcol_ui,\n" +
|
||||
" ISNULL(mtb_lisv_data.prz_vend_sug, 0) AS prz_vend_sug,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN ISNULL(mtb_lisv_data.qta_cnf, 0) <> 0\n" +
|
||||
" AND dbo.getGestSetup('VTB_LIST', 'SETUP', 'QTA_CNF_LISTINO') = 'S' \n" +
|
||||
" THEN mtb_lisv_data.qta_cnf\n" +
|
||||
" ELSE mtb_aart.qta_cnf / ISNULL(mtb_lisv_data.rap_conv, 1) END AS qta_cnf,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN ISNULL(mtb_lisv_data.colli_strato, 0) <> 0 THEN mtb_lisv_data.colli_strato\n" +
|
||||
" ELSE mtb_aart.colli_strato END AS colli_strato,\n" +
|
||||
" mtb_lisv_data.descrizione_html AS descrizione_html,\n" +
|
||||
" mtb_lisv_data.colli_pedana AS colli_pedana_lisv,\n" +
|
||||
" mtb_lisv_data.qta_cnf AS qta_cnf_lisv,\n" +
|
||||
" mtb_lisv_data.colli_strato AS colli_strato_lisv,\n" +
|
||||
" mtb_lisv_data.sconto_cartoni,\n" +
|
||||
" mtb_lisv_data.sconto_strato,\n" +
|
||||
" mtb_lisv_data.sconto_pedane,\n" +
|
||||
" vtb_list.flag_attivo,\n" +
|
||||
" vtb_list_data.note AS note_testata,\n" +
|
||||
" ISNULL(mtb_lisv_data.flag_prz_bloccato, 'N') AS flag_prz_bloccato,\n" +
|
||||
" vtb_list_data.porto AS porto,\n" +
|
||||
" mtb_lisv_data.system_note,\n" +
|
||||
" mtb_lisv.add_val_spese,\n" +
|
||||
" mtb_lisv.add_ric_spese,\n" +
|
||||
" mtb_lisv.add_sco_spese,\n" +
|
||||
" mtb_aart.flag_incl_listino,\n" +
|
||||
" mtb_lisv.flag_primario\n" +
|
||||
" FROM (SELECT vtb_list.cod_vlis AS cod_vlis,\n" +
|
||||
" mtb_lisv_data.cod_mart,\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" +
|
||||
" vtb_list.cod_vlis AS 'cod_vlis_rif'\n" +
|
||||
" FROM vtb_list\n" +
|
||||
" INNER JOIN mtb_lisv_data ON vtb_list.cod_vlis = mtb_lisv_data.cod_vlis\n" +
|
||||
" LEFT OUTER JOIN vtb_list_data ON mtb_lisv_data.cod_vlis = vtb_list_data.cod_vlis AND\n" +
|
||||
" mtb_lisv_data.versione = vtb_list_data.versione AND\n" +
|
||||
" vtb_list_data.cod_promo IS NULL AND\n" +
|
||||
" vtb_list_data.data_iniz <= ISNULL(@datavalidita, GETDATE())\n" +
|
||||
" WHERE vtb_list.cod_vlis_rif IS NULL\n" +
|
||||
" GROUP BY vtb_list.cod_vlis,\n" +
|
||||
" mtb_lisv_data.cod_mart\n" +
|
||||
" UNION\n" +
|
||||
" SELECT vtb_list.cod_vlis AS cod_vlis,\n" +
|
||||
" mtb_lisv_data.cod_mart,\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_rif)) +\n" +
|
||||
" CONVERT(VARCHAR(5), vtb_list_data.versione_rif) END) AS max_lisv,\n" +
|
||||
" vtb_list.cod_vlis_rif AS 'cod_vlis_rif'\n" +
|
||||
" FROM vtb_list\n" +
|
||||
" INNER JOIN vtb_list_data ON vtb_list.cod_vlis = vtb_list_data.cod_vlis\n" +
|
||||
" INNER JOIN vtb_list_data vtb_list_data_rif\n" +
|
||||
" ON vtb_list_data.versione_rif = vtb_list_data_rif.versione AND\n" +
|
||||
" vtb_list_data.cod_vlis_rif = vtb_list_data_rif.cod_vlis\n" +
|
||||
" INNER JOIN mtb_lisv_data ON vtb_list_data_rif.cod_vlis = mtb_lisv_data.cod_vlis AND\n" +
|
||||
" vtb_list_data_rif.versione = mtb_lisv_data.versione\n" +
|
||||
"\n" +
|
||||
" WHERE vtb_list_data.data_iniz <= ISNULL(@datavalidita, GETDATE())\n" +
|
||||
" AND vtb_list.cod_vlis_rif IS NOT NULL\n" +
|
||||
" GROUP BY vtb_list.cod_vlis,\n" +
|
||||
" mtb_lisv_data.cod_mart,\n" +
|
||||
" vtb_list.cod_vlis_rif) tmp_list\n" +
|
||||
" INNER JOIN vtb_list ON vtb_list.cod_vlis = tmp_list.cod_vlis\n" +
|
||||
" INNER JOIN mtb_lisv\n" +
|
||||
" ON tmp_list.cod_vlis_rif = mtb_lisv.cod_vlis AND tmp_list.cod_mart = mtb_lisv.cod_mart\n" +
|
||||
" INNER JOIN mtb_aart ON tmp_list.cod_mart = mtb_aart.cod_mart\n" +
|
||||
" LEFT OUTER JOIN mtb_lisv_data ON tmp_list.cod_vlis_rif = mtb_lisv_data.cod_vlis AND\n" +
|
||||
" tmp_list.cod_mart = mtb_lisv_data.cod_mart AND\n" +
|
||||
" CONVERT(INT, RIGHT(tmp_list.max_lisv, 5)) = mtb_lisv_data.versione\n" +
|
||||
" LEFT OUTER JOIN vtb_list_data ON tmp_list.cod_vlis = vtb_list_data.cod_vlis AND\n" +
|
||||
" CONVERT(INT, RIGHT(tmp_list.max_lisv, 5)) = vtb_list_data.versione\n" +
|
||||
"\n" +
|
||||
" WHERE (@codmart IS NULL OR tmp_list.cod_mart = @codmart)\n" +
|
||||
" AND (@codvlis IS NULL OR tmp_list.cod_vlis = @codvlis)");
|
||||
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 vtb_list_data\n" +
|
||||
" --riga Sotto Aggiunta da Massimo 08/01/25 per non fare uscire i range pedane quando il prezzo non deve essere addizionato del costo dei trasporti\n" +
|
||||
" --inner join vtb_list on vtb_list_data.cod_vlis = vtb_list.cod_vlis and vtb_list.flag_add_trasp = 1\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" +
|
||||
" CROSS APPLY (SELECT MAX(id_listino) AS max_id_listino\n" +
|
||||
" FROM vtb_list_data t\n" +
|
||||
" WHERE t.data_iniz <= ISNULL(@datavalidita, CAST(GETDATE() AS DATE))\n" +
|
||||
" AND vtb_list_data.cod_vlis = t.cod_vlis) max_lisv\n" +
|
||||
" WHERE vtb_list_data.id_listino = max_lisv.max_id_listino)\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, --Questa condizione si potrebbe togliere per la modifica fatta l'8/01/25\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" +
|
||||
" ((list.prz_vend +\n" +
|
||||
" IIF(list.flag_add_trasp = 1, --Questa condizione si potrebbe togliere per la modifica fatta l'8/01/25\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)) * (1 - list.perc_sco1 / 100) *\n" +
|
||||
" (1 - list.perc_sco2 / 100) *\n" +
|
||||
" (1 - list.perc_sco3 / 100) *\n" +
|
||||
" (1 - list.perc_sco4 / 100) AS prz_vend_trasp_netto\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 {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1053,11 +1053,12 @@ public class SalesRules extends QueryRules {
|
||||
mtbLisv.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
}
|
||||
|
||||
if (mtbLisvData.getAddRicSpese() != null || mtbLisvData.getAddScoSpese() != null || mtbLisvData.getAddValSpese() != null) {
|
||||
if (mtbLisvData.getAddRicSpese() != null || mtbLisvData.getAddScoSpese() != null || mtbLisvData.getAddValSpese() != null || mtbLisvData.getFlagPrimario() != null) {
|
||||
mtbLisv
|
||||
.setAddRicSpese(mtbLisvData.getAddRicSpese())
|
||||
.setAddScoSpese(mtbLisvData.getAddScoSpese())
|
||||
.setAddValSpese(mtbLisvData.getAddValSpese());
|
||||
.setAddValSpese(mtbLisvData.getAddValSpese())
|
||||
.setFlagPrimario(mtbLisvData.getFlagPrimario());
|
||||
mtbLisv.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
}
|
||||
|
||||
@@ -1195,6 +1196,7 @@ public class SalesRules extends QueryRules {
|
||||
" 0 AS giacenza,\n" +
|
||||
" ISNULL(lisv.cod_tcol_ui, articoli.cod_tcol_ui) AS cod_tcol_ui,\n" +
|
||||
" ISNULL(lisv.cod_tcol_ul, articoli.cod_tcol_ul) AS cod_tcol_ul,\n" +
|
||||
" ISNULL(lisv.flag_primario, 0) AS flag_primario,\n" +
|
||||
" :flagPrzBloccato AS flag_prz_bloccato,\n" +
|
||||
" :przVendSug AS prz_vend_sug,\n" +
|
||||
" CASE \n" +
|
||||
|
||||
@@ -128,6 +128,9 @@ public class MtbLisv extends EntityBase {
|
||||
@SqlField(value = "add_sco_spese", nullable = false, defaultObjectValue = "0")
|
||||
private Boolean addScoSpese;
|
||||
|
||||
@SqlField(value = "flag_primario", nullable = false, defaultObjectValue = "0")
|
||||
private Boolean flagPrimario;
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
@@ -424,4 +427,13 @@ public class MtbLisv extends EntityBase {
|
||||
this.addScoSpese = addScoSpese;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getFlagPrimario() {
|
||||
return flagPrimario;
|
||||
}
|
||||
|
||||
public MtbLisv setFlagPrimario(Boolean flagPrimario) {
|
||||
this.flagPrimario = flagPrimario;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,6 +175,8 @@ public class MtbLisvData extends EntityBase {
|
||||
|
||||
private Boolean addScoSpese;
|
||||
|
||||
private Boolean flagPrimario;
|
||||
|
||||
@ImportFromParent
|
||||
@MapToTable("data_iniz")
|
||||
private Date dataIniz;
|
||||
@@ -748,6 +750,15 @@ public class MtbLisvData extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getFlagPrimario() {
|
||||
return flagPrimario;
|
||||
}
|
||||
|
||||
public MtbLisvData setFlagPrimario(Boolean flagPrimario) {
|
||||
this.flagPrimario = flagPrimario;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getInseritoDa() {
|
||||
return inseritoDa;
|
||||
}
|
||||
|
||||
@@ -182,6 +182,12 @@ public class StbActivity extends EntityBase {
|
||||
@SqlField(value = "id_posizione")
|
||||
private Long idPosizione;
|
||||
|
||||
@SqlField(value = "extra_project", nullable = false, defaultObjectValue = "0")
|
||||
private Boolean extraProject;
|
||||
|
||||
@SqlField(value = "view_in_meeting", nullable = false, defaultObjectValue = "0")
|
||||
private Boolean viewInMeeting;
|
||||
|
||||
@EntityChild
|
||||
private List<StbActivityCosts> stbActivityCosts = new ArrayList<>();
|
||||
|
||||
@@ -618,6 +624,24 @@ public class StbActivity extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getExtraProject() {
|
||||
return extraProject;
|
||||
}
|
||||
|
||||
public StbActivity setExtraProject(Boolean extraProject) {
|
||||
this.extraProject = extraProject;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getViewInMeeting() {
|
||||
return viewInMeeting;
|
||||
}
|
||||
|
||||
public StbActivity setViewInMeeting(Boolean viewInMeeting) {
|
||||
this.viewInMeeting = viewInMeeting;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDateTime getEstimatedTime() {
|
||||
return estimatedTime;
|
||||
}
|
||||
|
||||
@@ -25,26 +25,7 @@ public class UtilityString {
|
||||
|
||||
//private static final Logger logger = LogManager.getLogger();
|
||||
|
||||
private static final Map<String, String> DATE_FORMAT_REGEXPS = new HashMap<String, String>() {{
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//giorno-mese-giorno
|
||||
put("^\\d{1,2}/\\d{1,2}/\\d{4}$", "dd/MM/yyyy");
|
||||
put("^\\d{1,2}\\.\\d{1,2}\\.\\d{4}$", "dd.MM.yyyy");
|
||||
put("^\\d{1,2}-\\d{1,2}-\\d{4}$", "dd-MM-yyyy");
|
||||
|
||||
//anno-mese-giorno
|
||||
put("^\\d{4}/\\d{1,2}/\\d{1,2}$", "yyyy/MM/dd");
|
||||
put("^\\d{4}\\.\\d{1,2}\\.\\d{1,2}$", "yyyy.MM.dd");
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}$", "yyyy-MM-dd");
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//senza spazi
|
||||
put("^\\d{8}$", "yyyyMMdd");
|
||||
put("^\\d{6}$", "yyMMdd");
|
||||
put("^\\d{1,2}\\s[a-z]{3}\\s\\d{4}$", "dd MMM yyyy");
|
||||
put("^\\d{1,2}\\s[a-z]{4,}\\s\\d{4}$", "dd MMMM yyyy");
|
||||
private static final Map<String, String> DATETIME_FORMAT_REGEXPS = new HashMap<String, String>() {{
|
||||
|
||||
put("^\\d{12}$", "yyyyMMddHHmm");
|
||||
put("^\\d{8}\\s\\d{4}$", "yyyyMMdd HHmm");
|
||||
@@ -110,6 +91,29 @@ public class UtilityString {
|
||||
put("^(\\d{4})-(\\d{2})-(\\d{2})t(\\d{2}):(\\d{2}):(\\d{2})((\\+|-)(\\d{2}):(\\d{2}))$", "yyyy-MM-dd'T'HH:mm:ss");
|
||||
}};
|
||||
|
||||
private static final Map<String, String> DATE_FORMAT_REGEXPS = new HashMap<String, String>() {{
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//giorno-mese-giorno
|
||||
put("^\\d{1,2}/\\d{1,2}/\\d{4}$", "dd/MM/yyyy");
|
||||
put("^\\d{1,2}\\.\\d{1,2}\\.\\d{4}$", "dd.MM.yyyy");
|
||||
put("^\\d{1,2}-\\d{1,2}-\\d{4}$", "dd-MM-yyyy");
|
||||
|
||||
//anno-mese-giorno
|
||||
put("^\\d{4}/\\d{1,2}/\\d{1,2}$", "yyyy/MM/dd");
|
||||
put("^\\d{4}\\.\\d{1,2}\\.\\d{1,2}$", "yyyy.MM.dd");
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}$", "yyyy-MM-dd");
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//senza spazi
|
||||
put("^\\d{8}$", "yyyyMMdd");
|
||||
put("^\\d{6}$", "yyMMdd");
|
||||
put("^\\d{1,2}\\s[a-z]{3}\\s\\d{4}$", "dd MMM yyyy");
|
||||
put("^\\d{1,2}\\s[a-z]{4,}\\s\\d{4}$", "dd MMMM yyyy");
|
||||
|
||||
}};
|
||||
|
||||
private static final Map<String, String> TIME_FORMAT_REGEXPS = new HashMap<String, String>() {{
|
||||
put("^\\d{1,2}:\\d{2}$", "HH:mm");
|
||||
put("^\\d{2}:\\d{2}$", "HH:mm");
|
||||
@@ -123,6 +127,11 @@ public class UtilityString {
|
||||
return DATE_FORMAT_REGEXPS.get(regexp);
|
||||
}
|
||||
}
|
||||
for (String regexp : DATETIME_FORMAT_REGEXPS.keySet()) {
|
||||
if (timeString.toLowerCase().matches(regexp)) {
|
||||
return DATETIME_FORMAT_REGEXPS.get(regexp);
|
||||
}
|
||||
}
|
||||
return null; // Unknown format.
|
||||
}
|
||||
|
||||
@@ -209,8 +218,15 @@ public class UtilityString {
|
||||
|
||||
if (format == null)
|
||||
throw new IOException("Impossibile riconoscere il formato data per " + value);
|
||||
|
||||
if (format.equalsIgnoreCase("yyyy-MM-dd'T'HH:mm:ss") && value.length() > 19)
|
||||
format += "z";
|
||||
|
||||
else if (DATE_FORMAT_REGEXPS.containsValue(format)) {
|
||||
final LocalDate localDate = parseLocalDate(value, format);
|
||||
return localDate.atStartOfDay();
|
||||
}
|
||||
|
||||
return parseLocalDateTime(value, format);
|
||||
}
|
||||
|
||||
|
||||
@@ -131,20 +131,23 @@ public class ActivityController {
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_UPLOAD_STB_ACTIVITY_FILE_ATTACHMENT, method = RequestMethod.POST)
|
||||
@PostMapping(value = "uploadStbActivityFileAttachment")
|
||||
public ServiceRestResponse uploadStbActivityFileAttachment(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@RequestParam() String activityId,
|
||||
@RequestPart() MultipartFile[] files) throws Exception {
|
||||
if (files == null || files.length == 0) {
|
||||
if (files == null || files.length == 0)
|
||||
throw new Exception("Nessun file è stato rilevato");
|
||||
}
|
||||
|
||||
StbActivity stbActivity = activityService.uploadAttachment(activityId, files);
|
||||
return ServiceRestResponse.createPositiveResponse(activityService.uploadAttachment(activityId, files));
|
||||
}
|
||||
|
||||
ServiceRestResponse serviceRestResponse = ServiceRestResponse.createPositiveResponse();
|
||||
serviceRestResponse.setEntityList(stbActivity.getStbActivityFile());
|
||||
@GetMapping(value = "activity/removeAttachment")
|
||||
public ServiceRestResponse removeAttachment(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||
@RequestParam() String activityId,
|
||||
@RequestParam() String fileName) throws Exception {
|
||||
|
||||
return serviceRestResponse;
|
||||
activityService.removeAttachment(activityId, fileName);
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
}
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_ACTIVITY_GET_ACTIVITY, method = RequestMethod.GET)
|
||||
|
||||
@@ -127,12 +127,19 @@ public class ActivityService {
|
||||
}
|
||||
|
||||
public void removeAttachment(String activityId, String fileName) throws Exception {
|
||||
StbActivityFile activityFile = new StbActivityFile();
|
||||
if (activityId == null || fileName == null)
|
||||
throw new Exception("activityId e fileName sono obbligatori");
|
||||
|
||||
StbActivityFile activityFile = new StbActivityFile()
|
||||
.setId(activityId)
|
||||
.setFileName(fileName);
|
||||
activityFile.setOperation(OperationType.DELETE);
|
||||
activityFile.setId(activityId);
|
||||
activityFile.setFileName(fileName);
|
||||
entityProcessor.processEntity(activityFile, multiDBTransactionManager);
|
||||
multiDBTransactionManager.commitAll();
|
||||
|
||||
StbActivity stbActivity = new StbActivity().setActivityId(activityId);
|
||||
stbActivity.getStbActivityFile().add(activityFile);
|
||||
stbActivity.setOperation(OperationType.NO_OP);
|
||||
|
||||
entityProcessor.processEntity(stbActivity, multiDBTransactionManager);
|
||||
}
|
||||
|
||||
public List<AttivitaDTO> save(List<AttivitaDTO> listAttivita) throws Exception {
|
||||
@@ -957,7 +964,7 @@ public class ActivityService {
|
||||
" task.dapagare AS da_pagare,\n " +
|
||||
" task.acanone AS a_canone\n ";
|
||||
if (daInstallare) {
|
||||
sql += ", lastUpdt.data AS ultimo_aggiornamento\n";
|
||||
sql += ", CAST(lastUpdt.data AS DATETIME) AS ultimo_aggiornamento\n";
|
||||
} else {
|
||||
sql += ", CAST(NULL AS DATETIME) AS ultimo_aggiornamento\n";
|
||||
}
|
||||
|
||||
@@ -64,6 +64,18 @@ public class ProductionWarehouseService {
|
||||
rettificaDto.getNewQtaCol(),
|
||||
true,
|
||||
true));
|
||||
|
||||
if (rettifica == null) {
|
||||
throw new Exception(String.format(
|
||||
"Nessuna rettifica da effettuare per articolo %s, qta collo da %f a %f, num cnf da %f a %f",
|
||||
rettificaDto.getSourceMtbColr().getCodMart(),
|
||||
rettificaDto.getSourceMtbColr().getQtaCol(),
|
||||
rettificaDto.getNewQtaCol(),
|
||||
rettificaDto.getSourceMtbColr().getNumCnf(),
|
||||
rettificaDto.getNewNumCnf()
|
||||
));
|
||||
}
|
||||
|
||||
MtbColt testata = new MtbColt();
|
||||
testata.setNumCollo(rettifica.getNumCollo());
|
||||
testata.setDataCollo(rettifica.getDataCollo());
|
||||
|
||||
@@ -334,7 +334,7 @@ public class SystemService {
|
||||
for (String profile : profiles) {
|
||||
String dbName = settingsModel.getDbNameFromProfileDb(profile);
|
||||
|
||||
//MD5 utilizzato da Ordikids
|
||||
//MD5 utilizzato da Ordikids e Farmmes
|
||||
if (UtilityString.isNullOrEmpty(password) && !UtilityString.isNullOrEmpty(md5User)) {
|
||||
foundUser = userCacheService.retrieveUser(dbName, md5User);
|
||||
} else
|
||||
@@ -351,7 +351,7 @@ public class SystemService {
|
||||
|
||||
if (foundUser == null) {
|
||||
logger.error(String.format("Credenziali non valide utente: %s ( %s) ",
|
||||
username, multiDBTransactionManager.getPrimaryConnection().getCatalog() + " )"));
|
||||
UtilityString.isNull(username,md5User), multiDBTransactionManager.getPrimaryConnection().getCatalog() + " )"));
|
||||
throw new Exception("Credenziali non valide");
|
||||
} else if (!foundUser.isAttivo()) {
|
||||
throw new Exception("Utente non attivo");
|
||||
|
||||
Reference in New Issue
Block a user