aggiunta migratione e corretto servizio per selezione conto
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good

This commit is contained in:
2025-11-21 18:52:03 +01:00
parent b2c3008464
commit d01b4aef8f
2 changed files with 26 additions and 4 deletions

View File

@@ -0,0 +1,22 @@
package it.integry.ems.migration.model;
import it.integry.ems.migration._base.BaseMigration;
import it.integry.ems.migration._base.IntegryCustomer;
import it.integry.ems.migration._base.MigrationModelInterface;
public class Migration_20251121183801 extends BaseMigration implements MigrationModelInterface {
@Override
public void up() throws Exception {
if (isHistoryDB())
return;
if (!isCustomer(IntegryCustomer.Materica) && !isCustomer(IntegryCustomer.Ime)) return;
updateSetupValue("CRM", "COD_CCON", "PREFISSO_I", "105000");
updateSetupValue("CRM", "COD_CCON", "DEFAULT", "111000");
}
@Override
public void down() throws Exception {
}
}

View File

@@ -374,7 +374,7 @@ public class CRMUtility {
gtbAnag.setCodAnag(codAnag);
gtbAnag.setOperation(OperationType.INSERT);
CtbAnag ctbAnag = new CtbAnag().setCodCcon(getCodCcon(conn));
CtbAnag ctbAnag = new CtbAnag().setCodCcon(getCodCcon(codAnag, conn));
ctbAnag.setOperation(OperationType.INSERT);
gtbAnag.setCtbAnag(ctbAnag);
@@ -545,14 +545,14 @@ public class CRMUtility {
return response;
}
private static String getCodCcon(Connection conn) throws Exception {
private static String getCodCcon(String codAnag, Connection conn) throws Exception {
String codCcon;
String prefissoCodAnag = (UtilityString.isNullOrEmpty(codAnag) || codAnag.length() < 1) ? "" : codAnag.substring(0, 1);
String sql = "SELECT value\n" +
"FROM stb_gest_setup\n" +
"WHERE gest_name = 'CRM'\n" +
" AND section = 'COD_CCON'\n" +
" AND key_section = 'PREFISSO_I'";
" AND key_section = 'PREFISSO_" + prefissoCodAnag + "'";
codCcon = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);