|
|
|
|
@@ -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;
|
|
|
|
|
@@ -46,6 +47,7 @@ import java.sql.ResultSet;
|
|
|
|
|
import java.text.DateFormat;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
@Scope("request")
|
|
|
|
|
@@ -69,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);
|
|
|
|
|
@@ -110,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" +
|
|
|
|
|
@@ -150,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 "
|
|
|
|
|
@@ -220,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, "
|
|
|
|
|
@@ -247,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();
|
|
|
|
|
@@ -394,9 +387,6 @@ public class OrdikidsService {
|
|
|
|
|
private List<ArticoliDTO> getListArticoli(String codVage, String tableName) throws Exception {
|
|
|
|
|
boolean overProduction = setupGest.getSetupBoolean(multiDBTransactionManager.getPrimaryConnection(), "ORDIKIDS", "SETUP", "VEND_OVER_PRODUCTION");
|
|
|
|
|
|
|
|
|
|
List<ArticoliDTO> articoli = null;
|
|
|
|
|
PreparedStatement ps, psArt;
|
|
|
|
|
|
|
|
|
|
String sql =
|
|
|
|
|
"SELECT ttb_style.cod_style, " +
|
|
|
|
|
" mtb_aart.descrizione, " +
|
|
|
|
|
@@ -406,9 +396,11 @@ public class OrdikidsService {
|
|
|
|
|
" 'N' AS chiedi_disp, " +
|
|
|
|
|
" mtb_aart.cod_sco_art, " +
|
|
|
|
|
" ttb_style.prezzo_base, " +
|
|
|
|
|
" ttb_style.val_scatto " +
|
|
|
|
|
" ttb_style.val_scatto, " +
|
|
|
|
|
" ttb_line.num_min_art_col " +
|
|
|
|
|
"FROM tvvw_agen_line INNER JOIN ttb_style ON tvvw_agen_line.cod_line = ttb_style.cod_line and ttb_style.anno_stag = tvvw_agen_line.anno_stag " +
|
|
|
|
|
" INNER JOIN mtb_aart ON ttb_style.cod_style = mtb_aart.cod_mart " +
|
|
|
|
|
" INNER JOIN ttb_line ON ttb_style.cod_line = ttb_line.cod_line " +
|
|
|
|
|
"WHERE tvvw_agen_line.cod_vage =" + UtilityDB.valueToString(codVage) + " AND " +
|
|
|
|
|
" CONVERT(VARCHAR, GETDATE(), 111) BETWEEN tvvw_agen_line.data_iniz_ord AND tvvw_agen_line.data_fine_ord AND " +
|
|
|
|
|
" tvvw_agen_line.data_iniz_ord >= tvvw_agen_line.first_data_iniz_ord AND " +
|
|
|
|
|
@@ -435,39 +427,37 @@ public class OrdikidsService {
|
|
|
|
|
" CASE WHEN qta_ord_prod > 0 THEN 'S' ELSE 'N'END AS chiedi_disp, " +
|
|
|
|
|
" art.cod_sco_art, " +
|
|
|
|
|
" art.prezzo_base, " +
|
|
|
|
|
" art.val_scatto " +
|
|
|
|
|
" art.val_scatto, " +
|
|
|
|
|
" art.num_min_art_col " +
|
|
|
|
|
" FROM art left outer join ordP on art.cod_style = ordP.cod_mart ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ps = multiDBTransactionManager.prepareStatement(sql);
|
|
|
|
|
|
|
|
|
|
articoli = new ResultSetMapper()
|
|
|
|
|
.mapResultSetToList(ps.executeQuery(), ArticoliDTO.class);
|
|
|
|
|
List<ArticoliDTO> articoli = new ResultSetMapper()
|
|
|
|
|
.mapQuerySetToList(multiDBTransactionManager.getPrimaryConnection(), sql, ArticoliDTO.class);
|
|
|
|
|
if (articoli == null) articoli = new ArrayList<>();
|
|
|
|
|
ps.close();
|
|
|
|
|
|
|
|
|
|
sql = "SELECT ttb_style.cod_style, mtb_aart.descrizione, ttb_style.des_estera, " +
|
|
|
|
|
" ttb_style.flag_asso, 'S' chiedi_disp, " +
|
|
|
|
|
" mtb_aart.cod_sco_art, ttb_style.prezzo_base, ttb_style.val_scatto " +
|
|
|
|
|
" mtb_aart.cod_sco_art, ttb_style.prezzo_base, ttb_style.val_scatto, " +
|
|
|
|
|
" ttb_line.num_min_art_col " +
|
|
|
|
|
"FROM tvvw_agen_line INNER JOIN ttb_style ON tvvw_agen_line.cod_line = ttb_style.cod_line and tvvw_agen_line.anno_stag = ttb_style.anno_stag " +
|
|
|
|
|
" INNER JOIN mtb_aart ON ttb_style.cod_style = mtb_aart.cod_mart " +
|
|
|
|
|
" INNER JOIN ttb_line ON ttb_style.cod_line = ttb_line.cod_line " +
|
|
|
|
|
" INNER JOIN (Select cod_style " +
|
|
|
|
|
" from dbo.ftx_getDisponibilitaArticoli( CONVERT(varchar, GETDATE(), 111), null, null, null, null, null, null)tab " +
|
|
|
|
|
" from dbo.ftx_getDisponibilitaArticoli( CAST(GETDATE() as DATE), null, null, null, null, null, null)tab " +
|
|
|
|
|
" Where tab.qta_disp > 0 " +
|
|
|
|
|
" Group by cod_style ) disponib ON ttb_style.cod_style = disponib.cod_style " +
|
|
|
|
|
" WHERE tvvw_agen_line.cod_vage =" + UtilityDB.valueToString(codVage) + " AND " +
|
|
|
|
|
" CONVERT(VARCHAR, GETDATE(), 111) BETWEEN tvvw_agen_line.data_iniz_riord AND tvvw_agen_line.data_fine_riord AND " +
|
|
|
|
|
" CAST(GETDATE() as DATE) BETWEEN tvvw_agen_line.data_iniz_riord AND tvvw_agen_line.data_fine_riord AND " +
|
|
|
|
|
" tvvw_agen_line.data_iniz_riord >= tvvw_agen_line.first_data_iniz_riord AND " +
|
|
|
|
|
" ttb_style.flag_listino = 'S' ";
|
|
|
|
|
|
|
|
|
|
psArt = multiDBTransactionManager.prepareStatement(sql);
|
|
|
|
|
|
|
|
|
|
List<ArticoliDTO> articoliPronto = new ResultSetMapper()
|
|
|
|
|
.mapResultSetToList(psArt.executeQuery(), ArticoliDTO.class);
|
|
|
|
|
.mapQuerySetToList(multiDBTransactionManager.getPrimaryConnection(), sql, ArticoliDTO.class);
|
|
|
|
|
|
|
|
|
|
if (articoliPronto == null) articoliPronto = new ArrayList<>();
|
|
|
|
|
articoli.addAll(articoliPronto);
|
|
|
|
|
psArt.close();
|
|
|
|
|
|
|
|
|
|
//CREAZIONE TABELLA TEMPORANEA CHE DOVRA' CONTENERE TUTTE LE ISTANZE DELLA CLASSE ArticoliDTO
|
|
|
|
|
if (!UtilityString.isNullOrEmpty(tableName)) {
|
|
|
|
|
@@ -479,7 +469,8 @@ public class OrdikidsService {
|
|
|
|
|
+ " chiedi_disp varchar(1),"
|
|
|
|
|
+ " cod_sco_art varchar(5),"
|
|
|
|
|
+ " prezzo_base decimal(20, 5), "
|
|
|
|
|
+ " val_scatto decimal(20, 5)) ";
|
|
|
|
|
+ " val_scatto decimal(20, 5), "
|
|
|
|
|
+ " num_min_art_col tinyint) ";
|
|
|
|
|
|
|
|
|
|
PreparedStatement info = multiDBTransactionManager.prepareStatement(sql);
|
|
|
|
|
info.executeUpdate();
|
|
|
|
|
@@ -505,52 +496,37 @@ public class OrdikidsService {
|
|
|
|
|
List<CodBarreDTO> codBarre = null;
|
|
|
|
|
List<ArticoliDTO> articoli = null;
|
|
|
|
|
|
|
|
|
|
Map<String, String> DatiAgente = new HashMap<String, String>();
|
|
|
|
|
DatiAgente = getCond_vvwClientiAgenti(md5User);
|
|
|
|
|
Map<String, String> DatiAgente = getCond_vvwClientiAgenti(md5User);
|
|
|
|
|
|
|
|
|
|
if (DatiAgente.size() > 0) {
|
|
|
|
|
PreparedStatement ps;
|
|
|
|
|
String sql;
|
|
|
|
|
|
|
|
|
|
String codVage = DatiAgente.get("cod_vage");
|
|
|
|
|
|
|
|
|
|
//ACQUISIZIONE ELENCO ARTICOLI
|
|
|
|
|
String tableName = UtilityDB.defTmpTabName("t1_");
|
|
|
|
|
articoli = this.getListArticoli(codVage, tableName);
|
|
|
|
|
articoli = this.getListArticoli(codVage);
|
|
|
|
|
|
|
|
|
|
List<String> articoliCodStyles = new ArrayList<String>();
|
|
|
|
|
|
|
|
|
|
for (ArticoliDTO articoliDTO : articoli) {
|
|
|
|
|
articoliCodStyles.add(articoliDTO.getCod_style());
|
|
|
|
|
}
|
|
|
|
|
List<String> articoliCodStyles = articoli.stream().map(x -> x.getCod_style()).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
String articoliInVector = "'" + Joiner.on("','").skipNulls().join(articoliCodStyles) + "'";
|
|
|
|
|
|
|
|
|
|
sql = "SELECT ttb_style_colori.cod_col, ttb_style_colori.descrizione, ttb_style_colori.cod_style, "
|
|
|
|
|
String sql = "SELECT ttb_style_colori.cod_col, ttb_style_colori.descrizione, ttb_style_colori.cod_style, "
|
|
|
|
|
+ "CASE WHEN ttb_style_colori.cod_col = ttb_style.cod_col_camp THEN 'S' ELSE 'N' end as flag_campione "
|
|
|
|
|
+ "FROM ttb_style_colori "
|
|
|
|
|
+ "left outer join ttb_style ON ttb_style.cod_style = ttb_style_colori.cod_style "
|
|
|
|
|
+ "WHERE ttb_style_colori.flag_attivo = 'S' AND ttb_style_colori.cod_style IN(" + articoliInVector + ")";
|
|
|
|
|
|
|
|
|
|
ps = multiDBTransactionManager.prepareStatement(sql);
|
|
|
|
|
|
|
|
|
|
List<ColoriDTO> coloriFull = new ResultSetMapper()
|
|
|
|
|
.mapResultSetToList(ps.executeQuery(), ColoriDTO.class);
|
|
|
|
|
if (coloriFull == null) coloriFull = new ArrayList<ColoriDTO>();
|
|
|
|
|
ps.close();
|
|
|
|
|
.mapQuerySetToList(multiDBTransactionManager.getPrimaryConnection(), sql, ColoriDTO.class);
|
|
|
|
|
if (coloriFull == null) coloriFull = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
sql = "SELECT cod_tagl, num_scatto, costo, cod_style, pos FROM ttb_style_taglie WHERE flag_attivo = 'S' AND cod_style IN(" + articoliInVector + ") ORDER BY cod_style, pos";
|
|
|
|
|
|
|
|
|
|
ps = multiDBTransactionManager.prepareStatement(sql);
|
|
|
|
|
List<TaglieDTO> taglieFull = new ResultSetMapper()
|
|
|
|
|
.mapResultSetToList(ps.executeQuery(), TaglieDTO.class);
|
|
|
|
|
if (taglieFull == null) taglieFull = new ArrayList<TaglieDTO>();
|
|
|
|
|
ps.close();
|
|
|
|
|
.mapQuerySetToList(multiDBTransactionManager.getPrimaryConnection(), sql, TaglieDTO.class);
|
|
|
|
|
if (taglieFull == null) taglieFull = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for (ArticoliDTO articoloDTO : articoli) {
|
|
|
|
|
List<ColoriDTO> coloriOLDStyle = new ArrayList<ColoriDTO>();
|
|
|
|
|
for (ColoriDTO colore : coloriFull) {
|
|
|
|
|
if (colore.getCodStyle().equalsIgnoreCase(articoloDTO.getCod_style())) coloriOLDStyle.add(colore);
|
|
|
|
|
}
|
|
|
|
|
List<ColoriDTO> coloriOLDStyle =
|
|
|
|
|
coloriFull.stream().filter(x -> x.getCodStyle().equalsIgnoreCase(articoloDTO.getCod_style())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
articoloDTO.setColori(coloriOLDStyle);
|
|
|
|
|
|
|
|
|
|
@@ -573,22 +549,7 @@ public class OrdikidsService {
|
|
|
|
|
+ " mtb_lisv.cod_mart = ttb_lisv_taglie.cod_style AND "
|
|
|
|
|
+ " ttb_lisv_taglie.cod_style + ttb_lisv_taglie.cod_tagl IN(" + codStyleTaglInVector + ")";
|
|
|
|
|
|
|
|
|
|
List<ListiniTaglieDTO> listiniFull = new ArrayList<ListiniTaglieDTO>();
|
|
|
|
|
|
|
|
|
|
ps = multiDBTransactionManager.prepareStatement(sql);
|
|
|
|
|
ResultSet rs = ps.executeQuery();
|
|
|
|
|
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
ListiniTaglieDTO dto = new ListiniTaglieDTO();
|
|
|
|
|
dto.setCod_vlis(rs.getString("cod_vlis"));
|
|
|
|
|
dto.setPrz_vend(rs.getBigDecimal("prz_vend"));
|
|
|
|
|
dto.setRicarica(rs.getBigDecimal("ricarica"));
|
|
|
|
|
dto.setCodStyleTagl(rs.getString("style_tagl"));
|
|
|
|
|
listiniFull.add(dto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rs.close();
|
|
|
|
|
ps.close();
|
|
|
|
|
List<ListiniTaglieDTO> listiniFull = new ResultSetMapper().mapQuerySetToList(multiDBTransactionManager.getPrimaryConnection(), sql, ListiniTaglieDTO.class);
|
|
|
|
|
|
|
|
|
|
for (TaglieDTO tagliaDTO : articoloDTO.getTaglie()) {
|
|
|
|
|
List<ListiniTaglieDTO> listiniOLDStyle = new ArrayList<ListiniTaglieDTO>();
|
|
|
|
|
@@ -608,23 +569,22 @@ public class OrdikidsService {
|
|
|
|
|
sql = "SELECT isNull(mtb_aart.cod_mart_stat, mtb_aart.cod_mart) as cod_style, "
|
|
|
|
|
+ " null as cod_asso,"
|
|
|
|
|
+ " cod_barre "
|
|
|
|
|
+ " FROM " + tableName + " as TabArt, ttb_bar_code, mtb_aart "
|
|
|
|
|
+ " WHERE isNull(mtb_aart.cod_mart_stat, mtb_aart.cod_mart) = TabArt.cod_style AND "
|
|
|
|
|
+ " FROM ttb_bar_code, mtb_aart "
|
|
|
|
|
+ " WHERE isNull(mtb_aart.cod_mart_stat, mtb_aart.cod_mart)IN (" + articoliInVector + ") AND "
|
|
|
|
|
+ " mtb_aart.cod_mart = ttb_bar_code.cod_style"
|
|
|
|
|
+ " UNION "
|
|
|
|
|
+ " SELECT isNull(mtb_aart.cod_mart_stat, mtb_aart.cod_mart) as cod_style, "
|
|
|
|
|
+ " ttb_style_ass.cod_asso, "
|
|
|
|
|
+ " ttb_style_ass.cod_barre "
|
|
|
|
|
+ " FROM " + tableName + " as TabArt, ttb_style_ass, mtb_aart "
|
|
|
|
|
+ " WHERE isNull(mtb_aart.cod_mart_stat, mtb_aart.cod_mart) = TabArt.cod_style AND "
|
|
|
|
|
+ " FROM ttb_style_ass, mtb_aart "
|
|
|
|
|
+ " WHERE isNull(mtb_aart.cod_mart_stat, mtb_aart.cod_mart) IN (" + articoliInVector + ") AND "
|
|
|
|
|
+ " mtb_aart.cod_mart = ttb_style_ass.cod_style "
|
|
|
|
|
+ "ORDER BY 1, 2";
|
|
|
|
|
|
|
|
|
|
ps = multiDBTransactionManager.prepareStatement(sql);
|
|
|
|
|
|
|
|
|
|
codBarre = new ResultSetMapper().mapResultSetToList(ps.executeQuery(), CodBarreDTO.class);
|
|
|
|
|
if (codBarre == null) codBarre = new ArrayList<CodBarreDTO>();
|
|
|
|
|
ps.close();
|
|
|
|
|
codBarre = new ResultSetMapper().mapQuerySetToList(multiDBTransactionManager.getPrimaryConnection(), sql, CodBarreDTO.class);
|
|
|
|
|
if (codBarre == null) codBarre = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (articoli == null) {
|
|
|
|
|
@@ -632,7 +592,7 @@ public class OrdikidsService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (codBarre == null) {
|
|
|
|
|
codBarre = new ArrayList<CodBarreDTO>();
|
|
|
|
|
codBarre = new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new ArticoliCodbarreDTO(articoli, codBarre);
|
|
|
|
|
|