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