651 lines
22 KiB
Java
651 lines
22 KiB
Java
package it.acxent.cc;
|
|
|
|
import it.acxent.anag.ListinoArticolo;
|
|
import it.acxent.art.Articolo;
|
|
import it.acxent.art.ArticoloCR;
|
|
import it.acxent.art.Tipo;
|
|
import it.acxent.common.StatusMsg;
|
|
import it.acxent.db.ApplParmFull;
|
|
import it.acxent.db.DBAdapter;
|
|
import it.acxent.db.ResParm;
|
|
import it.acxent.util.ScaleImage;
|
|
import it.acxent.util.StringTokenizer;
|
|
import it.acxent.util.Timer;
|
|
import it.acxent.util.Vectumerator;
|
|
import java.io.File;
|
|
import java.sql.Date;
|
|
|
|
public class ArticoloBulkUpdate {
|
|
public final long FLG_TAG_SOSTITUISCI = 0L;
|
|
|
|
public final long FLG_TAG_AGGIUNGI = 1L;
|
|
|
|
public final long FLG_TAG_RIMUOVI = 2L;
|
|
|
|
private final String TAG_THREAD_MSG = "BULK UPDATE ";
|
|
|
|
private ApplParmFull apFull;
|
|
|
|
private long id_tipoBA;
|
|
|
|
private double ricaricoBA;
|
|
|
|
private long qtaMaxAcquistoWwwBA;
|
|
|
|
private long id_listinoEbayBA;
|
|
|
|
private long qtaEbayBA;
|
|
|
|
private long flgEbayBA;
|
|
|
|
private long id_listinoAmazonBA;
|
|
|
|
private long qtaAmazonBA;
|
|
|
|
private long flgAmazonBA;
|
|
|
|
private long flgGoogleBA = -1L;
|
|
|
|
private String icecatLang;
|
|
|
|
private long flgEscludiWebArtBA;
|
|
|
|
private String previewSizes = "66,350";
|
|
|
|
private long flgPreventivoWwwArtBA = -1L;
|
|
|
|
private long percCostoSpedizioneBA = -1L;
|
|
|
|
private long percScontoOffertaBA = -1L;
|
|
|
|
private Date dataScadenzaOffertaBA;
|
|
|
|
private long flgCaricaAmazon;
|
|
|
|
private String tagBA;
|
|
|
|
private long flgRicaricaImmagini;
|
|
|
|
private long id_vetrinaBA;
|
|
|
|
private long flgTagActBA;
|
|
|
|
private String previewSizes1 = "50,150,200";
|
|
|
|
private long id_statoUsatoBA;
|
|
|
|
private long flgTrovaprezziBA;
|
|
|
|
private long flgIdealoBA;
|
|
|
|
private Tipo tipoBA;
|
|
|
|
private double prezzoPubblicoDaBA;
|
|
|
|
private double ricaricoOltreBA;
|
|
|
|
private long flgCaricaEbay;
|
|
|
|
private static boolean threadBulkUpdate = false;
|
|
|
|
public static final String getGoogleBA(long l_flgGoogleBA) {
|
|
return Articolo.getGoogle(l_flgGoogleBA);
|
|
}
|
|
|
|
public final String getGoogleBA() {
|
|
return Articolo.getGoogle(getFlgGoogleBA());
|
|
}
|
|
|
|
class ThreadBulkUpdate extends Thread {
|
|
private ApplParmFull apFull;
|
|
|
|
private boolean sendEmail;
|
|
|
|
private ArticoloCR CR;
|
|
|
|
private WwwAutomator wwwAutomator;
|
|
|
|
public ThreadBulkUpdate(ApplParmFull apFull, ArticoloCR CR, boolean sendEmail) {
|
|
this.apFull = apFull;
|
|
this.sendEmail = sendEmail;
|
|
this.CR = CR;
|
|
this.wwwAutomator = null;
|
|
if (!ArticoloBulkUpdate.isThreadAttivo()) {
|
|
ArticoloBulkUpdate.threadBulkUpdate = true;
|
|
start();
|
|
}
|
|
}
|
|
|
|
public ThreadBulkUpdate(ApplParmFull apFull, ArticoloCR CR, WwwAutomator wwwAutomator) {
|
|
this.apFull = apFull;
|
|
this.sendEmail = false;
|
|
this.CR = CR;
|
|
this.wwwAutomator = wwwAutomator;
|
|
if (!ArticoloBulkUpdate.isThreadAttivo()) {
|
|
ArticoloBulkUpdate.threadBulkUpdate = true;
|
|
start();
|
|
}
|
|
}
|
|
|
|
public void run() {
|
|
boolean debug = true;
|
|
Timer timer = new Timer();
|
|
timer.start();
|
|
StatusMsg.updateMsgByTag(ArticoloBulkUpdate.this.getApFull(), "BULK UPDATE ", "...inizio ...");
|
|
ResParm rp = new ResParm(true);
|
|
StringBuffer err = new StringBuffer();
|
|
StringBuilder sb = new StringBuilder();
|
|
int i = 0;
|
|
int se1 = 10;
|
|
int se2 = 100;
|
|
boolean sovrascriviImmagini = (ArticoloBulkUpdate.this.getFlgRicaricaImmagini() == 1L);
|
|
Articolo bean = new Articolo(this.apFull);
|
|
sb.append("<style>\ntable, th, td {\n border: 1px solid black;\n border-collapse: collapse;\n padding: 2px;\n}\n</style>");
|
|
sb.append("<table>");
|
|
sb.append("<tr>");
|
|
StringTokenizer st = new StringTokenizer(bean.getDescrizionePerMail(true), "|");
|
|
while (st.hasMoreTokens()) {
|
|
sb.append("<th>");
|
|
String token = st.nextToken();
|
|
sb.append(token);
|
|
sb.append("</th>");
|
|
}
|
|
sb.append("</tr>");
|
|
Vectumerator<Articolo> vec = bean.findByCR(this.CR, 0, 0);
|
|
DBAdapter.printDebug(debug, "Tot Record: " + vec.getTotNumberOfRecords());
|
|
while (vec.hasMoreElements()) {
|
|
Articolo row = (Articolo)vec.nextElement();
|
|
String temp = "Aggiornamento " + i + " su " + vec.getTotNumberOfRecords() + " " + row.getCodice() + " " + row.getNome();
|
|
StatusMsg.updateMsgByTag(ArticoloBulkUpdate.this.getApFull(), "BULK UPDATE ", temp);
|
|
DBAdapter.printDebug(debug, "BULK UPDATE " + temp);
|
|
if (ArticoloBulkUpdate.this.getId_tipoBA() > 0L) {
|
|
row.setId_tipo(ArticoloBulkUpdate.this.getId_tipoBA());
|
|
row.superSave();
|
|
DBAdapter.printDebug(debug, "BULK UPDATE tipo save ok");
|
|
}
|
|
if (row.getMarca().getFlgIcecatAuto() == 1L &&
|
|
!ArticoloBulkUpdate.this.getIcecatLang().isEmpty()) {
|
|
boolean caricaImmagini = sovrascriviImmagini;
|
|
st = new StringTokenizer(ArticoloBulkUpdate.this.getIcecatLang(), ",");
|
|
while (st.hasMoreTokens()) {
|
|
String lang = st.nextToken();
|
|
StatusMsg.updateMsgByTag(ArticoloBulkUpdate.this.getApFull(), "BULK UPDATE ", temp + " chiamata icecat " + temp + " .....");
|
|
DBAdapter.printDebug(debug, "BULK UPDATE chiamo icecat " + lang + "...");
|
|
row.caricaIcecat(lang, caricaImmagini, 1);
|
|
caricaImmagini = false;
|
|
DBAdapter.printDebug(debug, "BULK UPDATE chiamo icecat " + lang + " ok");
|
|
}
|
|
}
|
|
if (ArticoloBulkUpdate.this.getRicaricoBA() > 0.0D) {
|
|
if (ArticoloBulkUpdate.this.getPrezzoPubblicoDaBA() == 0.0D) {
|
|
row.setPercRicarico(ArticoloBulkUpdate.this.getRicaricoBA());
|
|
} else if (row.getPrezzoPubblico() < ArticoloBulkUpdate.this.getPrezzoPubblicoDaBA()) {
|
|
row.setPercRicarico(ArticoloBulkUpdate.this.getRicaricoBA());
|
|
} else if (ArticoloBulkUpdate.this.getRicaricoOltreBA() <= 0.0D) {
|
|
row.setPercRicarico(ArticoloBulkUpdate.this.getRicaricoBA());
|
|
} else {
|
|
row.setPercRicarico(ArticoloBulkUpdate.this.getRicaricoOltreBA());
|
|
}
|
|
row.setCostoNuovo(row.getCostoNetto());
|
|
DBAdapter.printDebug(debug, "BULK UPDATE ricarico ok");
|
|
}
|
|
row.setPrezzoIvatoBarrato(row.getStreetPriceIva());
|
|
if (ArticoloBulkUpdate.this.getFlgEbayBA() >= 0L)
|
|
row.setFlgEbay(ArticoloBulkUpdate.this.getFlgEbayBA());
|
|
if (ArticoloBulkUpdate.this.getId_listinoEbayBA() > 0L)
|
|
row.setId_listinoEbay(ArticoloBulkUpdate.this.getId_listinoEbayBA());
|
|
if (ArticoloBulkUpdate.this.getQtaEbayBA() >= 0L)
|
|
row.setQtaEbay(ArticoloBulkUpdate.this.getQtaEbayBA());
|
|
if (ArticoloBulkUpdate.this.getFlgAmazonBA() >= 0L)
|
|
row.setFlgAmazon(ArticoloBulkUpdate.this.getFlgAmazonBA());
|
|
if (ArticoloBulkUpdate.this.getId_listinoAmazonBA() > 0L)
|
|
row.setId_listinoAmazon(ArticoloBulkUpdate.this.getId_listinoAmazonBA());
|
|
if (ArticoloBulkUpdate.this.getQtaAmazonBA() >= 0L)
|
|
row.setQtaAmz(ArticoloBulkUpdate.this.getQtaAmazonBA());
|
|
if (ArticoloBulkUpdate.this.getQtaMaxAcquistoWwwBA() >= 0L)
|
|
row.setQtaMaxAcquistoWww(ArticoloBulkUpdate.this.getQtaMaxAcquistoWwwBA());
|
|
if (ArticoloBulkUpdate.this.getFlgGoogleBA() >= 0L)
|
|
row.setFlgGoogle(ArticoloBulkUpdate.this.getFlgGoogleBA());
|
|
if (ArticoloBulkUpdate.this.getFlgTrovaprezziBA() >= 0L)
|
|
row.setFlgTrovaprezzi(ArticoloBulkUpdate.this.getFlgTrovaprezziBA());
|
|
if (ArticoloBulkUpdate.this.getFlgIdealoBA() >= 0L)
|
|
row.setFlgIdealo(ArticoloBulkUpdate.this.getFlgIdealoBA());
|
|
if (ArticoloBulkUpdate.this.getFlgEscludiWebArtBA() >= -1L)
|
|
row.setFlgEscludiWebArt(ArticoloBulkUpdate.this.getFlgEscludiWebArtBA());
|
|
if (ArticoloBulkUpdate.this.getFlgPreventivoWwwArtBA() >= 0L)
|
|
row.setFlgPreventivoWwwArt(ArticoloBulkUpdate.this.getFlgPreventivoWwwArtBA());
|
|
if (ArticoloBulkUpdate.this.getPercCostoSpedizioneBA() >= 0L)
|
|
row.setPercCostoSpedizione(ArticoloBulkUpdate.this.getPercCostoSpedizioneBA());
|
|
if (ArticoloBulkUpdate.this.getId_vetrinaBA() == -1L) {
|
|
row.setId_vetrina(0L);
|
|
} else if (ArticoloBulkUpdate.this.getId_vetrinaBA() > 0L) {
|
|
row.setId_vetrina(ArticoloBulkUpdate.this.getId_vetrinaBA());
|
|
}
|
|
if (ArticoloBulkUpdate.this.getId_statoUsatoBA() == -1L) {
|
|
row.setId_statoUsato(0L);
|
|
} else if (ArticoloBulkUpdate.this.getId_statoUsatoBA() > 0L) {
|
|
row.setId_statoUsato(ArticoloBulkUpdate.this.getId_statoUsatoBA());
|
|
if (ArticoloBulkUpdate.this.getId_statoUsatoBA() == 1L) {
|
|
row.setFlgUsato(0L);
|
|
} else {
|
|
row.setFlgUsato(2L);
|
|
}
|
|
}
|
|
DBAdapter.printDebug(debug, "BULK UPDATE inizio tag..");
|
|
if (ArticoloBulkUpdate.this.getFlgTagActBA() == 2L) {
|
|
row.setTagArticolo("");
|
|
} else if (!ArticoloBulkUpdate.this.getTagBA().isEmpty()) {
|
|
if (ArticoloBulkUpdate.this.getFlgTagActBA() == 0L) {
|
|
l_tag = "";
|
|
} else {
|
|
l_tag = row.getTagArticolo();
|
|
}
|
|
if (!l_tag.endsWith(","))
|
|
l_tag = l_tag + ",";
|
|
String l_tag = l_tag + l_tag + ",";
|
|
row.setTagArticolo(l_tag);
|
|
}
|
|
DBAdapter.printDebug(debug, "BULK UPDATE tag finito... ora salvo...");
|
|
row.save();
|
|
DBAdapter.printDebug(debug, "BULK UPDATE salvataggio ok");
|
|
if (ArticoloBulkUpdate.this.getRicaricoBA() > 0.0D) {
|
|
DBAdapter.printDebug(debug, "BULK UPDATE aggiornamento prezzo con costo nuovo....");
|
|
row.aggiornaPrezzoNettoConCostoNuovo();
|
|
DBAdapter.printDebug(debug, "BULK UPDATE aggiornamento prezzo con costo nuovo OK");
|
|
}
|
|
if (DBAdapter.getDateDiff(DBAdapter.getToday(), ArticoloBulkUpdate.this.getDataScadenzaOffertaBA()) < 0L) {
|
|
DBAdapter.printDebug(debug, "BULK UPDATE cancello offerta....");
|
|
ListinoArticolo la = row.getListinoArticoloBase();
|
|
la.setDataScadenzaOffertaLA(null);
|
|
la.setPercScontoOffertaLA(0.0D);
|
|
la.setPrezzoOffertaLA(0.0D);
|
|
la.save();
|
|
}
|
|
if (ArticoloBulkUpdate.this.getDataScadenzaOffertaBA() != null && DBAdapter.getDateDiff(DBAdapter.getToday(), ArticoloBulkUpdate.this.getDataScadenzaOffertaBA()) >= 0L &&
|
|
ArticoloBulkUpdate.this.getPercScontoOffertaBA() > 0L) {
|
|
DBAdapter.printDebug(debug, "BULK UPDATE inserisco offerta....");
|
|
ListinoArticolo la = row.getListinoArticoloBase();
|
|
la.setDataScadenzaOffertaLA(ArticoloBulkUpdate.this.getDataScadenzaOffertaBA());
|
|
la.setPercScontoOffertaLA((double)ArticoloBulkUpdate.this.getPercScontoOffertaBA());
|
|
la.save();
|
|
}
|
|
if (!bean.isLocalhost()) {
|
|
if (ArticoloBulkUpdate.this.getFlgCaricaEbay() == 1L && row.getFlgEbay() == 1L) {
|
|
DBAdapter.printDebug(debug, "BULK UPDATE ebay publish full....");
|
|
row.ebayPublishFull();
|
|
}
|
|
if (ArticoloBulkUpdate.this.getFlgCaricaEbay() == 9L && row.getFlgEbay() == 1L && row.isEbayPubblicato()) {
|
|
DBAdapter.printDebug(debug, "BULK UPDATE ebay delete inventory item....");
|
|
rp = row.ebayDeleteInventoryItem();
|
|
}
|
|
if (ArticoloBulkUpdate.this.getFlgCaricaAmazon() == 1L && row.getFlgAmazon() == 1L) {
|
|
DBAdapter.printDebug(debug, "BULK UPDATE amazon publish full.... ");
|
|
bean.setFlgPriceTypeAmz(1L);
|
|
rp = bean.amzUpdateOfferAuto();
|
|
}
|
|
if (ArticoloBulkUpdate.this.getFlgCaricaAmazon() == 9L && row.getFlgAmazon() == 1L) {
|
|
DBAdapter.printDebug(debug, "BULK UPDATE amazon delete inventory item....");
|
|
rp = row.amzDeleteItem();
|
|
}
|
|
} else {
|
|
DBAdapter.printDebug(true, "Bulk Update: ebay non aggiornabile se localhost");
|
|
}
|
|
if (!ArticoloBulkUpdate.this.getPreviewSizes().isEmpty()) {
|
|
DBAdapter.printDebug(debug, "BULK UPDATE creo preview....");
|
|
row.creaPreviewH(ArticoloBulkUpdate.this.getPreviewSizes(), 8, "BULK UPDATE ", temp);
|
|
}
|
|
if (!ArticoloBulkUpdate.this.getPreviewSizes1().isEmpty()) {
|
|
DBAdapter.printDebug(debug, "BULK UPDATE creo preview 1....");
|
|
row.creaPreviewH(ArticoloBulkUpdate.this.getPreviewSizes1(), 1, "BULK UPDATE ", temp);
|
|
}
|
|
sb.append("<tr>");
|
|
st = new StringTokenizer(row.getDescrizionePerMail(false), "|");
|
|
while (st.hasMoreTokens()) {
|
|
sb.append("<td>");
|
|
String token = st.nextToken();
|
|
sb.append(token);
|
|
sb.append("</td>");
|
|
}
|
|
sb.append("</tr>");
|
|
DBAdapter.printDebug(debug, "BULK UPDATE FINE CICLO.... RIPARTO... " + i + "\n");
|
|
i++;
|
|
if (se1 > 0 && i % se1 == 0)
|
|
System.out.print(".");
|
|
if (se2 > 0 && i % se2 == 0)
|
|
System.out.println("" + i + " / " + i);
|
|
}
|
|
sb.append("</table>");
|
|
timer.stop();
|
|
rp.setMsg("BULK UPDATE concluso. DURATA: " + timer.getDurataHourMin() + "\n" + rp.getMsg());
|
|
if (this.wwwAutomator != null) {
|
|
if (i == 0) {
|
|
this.wwwAutomator.setUltimaEsecuzione(DBAdapter.getTimestamp().toString() + "<br/>BULK UPDATE concluso. DURATA: " + DBAdapter.getTimestamp().toString() + "<br/>record processati: " +
|
|
timer.getDurataHourMin() + "<br/>" + i);
|
|
} else {
|
|
this.wwwAutomator.setUltimaEsecuzione(DBAdapter.getTimestamp().toString() + "<br/>BULK UPDATE concluso. DURATA: " + DBAdapter.getTimestamp().toString() + "<br/><b style='color:darkred'>record processati: " +
|
|
timer.getDurataHourMin() + "</b><br/>" + i);
|
|
}
|
|
this.wwwAutomator.save();
|
|
}
|
|
if (this.sendEmail);
|
|
StatusMsg.updateMsgByTag(ArticoloBulkUpdate.this.getApFull(), "BULK UPDATE ", rp.getMsg());
|
|
try {
|
|
if (this.wwwAutomator != null) {
|
|
sleep(1000L);
|
|
} else {
|
|
sleep(10000L);
|
|
}
|
|
} catch (Exception e) {}
|
|
StatusMsg.deleteMsgByTag(ArticoloBulkUpdate.this.getApFull(), "BULK UPDATE ");
|
|
ArticoloBulkUpdate.threadBulkUpdate = false;
|
|
DBAdapter.printDebug(debug, rp.getMsg());
|
|
}
|
|
}
|
|
|
|
public ArticoloBulkUpdate(ApplParmFull apFull) {
|
|
this.apFull = apFull;
|
|
}
|
|
|
|
public ArticoloBulkUpdate() {}
|
|
|
|
public ApplParmFull getApFull() {
|
|
return this.apFull;
|
|
}
|
|
|
|
public void setApFull(ApplParmFull apFull) {
|
|
this.apFull = apFull;
|
|
}
|
|
|
|
public long getId_tipoBA() {
|
|
return this.id_tipoBA;
|
|
}
|
|
|
|
public void setId_tipoBA(long id_tipoBA) {
|
|
this.id_tipoBA = id_tipoBA;
|
|
}
|
|
|
|
public double getRicaricoBA() {
|
|
return this.ricaricoBA;
|
|
}
|
|
|
|
public void setRicaricoBA(double ricaricoBA) {
|
|
this.ricaricoBA = ricaricoBA;
|
|
}
|
|
|
|
public long getId_listinoEbayBA() {
|
|
return this.id_listinoEbayBA;
|
|
}
|
|
|
|
public void setId_listinoEbayBA(long id_listinoEbayBA) {
|
|
this.id_listinoEbayBA = id_listinoEbayBA;
|
|
}
|
|
|
|
public long getQtaMaxAcquistoWwwBA() {
|
|
return this.qtaMaxAcquistoWwwBA;
|
|
}
|
|
|
|
public void setQtaMaxAcquistoWwwBA(long qtaMaxAcquistoWwwBA) {
|
|
this.qtaMaxAcquistoWwwBA = qtaMaxAcquistoWwwBA;
|
|
}
|
|
|
|
public long getQtaEbayBA() {
|
|
return this.qtaEbayBA;
|
|
}
|
|
|
|
public void setQtaEbayBA(long qtaEbayBA) {
|
|
this.qtaEbayBA = qtaEbayBA;
|
|
}
|
|
|
|
public long getFlgEbayBA() {
|
|
return this.flgEbayBA;
|
|
}
|
|
|
|
public void setFlgEbayBA(long flgEbayBA) {
|
|
this.flgEbayBA = flgEbayBA;
|
|
}
|
|
|
|
public long getFlgGoogleBA() {
|
|
return this.flgGoogleBA;
|
|
}
|
|
|
|
public void setFlgGoogleBA(long flgGoogleBA) {
|
|
this.flgGoogleBA = flgGoogleBA;
|
|
}
|
|
|
|
public String getIcecatLang() {
|
|
return (this.icecatLang == null) ? "" : this.icecatLang.trim();
|
|
}
|
|
|
|
public void setIcecatLang(String icecatLang) {
|
|
this.icecatLang = icecatLang;
|
|
}
|
|
|
|
public long getFlgEscludiWebArtBA() {
|
|
return this.flgEscludiWebArtBA;
|
|
}
|
|
|
|
public void setFlgEscludiWebArtBA(long flgEscludiWebArtBA) {
|
|
this.flgEscludiWebArtBA = flgEscludiWebArtBA;
|
|
}
|
|
|
|
public final ResParm starBulkUpdate(ApplParmFull apFull, ArticoloCR CR, boolean sendEmail) {
|
|
boolean test = false;
|
|
if (!isThreadAttivo()) {
|
|
new ThreadBulkUpdate(apFull, CR, sendEmail);
|
|
return new ResParm(true, "Thread BULK UPDATE avviato");
|
|
}
|
|
return new ResParm(false, "ATTENZIONE!! Thread in esecuzione!!!");
|
|
}
|
|
|
|
public final ResParm starBulkUpdate(ApplParmFull apFull, ArticoloCR CR, WwwAutomator wwwAutomator) {
|
|
boolean test = false;
|
|
if (!isThreadAttivo()) {
|
|
new ThreadBulkUpdate(apFull, CR, wwwAutomator);
|
|
return new ResParm(true, "Thread BULK UPDATE AUTOMATOR avviato");
|
|
}
|
|
return new ResParm(false, "ATTENZIONE!! Thread in esecuzione!!!");
|
|
}
|
|
|
|
public final ResParm starBulkUpdateAutomator(ApplParmFull apFull, ArticoloCR CR, WwwAutomator wwwAutomator) {
|
|
boolean test = false;
|
|
if (!isThreadAttivo()) {
|
|
new ThreadBulkUpdate(apFull, CR, false);
|
|
return new ResParm(true, "Thread BULK UPDATE avviato");
|
|
}
|
|
return new ResParm(false, "ATTENZIONE!! Thread in esecuzione!!!");
|
|
}
|
|
|
|
public static boolean isThreadAttivo() {
|
|
return threadBulkUpdate;
|
|
}
|
|
|
|
public long getFlgCaricaEbay() {
|
|
return this.flgCaricaEbay;
|
|
}
|
|
|
|
public void setFlgCaricaEbay(long flgCaricaEbay) {
|
|
this.flgCaricaEbay = flgCaricaEbay;
|
|
}
|
|
|
|
public String getPreviewSizes() {
|
|
return (this.previewSizes == null) ? "" : this.previewSizes.trim();
|
|
}
|
|
|
|
public void setPreviewSizes(String previewSizes) {
|
|
this.previewSizes = previewSizes;
|
|
}
|
|
|
|
public String getPreviewSizes1() {
|
|
return (this.previewSizes1 == null) ? "" : this.previewSizes1.trim();
|
|
}
|
|
|
|
public void setPreviewSizes1(String previewSizes1) {
|
|
this.previewSizes1 = previewSizes1;
|
|
}
|
|
|
|
protected void creaPreviewXX(Articolo row, String sizes, int fotoFinale, String statusMsg) {
|
|
if (!sizes.isEmpty()) {
|
|
String targetDir = row.getDocBase() + row.getDocBase();
|
|
StringTokenizer st = new StringTokenizer(sizes, ",");
|
|
while (st.hasMoreTokens()) {
|
|
int size = Integer.parseInt(st.nextToken());
|
|
for (int j = 1; j <= fotoFinale; j++) {
|
|
String currentImageName = targetDir + targetDir;
|
|
if (new File(currentImageName).exists()) {
|
|
StatusMsg.updateMsgByTag(getApFull(), "BULK UPDATE ", statusMsg + " crea preview foto " + statusMsg + " size " + j + " .....");
|
|
ScaleImage si = new ScaleImage(currentImageName, "" + size + "/" + size + "+", 0L, size, 0, false, false);
|
|
si.scaleIt();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public long getFlgRicaricaImmagini() {
|
|
return this.flgRicaricaImmagini;
|
|
}
|
|
|
|
public void setFlgRicaricaImmagini(long flgRicaricaImmagini) {
|
|
this.flgRicaricaImmagini = flgRicaricaImmagini;
|
|
}
|
|
|
|
public long getFlgPreventivoWwwArtBA() {
|
|
return this.flgPreventivoWwwArtBA;
|
|
}
|
|
|
|
public void setFlgPreventivoWwwArtBA(long flgPreventivoWwwArtBA) {
|
|
this.flgPreventivoWwwArtBA = flgPreventivoWwwArtBA;
|
|
}
|
|
|
|
public long getPercCostoSpedizioneBA() {
|
|
return this.percCostoSpedizioneBA;
|
|
}
|
|
|
|
public void setPercCostoSpedizioneBA(long percCostoSpedizioneBA) {
|
|
this.percCostoSpedizioneBA = percCostoSpedizioneBA;
|
|
}
|
|
|
|
public long getPercScontoOffertaBA() {
|
|
return this.percScontoOffertaBA;
|
|
}
|
|
|
|
public void setPercScontoOffertaBA(long percScontoOffertaBA) {
|
|
this.percScontoOffertaBA = percScontoOffertaBA;
|
|
}
|
|
|
|
public Date getDataScadenzaOffertaBA() {
|
|
return this.dataScadenzaOffertaBA;
|
|
}
|
|
|
|
public void setDataScadenzaOffertaBA(Date dataScadenzaOffertaBA) {
|
|
this.dataScadenzaOffertaBA = dataScadenzaOffertaBA;
|
|
}
|
|
|
|
public long getId_vetrinaBA() {
|
|
return this.id_vetrinaBA;
|
|
}
|
|
|
|
public void setId_vetrinaBA(long id_vetrinaBA) {
|
|
this.id_vetrinaBA = id_vetrinaBA;
|
|
}
|
|
|
|
public String getTagBA() {
|
|
return (this.tagBA == null) ? "" : this.tagBA.trim();
|
|
}
|
|
|
|
public void setTagBA(String tagBA) {
|
|
this.tagBA = tagBA;
|
|
}
|
|
|
|
public long getFlgTagActBA() {
|
|
return this.flgTagActBA;
|
|
}
|
|
|
|
public void setFlgTagActBA(long flgTagModBA) {
|
|
this.flgTagActBA = flgTagModBA;
|
|
}
|
|
|
|
public long getId_statoUsatoBA() {
|
|
return this.id_statoUsatoBA;
|
|
}
|
|
|
|
public void setId_statoUsatoBA(long id_statoUsato) {
|
|
this.id_statoUsatoBA = id_statoUsato;
|
|
}
|
|
|
|
public long getFlgTrovaprezziBA() {
|
|
return this.flgTrovaprezziBA;
|
|
}
|
|
|
|
public void setFlgTrovaprezziBA(long flgTrovaprezziBA) {
|
|
this.flgTrovaprezziBA = flgTrovaprezziBA;
|
|
}
|
|
|
|
public long getFlgIdealoBA() {
|
|
return this.flgIdealoBA;
|
|
}
|
|
|
|
public void setFlgIdealoBA(long flgIdealoBA) {
|
|
this.flgIdealoBA = flgIdealoBA;
|
|
}
|
|
|
|
public Tipo getTipoBA() {
|
|
if (this.tipoBA == null) {
|
|
this.tipoBA = new Tipo(getApFull());
|
|
this.tipoBA.findByPrimaryKey(getId_tipoBA());
|
|
}
|
|
return (this.tipoBA == null) ? new Tipo() : this.tipoBA;
|
|
}
|
|
|
|
public void setTipoBA(Tipo tipoBA) {
|
|
this.tipoBA = tipoBA;
|
|
}
|
|
|
|
public double getPrezzoPubblicoDaBA() {
|
|
return this.prezzoPubblicoDaBA;
|
|
}
|
|
|
|
public void setPrezzoPubblicoDaBA(double prezzoPubblicoDa) {
|
|
this.prezzoPubblicoDaBA = prezzoPubblicoDa;
|
|
}
|
|
|
|
public double getRicaricoOltreBA() {
|
|
return this.ricaricoOltreBA;
|
|
}
|
|
|
|
public void setRicaricoOltreBA(double ricaricoOltre) {
|
|
this.ricaricoOltreBA = ricaricoOltre;
|
|
}
|
|
|
|
public long getId_listinoAmazonBA() {
|
|
return this.id_listinoAmazonBA;
|
|
}
|
|
|
|
public void setId_listinoAmazonBA(long id_listinoAmazonBA) {
|
|
this.id_listinoAmazonBA = id_listinoAmazonBA;
|
|
}
|
|
|
|
public long getQtaAmazonBA() {
|
|
return this.qtaAmazonBA;
|
|
}
|
|
|
|
public void setQtaAmazonBA(long qtaAmzBA) {
|
|
this.qtaAmazonBA = qtaAmzBA;
|
|
}
|
|
|
|
public long getFlgAmazonBA() {
|
|
return this.flgAmazonBA;
|
|
}
|
|
|
|
public void setFlgAmazonBA(long flgAmzBA) {
|
|
this.flgAmazonBA = flgAmzBA;
|
|
}
|
|
|
|
public long getFlgCaricaAmazon() {
|
|
return this.flgCaricaAmazon;
|
|
}
|
|
|
|
public void setFlgCaricaAmazon(long flgCaricaAmazon) {
|
|
this.flgCaricaAmazon = flgCaricaAmazon;
|
|
}
|
|
}
|