- Aggiunto NomeNegozioRequired nei settings di Ordikids

- Creazione migration setup NomeNegozioRequired
This commit is contained in:
2024-05-23 11:36:32 +02:00
parent a805edc181
commit 68f7123eec
3 changed files with 64 additions and 34 deletions

View File

@@ -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_20240522173844 extends BaseMigration implements MigrationModelInterface {
@Override
public void up() throws Exception {
if (isHistoryDB())
return;
createSetupQuery("SI_NO", "SI_NO", "SELECT 'S' UNION ALL SELECT 'N'", false);
createSetup("ORDIKIDS", "SETUP", "NOME_NEGOZIO_REQUIRED", null, null, false, "SI_NO", false, false, false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
if (isCustomer(IntegryCustomer.FolliesGroup)) {
updateSetupValue("ORDIKIDS", "SETUP", "NOME_NEGOZIO_REQUIRED", "S");
}
}
@Override
public void down() throws Exception {
}
}

View File

@@ -41,6 +41,8 @@ public class UtenteDTO implements Serializable {
private String nomeAzienda;
@SqlField
private String recTelObbligatorio;
@SqlField
private String nomeNegozioRequired;
public UtenteDTO(String user_name, String full_name, String user_code,
String cod_vlis_newclie, String cod_anag_newclie, BigDecimal sc1, BigDecimal sc2, String cod_paga) {
@@ -186,4 +188,12 @@ public class UtenteDTO implements Serializable {
this.recTelObbligatorio = recTelObbligatorio;
return this;
}
}
public String getNomeNegozioRequired() {
return nomeNegozioRequired;
}
public void setNomeNegozioRequired(String nomeNegozioRequired) {
this.nomeNegozioRequired = nomeNegozioRequired;
}
}

View File

@@ -28,6 +28,7 @@ import it.integry.ems_model.entity.WtbFavoriteArt;
import it.integry.ems_model.service.SetupGest;
import it.integry.ems_model.types.OperationType;
import it.integry.ems_model.utility.UtilityDB;
import it.integry.ems_model.utility.UtilityHashMap;
import it.integry.ems_model.utility.UtilityString;
import org.apache.commons.io.IOUtils;
import org.apache.logging.log4j.LogManager;
@@ -70,7 +71,7 @@ public class OrdikidsService {
private EntityProcessor entityProcessor;
public LoginDTO login(String md5Agente) throws Exception {
String sql, flag_bloccoPagaClie, flag_bloccoPagaNewClie, flag_bloccoListino, flag_bloccoMenuListini, elencoListini, condListini, flag_moltip, flag_vendAsso;
String sql, flag_bloccoPagaClie, flag_bloccoPagaNewClie, flag_nomeNegozioRequired, flag_bloccoListino, flag_bloccoMenuListini, elencoListini, condListini, flag_moltip, flag_vendAsso;
PreparedStatement ps;
Map<String, String> DatiAgente = getCond_vvwClientiAgenti(md5Agente);
@@ -111,28 +112,14 @@ public class OrdikidsService {
}
rs.close();
flag_bloccoPagaClie = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), "ORDIKIDS", "SETUP", "BLOCCO_PAGA_CLIE");
if (flag_bloccoPagaClie.compareTo("") == 0) {
flag_bloccoPagaClie = "N";
}
utente.setBloccoPagaClie(flag_bloccoPagaClie);
HashMap<String, String> setupSection = setupGest.getSetupSection(multiDBTransactionManager.getPrimaryConnection(), "ORDIKIDS", "SETUP");
flag_bloccoPagaNewClie = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), "ORDIKIDS", "SETUP", "BLOCCO_PAGA_NEWCLIE");
if (flag_bloccoPagaNewClie.compareTo("") == 0) {
flag_bloccoPagaNewClie = "N";
}
utente.setBloccoPagaNewClie(flag_bloccoPagaNewClie);
flag_moltip = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), "ORDIKIDS", "SETUP", "MOLTIP_BARCODEMODE");
if (flag_moltip.compareTo("") == 0) {
flag_moltip = "S";
}
utente.setMoltipl_barcodemode(flag_moltip);
flag_vendAsso = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), "ORDIKIDS", "SETUP", "VEND_ASSO_OBBLIGATORIO");
utente.setVend_asso_obbligatorio(flag_vendAsso);
utente.setRecTelObbligatorio(setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), "ORDIKIDS", "SETUP", "REC_TEL_OBBLIGATORIO"));
utente.setBloccoPagaClie(UtilityHashMap.getValueIfExists(setupSection, "BLOCCO_PAGA_CLIE", "N"));
utente.setBloccoPagaNewClie(UtilityHashMap.getValueIfExists(setupSection, "BLOCCO_PAGA_NEWCLIE", "N"));
utente.setNomeNegozioRequired(UtilityHashMap.getValueIfExists(setupSection, "NOME_NEGOZIO_REQUIRED", "N"));
utente.setMoltipl_barcodemode(UtilityHashMap.getValueIfExists(setupSection, "MOLTIP_BARCODEMODE", "S"));
utente.setVend_asso_obbligatorio(UtilityHashMap.getValueIfExists(setupSection, "VEND_ASSO_OBBLIGATORIO"));
utente.setRecTelObbligatorio(UtilityHashMap.getValueIfExists(setupSection, "REC_TEL_OBBLIGATORIO"));
sql = "SELECT gtb_paga.cod_paga,\n" +
" gtb_paga.descrizione,\n" +
@@ -151,38 +138,43 @@ public class OrdikidsService {
List<ElencoListiniDTO> ElencoListiniMenu = new ArrayList<>();
flag_bloccoMenuListini = "S"; //Inizializzazione con il blocco del menu
flag_bloccoListino = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), "ORDIKIDS", "SETUP", "BLOCCO_LISTINO");
if (flag_bloccoListino.compareTo("") == 0 || flag_bloccoListino.compareTo("S") == 0) {
flag_bloccoListino = setupSection.get("BLOCCO_LISTINO");
if (flag_bloccoListino.equalsIgnoreCase("") || flag_bloccoListino.equalsIgnoreCase("S")) {
//S acquisisce il listino Esclusivamente dalle categorie di sconto, il menu è bloccato
flag_bloccoMenuListini = "S";
ElencoListiniMenu.add(0, new ElencoListiniDTO("", "IN FUNZIONE DELLA LINEA"));
} else {
if (flag_bloccoListino.compareTo("N") == 0) {
if (flag_bloccoListino.equalsIgnoreCase("N")) {
//N consente di scegliere o il calcolo in base alle categorie di sconto o
// un listino diverso se presenti in ELENCO_LISTINI
// il menu è attivo
flag_bloccoMenuListini = flag_bloccoListino;
ElencoListiniMenu.add(0, new ElencoListiniDTO("", "IN FUNZIONE DELLA LINEA"));
} else if (flag_bloccoListino.compareTo("L") == 0) {
} else if (flag_bloccoListino.equalsIgnoreCase("L")) {
//se L consente di scegliere solo uno dei listini presenti in ELENCO_LISTINI
// il menu è attivo
flag_bloccoMenuListini = "N";
}
List<ElencoListiniDTO> ElencoListini;
elencoListini = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), "ORDIKIDS", "SETUP", "ELENCO_LISTINI");
if (elencoListini.compareTo("") != 0) {
condListini = "'" + elencoListini.replaceAll(",", "', '") + "' ";
elencoListini = setupSection.get("ELENCO_LISTINI");
if (!elencoListini.equalsIgnoreCase("")) {
condListini = "'" + elencoListini.replaceAll(",", "', '") + "' ";
sql = "SELECT cod_vlis, descrizione FROM vtb_list WHERE cod_vlis IN ( " + condListini + " ) ";
ps = multiDBTransactionManager.prepareStatement(sql);
ElencoListini = new ResultSetMapper()
.mapResultSetToList(ps.executeQuery(), ElencoListiniDTO.class);
if (ElencoListini == null) ElencoListini = new ArrayList<ElencoListiniDTO>();
if (ElencoListini == null) {
ElencoListini = new ArrayList<ElencoListiniDTO>();
}
ps.close();
ElencoListiniMenu.addAll(ElencoListini);
}
}
utente.setBloccoListino(flag_bloccoMenuListini);
sql = "SELECT top 1 Convert(varchar(10), dateupd , 121) as dateupd "
@@ -221,7 +213,7 @@ public class OrdikidsService {
ps.close();
List<CategorieClienteDTO> categorie;
String flag_invioCategorie = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), "ORDIKIDS", "SETUP", "INVIO_CATEGORIE_SCONTO");
String flag_invioCategorie = setupSection.get("INVIO_CATEGORIE_SCONTO");
// if("S".equals(flag_invioCategorie)){
sql = "SELECT DISTINCT vvw_clienti_agenti.cod_sco_cli, vtb_sccl.descrizione, "
@@ -248,7 +240,7 @@ public class OrdikidsService {
}
List<ModuloPvmDTO> moduliPvm = new ArrayList<>();
String jsonModuliPvm = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), "ORDIKIDS", "SETUP", "MODULI_PVM");
String jsonModuliPvm = setupSection.get("MODULI_PVM");
if (jsonModuliPvm != null && jsonModuliPvm.length() > 0) {
try {
ObjectMapper mapper = new ObjectMapper();
@@ -534,7 +526,7 @@ public class OrdikidsService {
for (ArticoliDTO articoloDTO : articoli) {
List<ColoriDTO> coloriOLDStyle =
coloriFull.stream().filter(x->x.getCodStyle().equalsIgnoreCase(articoloDTO.getCod_style())).collect(Collectors.toList());
coloriFull.stream().filter(x -> x.getCodStyle().equalsIgnoreCase(articoloDTO.getCod_style())).collect(Collectors.toList());
articoloDTO.setColori(coloriOLDStyle);